Ensure that tests fail early if network interfaces are down

Interfaces such as eth12 are required to be working for functional
tests such as healthcheck/tempest, and we waste a lot of CI time
when these interfaces do not come up properly during host preparation.

This change makes the build fail if either:

* The network bridges do not come up after creation
* The new interfaces eth12/13/14 are not up after host bootstrap

Change-Id: Idf83b48beab29e9044fbc0e6d4eacc89f68bf18f
This commit is contained in:
Jonathan Rosser 2018-08-20 09:42:33 +01:00
parent d0731c31df
commit 420df0153e
2 changed files with 28 additions and 1 deletions

View File

@ -74,6 +74,13 @@
MaxStartups: "100:100:100"
GSSAPIAuthentication: no
GSSAPICleanupCredentials: no
post_tasks:
- name: Check that new network interfaces are up
assert:
that:
- ansible_eth12['active'] == true
- ansible_eth13['active'] == true
- ansible_eth14['active'] == true
vars_files:
- "{{ playbook_dir }}/../playbooks/defaults/repo_packages/openstack_services.yml"
- vars/bootstrap-aio-vars.yml

View File

@ -197,6 +197,26 @@
tags:
- network-config
# NOTE(jrosser) The systemd_networkd role uses a handler to restart the networking service
# This will normally not run until the end of the play, so we must force it here
- name: Force systemd_networkd hander to run
meta: flush_handlers
# NOTE(jrosser) The intention here is not to proceed further until the network bridges are up
# This ensures there will be no race between the bridges coming up and subsequent tasks which
# require functional network interfaces
- name: Check that network bridges are up
wait_for:
port: 22
timeout: 30
host: "{{ item }}"
with_items:
- 172.29.236.100 # br-mgmt
- 172.29.244.100 # br-storage
- 172.29.232.100 # br-dbaas
- 172.29.252.100 # br-lbaas
- 172.29.240.100 # br-vxlan
- name: Run the systemd service role
include_role:
name: systemd_service
@ -241,6 +261,6 @@
- name: Updating the facts due to net changes
setup:
filter: "ansible_br*"
gather_subset: network
tags:
- networking