Merge "Split resource_setup for identity tests"
This commit is contained in:
commit
0fd81db60d
|
@ -23,9 +23,9 @@ CONF = config.CONF
|
|||
class TestDefaultProjectId (base.BaseIdentityV3AdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
def setup_credentials(cls):
|
||||
cls.set_network_resources()
|
||||
super(TestDefaultProjectId, cls).resource_setup()
|
||||
super(TestDefaultProjectId, cls).setup_credentials()
|
||||
|
||||
def _delete_domain(self, domain_id):
|
||||
# It is necessary to disable the domain before deleting,
|
||||
|
|
|
@ -21,10 +21,14 @@ from tempest import test
|
|||
class EndPointsTestJSON(base.BaseIdentityV3AdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(EndPointsTestJSON, cls).resource_setup()
|
||||
def setup_clients(cls):
|
||||
super(EndPointsTestJSON, cls).setup_clients()
|
||||
cls.identity_client = cls.client
|
||||
cls.client = cls.endpoints_client
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(EndPointsTestJSON, cls).resource_setup()
|
||||
cls.service_ids = list()
|
||||
s_name = data_utils.rand_name('service-')
|
||||
s_type = data_utils.rand_name('type--')
|
||||
|
|
|
@ -24,10 +24,14 @@ from tempest import test
|
|||
class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(EndpointsNegativeTestJSON, cls).resource_setup()
|
||||
def setup_clients(cls):
|
||||
super(EndpointsNegativeTestJSON, cls).setup_clients()
|
||||
cls.identity_client = cls.client
|
||||
cls.client = cls.endpoints_client
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(EndpointsNegativeTestJSON, cls).resource_setup()
|
||||
cls.service_ids = list()
|
||||
s_name = data_utils.rand_name('service-')
|
||||
s_type = data_utils.rand_name('type--')
|
||||
|
|
|
@ -20,10 +20,6 @@ from tempest import test
|
|||
|
||||
class GroupsV3TestJSON(base.BaseIdentityV3AdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(GroupsV3TestJSON, cls).resource_setup()
|
||||
|
||||
@test.attr(type='smoke')
|
||||
def test_group_create_update_get(self):
|
||||
name = data_utils.rand_name('Group')
|
||||
|
|
|
@ -22,11 +22,15 @@ from tempest import test
|
|||
|
||||
class RegionsTestJSON(base.BaseIdentityV3AdminTest):
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(RegionsTestJSON, cls).setup_clients()
|
||||
cls.client = cls.region_client
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(RegionsTestJSON, cls).resource_setup()
|
||||
cls.setup_regions = list()
|
||||
cls.client = cls.region_client
|
||||
for i in range(2):
|
||||
r_description = data_utils.rand_name('description-')
|
||||
region = cls.client.create_region(r_description)
|
||||
|
|
|
@ -29,8 +29,8 @@ LOG = logging.getLogger(__name__)
|
|||
class BaseIdentityAdminTest(tempest.test.BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(BaseIdentityAdminTest, cls).resource_setup()
|
||||
def setup_credentials(cls):
|
||||
super(BaseIdentityAdminTest, cls).setup_credentials()
|
||||
cls.os_adm = clients.AdminManager()
|
||||
cls.os = clients.Manager()
|
||||
|
||||
|
@ -72,17 +72,26 @@ class BaseIdentityAdminTest(tempest.test.BaseTestCase):
|
|||
class BaseIdentityV2AdminTest(BaseIdentityAdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
def skip_checks(cls):
|
||||
super(BaseIdentityV2AdminTest, cls).skip_checks()
|
||||
if not CONF.identity_feature_enabled.api_v2:
|
||||
raise cls.skipException("Identity api v2 is not enabled")
|
||||
super(BaseIdentityV2AdminTest, cls).resource_setup()
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(BaseIdentityV2AdminTest, cls).setup_clients()
|
||||
cls.client = cls.os_adm.identity_client
|
||||
cls.token_client = cls.os_adm.token_client
|
||||
if not cls.client.has_admin_extensions():
|
||||
raise cls.skipException("Admin extensions disabled")
|
||||
cls.data = DataGenerator(cls.client)
|
||||
|
||||
cls.non_admin_client = cls.os.identity_client
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(BaseIdentityV2AdminTest, cls).resource_setup()
|
||||
cls.data = DataGenerator(cls.client)
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
cls.data.teardown_all()
|
||||
|
@ -92,10 +101,14 @@ class BaseIdentityV2AdminTest(BaseIdentityAdminTest):
|
|||
class BaseIdentityV3AdminTest(BaseIdentityAdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
def skip_checks(cls):
|
||||
super(BaseIdentityV3AdminTest, cls).skip_checks()
|
||||
if not CONF.identity_feature_enabled.api_v3:
|
||||
raise cls.skipException("Identity api v3 is not enabled")
|
||||
super(BaseIdentityV3AdminTest, cls).resource_setup()
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(BaseIdentityV3AdminTest, cls).setup_clients()
|
||||
cls.client = cls.os_adm.identity_v3_client
|
||||
cls.token = cls.os_adm.token_v3_client
|
||||
cls.endpoints_client = cls.os_adm.endpoints_client
|
||||
|
|
Loading…
Reference in New Issue