From 59d8a9b596b38ac498c6bb1c1bdf86a5f64d3767 Mon Sep 17 00:00:00 2001 From: Myles Penner Date: Fri, 28 Jun 2024 11:17:44 -0700 Subject: [PATCH] Fix audit test to handle xena release --- zaza/openstack/charm_tests/audit/tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/audit/tests.py b/zaza/openstack/charm_tests/audit/tests.py index b10c3837f..51c9f7abb 100644 --- a/zaza/openstack/charm_tests/audit/tests.py +++ b/zaza/openstack/charm_tests/audit/tests.py @@ -19,12 +19,14 @@ These methods test the rendering of the charm api-paste.ini file to ensure the appropriate sections are rendered or not rendered depending -on the state of the audit-middleware configuration option. +on the state of the audit-middleware configuration option. OpenStack +releases older than Yoga are skipped as this feature is not supported. """ import textwrap import logging import zaza.model +from zaza.openstack.utilities import openstack as openstack_utils import zaza.openstack.charm_tests.test_utils as test_utils @@ -35,6 +37,15 @@ class KeystoneAuditMiddlewareTest(test_utils.OpenStackBaseTest): def setUpClass(cls): """Run class setup for Keystone audit middleware tests.""" super(KeystoneAuditMiddlewareTest, cls).setUpClass() + os_version = openstack_utils.get_openstack_release( + cls.application_name, + cls.model_name + ) + + if os_version < 'yoga': + cls.skipTest(cls, 'Skipping audit middleware test in unsupported' + ' version of OpenStack: %s' % os_version) + test_config = cls.test_config['tests_options']['audit-middleware'] cls.service_name = test_config['service']