From eeabdd2ce6576836a4572bdd5eced17809675515 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Fri, 27 Jan 2017 17:46:00 -0800 Subject: Switch to decorators.idempotent_id on identity So many modules are using test.idempotent_id and this is for switching to decorators.idempotent_id on identity. Change-Id: I8c3ad6a3b20c6829c752f9fae5a27bd3e284c1b1 Related-Bug: #1616913 --- tempest/api/identity/admin/v2/test_endpoints.py | 6 +-- tempest/api/identity/admin/v2/test_roles.py | 14 +++---- .../api/identity/admin/v2/test_roles_negative.py | 41 +++++++++++---------- tempest/api/identity/admin/v2/test_services.py | 7 ++-- .../api/identity/admin/v2/test_tenant_negative.py | 27 +++++++------- tempest/api/identity/admin/v2/test_tenants.py | 16 ++++---- tempest/api/identity/admin/v2/test_tokens.py | 6 +-- tempest/api/identity/admin/v2/test_users.py | 21 ++++++----- .../api/identity/admin/v2/test_users_negative.py | 43 +++++++++++----------- tempest/api/identity/admin/v3/test_credentials.py | 5 ++- .../identity/admin/v3/test_default_project_id.py | 4 +- tempest/api/identity/admin/v3/test_domains.py | 15 ++++---- .../api/identity/admin/v3/test_domains_negative.py | 11 +++--- tempest/api/identity/admin/v3/test_endpoints.py | 7 ++-- .../identity/admin/v3/test_endpoints_negative.py | 9 +++-- tempest/api/identity/admin/v3/test_groups.py | 11 +++--- tempest/api/identity/admin/v3/test_inherits.py | 13 ++++--- .../api/identity/admin/v3/test_list_projects.py | 12 +++--- tempest/api/identity/admin/v3/test_list_users.py | 12 +++--- tempest/api/identity/admin/v3/test_policies.py | 5 ++- tempest/api/identity/admin/v3/test_projects.py | 20 +++++----- .../identity/admin/v3/test_projects_negative.py | 15 ++++---- tempest/api/identity/admin/v3/test_regions.py | 9 +++-- tempest/api/identity/admin/v3/test_roles.py | 13 ++++--- tempest/api/identity/admin/v3/test_services.py | 7 ++-- tempest/api/identity/admin/v3/test_tokens.py | 6 +-- tempest/api/identity/admin/v3/test_trusts.py | 13 ++++--- tempest/api/identity/admin/v3/test_users.py | 12 +++--- .../api/identity/admin/v3/test_users_negative.py | 5 ++- tempest/api/identity/test_extension.py | 4 +- tempest/api/identity/v2/test_api_discovery.py | 7 ++-- tempest/api/identity/v2/test_ec2_credentials.py | 9 +++-- tempest/api/identity/v2/test_tenants.py | 4 +- tempest/api/identity/v2/test_tokens.py | 4 +- tempest/api/identity/v2/test_users.py | 4 +- 35 files changed, 219 insertions(+), 198 deletions(-) (limited to 'tempest/api') diff --git a/tempest/api/identity/admin/v2/test_endpoints.py b/tempest/api/identity/admin/v2/test_endpoints.py index 0da579cd2..df55d2f94 100644 --- a/tempest/api/identity/admin/v2/test_endpoints.py +++ b/tempest/api/identity/admin/v2/test_endpoints.py @@ -15,7 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils -from tempest import test +from tempest.lib import decorators class EndPointsTestJSON(base.BaseIdentityV2AdminTest): @@ -55,7 +55,7 @@ class EndPointsTestJSON(base.BaseIdentityV2AdminTest): cls.services_client.delete_service(s) super(EndPointsTestJSON, cls).resource_cleanup() - @test.idempotent_id('11f590eb-59d8-4067-8b2b-980c7f387f51') + @decorators.idempotent_id('11f590eb-59d8-4067-8b2b-980c7f387f51') def test_list_endpoints(self): # Get a list of endpoints fetched_endpoints = self.endpoints_client.list_endpoints()['endpoints'] @@ -66,7 +66,7 @@ class EndPointsTestJSON(base.BaseIdentityV2AdminTest): "Failed to find endpoint %s in fetched list" % ', '.join(str(e) for e in missing_endpoints)) - @test.idempotent_id('9974530a-aa28-4362-8403-f06db02b26c1') + @decorators.idempotent_id('9974530a-aa28-4362-8403-f06db02b26c1') def test_create_list_delete_endpoint(self): region = data_utils.rand_name('region') url = data_utils.rand_url() diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py index d284aaccb..799b65304 100644 --- a/tempest/api/identity/admin/v2/test_roles.py +++ b/tempest/api/identity/admin/v2/test_roles.py @@ -16,7 +16,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.lib.common.utils import test_utils -from tempest import test +from tempest.lib import decorators class RolesTestJSON(base.BaseIdentityV2AdminTest): @@ -49,7 +49,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): found = True self.assertTrue(found, "assigned role was not in list") - @test.idempotent_id('75d9593f-50b7-4fcf-bd64-e3fb4a278e23') + @decorators.idempotent_id('75d9593f-50b7-4fcf-bd64-e3fb4a278e23') def test_list_roles(self): """Return a list of all roles.""" body = self.roles_client.list_roles()['roles'] @@ -57,7 +57,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): self.assertTrue(any(found)) self.assertEqual(len(found), len(self.roles)) - @test.idempotent_id('c62d909d-6c21-48c0-ae40-0a0760e6db5e') + @decorators.idempotent_id('c62d909d-6c21-48c0-ae40-0a0760e6db5e') def test_role_create_delete(self): """Role should be created, verified, and deleted.""" role_name = data_utils.rand_name(name='role-test') @@ -76,7 +76,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): found = [role for role in body if role['name'] == role_name] self.assertFalse(any(found)) - @test.idempotent_id('db6870bd-a6ed-43be-a9b1-2f10a5c9994f') + @decorators.idempotent_id('db6870bd-a6ed-43be-a9b1-2f10a5c9994f') def test_get_role_by_id(self): """Get a role by its id.""" role = self.setup_test_role() @@ -86,7 +86,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): self.assertEqual(role_id, body['id']) self.assertEqual(role_name, body['name']) - @test.idempotent_id('0146f675-ffbd-4208-b3a4-60eb628dbc5e') + @decorators.idempotent_id('0146f675-ffbd-4208-b3a4-60eb628dbc5e') def test_assign_user_role(self): """Assign a role to a user on a tenant.""" (user, tenant, role) = self._get_role_params() @@ -97,7 +97,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'])['roles'] self.assert_role_in_role_list(role, roles) - @test.idempotent_id('f0b9292c-d3ba-4082-aa6c-440489beef69') + @decorators.idempotent_id('f0b9292c-d3ba-4082-aa6c-440489beef69') def test_remove_user_role(self): """Remove a role assigned to a user on a tenant.""" (user, tenant, role) = self._get_role_params() @@ -107,7 +107,7 @@ class RolesTestJSON(base.BaseIdentityV2AdminTest): user['id'], user_role['id']) - @test.idempotent_id('262e1e3e-ed71-4edd-a0e5-d64e83d66d05') + @decorators.idempotent_id('262e1e3e-ed71-4edd-a0e5-d64e83d66d05') def test_list_user_roles(self): """List roles assigned to a user on tenant.""" (user, tenant, role) = self._get_role_params() diff --git a/tempest/api/identity/admin/v2/test_roles_negative.py b/tempest/api/identity/admin/v2/test_roles_negative.py index 7116913e4..b017b442b 100644 --- a/tempest/api/identity/admin/v2/test_roles_negative.py +++ b/tempest/api/identity/admin/v2/test_roles_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -28,14 +29,14 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): return (user, tenant, role) @test.attr(type=['negative']) - @test.idempotent_id('d5d5f1df-f8ca-4de0-b2ef-259c1cc67025') + @decorators.idempotent_id('d5d5f1df-f8ca-4de0-b2ef-259c1cc67025') def test_list_roles_by_unauthorized_user(self): # Non-administrator user should not be able to list roles self.assertRaises(lib_exc.Forbidden, self.non_admin_roles_client.list_roles) @test.attr(type=['negative']) - @test.idempotent_id('11a3c7da-df6c-40c2-abc2-badd682edf9f') + @decorators.idempotent_id('11a3c7da-df6c-40c2-abc2-badd682edf9f') def test_list_roles_request_without_token(self): # Request to list roles without a valid token should fail token = self.client.auth_provider.get_token() @@ -44,14 +45,14 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('c0b89e56-accc-4c73-85f8-9c0f866104c1') + @decorators.idempotent_id('c0b89e56-accc-4c73-85f8-9c0f866104c1') def test_role_create_blank_name(self): # Should not be able to create a role with a blank name self.assertRaises(lib_exc.BadRequest, self.roles_client.create_role, name='') @test.attr(type=['negative']) - @test.idempotent_id('585c8998-a8a4-4641-a5dd-abef7a8ced00') + @decorators.idempotent_id('585c8998-a8a4-4641-a5dd-abef7a8ced00') def test_create_role_by_unauthorized_user(self): # Non-administrator user should not be able to create role role_name = data_utils.rand_name(name='role') @@ -60,7 +61,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): name=role_name) @test.attr(type=['negative']) - @test.idempotent_id('a7edd17a-e34a-4aab-8bb7-fa6f498645b8') + @decorators.idempotent_id('a7edd17a-e34a-4aab-8bb7-fa6f498645b8') def test_create_role_request_without_token(self): # Request to create role without a valid token should fail token = self.client.auth_provider.get_token() @@ -71,7 +72,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('c0cde2c8-81c1-4bb0-8fe2-cf615a3547a8') + @decorators.idempotent_id('c0cde2c8-81c1-4bb0-8fe2-cf615a3547a8') def test_role_create_duplicate(self): # Role names should be unique role_name = data_utils.rand_name(name='role-dup') @@ -82,7 +83,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): name=role_name) @test.attr(type=['negative']) - @test.idempotent_id('15347635-b5b1-4a87-a280-deb2bd6d865e') + @decorators.idempotent_id('15347635-b5b1-4a87-a280-deb2bd6d865e') def test_delete_role_by_unauthorized_user(self): # Non-administrator user should not be able to delete role role_name = data_utils.rand_name(name='role') @@ -93,7 +94,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.non_admin_roles_client.delete_role, role_id) @test.attr(type=['negative']) - @test.idempotent_id('44b60b20-70de-4dac-beaf-a3fc2650a16b') + @decorators.idempotent_id('44b60b20-70de-4dac-beaf-a3fc2650a16b') def test_delete_role_request_without_token(self): # Request to delete role without a valid token should fail role_name = data_utils.rand_name(name='role') @@ -108,7 +109,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('38373691-8551-453a-b074-4260ad8298ef') + @decorators.idempotent_id('38373691-8551-453a-b074-4260ad8298ef') def test_delete_role_non_existent(self): # Attempt to delete a non existent role should fail non_existent_role = data_utils.rand_uuid_hex() @@ -116,7 +117,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): non_existent_role) @test.attr(type=['negative']) - @test.idempotent_id('391df5cf-3ec3-46c9-bbe5-5cb58dd4dc41') + @decorators.idempotent_id('391df5cf-3ec3-46c9-bbe5-5cb58dd4dc41') def test_assign_user_role_by_unauthorized_user(self): # Non-administrator user should not be authorized to # assign a role to user @@ -127,7 +128,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'], role['id']) @test.attr(type=['negative']) - @test.idempotent_id('f0d2683c-5603-4aee-95d7-21420e87cfd8') + @decorators.idempotent_id('f0d2683c-5603-4aee-95d7-21420e87cfd8') def test_assign_user_role_request_without_token(self): # Request to assign a role to a user without a valid token (user, tenant, role) = self._get_role_params() @@ -140,7 +141,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('99b297f6-2b5d-47c7-97a9-8b6bb4f91042') + @decorators.idempotent_id('99b297f6-2b5d-47c7-97a9-8b6bb4f91042') def test_assign_user_role_for_non_existent_role(self): # Attempt to assign a non existent role to user should fail (user, tenant, role) = self._get_role_params() @@ -150,7 +151,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'], non_existent_role) @test.attr(type=['negative']) - @test.idempotent_id('b2285aaa-9e76-4704-93a9-7a8acd0a6c8f') + @decorators.idempotent_id('b2285aaa-9e76-4704-93a9-7a8acd0a6c8f') def test_assign_user_role_for_non_existent_tenant(self): # Attempt to assign a role on a non existent tenant should fail (user, tenant, role) = self._get_role_params() @@ -160,7 +161,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): non_existent_tenant, user['id'], role['id']) @test.attr(type=['negative']) - @test.idempotent_id('5c3132cd-c4c8-4402-b5ea-71eb44e97793') + @decorators.idempotent_id('5c3132cd-c4c8-4402-b5ea-71eb44e97793') def test_assign_duplicate_user_role(self): # Duplicate user role should not get assigned (user, tenant, role) = self._get_role_params() @@ -172,7 +173,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'], role['id']) @test.attr(type=['negative']) - @test.idempotent_id('d0537987-0977-448f-a435-904c15de7298') + @decorators.idempotent_id('d0537987-0977-448f-a435-904c15de7298') def test_remove_user_role_by_unauthorized_user(self): # Non-administrator user should not be authorized to # remove a user's role @@ -186,7 +187,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'], role['id']) @test.attr(type=['negative']) - @test.idempotent_id('cac81cf4-c1d2-47dc-90d3-f2b7eb572286') + @decorators.idempotent_id('cac81cf4-c1d2-47dc-90d3-f2b7eb572286') def test_remove_user_role_request_without_token(self): # Request to remove a user's role without a valid token (user, tenant, role) = self._get_role_params() @@ -201,7 +202,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('ab32d759-cd16-41f1-a86e-44405fa9f6d2') + @decorators.idempotent_id('ab32d759-cd16-41f1-a86e-44405fa9f6d2') def test_remove_user_role_non_existent_role(self): # Attempt to delete a non existent role from a user should fail (user, tenant, role) = self._get_role_params() @@ -214,7 +215,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id'], non_existent_role) @test.attr(type=['negative']) - @test.idempotent_id('67a679ec-03dd-4551-bbfc-d1c93284f023') + @decorators.idempotent_id('67a679ec-03dd-4551-bbfc-d1c93284f023') def test_remove_user_role_non_existent_tenant(self): # Attempt to remove a role from a non existent tenant should fail (user, tenant, role) = self._get_role_params() @@ -227,7 +228,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): non_existent_tenant, user['id'], role['id']) @test.attr(type=['negative']) - @test.idempotent_id('7391ab4c-06f3-477a-a64a-c8e55ce89837') + @decorators.idempotent_id('7391ab4c-06f3-477a-a64a-c8e55ce89837') def test_list_user_roles_by_unauthorized_user(self): # Non-administrator user should not be authorized to list # a user's roles @@ -241,7 +242,7 @@ class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id'], user['id']) @test.attr(type=['negative']) - @test.idempotent_id('682adfb2-fd5f-4b0a-a9ca-322e9bebb907') + @decorators.idempotent_id('682adfb2-fd5f-4b0a-a9ca-322e9bebb907') def test_list_user_roles_request_without_token(self): # Request to list user's roles without a valid token should fail (user, tenant, role) = self._get_role_params() diff --git a/tempest/api/identity/admin/v2/test_services.py b/tempest/api/identity/admin/v2/test_services.py index 7973a03d2..3b0ddbbe9 100644 --- a/tempest/api/identity/admin/v2/test_services.py +++ b/tempest/api/identity/admin/v2/test_services.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -28,7 +29,7 @@ class ServicesTestJSON(base.BaseIdentityV2AdminTest): self.assertRaises(lib_exc.NotFound, self.services_client.show_service, service_id) - @test.idempotent_id('84521085-c6e6-491c-9a08-ec9f70f90110') + @decorators.idempotent_id('84521085-c6e6-491c-9a08-ec9f70f90110') def test_create_get_delete_service(self): # GET Service # Creating a Service @@ -63,7 +64,7 @@ class ServicesTestJSON(base.BaseIdentityV2AdminTest): self.assertEqual(fetched_service['description'], service_data['description']) - @test.idempotent_id('5d3252c8-e555-494b-a6c8-e11d7335da42') + @decorators.idempotent_id('5d3252c8-e555-494b-a6c8-e11d7335da42') def test_create_service_without_description(self): # Create a service only with name and type name = data_utils.rand_name('service') @@ -78,7 +79,7 @@ class ServicesTestJSON(base.BaseIdentityV2AdminTest): self.assertEqual(s_type, service['type']) @test.attr(type='smoke') - @test.idempotent_id('34ea6489-012d-4a86-9038-1287cadd5eca') + @decorators.idempotent_id('34ea6489-012d-4a86-9038-1287cadd5eca') def test_list_services(self): # Create, List, Verify and Delete Services services = [] diff --git a/tempest/api/identity/admin/v2/test_tenant_negative.py b/tempest/api/identity/admin/v2/test_tenant_negative.py index baa78e979..e8c32b9a6 100644 --- a/tempest/api/identity/admin/v2/test_tenant_negative.py +++ b/tempest/api/identity/admin/v2/test_tenant_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -22,14 +23,14 @@ from tempest import test class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): @test.attr(type=['negative']) - @test.idempotent_id('ca9bb202-63dd-4240-8a07-8ef9c19c04bb') + @decorators.idempotent_id('ca9bb202-63dd-4240-8a07-8ef9c19c04bb') def test_list_tenants_by_unauthorized_user(self): # Non-administrator user should not be able to list tenants self.assertRaises(lib_exc.Forbidden, self.non_admin_tenants_client.list_tenants) @test.attr(type=['negative']) - @test.idempotent_id('df33926c-1c96-4d8d-a762-79cc6b0c3cf4') + @decorators.idempotent_id('df33926c-1c96-4d8d-a762-79cc6b0c3cf4') def test_list_tenant_request_without_token(self): # Request to list tenants without a valid token should fail token = self.client.auth_provider.get_token() @@ -39,7 +40,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('162ba316-f18b-4987-8c0c-fd9140cd63ed') + @decorators.idempotent_id('162ba316-f18b-4987-8c0c-fd9140cd63ed') def test_tenant_delete_by_unauthorized_user(self): # Non-administrator user should not be able to delete a tenant tenant_name = data_utils.rand_name(name='tenant') @@ -50,7 +51,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id']) @test.attr(type=['negative']) - @test.idempotent_id('e450db62-2e9d-418f-893a-54772d6386b1') + @decorators.idempotent_id('e450db62-2e9d-418f-893a-54772d6386b1') def test_tenant_delete_request_without_token(self): # Request to delete a tenant without a valid token should fail tenant_name = data_utils.rand_name(name='tenant') @@ -64,14 +65,14 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('9c9a2aed-6e3c-467a-8f5c-89da9d1b516b') + @decorators.idempotent_id('9c9a2aed-6e3c-467a-8f5c-89da9d1b516b') def test_delete_non_existent_tenant(self): # Attempt to delete a non existent tenant should fail self.assertRaises(lib_exc.NotFound, self.tenants_client.delete_tenant, data_utils.rand_uuid_hex()) @test.attr(type=['negative']) - @test.idempotent_id('af16f44b-a849-46cb-9f13-a751c388f739') + @decorators.idempotent_id('af16f44b-a849-46cb-9f13-a751c388f739') def test_tenant_create_duplicate(self): # Tenant names should be unique tenant_name = data_utils.rand_name(name='tenant') @@ -83,7 +84,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): name=tenant_name) @test.attr(type=['negative']) - @test.idempotent_id('d26b278a-6389-4702-8d6e-5980d80137e0') + @decorators.idempotent_id('d26b278a-6389-4702-8d6e-5980d80137e0') def test_create_tenant_by_unauthorized_user(self): # Non-administrator user should not be authorized to create a tenant tenant_name = data_utils.rand_name(name='tenant') @@ -92,7 +93,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): name=tenant_name) @test.attr(type=['negative']) - @test.idempotent_id('a3ee9d7e-6920-4dd5-9321-d4b2b7f0a638') + @decorators.idempotent_id('a3ee9d7e-6920-4dd5-9321-d4b2b7f0a638') def test_create_tenant_request_without_token(self): # Create tenant request without a token should not be authorized tenant_name = data_utils.rand_name(name='tenant') @@ -104,7 +105,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): self.client.auth_provider.clear_auth() @test.attr(type=['negative']) - @test.idempotent_id('5a2e4ca9-b0c0-486c-9c48-64a94fba2395') + @decorators.idempotent_id('5a2e4ca9-b0c0-486c-9c48-64a94fba2395') def test_create_tenant_with_empty_name(self): # Tenant name should not be empty self.assertRaises(lib_exc.BadRequest, @@ -112,7 +113,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): name='') @test.attr(type=['negative']) - @test.idempotent_id('2ff18d1e-dfe3-4359-9dc3-abf582c196b9') + @decorators.idempotent_id('2ff18d1e-dfe3-4359-9dc3-abf582c196b9') def test_create_tenants_name_length_over_64(self): # Tenant name length should not be greater than 64 characters tenant_name = 'a' * 65 @@ -121,14 +122,14 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): name=tenant_name) @test.attr(type=['negative']) - @test.idempotent_id('bd20dc2a-9557-4db7-b755-f48d952ad706') + @decorators.idempotent_id('bd20dc2a-9557-4db7-b755-f48d952ad706') def test_update_non_existent_tenant(self): # Attempt to update a non existent tenant should fail self.assertRaises(lib_exc.NotFound, self.tenants_client.update_tenant, data_utils.rand_uuid_hex()) @test.attr(type=['negative']) - @test.idempotent_id('41704dc5-c5f7-4f79-abfa-76e6fedc570b') + @decorators.idempotent_id('41704dc5-c5f7-4f79-abfa-76e6fedc570b') def test_tenant_update_by_unauthorized_user(self): # Non-administrator user should not be able to update a tenant tenant_name = data_utils.rand_name(name='tenant') @@ -139,7 +140,7 @@ class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['id']) @test.attr(type=['negative']) - @test.idempotent_id('7a421573-72c7-4c22-a98e-ce539219c657') + @decorators.idempotent_id('7a421573-72c7-4c22-a98e-ce539219c657') def test_tenant_update_request_without_token(self): # Request to update a tenant without a valid token should fail tenant_name = data_utils.rand_name(name='tenant') diff --git a/tempest/api/identity/admin/v2/test_tenants.py b/tempest/api/identity/admin/v2/test_tenants.py index f4fad531b..eb51b5a51 100644 --- a/tempest/api/identity/admin/v2/test_tenants.py +++ b/tempest/api/identity/admin/v2/test_tenants.py @@ -16,12 +16,12 @@ from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.lib.common.utils import test_utils -from tempest import test +from tempest.lib import decorators class TenantsTestJSON(base.BaseIdentityV2AdminTest): - @test.idempotent_id('16c6e05c-6112-4b0e-b83f-5e43f221b6b0') + @decorators.idempotent_id('16c6e05c-6112-4b0e-b83f-5e43f221b6b0') def test_tenant_list_delete(self): # Create several tenants and delete them tenants = [] @@ -45,7 +45,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): found = [tenant for tenant in body if tenant['id'] in tenant_ids] self.assertFalse(any(found), 'Tenants failed to delete') - @test.idempotent_id('d25e9f24-1310-4d29-b61b-d91299c21d6d') + @decorators.idempotent_id('d25e9f24-1310-4d29-b61b-d91299c21d6d') def test_tenant_create_with_description(self): # Create tenant with a description tenant_name = data_utils.rand_name(name='tenant') @@ -66,7 +66,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): 'to be set') self.tenants_client.delete_tenant(tenant_id) - @test.idempotent_id('670bdddc-1cd7-41c7-b8e2-751cfb67df50') + @decorators.idempotent_id('670bdddc-1cd7-41c7-b8e2-751cfb67df50') def test_tenant_create_enabled(self): # Create a tenant that is enabled tenant_name = data_utils.rand_name(name='tenant') @@ -84,7 +84,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): self.assertTrue(en2, 'Enable should be True in lookup') self.tenants_client.delete_tenant(tenant_id) - @test.idempotent_id('3be22093-b30f-499d-b772-38340e5e16fb') + @decorators.idempotent_id('3be22093-b30f-499d-b772-38340e5e16fb') def test_tenant_create_not_enabled(self): # Create a tenant that is not enabled tenant_name = data_utils.rand_name(name='tenant') @@ -104,7 +104,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): 'Enable should be False in lookup') self.tenants_client.delete_tenant(tenant_id) - @test.idempotent_id('781f2266-d128-47f3-8bdb-f70970add238') + @decorators.idempotent_id('781f2266-d128-47f3-8bdb-f70970add238') def test_tenant_update_name(self): # Update name attribute of a tenant t_name1 = data_utils.rand_name(name='tenant') @@ -131,7 +131,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): self.tenants_client.delete_tenant(t_id) - @test.idempotent_id('859fcfe1-3a03-41ef-86f9-b19a47d1cd87') + @decorators.idempotent_id('859fcfe1-3a03-41ef-86f9-b19a47d1cd87') def test_tenant_update_desc(self): # Update description attribute of a tenant t_name = data_utils.rand_name(name='tenant') @@ -161,7 +161,7 @@ class TenantsTestJSON(base.BaseIdentityV2AdminTest): self.tenants_client.delete_tenant(t_id) - @test.idempotent_id('8fc8981f-f12d-4c66-9972-2bdcf2bc2e1a') + @decorators.idempotent_id('8fc8981f-f12d-4c66-9972-2bdcf2bc2e1a') def test_tenant_update_enable(self): # Update the enabled attribute of a tenant t_name = data_utils.rand_name(name='tenant') diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py index 2f7e9414f..7b5e01e04 100644 --- a/tempest/api/identity/admin/v2/test_tokens.py +++ b/tempest/api/identity/admin/v2/test_tokens.py @@ -15,12 +15,12 @@ from tempest.api.identity import base from tempest.common.utils import data_utils -from tempest import test +from tempest.lib import decorators class TokensTestJSON(base.BaseIdentityV2AdminTest): - @test.idempotent_id('453ad4d5-e486-4b2f-be72-cffc8149e586') + @decorators.idempotent_id('453ad4d5-e486-4b2f-be72-cffc8149e586') def test_create_get_delete_token(self): # get a token by username and password user_name = data_utils.rand_name(name='user') @@ -54,7 +54,7 @@ class TokensTestJSON(base.BaseIdentityV2AdminTest): # then delete the token self.client.delete_token(token_id) - @test.idempotent_id('25ba82ee-8a32-4ceb-8f50-8b8c71e8765e') + @decorators.idempotent_id('25ba82ee-8a32-4ceb-8f50-8b8c71e8765e') def test_rescope_token(self): """An unscoped token can be requested diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py index 4a4b51a0b..588981323 100644 --- a/tempest/api/identity/admin/v2/test_users.py +++ b/tempest/api/identity/admin/v2/test_users.py @@ -20,6 +20,7 @@ from testtools import matchers from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.lib.common.utils import test_utils +from tempest.lib import decorators from tempest import test @@ -33,7 +34,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): cls.alt_email = cls.alt_user + '@testmail.tm' @test.attr(type='smoke') - @test.idempotent_id('2d55a71e-da1d-4b43-9c03-d269fd93d905') + @decorators.idempotent_id('2d55a71e-da1d-4b43-9c03-d269fd93d905') def test_create_user(self): # Create a user tenant = self.setup_test_tenant() @@ -45,7 +46,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): self.addCleanup(self.users_client.delete_user, user['id']) self.assertEqual(self.alt_user, user['name']) - @test.idempotent_id('89d9fdb8-15c2-4304-a429-48715d0af33d') + @decorators.idempotent_id('89d9fdb8-15c2-4304-a429-48715d0af33d') def test_create_user_with_enabled(self): # Create a user with enabled : False tenant = self.setup_test_tenant() @@ -61,7 +62,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): self.assertEqual(False, user['enabled']) self.assertEqual(self.alt_email, user['email']) - @test.idempotent_id('39d05857-e8a5-4ed4-ba83-0b52d3ab97ee') + @decorators.idempotent_id('39d05857-e8a5-4ed4-ba83-0b52d3ab97ee') def test_update_user(self): # Test case to check if updating of user attributes is successful. test_user = data_utils.rand_name('test_user') @@ -88,7 +89,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): self.assertEqual(u_email2, updated_user['email']) self.assertEqual(False, update_user['enabled']) - @test.idempotent_id('29ed26f4-a74e-4425-9a85-fdb49fa269d2') + @decorators.idempotent_id('29ed26f4-a74e-4425-9a85-fdb49fa269d2') def test_delete_user(self): # Delete a user test_user = data_utils.rand_name('test_user') @@ -102,7 +103,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): self.users_client.delete_user, user['id']) self.users_client.delete_user(user['id']) - @test.idempotent_id('aca696c3-d645-4f45-b728-63646045beb1') + @decorators.idempotent_id('aca696c3-d645-4f45-b728-63646045beb1') def test_user_authentication(self): # Valid user's token is authenticated password = data_utils.rand_password() @@ -117,7 +118,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): password, tenant['name']) - @test.idempotent_id('5d1fa498-4c2d-4732-a8fe-2b054598cfdd') + @decorators.idempotent_id('5d1fa498-4c2d-4732-a8fe-2b054598cfdd') def test_authentication_request_without_token(self): # Request for token authentication with a valid token in header password = data_utils.rand_password() @@ -136,7 +137,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): tenant['name']) self.client.auth_provider.clear_auth() - @test.idempotent_id('a149c02e-e5e0-4b89-809e-7e8faf33ccda') + @decorators.idempotent_id('a149c02e-e5e0-4b89-809e-7e8faf33ccda') def test_get_users(self): # Get a list of users and find the test user user = self.setup_test_user() @@ -145,7 +146,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): matchers.Contains(user['name']), "Could not find %s" % user['name']) - @test.idempotent_id('6e317209-383a-4bed-9f10-075b7c82c79a') + @decorators.idempotent_id('6e317209-383a-4bed-9f10-075b7c82c79a') def test_list_users_for_tenant(self): # Return a list of all users for a tenant tenant = self.setup_test_tenant() @@ -181,7 +182,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): "Failed to find user %s in fetched list" % ', '.join(m_user for m_user in missing_users)) - @test.idempotent_id('a8b54974-40e1-41c0-b812-50fc90827971') + @decorators.idempotent_id('a8b54974-40e1-41c0-b812-50fc90827971') def test_list_users_with_roles_for_tenant(self): # Return list of users on tenant when roles are assigned to users user = self.setup_test_user() @@ -217,7 +218,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): "Failed to find user %s in fetched list" % ', '.join(m_user for m_user in missing_users)) - @test.idempotent_id('1aeb25ac-6ec5-4d8b-97cb-7ac3567a989f') + @decorators.idempotent_id('1aeb25ac-6ec5-4d8b-97cb-7ac3567a989f') def test_update_user_password(self): # Test case to check if updating of user password is successful. user = self.setup_test_user() diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py index 597413e4f..49fda4ec9 100644 --- a/tempest/api/identity/admin/v2/test_users_negative.py +++ b/tempest/api/identity/admin/v2/test_users_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -29,7 +30,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): cls.alt_email = cls.alt_user + '@testmail.tm' @test.attr(type=['negative']) - @test.idempotent_id('60a1f5fa-5744-4cdf-82bf-60b7de2d29a4') + @decorators.idempotent_id('60a1f5fa-5744-4cdf-82bf-60b7de2d29a4') def test_create_user_by_unauthorized_user(self): # Non-administrator should not be authorized to create a user tenant = self.setup_test_tenant() @@ -40,7 +41,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email) @test.attr(type=['negative']) - @test.idempotent_id('d80d0c2f-4514-4d1e-806d-0930dfc5a187') + @decorators.idempotent_id('d80d0c2f-4514-4d1e-806d-0930dfc5a187') def test_create_user_with_empty_name(self): # User with an empty name should not be created tenant = self.setup_test_tenant() @@ -50,7 +51,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email) @test.attr(type=['negative']) - @test.idempotent_id('7704b4f3-3b75-4b82-87cc-931d41c8f780') + @decorators.idempotent_id('7704b4f3-3b75-4b82-87cc-931d41c8f780') def test_create_user_with_name_length_over_255(self): # Length of user name filed should be restricted to 255 characters tenant = self.setup_test_tenant() @@ -60,7 +61,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email) @test.attr(type=['negative']) - @test.idempotent_id('57ae8558-120c-4723-9308-3751474e7ecf') + @decorators.idempotent_id('57ae8558-120c-4723-9308-3751474e7ecf') def test_create_user_with_duplicate_name(self): # Duplicate user should not be created password = data_utils.rand_password() @@ -73,7 +74,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=user['email']) @test.attr(type=['negative']) - @test.idempotent_id('0132cc22-7c4f-42e1-9e50-ac6aad31d59a') + @decorators.idempotent_id('0132cc22-7c4f-42e1-9e50-ac6aad31d59a') def test_create_user_for_non_existent_tenant(self): # Attempt to create a user in a non-existent tenant should fail self.assertRaises(lib_exc.NotFound, self.users_client.create_user, @@ -83,7 +84,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email) @test.attr(type=['negative']) - @test.idempotent_id('55bbb103-d1ae-437b-989b-bcdf8175c1f4') + @decorators.idempotent_id('55bbb103-d1ae-437b-989b-bcdf8175c1f4') def test_create_user_request_without_a_token(self): # Request to create a user without a valid token should fail tenant = self.setup_test_tenant() @@ -101,7 +102,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email) @test.attr(type=['negative']) - @test.idempotent_id('23a2f3da-4a1a-41da-abdd-632328a861ad') + @decorators.idempotent_id('23a2f3da-4a1a-41da-abdd-632328a861ad') def test_create_user_with_enabled_non_bool(self): # Attempt to create a user with valid enabled para should fail tenant = self.setup_test_tenant() @@ -112,7 +113,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): email=self.alt_email, enabled=3) @test.attr(type=['negative']) - @test.idempotent_id('3d07e294-27a0-4144-b780-a2a1bf6fee19') + @decorators.idempotent_id('3d07e294-27a0-4144-b780-a2a1bf6fee19') def test_update_user_for_non_existent_user(self): # Attempt to update a user non-existent user should fail user_name = data_utils.rand_name('user') @@ -121,7 +122,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): non_existent_id, name=user_name) @test.attr(type=['negative']) - @test.idempotent_id('3cc2a64b-83aa-4b02-88f0-d6ab737c4466') + @decorators.idempotent_id('3cc2a64b-83aa-4b02-88f0-d6ab737c4466') def test_update_user_request_without_a_token(self): # Request to update a user without a valid token should fail @@ -137,7 +138,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): self.alt_user) @test.attr(type=['negative']) - @test.idempotent_id('424868d5-18a7-43e1-8903-a64f95ee3aac') + @decorators.idempotent_id('424868d5-18a7-43e1-8903-a64f95ee3aac') def test_update_user_by_unauthorized_user(self): # Non-administrator should not be authorized to update user self.assertRaises(lib_exc.Forbidden, @@ -145,7 +146,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): self.alt_user) @test.attr(type=['negative']) - @test.idempotent_id('d45195d5-33ed-41b9-a452-7d0d6a00f6e9') + @decorators.idempotent_id('d45195d5-33ed-41b9-a452-7d0d6a00f6e9') def test_delete_users_by_unauthorized_user(self): # Non-administrator user should not be authorized to delete a user user = self.setup_test_user() @@ -154,14 +155,14 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): user['id']) @test.attr(type=['negative']) - @test.idempotent_id('7cc82f7e-9998-4f89-abae-23df36495867') + @decorators.idempotent_id('7cc82f7e-9998-4f89-abae-23df36495867') def test_delete_non_existent_user(self): # Attempt to delete a non-existent user should fail self.assertRaises(lib_exc.NotFound, self.users_client.delete_user, 'junk12345123') @test.attr(type=['negative']) - @test.idempotent_id('57fe1df8-0aa7-46c0-ae9f-c2e785c7504a') + @decorators.idempotent_id('57fe1df8-0aa7-46c0-ae9f-c2e785c7504a') def test_delete_user_request_without_a_token(self): # Request to delete a user without a valid token should fail @@ -177,7 +178,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): self.alt_user) @test.attr(type=['negative']) - @test.idempotent_id('593a4981-f6d4-460a-99a1-57a78bf20829') + @decorators.idempotent_id('593a4981-f6d4-460a-99a1-57a78bf20829') def test_authentication_for_disabled_user(self): # Disabled user's token should not get authenticated password = data_utils.rand_password() @@ -190,7 +191,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['name']) @test.attr(type=['negative']) - @test.idempotent_id('440a7a8d-9328-4b7b-83e0-d717010495e4') + @decorators.idempotent_id('440a7a8d-9328-4b7b-83e0-d717010495e4') def test_authentication_when_tenant_is_disabled(self): # User's token for a disabled tenant should not be authenticated password = data_utils.rand_password() @@ -203,7 +204,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): tenant['name']) @test.attr(type=['negative']) - @test.idempotent_id('921f1ad6-7907-40b8-853f-637e7ee52178') + @decorators.idempotent_id('921f1ad6-7907-40b8-853f-637e7ee52178') def test_authentication_with_invalid_tenant(self): # User's token for an invalid tenant should not be authenticated password = data_utils.rand_password() @@ -214,7 +215,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): 'junktenant1234') @test.attr(type=['negative']) - @test.idempotent_id('bde9aecd-3b1c-4079-858f-beb5deaa5b5e') + @decorators.idempotent_id('bde9aecd-3b1c-4079-858f-beb5deaa5b5e') def test_authentication_with_invalid_username(self): # Non-existent user's token should not get authenticated password = data_utils.rand_password() @@ -224,7 +225,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): 'junkuser123', password, tenant['name']) @test.attr(type=['negative']) - @test.idempotent_id('d5308b33-3574-43c3-8d87-1c090c5e1eca') + @decorators.idempotent_id('d5308b33-3574-43c3-8d87-1c090c5e1eca') def test_authentication_with_invalid_password(self): # User's token with invalid password should not be authenticated user = self.setup_test_user() @@ -233,14 +234,14 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): user['name'], 'junkpass1234', tenant['name']) @test.attr(type=['negative']) - @test.idempotent_id('284192ce-fb7c-4909-a63b-9a502e0ddd11') + @decorators.idempotent_id('284192ce-fb7c-4909-a63b-9a502e0ddd11') def test_get_users_by_unauthorized_user(self): # Non-administrator user should not be authorized to get user list self.assertRaises(lib_exc.Forbidden, self.non_admin_users_client.list_users) @test.attr(type=['negative']) - @test.idempotent_id('a73591ec-1903-4ffe-be42-282b39fefc9d') + @decorators.idempotent_id('a73591ec-1903-4ffe-be42-282b39fefc9d') def test_get_users_request_without_token(self): # Request to get list of users without a valid token should fail token = self.client.auth_provider.get_token() @@ -252,7 +253,7 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): self.assertRaises(lib_exc.Unauthorized, self.users_client.list_users) @test.attr(type=['negative']) - @test.idempotent_id('f5d39046-fc5f-425c-b29e-bac2632da28e') + @decorators.idempotent_id('f5d39046-fc5f-425c-b29e-bac2632da28e') def test_list_users_with_invalid_tenant(self): # Should not be able to return a list of all # users for a non-existent tenant diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py index d4fe32d52..e5a218d10 100644 --- a/tempest/api/identity/admin/v3/test_credentials.py +++ b/tempest/api/identity/admin/v3/test_credentials.py @@ -16,6 +16,7 @@ from oslo_serialization import jsonutils as json from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -52,7 +53,7 @@ class CredentialsTestJSON(base.BaseIdentityV3AdminTest): self.creds_client.delete_credential(cred_id) @test.attr(type='smoke') - @test.idempotent_id('7cd59bf9-bda4-4c72-9467-d21cab278355') + @decorators.idempotent_id('7cd59bf9-bda4-4c72-9467-d21cab278355') def test_credentials_create_get_update_delete(self): blob = '{"access": "%s", "secret": "%s"}' % ( data_utils.rand_name('Access'), data_utils.rand_name('Secret')) @@ -87,7 +88,7 @@ class CredentialsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(update_body['blob'][value2], get_body['blob'][value2]) - @test.idempotent_id('13202c00-0021-42a1-88d4-81b44d448aab') + @decorators.idempotent_id('13202c00-0021-42a1-88d4-81b44d448aab') def test_credentials_list_delete(self): created_cred_ids = list() fetched_cred_ids = list() diff --git a/tempest/api/identity/admin/v3/test_default_project_id.py b/tempest/api/identity/admin/v3/test_default_project_id.py index 361ff31eb..110695dfb 100644 --- a/tempest/api/identity/admin/v3/test_default_project_id.py +++ b/tempest/api/identity/admin/v3/test_default_project_id.py @@ -14,7 +14,7 @@ from tempest import clients from tempest.common.utils import data_utils from tempest import config from tempest.lib import auth -from tempest import test +from tempest.lib import decorators CONF = config.CONF @@ -32,7 +32,7 @@ class TestDefaultProjectId (base.BaseIdentityV3AdminTest): self.domains_client.update_domain(domain_id, enabled=False) self.domains_client.delete_domain(domain_id) - @test.idempotent_id('d6110661-6a71-49a7-a453-b5e26640ff6d') + @decorators.idempotent_id('d6110661-6a71-49a7-a453-b5e26640ff6d') def test_default_project_id(self): # create a domain dom_name = data_utils.rand_name('dom') diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py index e71341f9e..4cf9f66ed 100644 --- a/tempest/api/identity/admin/v3/test_domains.py +++ b/tempest/api/identity/admin/v3/test_domains.py @@ -17,6 +17,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import config from tempest.lib.common.utils import test_utils +from tempest.lib import decorators from tempest import test CONF = config.CONF @@ -50,7 +51,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): cls.domains_client.update_domain(domain_id, enabled=False) cls.domains_client.delete_domain(domain_id) - @test.idempotent_id('8cf516ef-2114-48f1-907b-d32726c734d4') + @decorators.idempotent_id('8cf516ef-2114-48f1-907b-d32726c734d4') def test_list_domains(self): # Test to list domains fetched_ids = list() @@ -62,7 +63,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): if d['id'] not in fetched_ids] self.assertEqual(0, len(missing_doms)) - @test.idempotent_id('c6aee07b-4981-440c-bb0b-eb598f58ffe9') + @decorators.idempotent_id('c6aee07b-4981-440c-bb0b-eb598f58ffe9') def test_list_domains_filter_by_name(self): # List domains filtering by name params = {'name': self.setup_domains[0]['name']} @@ -74,7 +75,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(self.setup_domains[0]['name'], fetched_domains[0]['name']) - @test.idempotent_id('3fd19840-65c1-43f8-b48c-51bdd066dff9') + @decorators.idempotent_id('3fd19840-65c1-43f8-b48c-51bdd066dff9') def test_list_domains_filter_by_enabled(self): # List domains filtering by enabled domains params = {'enabled': True} @@ -87,7 +88,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(True, domain['enabled']) @test.attr(type='smoke') - @test.idempotent_id('f2f5b44a-82e8-4dad-8084-0661ea3b18cf') + @decorators.idempotent_id('f2f5b44a-82e8-4dad-8084-0661ea3b18cf') def test_create_update_delete_domain(self): # Create domain d_name = data_utils.rand_name('domain') @@ -132,7 +133,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): domains_list = [d['id'] for d in body] self.assertNotIn(domain['id'], domains_list) - @test.idempotent_id('036df86e-bb5d-42c0-a7c2-66b9db3a6046') + @decorators.idempotent_id('036df86e-bb5d-42c0-a7c2-66b9db3a6046') def test_create_domain_with_disabled_status(self): # Create domain with enabled status as false d_name = data_utils.rand_name('domain') @@ -144,7 +145,7 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest): self.assertFalse(domain['enabled']) self.assertEqual(d_desc, domain['description']) - @test.idempotent_id('2abf8764-309a-4fa9-bc58-201b799817ad') + @decorators.idempotent_id('2abf8764-309a-4fa9-bc58-201b799817ad') def test_create_domain_without_description(self): # Create domain only with name d_name = data_utils.rand_name('domain') @@ -168,7 +169,7 @@ class DefaultDomainTestJSON(base.BaseIdentityV3AdminTest): super(DefaultDomainTestJSON, cls).resource_setup() @test.attr(type='smoke') - @test.idempotent_id('17a5de24-e6a0-4e4a-a9ee-d85b6e5612b5') + @decorators.idempotent_id('17a5de24-e6a0-4e4a-a9ee-d85b6e5612b5') def test_default_domain_exists(self): domain = self.domains_client.show_domain(self.domain_id)['domain'] diff --git a/tempest/api/identity/admin/v3/test_domains_negative.py b/tempest/api/identity/admin/v3/test_domains_negative.py index 100a121d1..280a5a86d 100644 --- a/tempest/api/identity/admin/v3/test_domains_negative.py +++ b/tempest/api/identity/admin/v3/test_domains_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.lib.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -23,7 +24,7 @@ class DomainsNegativeTestJSON(base.BaseIdentityV3AdminTest): _interface = 'json' @test.attr(type=['negative', 'gate']) - @test.idempotent_id('1f3fbff5-4e44-400d-9ca1-d953f05f609b') + @decorators.idempotent_id('1f3fbff5-4e44-400d-9ca1-d953f05f609b') def test_delete_active_domain(self): d_name = data_utils.rand_name('domain') d_desc = data_utils.rand_name('domain-desc') @@ -39,14 +40,14 @@ class DomainsNegativeTestJSON(base.BaseIdentityV3AdminTest): domain_id) @test.attr(type=['negative']) - @test.idempotent_id('9018461d-7d24-408d-b3fe-ae37e8cd5c9e') + @decorators.idempotent_id('9018461d-7d24-408d-b3fe-ae37e8cd5c9e') def test_create_domain_with_empty_name(self): # Domain name should not be empty self.assertRaises(lib_exc.BadRequest, self.domains_client.create_domain, name='') @test.attr(type=['negative']) - @test.idempotent_id('37b1bbf2-d664-4785-9a11-333438586eae') + @decorators.idempotent_id('37b1bbf2-d664-4785-9a11-333438586eae') def test_create_domain_with_name_length_over_64(self): # Domain name length should not ne greater than 64 characters d_name = 'a' * 65 @@ -55,14 +56,14 @@ class DomainsNegativeTestJSON(base.BaseIdentityV3AdminTest): name=d_name) @test.attr(type=['negative']) - @test.idempotent_id('43781c07-764f-4cf2-a405-953c1916f605') + @decorators.idempotent_id('43781c07-764f-4cf2-a405-953c1916f605') def test_delete_non_existent_domain(self): # Attempt to delete a non existent domain should fail self.assertRaises(lib_exc.NotFound, self.domains_client.delete_domain, data_utils.rand_uuid_hex()) @test.attr(type=['negative']) - @test.idempotent_id('e6f9e4a2-4f36-4be8-bdbc-4e199ae29427') + @decorators.idempotent_id('e6f9e4a2-4f36-4be8-bdbc-4e199ae29427') def test_domain_create_duplicate(self): domain_name = data_utils.rand_name('domain-dup') domain = self.domains_client.create_domain(name=domain_name)['domain'] diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py index ef450a283..686743bd8 100644 --- a/tempest/api/identity/admin/v3/test_endpoints.py +++ b/tempest/api/identity/admin/v3/test_endpoints.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -58,7 +59,7 @@ class EndPointsTestJSON(base.BaseIdentityV3AdminTest): cls.services_client.delete_service(s) super(EndPointsTestJSON, cls).resource_cleanup() - @test.idempotent_id('c19ecf90-240e-4e23-9966-21cee3f6a618') + @decorators.idempotent_id('c19ecf90-240e-4e23-9966-21cee3f6a618') def test_list_endpoints(self): # Get a list of endpoints fetched_endpoints = self.client.list_endpoints()['endpoints'] @@ -69,7 +70,7 @@ class EndPointsTestJSON(base.BaseIdentityV3AdminTest): "Failed to find endpoint %s in fetched list" % ', '.join(str(e) for e in missing_endpoints)) - @test.idempotent_id('0e2446d2-c1fd-461b-a729-b9e73e3e3b37') + @decorators.idempotent_id('0e2446d2-c1fd-461b-a729-b9e73e3e3b37') def test_create_list_show_delete_endpoint(self): region = data_utils.rand_name('region') url = data_utils.rand_url() @@ -110,7 +111,7 @@ class EndPointsTestJSON(base.BaseIdentityV3AdminTest): self.assertNotIn(endpoint['id'], fetched_endpoints_id) @test.attr(type='smoke') - @test.idempotent_id('37e8f15e-ee7c-4657-a1e7-f6b61e375eff') + @decorators.idempotent_id('37e8f15e-ee7c-4657-a1e7-f6b61e375eff') def test_update_endpoint(self): # Creating an endpoint so as to check update endpoint # with new values diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py index f0f870735..53c2b1fb3 100644 --- a/tempest/api/identity/admin/v3/test_endpoints_negative.py +++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py @@ -16,6 +16,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -48,7 +49,7 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest): super(EndpointsNegativeTestJSON, cls).resource_cleanup() @test.attr(type=['negative']) - @test.idempotent_id('ac6c137e-4d3d-448f-8c83-4f13d0942651') + @decorators.idempotent_id('ac6c137e-4d3d-448f-8c83-4f13d0942651') def test_create_with_enabled_False(self): # Enabled should be a boolean, not a string like 'False' interface = 'public' @@ -59,7 +60,7 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest): url=url, region=region, enabled='False') @test.attr(type=['negative']) - @test.idempotent_id('9c43181e-0627-484a-8c79-923e8a59598b') + @decorators.idempotent_id('9c43181e-0627-484a-8c79-923e8a59598b') def test_create_with_enabled_True(self): # Enabled should be a boolean, not a string like 'True' interface = 'public' @@ -86,13 +87,13 @@ class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest): endpoint_for_update['id'], enabled=enabled) @test.attr(type=['negative']) - @test.idempotent_id('65e41f32-5eb7-498f-a92a-a6ccacf7439a') + @decorators.idempotent_id('65e41f32-5eb7-498f-a92a-a6ccacf7439a') def test_update_with_enabled_False(self): # Enabled should be a boolean, not a string like 'False' self._assert_update_raises_bad_request('False') @test.attr(type=['negative']) - @test.idempotent_id('faba3587-f066-4757-a48e-b4a3f01803bb') + @decorators.idempotent_id('faba3587-f066-4757-a48e-b4a3f01803bb') def test_update_with_enabled_True(self): # Enabled should be a boolean, not a string like 'True' self._assert_update_raises_bad_request('True') diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py index 34b446867..5ce0709f6 100644 --- a/tempest/api/identity/admin/v3/test_groups.py +++ b/tempest/api/identity/admin/v3/test_groups.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -32,7 +33,7 @@ class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): cls.domains_client.delete_domain(cls.domain['id']) super(GroupsV3TestJSON, cls).resource_cleanup() - @test.idempotent_id('2e80343b-6c81-4ac3-88c7-452f3e9d5129') + @decorators.idempotent_id('2e80343b-6c81-4ac3-88c7-452f3e9d5129') def test_group_create_update_get(self): name = data_utils.rand_name('Group') description = data_utils.rand_name('Description') @@ -55,7 +56,7 @@ class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(new_name, new_group['name']) self.assertEqual(new_desc, new_group['description']) - @test.idempotent_id('b66eb441-b08a-4a6d-81ab-fef71baeb26c') + @decorators.idempotent_id('b66eb441-b08a-4a6d-81ab-fef71baeb26c') def test_group_update_with_few_fields(self): name = data_utils.rand_name('Group') old_description = data_utils.rand_name('Description') @@ -72,7 +73,7 @@ class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(old_description, updated_group['description']) @test.attr(type='smoke') - @test.idempotent_id('1598521a-2f36-4606-8df9-30772bd51339') + @decorators.idempotent_id('1598521a-2f36-4606-8df9-30772bd51339') def test_group_users_add_list_delete(self): name = data_utils.rand_name('Group') group = self.groups_client.create_group( @@ -101,7 +102,7 @@ class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): group_users = self.groups_client.list_group_users(group['id'])['users'] self.assertEqual(len(group_users), 0) - @test.idempotent_id('64573281-d26a-4a52-b899-503cb0f4e4ec') + @decorators.idempotent_id('64573281-d26a-4a52-b899-503cb0f4e4ec') def test_list_user_groups(self): # create a user user = self.users_client.create_user( @@ -123,7 +124,7 @@ class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): sorted(user_groups, key=lambda k: k['name'])) self.assertEqual(2, len(user_groups)) - @test.idempotent_id('cc9a57a5-a9ed-4f2d-a29f-4f979a06ec71') + @decorators.idempotent_id('cc9a57a5-a9ed-4f2d-a29f-4f979a06ec71') def test_list_groups(self): # Test to list groups group_ids = list() diff --git a/tempest/api/identity/admin/v3/test_inherits.py b/tempest/api/identity/admin/v3/test_inherits.py index 33fce8df8..85233964d 100644 --- a/tempest/api/identity/admin/v3/test_inherits.py +++ b/tempest/api/identity/admin/v3/test_inherits.py @@ -12,6 +12,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -61,7 +62,7 @@ class BaseInheritsV3Test(base.BaseIdentityV3AdminTest): class InheritsV3TestJSON(BaseInheritsV3Test): - @test.idempotent_id('4e6f0366-97c8-423c-b2be-41eae6ac91c8') + @decorators.idempotent_id('4e6f0366-97c8-423c-b2be-41eae6ac91c8') def test_inherit_assign_list_check_revoke_roles_on_domains_user(self): # Create role src_role = self.roles_client.create_role( @@ -87,7 +88,7 @@ class InheritsV3TestJSON(BaseInheritsV3Test): self.inherited_roles_client.delete_inherited_role_from_user_on_domain( self.domain['id'], self.user['id'], src_role['id']) - @test.idempotent_id('c7a8dda2-be50-4fb4-9a9c-e830771078b1') + @decorators.idempotent_id('c7a8dda2-be50-4fb4-9a9c-e830771078b1') def test_inherit_assign_list_check_revoke_roles_on_domains_group(self): # Create role src_role = self.roles_client.create_role( @@ -113,7 +114,7 @@ class InheritsV3TestJSON(BaseInheritsV3Test): self.inherited_roles_client.delete_inherited_role_from_group_on_domain( self.domain['id'], self.group['id'], src_role['id']) - @test.idempotent_id('18b70e45-7687-4b72-8277-b8f1a47d7591') + @decorators.idempotent_id('18b70e45-7687-4b72-8277-b8f1a47d7591') def test_inherit_assign_check_revoke_roles_on_projects_user(self): # Create role src_role = self.roles_client.create_role( @@ -130,7 +131,7 @@ class InheritsV3TestJSON(BaseInheritsV3Test): self.inherited_roles_client.delete_inherited_role_from_user_on_project( self.project['id'], self.user['id'], src_role['id']) - @test.idempotent_id('26021436-d5a4-4256-943c-ded01e0d4b45') + @decorators.idempotent_id('26021436-d5a4-4256-943c-ded01e0d4b45') def test_inherit_assign_check_revoke_roles_on_projects_group(self): # Create role src_role = self.roles_client.create_role( @@ -148,7 +149,7 @@ class InheritsV3TestJSON(BaseInheritsV3Test): delete_inherited_role_from_group_on_project( self.project['id'], self.group['id'], src_role['id'])) - @test.idempotent_id('3acf666e-5354-42ac-8e17-8b68893bcd36') + @decorators.idempotent_id('3acf666e-5354-42ac-8e17-8b68893bcd36') def test_inherit_assign_list_revoke_user_roles_on_domain(self): # Create role src_role = self.roles_client.create_role( @@ -198,7 +199,7 @@ class InheritsV3TestJSON(BaseInheritsV3Test): effective=True, **params)['role_assignments'] self.assertEmpty(assignments) - @test.idempotent_id('9f02ccd9-9b57-46b4-8f77-dd5a736f3a06') + @decorators.idempotent_id('9f02ccd9-9b57-46b4-8f77-dd5a736f3a06') def test_inherit_assign_list_revoke_user_roles_on_project_tree(self): # Create role src_role = self.roles_client.create_role( diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py index 7d9e41bc5..2d046bb2b 100644 --- a/tempest/api/identity/admin/v3/test_list_projects.py +++ b/tempest/api/identity/admin/v3/test_list_projects.py @@ -15,7 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils -from tempest import test +from tempest.lib import decorators class ListProjectsTestJSON(base.BaseIdentityV3AdminTest): @@ -56,7 +56,7 @@ class ListProjectsTestJSON(base.BaseIdentityV3AdminTest): cls.domains_client.delete_domain(cls.domain['id']) super(ListProjectsTestJSON, cls).resource_cleanup() - @test.idempotent_id('1d830662-22ad-427c-8c3e-4ec854b0af44') + @decorators.idempotent_id('1d830662-22ad-427c-8c3e-4ec854b0af44') def test_list_projects(self): # List projects list_projects = self.projects_client.list_projects()['projects'] @@ -65,23 +65,23 @@ class ListProjectsTestJSON(base.BaseIdentityV3AdminTest): show_project = self.projects_client.show_project(p)['project'] self.assertIn(show_project, list_projects) - @test.idempotent_id('fab13f3c-f6a6-4b9f-829b-d32fd44fdf10') + @decorators.idempotent_id('fab13f3c-f6a6-4b9f-829b-d32fd44fdf10') def test_list_projects_with_domains(self): # List projects with domain self._list_projects_with_params( {'domain_id': self.domain['id']}, 'domain_id') - @test.idempotent_id('0fe7a334-675a-4509-b00e-1c4b95d5dae8') + @decorators.idempotent_id('0fe7a334-675a-4509-b00e-1c4b95d5dae8') def test_list_projects_with_enabled(self): # List the projects with enabled self._list_projects_with_params({'enabled': False}, 'enabled') - @test.idempotent_id('fa178524-4e6d-4925-907c-7ab9f42c7e26') + @decorators.idempotent_id('fa178524-4e6d-4925-907c-7ab9f42c7e26') def test_list_projects_with_name(self): # List projects with name self._list_projects_with_params({'name': self.p1_name}, 'name') - @test.idempotent_id('6edc66f5-2941-4a17-9526-4073311c1fac') + @decorators.idempotent_id('6edc66f5-2941-4a17-9526-4073311c1fac') def test_list_projects_with_parent(self): # List projects with parent params = {'parent_id': self.p3['parent_id']} diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py index 99df5591c..0a0d65a32 100644 --- a/tempest/api/identity/admin/v3/test_list_users.py +++ b/tempest/api/identity/admin/v3/test_list_users.py @@ -15,7 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils -from tempest import test +from tempest.lib import decorators class UsersV3TestJSON(base.BaseIdentityV3AdminTest): @@ -62,7 +62,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): cls.domains_client.delete_domain(cls.domain['id']) super(UsersV3TestJSON, cls).resource_cleanup() - @test.idempotent_id('08f9aabb-dcfe-41d0-8172-82b5fa0bd73d') + @decorators.idempotent_id('08f9aabb-dcfe-41d0-8172-82b5fa0bd73d') def test_list_user_domains(self): # List users with domain params = {'domain_id': self.domain['id']} @@ -70,7 +70,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): self.domain_enabled_user, self.non_domain_enabled_user) - @test.idempotent_id('bff8bf2f-9408-4ef5-b63a-753c8c2124eb') + @decorators.idempotent_id('bff8bf2f-9408-4ef5-b63a-753c8c2124eb') def test_list_users_with_not_enabled(self): # List the users with not enabled params = {'enabled': False} @@ -78,7 +78,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): self.non_domain_enabled_user, self.domain_enabled_user) - @test.idempotent_id('c285bb37-7325-4c02-bff3-3da5d946d683') + @decorators.idempotent_id('c285bb37-7325-4c02-bff3-3da5d946d683') def test_list_users_with_name(self): # List users with name params = {'name': self.domain_enabled_user['name']} @@ -86,7 +86,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): self.domain_enabled_user, self.non_domain_enabled_user) - @test.idempotent_id('b30d4651-a2ea-4666-8551-0c0e49692635') + @decorators.idempotent_id('b30d4651-a2ea-4666-8551-0c0e49692635') def test_list_users(self): # List users body = self.users_client.list_users()['users'] @@ -97,7 +97,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): "Failed to find user %s in fetched list" % ', '.join(m_user for m_user in missing_users)) - @test.idempotent_id('b4baa3ae-ac00-4b4e-9e27-80deaad7771f') + @decorators.idempotent_id('b4baa3ae-ac00-4b4e-9e27-80deaad7771f') def test_get_user(self): # Get a user detail user = self.users_client.show_user(self.users[0]['id'])['user'] diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py index 3b5e5d461..eb1c69eae 100644 --- a/tempest/api/identity/admin/v3/test_policies.py +++ b/tempest/api/identity/admin/v3/test_policies.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -23,7 +24,7 @@ class PoliciesTestJSON(base.BaseIdentityV3AdminTest): def _delete_policy(self, policy_id): self.policies_client.delete_policy(policy_id) - @test.idempotent_id('1a0ad286-2d06-4123-ab0d-728893a76201') + @decorators.idempotent_id('1a0ad286-2d06-4123-ab0d-728893a76201') def test_list_policies(self): # Test to list policies policy_ids = list() @@ -44,7 +45,7 @@ class PoliciesTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(0, len(missing_pols)) @test.attr(type='smoke') - @test.idempotent_id('e544703a-2f03-4cf2-9b0f-350782fdb0d3') + @decorators.idempotent_id('e544703a-2f03-4cf2-9b0f-350782fdb0d3') def test_create_update_delete_policy(self): # Test to update policy blob = data_utils.rand_name('BlobName') diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py index 113719195..fef602024 100644 --- a/tempest/api/identity/admin/v3/test_projects.py +++ b/tempest/api/identity/admin/v3/test_projects.py @@ -18,14 +18,14 @@ import testtools from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import config -from tempest import test +from tempest.lib import decorators CONF = config.CONF class ProjectsTestJSON(base.BaseIdentityV3AdminTest): - @test.idempotent_id('0ecf465c-0dc4-4532-ab53-91ffeb74d12d') + @decorators.idempotent_id('0ecf465c-0dc4-4532-ab53-91ffeb74d12d') def test_project_create_with_description(self): # Create project with a description project_name = data_utils.rand_name('project') @@ -42,7 +42,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(desc2, project_desc, 'Description does not appear' 'to be set') - @test.idempotent_id('5f50fe07-8166-430b-a882-3b2ee0abe26f') + @decorators.idempotent_id('5f50fe07-8166-430b-a882-3b2ee0abe26f') def test_project_create_with_domain(self): # Create project with a domain domain = self.setup_test_domain() @@ -59,7 +59,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): @testtools.skipUnless(CONF.identity_feature_enabled.reseller, 'Reseller not available.') - @test.idempotent_id('1854f9c0-70bc-4d11-a08a-1c789d339e3d') + @decorators.idempotent_id('1854f9c0-70bc-4d11-a08a-1c789d339e3d') def test_project_create_with_parent(self): # Create root project without providing a parent_id domain = self.setup_test_domain() @@ -88,7 +88,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(project_name, project['name']) self.assertEqual(root_project_id, parent_id) - @test.idempotent_id('1f66dc76-50cc-4741-a200-af984509e480') + @decorators.idempotent_id('1f66dc76-50cc-4741-a200-af984509e480') def test_project_create_enabled(self): # Create a project that is enabled project_name = data_utils.rand_name('project') @@ -102,7 +102,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): en2 = body['enabled'] self.assertTrue(en2, 'Enable should be True in lookup') - @test.idempotent_id('78f96a9c-e0e0-4ee6-a3ba-fbf6dfd03207') + @decorators.idempotent_id('78f96a9c-e0e0-4ee6-a3ba-fbf6dfd03207') def test_project_create_not_enabled(self): # Create a project that is not enabled project_name = data_utils.rand_name('project') @@ -117,7 +117,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual('false', str(en2).lower(), 'Enable should be False in lookup') - @test.idempotent_id('f608f368-048c-496b-ad63-d286c26dab6b') + @decorators.idempotent_id('f608f368-048c-496b-ad63-d286c26dab6b') def test_project_update_name(self): # Update name attribute of a project p_name1 = data_utils.rand_name('project') @@ -139,7 +139,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(p_name1, resp1_name) self.assertEqual(resp2_name, resp3_name) - @test.idempotent_id('f138b715-255e-4a7d-871d-351e1ef2e153') + @decorators.idempotent_id('f138b715-255e-4a7d-871d-351e1ef2e153') def test_project_update_desc(self): # Update description attribute of a project p_name = data_utils.rand_name('project') @@ -162,7 +162,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(p_desc, resp1_desc) self.assertEqual(resp2_desc, resp3_desc) - @test.idempotent_id('b6b25683-c97f-474d-a595-55d410b68100') + @decorators.idempotent_id('b6b25683-c97f-474d-a595-55d410b68100') def test_project_update_enable(self): # Update the enabled attribute of a project p_name = data_utils.rand_name('project') @@ -186,7 +186,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual('false', str(resp1_en).lower()) self.assertEqual(resp2_en, resp3_en) - @test.idempotent_id('59398d4a-5dc5-4f86-9a4c-c26cc804d6c6') + @decorators.idempotent_id('59398d4a-5dc5-4f86-9a4c-c26cc804d6c6') def test_associate_user_to_project(self): # Associate a user to a project # Create a Project diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py index c76b9eeed..87f8684f4 100644 --- a/tempest/api/identity/admin/v3/test_projects_negative.py +++ b/tempest/api/identity/admin/v3/test_projects_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -22,14 +23,14 @@ from tempest import test class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest): @test.attr(type=['negative']) - @test.idempotent_id('24c49279-45dd-4155-887a-cb738c2385aa') + @decorators.idempotent_id('24c49279-45dd-4155-887a-cb738c2385aa') def test_list_projects_by_unauthorized_user(self): # Non-admin user should not be able to list projects self.assertRaises(lib_exc.Forbidden, self.non_admin_projects_client.list_projects) @test.attr(type=['negative']) - @test.idempotent_id('874c3e84-d174-4348-a16b-8c01f599561b') + @decorators.idempotent_id('874c3e84-d174-4348-a16b-8c01f599561b') def test_project_create_duplicate(self): # Project names should be unique project_name = data_utils.rand_name('project-dup') @@ -40,7 +41,7 @@ class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest): self.projects_client.create_project, project_name) @test.attr(type=['negative']) - @test.idempotent_id('8fba9de2-3e1f-4e77-812a-60cb68f8df13') + @decorators.idempotent_id('8fba9de2-3e1f-4e77-812a-60cb68f8df13') def test_create_project_by_unauthorized_user(self): # Non-admin user should not be authorized to create a project project_name = data_utils.rand_name('project') @@ -49,14 +50,14 @@ class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest): project_name) @test.attr(type=['negative']) - @test.idempotent_id('7828db17-95e5-475b-9432-9a51b4aa79a9') + @decorators.idempotent_id('7828db17-95e5-475b-9432-9a51b4aa79a9') def test_create_project_with_empty_name(self): # Project name should not be empty self.assertRaises(lib_exc.BadRequest, self.projects_client.create_project, name='') @test.attr(type=['negative']) - @test.idempotent_id('502b6ceb-b0c8-4422-bf53-f08fdb21e2f0') + @decorators.idempotent_id('502b6ceb-b0c8-4422-bf53-f08fdb21e2f0') def test_create_projects_name_length_over_64(self): # Project name length should not be greater than 64 characters project_name = 'a' * 65 @@ -64,7 +65,7 @@ class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest): self.projects_client.create_project, project_name) @test.attr(type=['negative']) - @test.idempotent_id('8d68c012-89e0-4394-8d6b-ccd7196def97') + @decorators.idempotent_id('8d68c012-89e0-4394-8d6b-ccd7196def97') def test_project_delete_by_unauthorized_user(self): # Non-admin user should not be able to delete a project project_name = data_utils.rand_name('project') @@ -75,7 +76,7 @@ class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest): project['id']) @test.attr(type=['negative']) - @test.idempotent_id('7965b581-60c1-43b7-8169-95d4ab7fc6fb') + @decorators.idempotent_id('7965b581-60c1-43b7-8169-95d4ab7fc6fb') def test_delete_non_existent_project(self): # Attempt to delete a non existent project should fail self.assertRaises(lib_exc.NotFound, diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py index b5ea90d5f..f57a07c51 100644 --- a/tempest/api/identity/admin/v3/test_regions.py +++ b/tempest/api/identity/admin/v3/test_regions.py @@ -16,6 +16,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.lib.common.utils import test_utils +from tempest.lib import decorators from tempest import test @@ -42,7 +43,7 @@ class RegionsTestJSON(base.BaseIdentityV3AdminTest): cls.client.delete_region(r['id']) super(RegionsTestJSON, cls).resource_cleanup() - @test.idempotent_id('56186092-82e4-43f2-b954-91013218ba42') + @decorators.idempotent_id('56186092-82e4-43f2-b954-91013218ba42') def test_create_update_get_delete_region(self): # Create region r_description = data_utils.rand_name('description') @@ -79,7 +80,7 @@ class RegionsTestJSON(base.BaseIdentityV3AdminTest): self.assertNotIn(region['id'], regions_list) @test.attr(type='smoke') - @test.idempotent_id('2c12c5b5-efcf-4aa5-90c5-bff1ab0cdbe2') + @decorators.idempotent_id('2c12c5b5-efcf-4aa5-90c5-bff1ab0cdbe2') def test_create_region_with_specific_id(self): # Create a region with a specific id r_region_id = data_utils.rand_uuid() @@ -91,7 +92,7 @@ class RegionsTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(r_region_id, region['id']) self.assertEqual(r_description, region['description']) - @test.idempotent_id('d180bf99-544a-445c-ad0d-0c0d27663796') + @decorators.idempotent_id('d180bf99-544a-445c-ad0d-0c0d27663796') def test_list_regions(self): # Get a list of regions fetched_regions = self.client.list_regions()['regions'] @@ -102,7 +103,7 @@ class RegionsTestJSON(base.BaseIdentityV3AdminTest): "Failed to find region %s in fetched list" % ', '.join(str(e) for e in missing_regions)) - @test.idempotent_id('2d1057cb-bbde-413a-acdf-e2d265284542') + @decorators.idempotent_id('2d1057cb-bbde-413a-acdf-e2d265284542') def test_list_regions_filter_by_parent_region_id(self): # Add a sub-region to one of the existing test regions r_description = data_utils.rand_name('description') diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py index 670cb2fa5..e89be4b4f 100644 --- a/tempest/api/identity/admin/v3/test_roles.py +++ b/tempest/api/identity/admin/v3/test_roles.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest import test @@ -69,7 +70,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): self.assertIn(role_id, fetched_role_ids) @test.attr(type='smoke') - @test.idempotent_id('18afc6c0-46cf-4911-824e-9989cc056c3a') + @decorators.idempotent_id('18afc6c0-46cf-4911-824e-9989cc056c3a') def test_role_create_update_show_list(self): r_name = data_utils.rand_name('Role') role = self.roles_client.create_role(name=r_name)['role'] @@ -92,7 +93,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): roles = self.roles_client.list_roles()['roles'] self.assertIn(role['id'], [r['id'] for r in roles]) - @test.idempotent_id('c6b80012-fe4a-498b-9ce8-eb391c05169f') + @decorators.idempotent_id('c6b80012-fe4a-498b-9ce8-eb391c05169f') def test_grant_list_revoke_role_to_user_on_project(self): self.roles_client.create_user_role_on_project(self.project['id'], self.user_body['id'], @@ -113,7 +114,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): self.roles_client.delete_role_from_user_on_project( self.project['id'], self.user_body['id'], self.role['id']) - @test.idempotent_id('6c9a2940-3625-43a3-ac02-5dcec62ef3bd') + @decorators.idempotent_id('6c9a2940-3625-43a3-ac02-5dcec62ef3bd') def test_grant_list_revoke_role_to_user_on_domain(self): self.roles_client.create_user_role_on_domain( self.domain['id'], self.user_body['id'], self.role['id']) @@ -133,7 +134,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): self.roles_client.delete_role_from_user_on_domain( self.domain['id'], self.user_body['id'], self.role['id']) - @test.idempotent_id('cbf11737-1904-4690-9613-97bcbb3df1c4') + @decorators.idempotent_id('cbf11737-1904-4690-9613-97bcbb3df1c4') def test_grant_list_revoke_role_to_group_on_project(self): # Grant role to group on project self.roles_client.create_group_role_on_project( @@ -168,7 +169,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): self.roles_client.delete_role_from_group_on_project( self.project['id'], self.group_body['id'], self.role['id']) - @test.idempotent_id('4bf8a70b-e785-413a-ad53-9f91ce02faa7') + @decorators.idempotent_id('4bf8a70b-e785-413a-ad53-9f91ce02faa7') def test_grant_list_revoke_role_to_group_on_domain(self): self.roles_client.create_group_role_on_domain( self.domain['id'], self.group_body['id'], self.role['id']) @@ -188,7 +189,7 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): self.roles_client.delete_role_from_group_on_domain( self.domain['id'], self.group_body['id'], self.role['id']) - @test.idempotent_id('f5654bcc-08c4-4f71-88fe-05d64e06de94') + @decorators.idempotent_id('f5654bcc-08c4-4f71-88fe-05d64e06de94') def test_list_roles(self): # Return a list of all roles body = self.roles_client.list_roles()['roles'] diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py index 2c3cae512..35e181493 100644 --- a/tempest/api/identity/admin/v3/test_services.py +++ b/tempest/api/identity/admin/v3/test_services.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -29,7 +30,7 @@ class ServicesTestJSON(base.BaseIdentityV3AdminTest): service_id) @test.attr(type='smoke') - @test.idempotent_id('5193aad5-bcb7-411d-85b0-b3b61b96ef06') + @decorators.idempotent_id('5193aad5-bcb7-411d-85b0-b3b61b96ef06') def test_create_update_get_service(self): # Creating a Service name = data_utils.rand_name('service') @@ -61,7 +62,7 @@ class ServicesTestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(resp2_desc, resp3_desc) self.assertDictContainsSubset(update_service, fetched_service) - @test.idempotent_id('d1dcb1a1-2b6b-4da8-bbb8-5532ef6e8269') + @decorators.idempotent_id('d1dcb1a1-2b6b-4da8-bbb8-5532ef6e8269') def test_create_service_without_description(self): # Create a service only with name and type name = data_utils.rand_name('service') @@ -73,7 +74,7 @@ class ServicesTestJSON(base.BaseIdentityV3AdminTest): expected_data = {'name': name, 'type': serv_type} self.assertDictContainsSubset(expected_data, service) - @test.idempotent_id('e55908e8-360e-439e-8719-c3230a3e179e') + @decorators.idempotent_id('e55908e8-360e-439e-8719-c3230a3e179e') def test_list_services(self): # Create, List, Verify and Delete Services service_ids = list() diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py index 8706cf7ad..a9508d1fa 100644 --- a/tempest/api/identity/admin/v3/test_tokens.py +++ b/tempest/api/identity/admin/v3/test_tokens.py @@ -17,13 +17,13 @@ import six from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc -from tempest import test class TokensV3TestJSON(base.BaseIdentityV3AdminTest): - @test.idempotent_id('0f9f5a5f-d5cd-4a86-8a5b-c5ded151f212') + @decorators.idempotent_id('0f9f5a5f-d5cd-4a86-8a5b-c5ded151f212') def test_tokens(self): # Valid user's token is authenticated # Create a User @@ -49,7 +49,7 @@ class TokensV3TestJSON(base.BaseIdentityV3AdminTest): self.assertRaises(lib_exc.NotFound, self.client.show_token, subject_token) - @test.idempotent_id('565fa210-1da1-4563-999b-f7b5b67cf112') + @decorators.idempotent_id('565fa210-1da1-4563-999b-f7b5b67cf112') def test_rescope_token(self): """Rescope a token. diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py index 4e69de8c6..1a466a003 100644 --- a/tempest/api/identity/admin/v3/test_trusts.py +++ b/tempest/api/identity/admin/v3/test_trusts.py @@ -20,6 +20,7 @@ from tempest import clients from tempest.common import credentials_factory as common_creds from tempest.common.utils import data_utils from tempest import config +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -197,7 +198,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.create_trustor_and_roles() self.addCleanup(self.cleanup_user_and_roles) - @test.idempotent_id('5a0a91a4-baef-4a14-baba-59bf4d7fcace') + @decorators.idempotent_id('5a0a91a4-baef-4a14-baba-59bf4d7fcace') def test_trust_impersonate(self): # Test case to check we can create, get and delete a trust # updates are not supported for trusts @@ -209,7 +210,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.check_trust_roles() - @test.idempotent_id('ed2a8779-a7ac-49dc-afd7-30f32f936ed2') + @decorators.idempotent_id('ed2a8779-a7ac-49dc-afd7-30f32f936ed2') def test_trust_noimpersonate(self): # Test case to check we can create, get and delete a trust # with impersonation=False @@ -221,7 +222,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.check_trust_roles() - @test.idempotent_id('0ed14b66-cefd-4b5c-a964-65759453e292') + @decorators.idempotent_id('0ed14b66-cefd-4b5c-a964-65759453e292') def test_trust_expire(self): # Test case to check we can create, get and delete a trust # with an expiry specified @@ -246,7 +247,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.check_trust_roles() - @test.idempotent_id('3e48f95d-e660-4fa9-85e0-5a3d85594384') + @decorators.idempotent_id('3e48f95d-e660-4fa9-85e0-5a3d85594384') def test_trust_expire_invalid(self): # Test case to check we can check an invalid expiry time # is rejected with the correct error @@ -256,7 +257,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.create_trust, expires=expires_str) - @test.idempotent_id('6268b345-87ca-47c0-9ce3-37792b43403a') + @decorators.idempotent_id('6268b345-87ca-47c0-9ce3-37792b43403a') def test_get_trusts_query(self): self.create_trust() trusts_get = self.trustor_client.list_trusts( @@ -265,7 +266,7 @@ class TrustsV3TestJSON(BaseTrustsV3Test): self.validate_trust(trusts_get[0], summary=True) @test.attr(type='smoke') - @test.idempotent_id('4773ebd5-ecbf-4255-b8d8-b63e6f72b65d') + @decorators.idempotent_id('4773ebd5-ecbf-4255-b8d8-b63e6f72b65d') def test_get_trusts_all(self): # Simple function that can be used for cleanup diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py index 54c62c7c8..e0ec88392 100644 --- a/tempest/api/identity/admin/v3/test_users.py +++ b/tempest/api/identity/admin/v3/test_users.py @@ -20,7 +20,7 @@ import testtools from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import config -from tempest import test +from tempest.lib import decorators CONF = config.CONF @@ -28,7 +28,7 @@ CONF = config.CONF class UsersV3TestJSON(base.BaseIdentityV3AdminTest): - @test.idempotent_id('b537d090-afb9-4519-b95d-270b0708e87e') + @decorators.idempotent_id('b537d090-afb9-4519-b95d-270b0708e87e') def test_user_update(self): # Test case to check if updating of user attributes is successful. # Creating first user @@ -71,7 +71,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(u_email2, new_user_get['email']) self.assertEqual(False, new_user_get['enabled']) - @test.idempotent_id('2d223a0e-e457-4a70-9fb1-febe027a0ff9') + @decorators.idempotent_id('2d223a0e-e457-4a70-9fb1-febe027a0ff9') def test_update_user_password(self): # Creating User to check password updation u_name = data_utils.rand_name('user') @@ -97,7 +97,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): self.assertEqual(token_details['user']['id'], user['id']) self.assertEqual(token_details['user']['name'], u_name) - @test.idempotent_id('a831e70c-e35b-430b-92ed-81ebbc5437b8') + @decorators.idempotent_id('a831e70c-e35b-430b-92ed-81ebbc5437b8') def test_list_user_projects(self): # List the projects that a user has access upon assigned_project_ids = list() @@ -152,7 +152,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): ', '.join(m_project for m_project in missing_projects)) - @test.idempotent_id('c10dcd90-461d-4b16-8e23-4eb836c00644') + @decorators.idempotent_id('c10dcd90-461d-4b16-8e23-4eb836c00644') def test_get_user(self): # Get a user detail user = self.setup_test_user() @@ -161,7 +161,7 @@ class UsersV3TestJSON(base.BaseIdentityV3AdminTest): @testtools.skipUnless(CONF.identity_feature_enabled.security_compliance, 'Security compliance not available.') - @test.idempotent_id('568cd46c-ee6c-4ab4-a33a-d3791931979e') + @decorators.idempotent_id('568cd46c-ee6c-4ab4-a33a-d3791931979e') def test_password_history_not_enforced_in_admin_reset(self): old_password = self.os.credentials.password user_id = self.os.credentials.user_id diff --git a/tempest/api/identity/admin/v3/test_users_negative.py b/tempest/api/identity/admin/v3/test_users_negative.py index 5b0fc97e7..962610822 100644 --- a/tempest/api/identity/admin/v3/test_users_negative.py +++ b/tempest/api/identity/admin/v3/test_users_negative.py @@ -15,6 +15,7 @@ from tempest.api.identity import base from tempest.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -22,7 +23,7 @@ from tempest import test class UsersNegativeTest(base.BaseIdentityV3AdminTest): @test.attr(type=['negative']) - @test.idempotent_id('e75f006c-89cc-477b-874d-588e4eab4b17') + @decorators.idempotent_id('e75f006c-89cc-477b-874d-588e4eab4b17') def test_create_user_for_non_existent_domain(self): # Attempt to create a user in a non-existent domain should fail u_name = data_utils.rand_name('user') @@ -34,7 +35,7 @@ class UsersNegativeTest(base.BaseIdentityV3AdminTest): domain_id=data_utils.rand_uuid_hex()) @test.attr(type=['negative']) - @test.idempotent_id('b3c9fccc-4134-46f5-b600-1da6fb0a3b1f') + @decorators.idempotent_id('b3c9fccc-4134-46f5-b600-1da6fb0a3b1f') def test_authentication_for_disabled_user(self): # Attempt to authenticate for disabled user should fail password = data_utils.rand_password() diff --git a/tempest/api/identity/test_extension.py b/tempest/api/identity/test_extension.py index 01e566124..7095181e8 100644 --- a/tempest/api/identity/test_extension.py +++ b/tempest/api/identity/test_extension.py @@ -14,12 +14,12 @@ # under the License. from tempest.api.identity import base -from tempest import test +from tempest.lib import decorators class ExtensionTestJSON(base.BaseIdentityV2AdminTest): - @test.idempotent_id('85f3f661-f54c-4d48-b563-72ae952b9383') + @decorators.idempotent_id('85f3f661-f54c-4d48-b563-72ae952b9383') def test_list_extensions(self): # List all the extensions body = self.non_admin_client.list_extensions()['extensions']['values'] diff --git a/tempest/api/identity/v2/test_api_discovery.py b/tempest/api/identity/v2/test_api_discovery.py index ca807a420..02caef536 100644 --- a/tempest/api/identity/v2/test_api_discovery.py +++ b/tempest/api/identity/v2/test_api_discovery.py @@ -14,6 +14,7 @@ # under the License. from tempest.api.identity import base +from tempest.lib import decorators from tempest import test @@ -21,7 +22,7 @@ class TestApiDiscovery(base.BaseIdentityV2Test): """Tests for API discovery features.""" @test.attr(type='smoke') - @test.idempotent_id('ea889a68-a15f-4166-bfb1-c12456eae853') + @decorators.idempotent_id('ea889a68-a15f-4166-bfb1-c12456eae853') def test_api_version_resources(self): descr = self.non_admin_client.show_api_description()['version'] expected_resources = ('id', 'links', 'media-types', 'status', @@ -32,7 +33,7 @@ class TestApiDiscovery(base.BaseIdentityV2Test): self.assertIn(res, keys) @test.attr(type='smoke') - @test.idempotent_id('007a0be0-78fe-4fdb-bbee-e9216cc17bb2') + @decorators.idempotent_id('007a0be0-78fe-4fdb-bbee-e9216cc17bb2') def test_api_media_types(self): descr = self.non_admin_client.show_api_description()['version'] # Get MIME type bases and descriptions @@ -47,7 +48,7 @@ class TestApiDiscovery(base.BaseIdentityV2Test): self.assertIn(s_type, media_types) @test.attr(type='smoke') - @test.idempotent_id('77fd6be0-8801-48e6-b9bf-38cdd2f253ec') + @decorators.idempotent_id('77fd6be0-8801-48e6-b9bf-38cdd2f253ec') def test_api_version_statuses(self): descr = self.non_admin_client.show_api_description()['version'] status = descr['status'].lower() diff --git a/tempest/api/identity/v2/test_ec2_credentials.py b/tempest/api/identity/v2/test_ec2_credentials.py index 8f493aa64..7a0f3d709 100644 --- a/tempest/api/identity/v2/test_ec2_credentials.py +++ b/tempest/api/identity/v2/test_ec2_credentials.py @@ -14,6 +14,7 @@ # under the License. from tempest.api.identity import base +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc from tempest import test @@ -32,7 +33,7 @@ class EC2CredentialsTest(base.BaseIdentityV2Test): super(EC2CredentialsTest, cls).resource_setup() cls.creds = cls.os.credentials - @test.idempotent_id('b580fab9-7ae9-46e8-8138-417260cb6f9f') + @decorators.idempotent_id('b580fab9-7ae9-46e8-8138-417260cb6f9f') def test_create_ec2_credential(self): """Create user ec2 credential.""" resp = self.non_admin_users_client.create_user_ec2_credential( @@ -47,7 +48,7 @@ class EC2CredentialsTest(base.BaseIdentityV2Test): self.assertEqual(self.creds.user_id, resp['user_id']) self.assertEqual(self.creds.tenant_id, resp['tenant_id']) - @test.idempotent_id('9e2ea42f-0a4f-468c-a768-51859ce492e0') + @decorators.idempotent_id('9e2ea42f-0a4f-468c-a768-51859ce492e0') def test_list_ec2_credentials(self): """Get the list of user ec2 credentials.""" created_creds = [] @@ -79,7 +80,7 @@ class EC2CredentialsTest(base.BaseIdentityV2Test): "Failed to find ec2_credentials %s in fetched list" % ', '.join(cred for cred in missing)) - @test.idempotent_id('cb284075-b613-440d-83ca-fe0b33b3c2b8') + @decorators.idempotent_id('cb284075-b613-440d-83ca-fe0b33b3c2b8') def test_show_ec2_credential(self): """Get the definite user ec2 credential.""" resp = self.non_admin_users_client.create_user_ec2_credential( @@ -95,7 +96,7 @@ class EC2CredentialsTest(base.BaseIdentityV2Test): for key in ['access', 'secret', 'user_id', 'tenant_id']: self.assertEqual(ec2_creds[key], resp[key]) - @test.idempotent_id('6aba0d4c-b76b-4e46-aa42-add79bc1551d') + @decorators.idempotent_id('6aba0d4c-b76b-4e46-aa42-add79bc1551d') def test_delete_ec2_credential(self): """Delete user ec2 credential.""" resp = self.non_admin_users_client.create_user_ec2_credential( diff --git a/tempest/api/identity/v2/test_tenants.py b/tempest/api/identity/v2/test_tenants.py index cc6de4713..2689998dd 100644 --- a/tempest/api/identity/v2/test_tenants.py +++ b/tempest/api/identity/v2/test_tenants.py @@ -14,15 +14,15 @@ # under the License. from tempest.api.identity import base +from tempest.lib import decorators from tempest.lib import exceptions as lib_exc -from tempest import test class IdentityTenantsTest(base.BaseIdentityV2Test): credentials = ['primary', 'alt'] - @test.idempotent_id('ecae2459-243d-4ba1-ad02-65f15dc82b78') + @decorators.idempotent_id('ecae2459-243d-4ba1-ad02-65f15dc82b78') def test_list_tenants_returns_only_authorized_tenants(self): alt_tenant_name = self.alt_manager.credentials.tenant_name resp = self.non_admin_tenants_client.list_tenants() diff --git a/tempest/api/identity/v2/test_tokens.py b/tempest/api/identity/v2/test_tokens.py index bdca1e070..79a176515 100644 --- a/tempest/api/identity/v2/test_tokens.py +++ b/tempest/api/identity/v2/test_tokens.py @@ -16,12 +16,12 @@ from oslo_utils import timeutils import six from tempest.api.identity import base -from tempest import test +from tempest.lib import decorators class TokensTest(base.BaseIdentityV2Test): - @test.idempotent_id('65ae3b78-91ff-467b-a705-f6678863b8ec') + @decorators.idempotent_id('65ae3b78-91ff-467b-a705-f6678863b8ec') def test_create_token(self): token_client = self.non_admin_token_client diff --git a/tempest/api/identity/v2/test_users.py b/tempest/api/identity/v2/test_users.py index 06730f85a..2b42981aa 100644 --- a/tempest/api/identity/v2/test_users.py +++ b/tempest/api/identity/v2/test_users.py @@ -18,8 +18,8 @@ import time from tempest.api.identity import base from tempest import config from tempest.lib.common.utils import data_utils +from tempest.lib import decorators from tempest.lib import exceptions -from tempest import test CONF = config.CONF @@ -77,7 +77,7 @@ class IdentityUsersTest(base.BaseIdentityV2Test): time.sleep(1) self.non_admin_users_client.auth_provider.set_auth() - @test.idempotent_id('165859c9-277f-4124-9479-a7d1627b0ca7') + @decorators.idempotent_id('165859c9-277f-4124-9479-a7d1627b0ca7') def test_user_update_own_password(self): old_pass = self.creds.password old_token = self.non_admin_users_client.token -- cgit v1.2.1