From 855847339404f7cb37b63e65a7f38e1a812d4980 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Wed, 26 May 2021 13:49:46 +0200 Subject: [PATCH] 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.