From 6a688d29bb242eee8874e3c9d4c95cb438f91d4a Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 25 May 2021 13:18:11 +0000 Subject: [PATCH 1/3] Add classes to collect NFS and S3 Trilio tests --- zaza/openstack/charm_tests/trilio/tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/trilio/tests.py b/zaza/openstack/charm_tests/trilio/tests.py index 5072b29..64239ae 100644 --- a/zaza/openstack/charm_tests/trilio/tests.py +++ b/zaza/openstack/charm_tests/trilio/tests.py @@ -440,7 +440,7 @@ class TrilioGhostNFSShareTest(TrilioBaseTest): ) -class TrilioWLMTest(TrilioGhostNFSShareTest): +class TrilioWLMBaseTest(TrilioBaseTest): """Tests for Trilio Workload Manager charm.""" conf_file = "/etc/workloadmgr/workloadmgr.conf" @@ -478,3 +478,11 @@ class TrilioDataMoverNFSTest(TrilioDataMoverBaseTest, TrilioGhostNFSShareTest): class TrilioDataMoverS3Test(TrilioDataMoverBaseTest): """Tests for Trilio Data Mover charm backed by S3.""" + + +class TrilioWLMNFSTest(TrilioWLMBaseTest, TrilioGhostNFSShareTest): + """Tests for Trilio WLM charm backed by NFS.""" + + +class TrilioWLMS3Test(TrilioWLMBaseTest): + """Tests for Trilio WLM charm backed by S3.""" From 855847339404f7cb37b63e65a7f38e1a812d4980 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Wed, 26 May 2021 13:49:46 +0200 Subject: [PATCH 2/3] Re-enable test_003_test_override_is_observed This test was disabled for releases older than groovy-victoria because of https://bugs.launchpad.net/ubuntu/+source/python-oslo.policy/+bug/1880959 This bug has now been fixed and released for xenial-queens and newer. Also made it more robust in GlanceTests // fixes #578 --- zaza/openstack/charm_tests/policyd/tests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/policyd/tests.py b/zaza/openstack/charm_tests/policyd/tests.py index 4722755..a87f2ef 100644 --- a/zaza/openstack/charm_tests/policyd/tests.py +++ b/zaza/openstack/charm_tests/policyd/tests.py @@ -401,9 +401,10 @@ class BasePolicydSpecialization(PolicydTest, def test_003_test_override_is_observed(self): """Test that the override is observed by the underlying service.""" if (openstack_utils.get_os_release() < - openstack_utils.get_os_release('groovy_victoria')): + openstack_utils.get_os_release('xenial_queens')): raise unittest.SkipTest( - "Test skipped until Bug #1880959 is fix released") + "Test skipped because bug #1880959 won't be fixed for " + "releases older than Queens") if self._test_name is None: logging.info("Doing policyd override for {}" .format(self._service_name)) @@ -571,6 +572,13 @@ class GlanceTests(BasePolicydSpecialization): super(GlanceTests, cls).setUpClass(application_name="glance") cls.application_name = "glance" + # NOTE(lourot): Same as NeutronApiTests. There is a race between the glance + # charm signalling its readiness and the service actually being ready to + # serve requests. The test will fail intermittently unless we gracefully + # accept this. + # Issue: openstack-charmers/zaza-openstack-tests#578 + @tenacity.retry(wait=tenacity.wait_fixed(1), + reraise=True, stop=tenacity.stop_after_delay(8)) def get_client_and_attempt_operation(self, ip): """Attempt to list the images as a policyd override. From 7ba3141cdb8c530d3bf92a4743c062141169a8db Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Thu, 27 May 2021 13:26:58 +0200 Subject: [PATCH 3/3] glance_simplestreams_sync/setup: Add tenacity The very nature of the action ran by the configure step will cause it to fail frequently unless it is retried. Fixes #580 --- .../glance_simplestreams_sync/setup.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/zaza/openstack/charm_tests/glance_simplestreams_sync/setup.py b/zaza/openstack/charm_tests/glance_simplestreams_sync/setup.py index 06e172d..ec6107b 100644 --- a/zaza/openstack/charm_tests/glance_simplestreams_sync/setup.py +++ b/zaza/openstack/charm_tests/glance_simplestreams_sync/setup.py @@ -17,6 +17,7 @@ """Code for configuring glance-simplestreams-sync.""" import logging +import tenacity import zaza.model as zaza_model import zaza.openstack.utilities.generic as generic_utils @@ -30,11 +31,17 @@ def sync_images(): deployment. """ logging.info("Synchronising images using glance-simplestreams-sync") - generic_utils.assertActionRanOK( - zaza_model.run_action_on_leader( - "glance-simplestreams-sync", - "sync-images", - raise_on_failure=True, - action_params={}, - ) - ) + for attempt in tenacity.Retrying( + stop=tenacity.stop_after_attempt(3), + wait=tenacity.wait_exponential( + multiplier=1, min=2, max=10), + reraise=True): + with attempt: + generic_utils.assertActionRanOK( + zaza_model.run_action_on_leader( + "glance-simplestreams-sync", + "sync-images", + raise_on_failure=True, + action_params={}, + ) + )