From 194752f1b5304e90e0e2911324f93cbe0169a1f3 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Mon, 10 Sep 2018 11:43:38 -0600 Subject: [PATCH] Remove deprecated patrole.enable_rbac configuration option This patch set removes deprecated [patrole].enable_rbac configuration option. It is better to use an appropriate test regex to skip Patrole tests. Change-Id: I639f3215f7aff8a85bc97dc55c1d97be3123e003 --- devstack/plugin.sh | 1 - patrole_tempest_plugin/config.py | 10 -------- patrole_tempest_plugin/rbac_utils.py | 13 ----------- .../tests/api/compute/rbac_base.py | 5 ---- .../tests/api/identity/rbac_base.py | 5 ---- .../tests/api/image/rbac_base.py | 5 ---- .../tests/api/network/rbac_base.py | 5 ---- .../tests/api/volume/rbac_base.py | 5 ---- .../tests/unit/test_rbac_utils.py | 23 ------------------- ...e-rbac-config-option-a5e46ce1053b7dea.yaml | 5 ++++ 10 files changed, 5 insertions(+), 72 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-enable-rbac-config-option-a5e46ce1053b7dea.yaml diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 4826d21f..01be7d65 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -40,7 +40,6 @@ function install_patrole_tempest_plugin { iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False fi - iniset $TEMPEST_CONFIG patrole enable_rbac True iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE } diff --git a/patrole_tempest_plugin/config.py b/patrole_tempest_plugin/config.py index 47b76d4f..df05eaaf 100644 --- a/patrole_tempest_plugin/config.py +++ b/patrole_tempest_plugin/config.py @@ -24,16 +24,6 @@ PatroleGroup = [ default='admin', help="""The current RBAC role against which to run Patrole tests."""), - cfg.BoolOpt('enable_rbac', - default=True, - deprecated_for_removal=True, - deprecated_reason="""This is a legacy option that was -meaningful when Patrole existed downstream as a suite of tests inside Tempest. -Installing the Patrole plugin necessarily means that RBAC tests should be run. -This option is paradoxical with the Tempest plugin architecture. -""", - deprecated_since='R', - help="Enables Patrole RBAC tests."), cfg.ListOpt('custom_policy_files', default=['/etc/%s/policy.json'], help="""List of the paths to search for policy files. Each diff --git a/patrole_tempest_plugin/rbac_utils.py b/patrole_tempest_plugin/rbac_utils.py index c928f40f..366e0336 100644 --- a/patrole_tempest_plugin/rbac_utils.py +++ b/patrole_tempest_plugin/rbac_utils.py @@ -18,7 +18,6 @@ import sys import time from oslo_log import log as logging -from oslo_log import versionutils from oslo_utils import excutils from tempest import clients @@ -243,18 +242,6 @@ class RbacUtilsMixin(object): """ return [cls.os_primary.auth_provider] - @classmethod - def skip_rbac_checks(cls): - if not CONF.patrole.enable_rbac: - deprecation_msg = ("The `[patrole].enable_rbac` option is " - "deprecated and will be removed in the S " - "release. Patrole tests will always be enabled " - "following installation of the Patrole Tempest " - "plugin. Use a regex to skip tests") - versionutils.report_deprecated_feature(LOG, deprecation_msg) - raise cls.skipException( - 'Patrole testing not enabled so skipping %s.' % cls.__name__) - @classmethod def setup_rbac_utils(cls): cls.rbac_utils = RbacUtils(cls) diff --git a/patrole_tempest_plugin/tests/api/compute/rbac_base.py b/patrole_tempest_plugin/tests/api/compute/rbac_base.py index 99137ccf..ab4551e4 100644 --- a/patrole_tempest_plugin/tests/api/compute/rbac_base.py +++ b/patrole_tempest_plugin/tests/api/compute/rbac_base.py @@ -21,11 +21,6 @@ from patrole_tempest_plugin import rbac_utils class BaseV2ComputeRbacTest(rbac_utils.RbacUtilsMixin, compute_base.BaseV2ComputeTest): - @classmethod - def skip_checks(cls): - super(BaseV2ComputeRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(BaseV2ComputeRbacTest, cls).setup_clients() diff --git a/patrole_tempest_plugin/tests/api/identity/rbac_base.py b/patrole_tempest_plugin/tests/api/identity/rbac_base.py index d34caaaa..44f5962e 100644 --- a/patrole_tempest_plugin/tests/api/identity/rbac_base.py +++ b/patrole_tempest_plugin/tests/api/identity/rbac_base.py @@ -27,11 +27,6 @@ LOG = logging.getLogger(__name__) class BaseIdentityRbacTest(rbac_utils.RbacUtilsMixin, base.BaseIdentityTest): - @classmethod - def skip_checks(cls): - super(BaseIdentityRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(BaseIdentityRbacTest, cls).setup_clients() diff --git a/patrole_tempest_plugin/tests/api/image/rbac_base.py b/patrole_tempest_plugin/tests/api/image/rbac_base.py index 2220335c..becd5646 100644 --- a/patrole_tempest_plugin/tests/api/image/rbac_base.py +++ b/patrole_tempest_plugin/tests/api/image/rbac_base.py @@ -19,11 +19,6 @@ from patrole_tempest_plugin import rbac_utils class BaseV2ImageRbacTest(rbac_utils.RbacUtilsMixin, image_base.BaseV2ImageTest): - @classmethod - def skip_checks(cls): - super(BaseV2ImageRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(BaseV2ImageRbacTest, cls).setup_clients() diff --git a/patrole_tempest_plugin/tests/api/network/rbac_base.py b/patrole_tempest_plugin/tests/api/network/rbac_base.py index 39ad3114..61023477 100644 --- a/patrole_tempest_plugin/tests/api/network/rbac_base.py +++ b/patrole_tempest_plugin/tests/api/network/rbac_base.py @@ -21,11 +21,6 @@ from patrole_tempest_plugin import rbac_utils class BaseNetworkRbacTest(rbac_utils.RbacUtilsMixin, network_base.BaseNetworkTest): - @classmethod - def skip_checks(cls): - super(BaseNetworkRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(BaseNetworkRbacTest, cls).setup_clients() diff --git a/patrole_tempest_plugin/tests/api/volume/rbac_base.py b/patrole_tempest_plugin/tests/api/volume/rbac_base.py index 8fa3b67f..14b3151d 100644 --- a/patrole_tempest_plugin/tests/api/volume/rbac_base.py +++ b/patrole_tempest_plugin/tests/api/volume/rbac_base.py @@ -28,11 +28,6 @@ class BaseVolumeRbacTest(rbac_utils.RbacUtilsMixin, # subclasses if necessary. _api_version = 3 - @classmethod - def skip_checks(cls): - super(BaseVolumeRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(BaseVolumeRbacTest, cls).setup_clients() diff --git a/patrole_tempest_plugin/tests/unit/test_rbac_utils.py b/patrole_tempest_plugin/tests/unit/test_rbac_utils.py index c5264aaa..51320791 100644 --- a/patrole_tempest_plugin/tests/unit/test_rbac_utils.py +++ b/patrole_tempest_plugin/tests/unit/test_rbac_utils.py @@ -207,11 +207,6 @@ class RBACUtilsMixinTest(base.TestCase): class FakeRbacTest(rbac_utils.RbacUtilsMixin, test.BaseTestCase): - @classmethod - def skip_checks(cls): - super(FakeRbacTest, cls).skip_checks() - cls.skip_rbac_checks() - @classmethod def setup_clients(cls): super(FakeRbacTest, cls).setup_clients() @@ -237,21 +232,3 @@ class RBACUtilsMixinTest(base.TestCase): self.assertTrue(hasattr(child_test, 'rbac_utils')) self.assertIsInstance(child_test.rbac_utils, rbac_utils.RbacUtils) - - def test_skip_rbac_checks(self): - """Validate that the child class is skipped if `[patrole] enable_rbac` - is False and that the child class's name is in the skip message. - """ - self.useFixture(patrole_fixtures.ConfPatcher(enable_rbac=False, - group='patrole')) - - class ChildRbacTest(self.parent_class): - pass - - child_test = ChildRbacTest() - - with testtools.ExpectedException( - testtools.TestCase.skipException, - value_re=('Patrole testing not enabled so skipping %s.' - % ChildRbacTest.__name__)): - child_test.setUpClass() diff --git a/releasenotes/notes/remove-deprecated-enable-rbac-config-option-a5e46ce1053b7dea.yaml b/releasenotes/notes/remove-deprecated-enable-rbac-config-option-a5e46ce1053b7dea.yaml new file mode 100644 index 00000000..53b17108 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-enable-rbac-config-option-a5e46ce1053b7dea.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Remove deprecated ``[patrole].enable_rbac`` configuration option. To skip + Patrole tests going forward, use an appropriate regex.