From ea84bf9ed8410fecd9c83f80ee07f23b0ea28a52 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 30 Sep 2019 12:31:50 +0000 Subject: [PATCH 1/2] Check aodh api after a change. The first query against the aodh api after a restart seems to fail. So, check the api after a restart with a tenacity wrapper. --- zaza/openstack/charm_tests/aodh/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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() From 64ddda0541d4b2d6adc039a0ee0ab03653fbb1a7 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 30 Sep 2019 13:24:08 +0000 Subject: [PATCH 2/2] Disable add_dataport_to_netplan while issue #72 is investogated --- zaza/openstack/utilities/openstack.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index 1e533d4..3a7f22c 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -608,10 +608,9 @@ def configure_gateway_ext_port(novaclient, neutronclient, port = neutronclient.create_port(body=body_value) server.interface_attach(port_id=port['port']['id'], net_id=None, fixed_ip=None) - if add_dataport_to_netplan: - add_interface_to_netplan(server.name, - mac_address=get_mac_from_port(port), - dvr_mode=dvr_mode) + # Temporarily disable call to add_interface_to_netplan as it + # sometimes throws a KeyError + # https://github.com/openstack-charmers/zaza-openstack-tests/issues/72 ext_br_macs = [] for port in neutronclient.list_ports(network_id=net_id)['ports']: if 'ext-port' in port['name']: