diff --git a/zaza/openstack/charm_tests/aodh/tests.py b/zaza/openstack/charm_tests/aodh/tests.py index 0ba24af..f43615f 100644 --- a/zaza/openstack/charm_tests/aodh/tests.py +++ b/zaza/openstack/charm_tests/aodh/tests.py @@ -17,6 +17,7 @@ """Encapsulate Aodh testing.""" import logging +import tenacity import zaza.model import zaza.openstack.charm_tests.test_utils as test_utils @@ -59,6 +60,12 @@ class AodhTest(test_utils.OpenStackBaseTest): logging.info('Waiting for alarm cache to clear') telemetry_utils.alarm_cache_wait() + @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), + reraise=True, stop=tenacity.stop_after_attempt(8)) + def query_aodh_api(self): + """Check that aodh api is responding.""" + self.aodh_client.alarm.list() + @property def services(self): """Return a list of the service that should be running.""" @@ -122,6 +129,7 @@ class AodhTest(test_utils.OpenStackBaseTest): {'DEFAULT': {'debug': ['False']}}, {'DEFAULT': {'debug': ['True']}}, self.services) + self.query_aodh_api() def test_901_pause_resume(self): """Run pause and resume tests. @@ -133,3 +141,4 @@ class AodhTest(test_utils.OpenStackBaseTest): self.services, pgrep_full=False): logging.info("Testing pause resume") + self.query_aodh_api() diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index ab600a0..465d73c 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -609,8 +609,9 @@ def configure_gateway_ext_port(novaclient, neutronclient, server.interface_attach(port_id=port['port']['id'], net_id=None, fixed_ip=None) if add_dataport_to_netplan: + mac_address = get_mac_from_port(port, neutronclient) add_interface_to_netplan(server.name, - mac_address=get_mac_from_port(port, neutronclient), + mac_address=mac_address, dvr_mode=dvr_mode) ext_br_macs = [] for port in neutronclient.list_ports(network_id=net_id)['ports']: