Skip to content

Commit

Permalink
Merge pull request #1236 from MylesJP/fix-xena
Browse files Browse the repository at this point in the history
[stable/yoga] Fix audit test to handle <yoga releases
  • Loading branch information
ajkavanagh authored Jul 2, 2024
2 parents e88be99 + 59d8a9b commit 0d2fd8f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion zaza/openstack/charm_tests/audit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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']

Expand Down

0 comments on commit 0d2fd8f

Please sign in to comment.