Fix gate: Add feature flag for nova policies removed in Wallaby
This patch set adds a new feature flag called
``removed_nova_policies_wallaby`` under the configuration
group ``[policy-feature-enabled]`` for skipping Nova
tests whose policies were removed in Wallaby. This feature flag
is currently applied to os-agents which is removed in nova
recently - https://review.opendev.org/#/c/749309
Change-Id: Iaa0ddbdca454b93bd8373ce749603f28c5c59180
diff --git a/patrole_tempest_plugin/config.py b/patrole_tempest_plugin/config.py
index 41d824d..b01cf10 100644
--- a/patrole_tempest_plugin/config.py
+++ b/patrole_tempest_plugin/config.py
@@ -175,6 +175,11 @@
help="""Are the Nova API extension policies available in the
cloud (e.g. os_compute_api:os-extended-availability-zone)? These policies were
removed in Stein because Nova API extension concept was removed in Pike."""),
+ # TODO(gmann): Remove these feature flags once Victoria is EOL.
+ cfg.BoolOpt('removed_nova_policies_wallaby',
+ default=True,
+ help="""Are the Nova API policies being removed in wallaby
+cycle (e.g. os_compute_api:os-agents)?"""),
cfg.BoolOpt('removed_keystone_policies_stein',
default=True,
help="""Are the obsolete Keystone policies available in the
diff --git a/patrole_tempest_plugin/tests/api/compute/test_agents_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_agents_rbac.py
index ba4c71a..de9a173 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_agents_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_agents_rbac.py
@@ -44,6 +44,10 @@
if not utils.is_extension_enabled('os-agents', 'compute'):
raise cls.skipException(
'%s skipped as os-agents not enabled' % cls.__name__)
+ if CONF.policy_feature_enabled.removed_nova_policies_wallaby:
+ raise cls.skipException(
+ '%s skipped as os-agents APIs/policies are not avaialble '
+ 'any more.' % cls.__name__)
def _param_helper(self, **kwargs):
rand_key = 'architecture'