Removing rbac_roles from config.py.
This option was needed for the old rbac converter framework.
Now, rbac_roles is no longer needed so has been removed.
The recent framework changes were made in this commit:
https://review.openstack.org/#/c/424347/
Change-Id: I69f9a2f4e39ed733f12253aba49f32c3c70b7b3a
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
index b0a6f33..00cc57b 100644
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -25,7 +25,7 @@
tempest.conf
++++++++++++
-To run the RBAC tempest api test you have to make the following changes to
+To run the RBAC tempest api test, you have to make the following changes to
the tempest.conf file.
#. [auth] section updates ::
@@ -49,11 +49,8 @@
# The role that you want the RBAC tests to use for RBAC testing
# This needs to be edited to run the test as a different role.
- rbac_test_role=_member_
+ rbac_test_role = _member_
- # The list of roles that your system contains.
- # This needs to be updated as new roles are added.
- rbac_roles=admin,_member_
-
- # Tell standard RBAC test cases to run other wise it they are skipped.
- rbac_flag=true
+ # Enables RBAC Tempest tests if set to True. Otherwise, they are
+ # skipped.
+ rbac_flag = True
diff --git a/patrole_tempest_plugin/config.py b/patrole_tempest_plugin/config.py
index 2b20391..a0ca307 100644
--- a/patrole_tempest_plugin/config.py
+++ b/patrole_tempest_plugin/config.py
@@ -26,8 +26,4 @@
cfg.BoolOpt('rbac_flag',
default=False,
help="Enables RBAC tests."),
- cfg.ListOpt('rbac_roles',
- default=['admin'],
- help="List of RBAC roles found in the policy files "
- "under testing."),
]
diff --git a/tests/test_rbac_role_converter.py b/tests/test_rbac_role_converter.py
index dadab88..4d4f673 100644
--- a/tests/test_rbac_role_converter.py
+++ b/tests/test_rbac_role_converter.py
@@ -38,8 +38,6 @@
def test_custom_policy(self):
default_roles = ['zero', 'one', 'two', 'three', 'four',
'five', 'six', 'seven', 'eight', 'nine']
- CONF.set_override('rbac_roles', default_roles, group='rbac',
- enforce_type=True)
converter = rbac_role_converter.RbacPolicyConverter(
None, "test", self.custom_policy_file)
@@ -66,10 +64,6 @@
self.assertFalse(converter.allowed(rule, role))
def test_admin_policy_file_with_admin_role(self):
- default_roles = ['admin', 'Member']
- CONF.set_override('rbac_roles', default_roles, group='rbac',
- enforce_type=True)
-
converter = rbac_role_converter.RbacPolicyConverter(
None, "test", self.admin_policy_file)
@@ -89,10 +83,6 @@
self.assertFalse(allowed)
def test_admin_policy_file_with_member_role(self):
- default_roles = ['admin', 'Member']
- CONF.set_override('rbac_roles', default_roles, group='rbac',
- enforce_type=True)
-
converter = rbac_role_converter.RbacPolicyConverter(
None, "test", self.admin_policy_file)