diff --git a/neutron/tests/tempest/api/admin/test_quotas.py b/neutron/tests/tempest/api/admin/test_quotas.py index 3013843a358..568380b0eb4 100644 --- a/neutron/tests/tempest/api/admin/test_quotas.py +++ b/neutron/tests/tempest/api/admin/test_quotas.py @@ -29,21 +29,18 @@ class QuotasTestBase(base.BaseAdminNetworkTest): @classmethod @test.requires_ext(extension="quotas", service="network") def resource_setup(cls): - if not CONF.identity_feature_enabled.api_v2_admin: - # TODO(ihrachys) adopt to v3 - raise cls.skipException('Identity v2 admin not available') super(QuotasTestBase, cls).resource_setup() def _create_tenant(self): # Add a tenant to conduct the test test_tenant = data_utils.rand_name('test_tenant_') test_description = data_utils.rand_name('desc_') - tenant = self.identity_admin_client.create_tenant( + project = self.identity_admin_clientv3.create_project( name=test_tenant, - description=test_description)['tenant'] + description=test_description)['project'] self.addCleanup( - self.identity_admin_client.delete_tenant, tenant['id']) - return tenant + self.identity_admin_clientv3.delete_project, project['id']) + return project def _setup_quotas(self, project_id, **new_quotas): # Change quotas for tenant diff --git a/neutron/tests/tempest/api/base.py b/neutron/tests/tempest/api/base.py index c4cec978bf0..f9f14cc5ac8 100644 --- a/neutron/tests/tempest/api/base.py +++ b/neutron/tests/tempest/api/base.py @@ -425,6 +425,7 @@ class BaseAdminNetworkTest(BaseNetworkTest): super(BaseAdminNetworkTest, cls).setup_clients() cls.admin_client = cls.os_adm.network_client cls.identity_admin_client = cls.os_adm.tenants_client + cls.identity_admin_clientv3 = cls.os_admin.projects_client @classmethod def create_metering_label(cls, name, description): diff --git a/neutron/tests/tempest/api/clients.py b/neutron/tests/tempest/api/clients.py index c6f41d02a15..949ce2ee2c0 100644 --- a/neutron/tests/tempest/api/clients.py +++ b/neutron/tests/tempest/api/clients.py @@ -16,6 +16,7 @@ from tempest.lib.services.compute import keypairs_client from tempest.lib.services.compute import servers_client from tempest.lib.services.identity.v2 import tenants_client +from tempest.lib.services.identity.v3 import projects_client from tempest import manager from neutron.tests.tempest import config @@ -85,3 +86,6 @@ class Manager(manager.Manager): # Client uses admin endpoint type of Keystone API v2 self.tenants_client = tenants_client.TenantsClient(self.auth_provider, **params_v2_admin) + # Client uses admin endpoint type of Keystone API v3 + self.projects_client = projects_client.ProjectsClient( + self.auth_provider, **params_v2_admin)