Skip tests in UsersV3TestJSON with an immutable user source

Adds a skip_checks condition to UsersV3TestJSON to skip if immutable 
user source is true. resource_setup() in this class attempts to create
users, which will fail if the environment uses an LDAP directory for 
example.

Change-Id: I42c3b7a17bfb73079b1d05951636359324bed207
This commit is contained in:
Leo Henken 2019-07-26 09:50:38 -05:00
parent ef47489dc1
commit 0f348f79c8

View File

@ -33,6 +33,14 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
self.assertNotIn(not_expected[key], self.assertNotIn(not_expected[key],
map(lambda x: x[key], body)) map(lambda x: x[key], body))
@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.')
@classmethod @classmethod
def resource_setup(cls): def resource_setup(cls):
super(UsersV3TestJSON, cls).resource_setup() super(UsersV3TestJSON, cls).resource_setup()