From cb28fb55884a9be7cd70c37343181116cf000a42 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Mon, 20 Jun 2016 17:12:44 -0400 Subject: use env vars to specify OS_IDENTITY_API_VERSION If the default identity API version were to change in devstack, the v2.0 tests would fail today, resulting in a broken OSC gate. Change-Id: Id634ea7e0fab9f3772383b5512ccac19f5119ac0 --- functional/tests/identity/v2/common.py | 184 +++++++++++++ functional/tests/identity/v2/test_catalog.py | 4 +- .../tests/identity/v2/test_ec2_credentials.py | 4 +- functional/tests/identity/v2/test_endpoint.py | 4 +- functional/tests/identity/v2/test_identity.py | 179 ------------- functional/tests/identity/v2/test_project.py | 6 +- functional/tests/identity/v2/test_role.py | 8 +- functional/tests/identity/v2/test_service.py | 6 +- functional/tests/identity/v2/test_token.py | 4 +- functional/tests/identity/v2/test_user.py | 6 +- functional/tests/identity/v3/common.py | 291 ++++++++++++++++++++ functional/tests/identity/v3/test_catalog.py | 4 +- functional/tests/identity/v3/test_domain.py | 6 +- functional/tests/identity/v3/test_endpoint.py | 4 +- functional/tests/identity/v3/test_group.py | 8 +- functional/tests/identity/v3/test_identity.py | 295 --------------------- functional/tests/identity/v3/test_idp.py | 4 +- functional/tests/identity/v3/test_project.py | 8 +- functional/tests/identity/v3/test_region.py | 4 +- functional/tests/identity/v3/test_role.py | 8 +- functional/tests/identity/v3/test_service.py | 6 +- .../tests/identity/v3/test_service_provider.py | 4 +- functional/tests/identity/v3/test_token.py | 4 +- functional/tests/identity/v3/test_user.py | 6 +- 24 files changed, 529 insertions(+), 528 deletions(-) create mode 100644 functional/tests/identity/v2/common.py delete mode 100644 functional/tests/identity/v2/test_identity.py create mode 100644 functional/tests/identity/v3/common.py delete mode 100644 functional/tests/identity/v3/test_identity.py (limited to 'functional') diff --git a/functional/tests/identity/v2/common.py b/functional/tests/identity/v2/common.py new file mode 100644 index 00000000..9d6a7bb5 --- /dev/null +++ b/functional/tests/identity/v2/common.py @@ -0,0 +1,184 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os + +from tempest.lib.common.utils import data_utils + +from functional.common import test + +BASIC_LIST_HEADERS = ['ID', 'Name'] + + +class IdentityTests(test.TestCase): + """Functional tests for Identity commands. """ + + USER_FIELDS = ['email', 'enabled', 'id', 'name', 'project_id', + 'username', 'domain_id', 'default_project_id'] + PROJECT_FIELDS = ['enabled', 'id', 'name', 'description', 'domain_id'] + TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] + ROLE_FIELDS = ['id', 'name', 'links', 'domain_id'] + SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description'] + ENDPOINT_FIELDS = ['id', 'region', 'service_id', 'service_name', + 'service_type', 'enabled', 'publicurl', + 'adminurl', 'internalurl'] + + EC2_CREDENTIALS_FIELDS = ['access', 'project_id', 'secret', + 'trust_id', 'user_id'] + EC2_CREDENTIALS_LIST_HEADERS = ['Access', 'Secret', + 'Project ID', 'User ID'] + CATALOG_LIST_HEADERS = ['Name', 'Type', 'Endpoints'] + ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type'] + + @classmethod + def setUpClass(cls): + # prepare v2 env + os.environ['OS_IDENTITY_API_VERSION'] = '2.0' + auth_url = os.environ.get('OS_AUTH_URL') + auth_url = auth_url.replace('v3', 'v2.0') + os.environ['OS_AUTH_URL'] = auth_url + + # create dummy project + cls.project_name = data_utils.rand_name('TestProject') + cls.project_description = data_utils.rand_name('description') + cls.openstack( + 'project create ' + '--description %(description)s ' + '--enable ' + '%(name)s' % {'description': cls.project_description, + 'name': cls.project_name}) + + @classmethod + def tearDownClass(cls): + cls.openstack('project delete %s' % cls.project_name) + + if hasattr(super(IdentityTests, cls), 'tearDownClass'): + super(IdentityTests, cls).tearDownClass() + + def _create_dummy_project(self, add_clean_up=True): + project_name = data_utils.rand_name('TestProject') + project_description = data_utils.rand_name('description') + raw_output = self.openstack( + 'project create ' + '--description %(description)s ' + '--enable %(name)s' % {'description': project_description, + 'name': project_name}) + project = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup( + self.openstack, + 'project delete %s' % project['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.PROJECT_FIELDS) + return project_name + + def _create_dummy_user(self, add_clean_up=True): + username = data_utils.rand_name('TestUser') + password = data_utils.rand_name('password') + email = data_utils.rand_name() + '@example.com' + raw_output = self.openstack( + 'user create ' + '--project %(project)s ' + '--password %(password)s ' + '--email %(email)s ' + '--enable ' + '%(name)s' % {'project': self.project_name, + 'email': email, + 'password': password, + 'name': username}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'user delete %s' % self.parse_show_as_object(raw_output)['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.USER_FIELDS) + return username + + def _create_dummy_role(self, add_clean_up=True): + role_name = data_utils.rand_name('TestRole') + raw_output = self.openstack('role create %s' % role_name) + role = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup( + self.openstack, + 'role delete %s' % role['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.ROLE_FIELDS) + self.assertEqual(role_name, role['name']) + return role_name + + def _create_dummy_ec2_credentials(self, add_clean_up=True): + raw_output = self.openstack('ec2 credentials create') + ec2_credentials = self.parse_show_as_object(raw_output) + access_key = ec2_credentials['access'] + if add_clean_up: + self.addCleanup( + self.openstack, + 'ec2 credentials delete %s' % access_key) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS) + return access_key + + def _create_dummy_token(self, add_clean_up=True): + raw_output = self.openstack('token issue') + token = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup(self.openstack, + 'token revoke %s' % token['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.TOKEN_FIELDS) + return token['id'] + + def _create_dummy_service(self, add_clean_up=True): + service_name = data_utils.rand_name('TestService') + description = data_utils.rand_name('description') + type_name = data_utils.rand_name('TestType') + raw_output = self.openstack( + 'service create ' + '--name %(name)s ' + '--description %(description)s ' + '%(type)s' % {'name': service_name, + 'description': description, + 'type': type_name}) + if add_clean_up: + service = self.parse_show_as_object(raw_output) + self.addCleanup(self.openstack, + 'service delete %s' % service['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.SERVICE_FIELDS) + return service_name + + def _create_dummy_endpoint(self, add_clean_up=True): + region_id = data_utils.rand_name('TestRegion') + service_name = self._create_dummy_service() + public_url = data_utils.rand_url() + admin_url = data_utils.rand_url() + internal_url = data_utils.rand_url() + raw_output = self.openstack( + 'endpoint create ' + '--publicurl %(publicurl)s ' + '--adminurl %(adminurl)s ' + '--internalurl %(internalurl)s ' + '--region %(region)s ' + '%(service)s' % {'publicurl': public_url, + 'adminurl': admin_url, + 'internalurl': internal_url, + 'region': region_id, + 'service': service_name}) + endpoint = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup( + self.openstack, + 'endpoint delete %s' % endpoint['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.ENDPOINT_FIELDS) + return endpoint['id'] diff --git a/functional/tests/identity/v2/test_catalog.py b/functional/tests/identity/v2/test_catalog.py index 3a1f7e11..b6291e05 100644 --- a/functional/tests/identity/v2/test_catalog.py +++ b/functional/tests/identity/v2/test_catalog.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class CatalogTests(test_identity.IdentityTests): +class CatalogTests(common.IdentityTests): def test_catalog_list(self): raw_output = self.openstack('catalog list') diff --git a/functional/tests/identity/v2/test_ec2_credentials.py b/functional/tests/identity/v2/test_ec2_credentials.py index 86702c0c..319bd11a 100644 --- a/functional/tests/identity/v2/test_ec2_credentials.py +++ b/functional/tests/identity/v2/test_ec2_credentials.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class EC2CredentialsTests(test_identity.IdentityTests): +class EC2CredentialsTests(common.IdentityTests): def test_ec2_credentials_create(self): self._create_dummy_ec2_credentials() diff --git a/functional/tests/identity/v2/test_endpoint.py b/functional/tests/identity/v2/test_endpoint.py index 8064365e..0682e6b4 100644 --- a/functional/tests/identity/v2/test_endpoint.py +++ b/functional/tests/identity/v2/test_endpoint.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class EndpointTests(test_identity.IdentityTests): +class EndpointTests(common.IdentityTests): def test_endpoint_create(self): self._create_dummy_endpoint() diff --git a/functional/tests/identity/v2/test_identity.py b/functional/tests/identity/v2/test_identity.py deleted file mode 100644 index 9adbe49f..00000000 --- a/functional/tests/identity/v2/test_identity.py +++ /dev/null @@ -1,179 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from tempest.lib.common.utils import data_utils - -from functional.common import test - -BASIC_LIST_HEADERS = ['ID', 'Name'] - - -class IdentityTests(test.TestCase): - """Functional tests for Identity commands. """ - - USER_FIELDS = ['email', 'enabled', 'id', 'name', 'project_id', - 'username', 'domain_id', 'default_project_id'] - PROJECT_FIELDS = ['enabled', 'id', 'name', 'description', 'domain_id'] - TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] - ROLE_FIELDS = ['id', 'name', 'links', 'domain_id'] - SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description'] - ENDPOINT_FIELDS = ['id', 'region', 'service_id', 'service_name', - 'service_type', 'enabled', 'publicurl', - 'adminurl', 'internalurl'] - - EC2_CREDENTIALS_FIELDS = ['access', 'project_id', 'secret', - 'trust_id', 'user_id'] - EC2_CREDENTIALS_LIST_HEADERS = ['Access', 'Secret', - 'Project ID', 'User ID'] - CATALOG_LIST_HEADERS = ['Name', 'Type', 'Endpoints'] - ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type'] - - @classmethod - def setUpClass(cls): - if hasattr(super(IdentityTests, cls), 'setUpClass'): - super(IdentityTests, cls).setUpClass() - - # create dummy project - cls.project_name = data_utils.rand_name('TestProject') - cls.project_description = data_utils.rand_name('description') - cls.openstack( - 'project create ' - '--description %(description)s ' - '--enable ' - '%(name)s' % {'description': cls.project_description, - 'name': cls.project_name}) - - @classmethod - def tearDownClass(cls): - cls.openstack('project delete %s' % cls.project_name) - - if hasattr(super(IdentityTests, cls), 'tearDownClass'): - super(IdentityTests, cls).tearDownClass() - - def _create_dummy_project(self, add_clean_up=True): - project_name = data_utils.rand_name('TestProject') - project_description = data_utils.rand_name('description') - raw_output = self.openstack( - 'project create ' - '--description %(description)s ' - '--enable %(name)s' % {'description': project_description, - 'name': project_name}) - project = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup( - self.openstack, - 'project delete %s' % project['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.PROJECT_FIELDS) - return project_name - - def _create_dummy_user(self, add_clean_up=True): - username = data_utils.rand_name('TestUser') - password = data_utils.rand_name('password') - email = data_utils.rand_name() + '@example.com' - raw_output = self.openstack( - 'user create ' - '--project %(project)s ' - '--password %(password)s ' - '--email %(email)s ' - '--enable ' - '%(name)s' % {'project': self.project_name, - 'email': email, - 'password': password, - 'name': username}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'user delete %s' % self.parse_show_as_object(raw_output)['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.USER_FIELDS) - return username - - def _create_dummy_role(self, add_clean_up=True): - role_name = data_utils.rand_name('TestRole') - raw_output = self.openstack('role create %s' % role_name) - role = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup( - self.openstack, - 'role delete %s' % role['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.ROLE_FIELDS) - self.assertEqual(role_name, role['name']) - return role_name - - def _create_dummy_ec2_credentials(self, add_clean_up=True): - raw_output = self.openstack('ec2 credentials create') - ec2_credentials = self.parse_show_as_object(raw_output) - access_key = ec2_credentials['access'] - if add_clean_up: - self.addCleanup( - self.openstack, - 'ec2 credentials delete %s' % access_key) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS) - return access_key - - def _create_dummy_token(self, add_clean_up=True): - raw_output = self.openstack('token issue') - token = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup(self.openstack, - 'token revoke %s' % token['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.TOKEN_FIELDS) - return token['id'] - - def _create_dummy_service(self, add_clean_up=True): - service_name = data_utils.rand_name('TestService') - description = data_utils.rand_name('description') - type_name = data_utils.rand_name('TestType') - raw_output = self.openstack( - 'service create ' - '--name %(name)s ' - '--description %(description)s ' - '%(type)s' % {'name': service_name, - 'description': description, - 'type': type_name}) - if add_clean_up: - service = self.parse_show_as_object(raw_output) - self.addCleanup(self.openstack, - 'service delete %s' % service['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.SERVICE_FIELDS) - return service_name - - def _create_dummy_endpoint(self, add_clean_up=True): - region_id = data_utils.rand_name('TestRegion') - service_name = self._create_dummy_service() - public_url = data_utils.rand_url() - admin_url = data_utils.rand_url() - internal_url = data_utils.rand_url() - raw_output = self.openstack( - 'endpoint create ' - '--publicurl %(publicurl)s ' - '--adminurl %(adminurl)s ' - '--internalurl %(internalurl)s ' - '--region %(region)s ' - '%(service)s' % {'publicurl': public_url, - 'adminurl': admin_url, - 'internalurl': internal_url, - 'region': region_id, - 'service': service_name}) - endpoint = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup( - self.openstack, - 'endpoint delete %s' % endpoint['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.ENDPOINT_FIELDS) - return endpoint['id'] diff --git a/functional/tests/identity/v2/test_project.py b/functional/tests/identity/v2/test_project.py index e9580ecf..7fb1a98d 100644 --- a/functional/tests/identity/v2/test_project.py +++ b/functional/tests/identity/v2/test_project.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class ProjectTests(test_identity.IdentityTests): +class ProjectTests(common.IdentityTests): def test_project_create(self): project_name = data_utils.rand_name('TestProject') @@ -49,7 +49,7 @@ class ProjectTests(test_identity.IdentityTests): def test_project_list(self): raw_output = self.openstack('project list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_project_set(self): project_name = self._create_dummy_project() diff --git a/functional/tests/identity/v2/test_role.py b/functional/tests/identity/v2/test_role.py index 9ee60069..0f8d5ed4 100644 --- a/functional/tests/identity/v2/test_role.py +++ b/functional/tests/identity/v2/test_role.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class RoleTests(test_identity.IdentityTests): +class RoleTests(common.IdentityTests): def test_role_create(self): self._create_dummy_role() @@ -27,7 +27,7 @@ class RoleTests(test_identity.IdentityTests): self._create_dummy_role() raw_output = self.openstack('role list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_role_list_with_user_project(self): project_name = self._create_dummy_project() @@ -58,7 +58,7 @@ class RoleTests(test_identity.IdentityTests): '' % {'project': project_name, 'user': username}) items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) self.assertEqual(1, len(items)) def test_role_show(self): diff --git a/functional/tests/identity/v2/test_service.py b/functional/tests/identity/v2/test_service.py index bd982be1..219ed33f 100644 --- a/functional/tests/identity/v2/test_service.py +++ b/functional/tests/identity/v2/test_service.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class ServiceTests(test_identity.IdentityTests): +class ServiceTests(common.IdentityTests): def test_service_create(self): self._create_dummy_service() @@ -27,7 +27,7 @@ class ServiceTests(test_identity.IdentityTests): self._create_dummy_service() raw_output = self.openstack('service list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_service_show(self): service_name = self._create_dummy_service() diff --git a/functional/tests/identity/v2/test_token.py b/functional/tests/identity/v2/test_token.py index bac2b0ac..ca9b7d68 100644 --- a/functional/tests/identity/v2/test_token.py +++ b/functional/tests/identity/v2/test_token.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class TokenTests(test_identity.IdentityTests): +class TokenTests(common.IdentityTests): def test_token_issue(self): self._create_dummy_token() diff --git a/functional/tests/identity/v2/test_user.py b/functional/tests/identity/v2/test_user.py index 34cabf7b..ef4defac 100644 --- a/functional/tests/identity/v2/test_user.py +++ b/functional/tests/identity/v2/test_user.py @@ -13,10 +13,10 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions -from functional.tests.identity.v2 import test_identity +from functional.tests.identity.v2 import common -class UserTests(test_identity.IdentityTests): +class UserTests(common.IdentityTests): def test_user_create(self): self._create_dummy_user() @@ -29,7 +29,7 @@ class UserTests(test_identity.IdentityTests): def test_user_list(self): raw_output = self.openstack('user list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_user_set(self): username = self._create_dummy_user() diff --git a/functional/tests/identity/v3/common.py b/functional/tests/identity/v3/common.py new file mode 100644 index 00000000..a7cddfc2 --- /dev/null +++ b/functional/tests/identity/v3/common.py @@ -0,0 +1,291 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os + +from tempest.lib.common.utils import data_utils + +from functional.common import test + + +BASIC_LIST_HEADERS = ['ID', 'Name'] + + +class IdentityTests(test.TestCase): + """Functional tests for Identity commands. """ + + DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links'] + GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links'] + TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] + USER_FIELDS = ['email', 'enabled', 'id', 'name', 'name', + 'domain_id', 'default_project_id', 'description'] + PROJECT_FIELDS = ['description', 'id', 'domain_id', 'is_domain', + 'enabled', 'name', 'parent_id', 'links'] + ROLE_FIELDS = ['id', 'name', 'links', 'domain_id'] + SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description'] + REGION_FIELDS = ['description', 'enabled', 'parent_region', 'region'] + ENDPOINT_FIELDS = ['id', 'region', 'region_id', 'service_id', + 'service_name', 'service_type', 'enabled', + 'interface', 'url'] + + REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description'] + ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type', + 'Enabled', 'Interface', 'URL'] + + IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids'] + IDENTITY_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description'] + + SERVICE_PROVIDER_FIELDS = ['auth_url', 'description', 'enabled', + 'id', 'relay_state_prefix', 'sp_url'] + SERVICE_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description', + 'Auth URL'] + + @classmethod + def setUpClass(cls): + # prepare v3 env + os.environ['OS_IDENTITY_API_VERSION'] = '3' + auth_url = os.environ.get('OS_AUTH_URL') + auth_url = auth_url.replace('v2.0', 'v3') + os.environ['OS_AUTH_URL'] = auth_url + + # create dummy domain + cls.domain_name = data_utils.rand_name('TestDomain') + cls.domain_description = data_utils.rand_name('description') + cls.openstack( + 'domain create ' + '--description %(description)s ' + '--enable ' + '%(name)s' % {'description': cls.domain_description, + 'name': cls.domain_name}) + + # create dummy project + cls.project_name = data_utils.rand_name('TestProject') + cls.project_description = data_utils.rand_name('description') + cls.openstack( + 'project create ' + '--domain %(domain)s ' + '--description %(description)s ' + '--enable ' + '%(name)s' % {'domain': cls.domain_name, + 'description': cls.project_description, + 'name': cls.project_name}) + + @classmethod + def tearDownClass(cls): + # delete dummy project + cls.openstack('project delete %s' % cls.project_name) + # disable and delete dummy domain + cls.openstack('domain set --disable %s' % cls.domain_name) + cls.openstack('domain delete %s' % cls.domain_name) + + if hasattr(super(IdentityTests, cls), 'tearDownClass'): + super(IdentityTests, cls).tearDownClass() + + def _create_dummy_user(self, add_clean_up=True): + username = data_utils.rand_name('TestUser') + password = data_utils.rand_name('password') + email = data_utils.rand_name() + '@example.com' + description = data_utils.rand_name('description') + raw_output = self.openstack( + 'user create ' + '--domain %(domain)s ' + '--project %(project)s ' + '--project-domain %(project_domain)s ' + '--password %(password)s ' + '--email %(email)s ' + '--description %(description)s ' + '--enable ' + '%(name)s' % {'domain': self.domain_name, + 'project': self.project_name, + 'project_domain': self.domain_name, + 'email': email, + 'password': password, + 'description': description, + 'name': username}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'user delete %s' % self.parse_show_as_object(raw_output)['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.USER_FIELDS) + return username + + def _create_dummy_role(self, add_clean_up=True): + role_name = data_utils.rand_name('TestRole') + raw_output = self.openstack('role create %s' % role_name) + role = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup( + self.openstack, + 'role delete %s' % role['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.ROLE_FIELDS) + self.assertEqual(role_name, role['name']) + return role_name + + def _create_dummy_group(self, add_clean_up=True): + group_name = data_utils.rand_name('TestGroup') + description = data_utils.rand_name('description') + raw_output = self.openstack( + 'group create ' + '--domain %(domain)s ' + '--description %(description)s ' + '%(name)s' % {'domain': self.domain_name, + 'description': description, + 'name': group_name}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'group delete ' + '--domain %(domain)s ' + '%(name)s' % {'domain': self.domain_name, + 'name': group_name}) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.GROUP_FIELDS) + return group_name + + def _create_dummy_domain(self, add_clean_up=True): + domain_name = data_utils.rand_name('TestDomain') + domain_description = data_utils.rand_name('description') + self.openstack( + 'domain create ' + '--description %(description)s ' + '--enable %(name)s' % {'description': domain_description, + 'name': domain_name}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'domain delete %s' % domain_name + ) + self.addCleanup( + self.openstack, + 'domain set --disable %s' % domain_name + ) + return domain_name + + def _create_dummy_project(self, add_clean_up=True): + project_name = data_utils.rand_name('TestProject') + project_description = data_utils.rand_name('description') + self.openstack( + 'project create ' + '--domain %(domain)s ' + '--description %(description)s ' + '--enable %(name)s' % {'domain': self.domain_name, + 'description': project_description, + 'name': project_name}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'project delete ' + '--domain %(domain)s ' + '%(name)s' % {'domain': self.domain_name, + 'name': project_name}) + return project_name + + def _create_dummy_region(self, parent_region=None, add_clean_up=True): + region_id = data_utils.rand_name('TestRegion') + description = data_utils.rand_name('description') + parent_region_arg = '' + if parent_region is not None: + parent_region_arg = '--parent-region %s' % parent_region + raw_output = self.openstack( + 'region create ' + '%(parent_region_arg)s ' + '--description %(description)s ' + '%(id)s' % {'parent_region_arg': parent_region_arg, + 'description': description, + 'id': region_id}) + if add_clean_up: + self.addCleanup(self.openstack, + 'region delete %s' % region_id) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.REGION_FIELDS) + return region_id + + def _create_dummy_service(self, add_clean_up=True): + service_name = data_utils.rand_name('TestService') + description = data_utils.rand_name('description') + type_name = data_utils.rand_name('TestType') + raw_output = self.openstack( + 'service create ' + '--name %(name)s ' + '--description %(description)s ' + '--enable ' + '%(type)s' % {'name': service_name, + 'description': description, + 'type': type_name}) + if add_clean_up: + service = self.parse_show_as_object(raw_output) + self.addCleanup(self.openstack, + 'service delete %s' % service['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.SERVICE_FIELDS) + return service_name + + def _create_dummy_endpoint(self, interface='public', add_clean_up=True): + region_id = self._create_dummy_region() + service_name = self._create_dummy_service() + endpoint_url = data_utils.rand_url() + raw_output = self.openstack( + 'endpoint create ' + '--region %(region)s ' + '--enable ' + '%(service)s ' + '%(interface)s ' + '%(url)s' % {'region': region_id, + 'service': service_name, + 'interface': interface, + 'url': endpoint_url}) + endpoint = self.parse_show_as_object(raw_output) + if add_clean_up: + self.addCleanup( + self.openstack, + 'endpoint delete %s' % endpoint['id']) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.ENDPOINT_FIELDS) + return endpoint['id'] + + def _create_dummy_idp(self, add_clean_up=True): + identity_provider = data_utils.rand_name('IdentityProvider') + description = data_utils.rand_name('description') + raw_output = self.openstack( + 'identity provider create ' + ' %(name)s ' + '--description %(description)s ' + '--enable ' % {'name': identity_provider, + 'description': description}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'identity provider delete %s' % identity_provider) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS) + return identity_provider + + def _create_dummy_sp(self, add_clean_up=True): + service_provider = data_utils.rand_name('ServiceProvider') + description = data_utils.rand_name('description') + raw_output = self.openstack( + 'service provider create ' + ' %(name)s ' + '--description %(description)s ' + '--auth-url https://sp.example.com:35357 ' + '--service-provider-url https://sp.example.com:5000 ' + '--enable ' % {'name': service_provider, + 'description': description}) + if add_clean_up: + self.addCleanup( + self.openstack, + 'service provider delete %s' % service_provider) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.SERVICE_PROVIDER_FIELDS) + return service_provider diff --git a/functional/tests/identity/v3/test_catalog.py b/functional/tests/identity/v3/test_catalog.py index 68364529..e33876b0 100644 --- a/functional/tests/identity/v3/test_catalog.py +++ b/functional/tests/identity/v3/test_catalog.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class CatalogTests(test_identity.IdentityTests): +class CatalogTests(common.IdentityTests): def test_catalog_list(self): raw_output = self.openstack('catalog list') diff --git a/functional/tests/identity/v3/test_domain.py b/functional/tests/identity/v3/test_domain.py index 0708e420..305ed58d 100644 --- a/functional/tests/identity/v3/test_domain.py +++ b/functional/tests/identity/v3/test_domain.py @@ -13,10 +13,10 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class DomainTests(test_identity.IdentityTests): +class DomainTests(common.IdentityTests): def test_domain_create(self): domain_name = data_utils.rand_name('TestDomain') @@ -33,7 +33,7 @@ class DomainTests(test_identity.IdentityTests): self._create_dummy_domain() raw_output = self.openstack('domain list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_domain_delete(self): domain_name = self._create_dummy_domain(add_clean_up=False) diff --git a/functional/tests/identity/v3/test_endpoint.py b/functional/tests/identity/v3/test_endpoint.py index ec11deab..162c9e58 100644 --- a/functional/tests/identity/v3/test_endpoint.py +++ b/functional/tests/identity/v3/test_endpoint.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class EndpointTests(test_identity.IdentityTests): +class EndpointTests(common.IdentityTests): def test_endpoint_create(self): self._create_dummy_endpoint(interface='public') diff --git a/functional/tests/identity/v3/test_group.py b/functional/tests/identity/v3/test_group.py index 3f58864d..35075698 100644 --- a/functional/tests/identity/v3/test_group.py +++ b/functional/tests/identity/v3/test_group.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class GroupTests(test_identity.IdentityTests): +class GroupTests(common.IdentityTests): def test_group_create(self): self._create_dummy_group() @@ -24,7 +24,7 @@ class GroupTests(test_identity.IdentityTests): group_name = self._create_dummy_group() raw_output = self.openstack('group list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) self.assertIn(group_name, raw_output) def test_group_list_with_domain(self): @@ -32,7 +32,7 @@ class GroupTests(test_identity.IdentityTests): raw_output = self.openstack( 'group list --domain %s' % self.domain_name) items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) self.assertIn(group_name, raw_output) def test_group_delete(self): diff --git a/functional/tests/identity/v3/test_identity.py b/functional/tests/identity/v3/test_identity.py deleted file mode 100644 index 3f988742..00000000 --- a/functional/tests/identity/v3/test_identity.py +++ /dev/null @@ -1,295 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import os - -from tempest.lib.common.utils import data_utils - -from functional.common import test - - -BASIC_LIST_HEADERS = ['ID', 'Name'] - - -class IdentityTests(test.TestCase): - """Functional tests for Identity commands. """ - - DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links'] - GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links'] - TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] - USER_FIELDS = ['email', 'enabled', 'id', 'name', 'name', - 'domain_id', 'default_project_id', 'description'] - PROJECT_FIELDS = ['description', 'id', 'domain_id', 'is_domain', - 'enabled', 'name', 'parent_id', 'links'] - ROLE_FIELDS = ['id', 'name', 'links', 'domain_id'] - SERVICE_FIELDS = ['id', 'enabled', 'name', 'type', 'description'] - REGION_FIELDS = ['description', 'enabled', 'parent_region', 'region'] - ENDPOINT_FIELDS = ['id', 'region', 'region_id', 'service_id', - 'service_name', 'service_type', 'enabled', - 'interface', 'url'] - - REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description'] - ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type', - 'Enabled', 'Interface', 'URL'] - - IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids'] - IDENTITY_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description'] - - SERVICE_PROVIDER_FIELDS = ['auth_url', 'description', 'enabled', - 'id', 'relay_state_prefix', 'sp_url'] - SERVICE_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description', - 'Auth URL'] - - @classmethod - def setUpClass(cls): - if hasattr(super(IdentityTests, cls), 'setUpClass'): - super(IdentityTests, cls).setUpClass() - - # prepare v3 env - auth_url = os.environ.get('OS_AUTH_URL') - auth_url = auth_url.replace('v2.0', 'v3') - os.environ['OS_AUTH_URL'] = auth_url - os.environ['OS_IDENTITY_API_VERSION'] = '3' - os.environ['OS_AUTH_TYPE'] = 'v3password' - - # create dummy domain - cls.domain_name = data_utils.rand_name('TestDomain') - cls.domain_description = data_utils.rand_name('description') - cls.openstack( - 'domain create ' - '--description %(description)s ' - '--enable ' - '%(name)s' % {'description': cls.domain_description, - 'name': cls.domain_name}) - - # create dummy project - cls.project_name = data_utils.rand_name('TestProject') - cls.project_description = data_utils.rand_name('description') - cls.openstack( - 'project create ' - '--domain %(domain)s ' - '--description %(description)s ' - '--enable ' - '%(name)s' % {'domain': cls.domain_name, - 'description': cls.project_description, - 'name': cls.project_name}) - - @classmethod - def tearDownClass(cls): - # delete dummy project - cls.openstack('project delete %s' % cls.project_name) - # disable and delete dummy domain - cls.openstack('domain set --disable %s' % cls.domain_name) - cls.openstack('domain delete %s' % cls.domain_name) - - if hasattr(super(IdentityTests, cls), 'tearDownClass'): - super(IdentityTests, cls).tearDownClass() - - def _create_dummy_user(self, add_clean_up=True): - username = data_utils.rand_name('TestUser') - password = data_utils.rand_name('password') - email = data_utils.rand_name() + '@example.com' - description = data_utils.rand_name('description') - raw_output = self.openstack( - 'user create ' - '--domain %(domain)s ' - '--project %(project)s ' - '--project-domain %(project_domain)s ' - '--password %(password)s ' - '--email %(email)s ' - '--description %(description)s ' - '--enable ' - '%(name)s' % {'domain': self.domain_name, - 'project': self.project_name, - 'project_domain': self.domain_name, - 'email': email, - 'password': password, - 'description': description, - 'name': username}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'user delete %s' % self.parse_show_as_object(raw_output)['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.USER_FIELDS) - return username - - def _create_dummy_role(self, add_clean_up=True): - role_name = data_utils.rand_name('TestRole') - raw_output = self.openstack('role create %s' % role_name) - role = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup( - self.openstack, - 'role delete %s' % role['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.ROLE_FIELDS) - self.assertEqual(role_name, role['name']) - return role_name - - def _create_dummy_group(self, add_clean_up=True): - group_name = data_utils.rand_name('TestGroup') - description = data_utils.rand_name('description') - raw_output = self.openstack( - 'group create ' - '--domain %(domain)s ' - '--description %(description)s ' - '%(name)s' % {'domain': self.domain_name, - 'description': description, - 'name': group_name}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'group delete ' - '--domain %(domain)s ' - '%(name)s' % {'domain': self.domain_name, - 'name': group_name}) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.GROUP_FIELDS) - return group_name - - def _create_dummy_domain(self, add_clean_up=True): - domain_name = data_utils.rand_name('TestDomain') - domain_description = data_utils.rand_name('description') - self.openstack( - 'domain create ' - '--description %(description)s ' - '--enable %(name)s' % {'description': domain_description, - 'name': domain_name}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'domain delete %s' % domain_name - ) - self.addCleanup( - self.openstack, - 'domain set --disable %s' % domain_name - ) - return domain_name - - def _create_dummy_project(self, add_clean_up=True): - project_name = data_utils.rand_name('TestProject') - project_description = data_utils.rand_name('description') - self.openstack( - 'project create ' - '--domain %(domain)s ' - '--description %(description)s ' - '--enable %(name)s' % {'domain': self.domain_name, - 'description': project_description, - 'name': project_name}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'project delete ' - '--domain %(domain)s ' - '%(name)s' % {'domain': self.domain_name, - 'name': project_name}) - return project_name - - def _create_dummy_region(self, parent_region=None, add_clean_up=True): - region_id = data_utils.rand_name('TestRegion') - description = data_utils.rand_name('description') - parent_region_arg = '' - if parent_region is not None: - parent_region_arg = '--parent-region %s' % parent_region - raw_output = self.openstack( - 'region create ' - '%(parent_region_arg)s ' - '--description %(description)s ' - '%(id)s' % {'parent_region_arg': parent_region_arg, - 'description': description, - 'id': region_id}) - if add_clean_up: - self.addCleanup(self.openstack, - 'region delete %s' % region_id) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.REGION_FIELDS) - return region_id - - def _create_dummy_service(self, add_clean_up=True): - service_name = data_utils.rand_name('TestService') - description = data_utils.rand_name('description') - type_name = data_utils.rand_name('TestType') - raw_output = self.openstack( - 'service create ' - '--name %(name)s ' - '--description %(description)s ' - '--enable ' - '%(type)s' % {'name': service_name, - 'description': description, - 'type': type_name}) - if add_clean_up: - service = self.parse_show_as_object(raw_output) - self.addCleanup(self.openstack, - 'service delete %s' % service['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.SERVICE_FIELDS) - return service_name - - def _create_dummy_endpoint(self, interface='public', add_clean_up=True): - region_id = self._create_dummy_region() - service_name = self._create_dummy_service() - endpoint_url = data_utils.rand_url() - raw_output = self.openstack( - 'endpoint create ' - '--region %(region)s ' - '--enable ' - '%(service)s ' - '%(interface)s ' - '%(url)s' % {'region': region_id, - 'service': service_name, - 'interface': interface, - 'url': endpoint_url}) - endpoint = self.parse_show_as_object(raw_output) - if add_clean_up: - self.addCleanup( - self.openstack, - 'endpoint delete %s' % endpoint['id']) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.ENDPOINT_FIELDS) - return endpoint['id'] - - def _create_dummy_idp(self, add_clean_up=True): - identity_provider = data_utils.rand_name('IdentityProvider') - description = data_utils.rand_name('description') - raw_output = self.openstack( - 'identity provider create ' - ' %(name)s ' - '--description %(description)s ' - '--enable ' % {'name': identity_provider, - 'description': description}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'identity provider delete %s' % identity_provider) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS) - return identity_provider - - def _create_dummy_sp(self, add_clean_up=True): - service_provider = data_utils.rand_name('ServiceProvider') - description = data_utils.rand_name('description') - raw_output = self.openstack( - 'service provider create ' - ' %(name)s ' - '--description %(description)s ' - '--auth-url https://sp.example.com:35357 ' - '--service-provider-url https://sp.example.com:5000 ' - '--enable ' % {'name': service_provider, - 'description': description}) - if add_clean_up: - self.addCleanup( - self.openstack, - 'service provider delete %s' % service_provider) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.SERVICE_PROVIDER_FIELDS) - return service_provider diff --git a/functional/tests/identity/v3/test_idp.py b/functional/tests/identity/v3/test_idp.py index 08f660f6..8d864712 100644 --- a/functional/tests/identity/v3/test_idp.py +++ b/functional/tests/identity/v3/test_idp.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common from tempest.lib.common.utils import data_utils -class IdentityProviderTests(test_identity.IdentityTests): +class IdentityProviderTests(common.IdentityTests): # Introduce functional test case for command 'Identity Provider' def test_idp_create(self): diff --git a/functional/tests/identity/v3/test_project.py b/functional/tests/identity/v3/test_project.py index d060c7b1..a27c58fb 100644 --- a/functional/tests/identity/v3/test_project.py +++ b/functional/tests/identity/v3/test_project.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class ProjectTests(test_identity.IdentityTests): +class ProjectTests(common.IdentityTests): def test_project_create(self): project_name = data_utils.rand_name('TestProject') @@ -57,14 +57,14 @@ class ProjectTests(test_identity.IdentityTests): def test_project_list(self): raw_output = self.openstack('project list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_project_list_with_domain(self): project_name = self._create_dummy_project() raw_output = self.openstack( 'project list --domain %s' % self.domain_name) items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) self.assertIn(project_name, raw_output) self.assertTrue(len(items) > 0) diff --git a/functional/tests/identity/v3/test_region.py b/functional/tests/identity/v3/test_region.py index be6ef1cb..5ba0c231 100644 --- a/functional/tests/identity/v3/test_region.py +++ b/functional/tests/identity/v3/test_region.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class RegionTests(test_identity.IdentityTests): +class RegionTests(common.IdentityTests): def test_region_create(self): self._create_dummy_region() diff --git a/functional/tests/identity/v3/test_role.py b/functional/tests/identity/v3/test_role.py index 29dc4b20..60aaf3f4 100644 --- a/functional/tests/identity/v3/test_role.py +++ b/functional/tests/identity/v3/test_role.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class RoleTests(test_identity.IdentityTests): +class RoleTests(common.IdentityTests): def test_role_create(self): self._create_dummy_role() @@ -29,7 +29,7 @@ class RoleTests(test_identity.IdentityTests): self._create_dummy_role() raw_output = self.openstack('role list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_role_list_with_user_project(self): role_name = self._create_dummy_role() @@ -69,7 +69,7 @@ class RoleTests(test_identity.IdentityTests): 'user': username, 'user_domain': self.domain_name}) items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) self.assertEqual(1, len(items)) def test_role_show(self): diff --git a/functional/tests/identity/v3/test_service.py b/functional/tests/identity/v3/test_service.py index 684fa5fe..c757d914 100644 --- a/functional/tests/identity/v3/test_service.py +++ b/functional/tests/identity/v3/test_service.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class ServiceTests(test_identity.IdentityTests): +class ServiceTests(common.IdentityTests): def test_service_create(self): self._create_dummy_service() @@ -29,7 +29,7 @@ class ServiceTests(test_identity.IdentityTests): self._create_dummy_service() raw_output = self.openstack('service list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_service_set(self): service_name = self._create_dummy_service() diff --git a/functional/tests/identity/v3/test_service_provider.py b/functional/tests/identity/v3/test_service_provider.py index 936c6620..6cfa7e56 100644 --- a/functional/tests/identity/v3/test_service_provider.py +++ b/functional/tests/identity/v3/test_service_provider.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common from tempest.lib.common.utils import data_utils -class ServiceProviderTests(test_identity.IdentityTests): +class ServiceProviderTests(common.IdentityTests): # Introduce functional test cases for command 'Service Provider' def test_sp_create(self): diff --git a/functional/tests/identity/v3/test_token.py b/functional/tests/identity/v3/test_token.py index 67fddccf..d8d3f43d 100644 --- a/functional/tests/identity/v3/test_token.py +++ b/functional/tests/identity/v3/test_token.py @@ -10,10 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class TokenTests(test_identity.IdentityTests): +class TokenTests(common.IdentityTests): def test_token_issue(self): raw_output = self.openstack('token issue') diff --git a/functional/tests/identity/v3/test_user.py b/functional/tests/identity/v3/test_user.py index cc3e08a0..f3657064 100644 --- a/functional/tests/identity/v3/test_user.py +++ b/functional/tests/identity/v3/test_user.py @@ -12,10 +12,10 @@ from tempest.lib.common.utils import data_utils -from functional.tests.identity.v3 import test_identity +from functional.tests.identity.v3 import common -class UserTests(test_identity.IdentityTests): +class UserTests(common.IdentityTests): def test_user_create(self): self._create_dummy_user() @@ -31,7 +31,7 @@ class UserTests(test_identity.IdentityTests): def test_user_list(self): raw_output = self.openstack('user list') items = self.parse_listing(raw_output) - self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS) + self.assert_table_structure(items, common.BASIC_LIST_HEADERS) def test_user_set(self): username = self._create_dummy_user() -- cgit v1.2.1