Merge "Support immutable user source"

This commit is contained in:
Zuul
2018-12-06 23:44:15 +00:00
committed by Gerrit Code Review
3 changed files with 26 additions and 1 deletions
@@ -0,0 +1,11 @@
---
features:
- |
Add a new config setting ``immutable_user_source`` in the
``[identity-feature-enabled]`` group that defaults to false.
This setting, combined with the usage of the ``@testtools.skipIf()``
decorator, will allow tests that require user creation, deletion,
or modification to skip instead of failing in environments that
are LDAP-backed. In such environments, the user source is read-only,
so this feature flag is needed to allow such tests to gracefully skip
without having to blacklist them.
@@ -28,6 +28,14 @@ CONF = config.CONF
class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
@classmethod
def skip_checks(cls):
super(UsersV3TestJSON, cls).skip_checks()
if CONF.identity_feature_enabled.immutable_user_source:
raise cls.skipException('Skipped because environment has an '
'immutable user source and solely '
'provides read-only access to users.')
@decorators.idempotent_id('b537d090-afb9-4519-b95d-270b0708e87e')
def test_user_update(self):
# Test case to check if updating of user attributes is successful.
+7 -1
View File
@@ -262,7 +262,13 @@ IdentityFeatureGroup = [
cfg.BoolOpt('application_credentials',
default=False,
help='Does the environment have application credentials '
'enabled?')
'enabled?'),
cfg.BoolOpt('immutable_user_source',
default=False,
help='Set to True if the environment has a read-only '
'user source. This will skip all tests that attempt to '
'create, delete, or modify users. This should not be set '
'to True if using dynamic credentials')
]
compute_group = cfg.OptGroup(name='compute',