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
This commit is contained in:
Ghanshyam Mann 2020-11-16 19:36:00 -06:00
parent a1e1ddc91c
commit 1b8838f189
4 changed files with 44 additions and 0 deletions

View File

@ -48,6 +48,10 @@ function install_patrole_tempest_plugin {
# These policies were removed in Ussuri but are available in Pike.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
@ -76,6 +80,10 @@ function install_patrole_tempest_plugin {
# These policies were removed in Ussuri but are available in Queens.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'rocky' ]]; then
@ -94,6 +102,10 @@ function install_patrole_tempest_plugin {
# These policies were removed in Ussuri but are available in Rocky.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'stein' ]]; then
@ -107,17 +119,33 @@ function install_patrole_tempest_plugin {
# These policies were removed in Ussuri but are available in Stein.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'train' ]]; then
# Remove this once stable/train becomes EOL.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'ussuri' ]]; then
# Remove this once stable/ussuri becomes EOL.
iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
if [[ ${DEVSTACK_SERIES} == 'victoria' ]]; then
# TODO(gmann): Remove these once stable/victoria becomes EOL.
# These policies were removed in Wallaby.
iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
fi
iniset $TEMPEST_CONFIG patrole rbac_test_roles $RBAC_TEST_ROLES

View File

@ -175,6 +175,11 @@ was changed in a backwards-incompatible way."""),
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

View File

@ -44,6 +44,10 @@ class AgentsRbacTest(rbac_base.BaseV2ComputeRbacTest):
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'

View File

@ -0,0 +1,7 @@
---
features:
- |
Added 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 related policies.