From c9cbb0f0ec39cd93fc9634364409c55c9a753f6e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 6 Apr 2016 19:08:07 -0400 Subject: [PATCH] Remove trove tests from tempest This commit removes the trove tests from tempest as part of plugin decomposition of tempest. Trove isn't in scope for testing in tempest anymore and tempest testing will be done via a plugin now. Change-Id: I0407e96f628e96bd4d3f7f42cf433b756a5bbaa9 --- .../remove-trove-tests-666522e9113549f9.yaml | 4 + tempest/api/database/__init__.py | 0 tempest/api/database/base.py | 48 ------------ tempest/api/database/flavors/__init__.py | 0 tempest/api/database/flavors/test_flavors.py | 77 ------------------- .../database/flavors/test_flavors_negative.py | 33 -------- tempest/api/database/limits/__init__.py | 0 tempest/api/database/limits/test_limits.py | 45 ----------- tempest/api/database/versions/__init__.py | 0 .../api/database/versions/test_versions.py | 39 ---------- tempest/clients.py | 19 ----- tempest/cmd/verify_tempest_config.py | 1 - tempest/config.py | 20 ----- tempest/hacking/checks.py | 2 +- tempest/services/database/__init__.py | 23 ------ tempest/services/database/json/__init__.py | 0 .../services/database/json/flavors_client.py | 38 --------- .../services/database/json/limits_client.py | 32 -------- .../services/database/json/versions_client.py | 38 --------- tempest/test.py | 4 +- 20 files changed, 6 insertions(+), 417 deletions(-) create mode 100644 releasenotes/notes/remove-trove-tests-666522e9113549f9.yaml delete mode 100644 tempest/api/database/__init__.py delete mode 100644 tempest/api/database/base.py delete mode 100644 tempest/api/database/flavors/__init__.py delete mode 100644 tempest/api/database/flavors/test_flavors.py delete mode 100644 tempest/api/database/flavors/test_flavors_negative.py delete mode 100644 tempest/api/database/limits/__init__.py delete mode 100644 tempest/api/database/limits/test_limits.py delete mode 100644 tempest/api/database/versions/__init__.py delete mode 100644 tempest/api/database/versions/test_versions.py delete mode 100644 tempest/services/database/__init__.py delete mode 100644 tempest/services/database/json/__init__.py delete mode 100644 tempest/services/database/json/flavors_client.py delete mode 100644 tempest/services/database/json/limits_client.py delete mode 100644 tempest/services/database/json/versions_client.py diff --git a/releasenotes/notes/remove-trove-tests-666522e9113549f9.yaml b/releasenotes/notes/remove-trove-tests-666522e9113549f9.yaml new file mode 100644 index 0000000000..1157a4f934 --- /dev/null +++ b/releasenotes/notes/remove-trove-tests-666522e9113549f9.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - All tests for the Trove project have been removed from tempest. They now + live as a tempest plugin in the the trove project. diff --git a/tempest/api/database/__init__.py b/tempest/api/database/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tempest/api/database/base.py b/tempest/api/database/base.py deleted file mode 100644 index 01e05dbd9f..0000000000 --- a/tempest/api/database/base.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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 import config -import tempest.test - -CONF = config.CONF - - -class BaseDatabaseTest(tempest.test.BaseTestCase): - """Base test case class for all Database API tests.""" - - credentials = ['primary'] - - @classmethod - def skip_checks(cls): - super(BaseDatabaseTest, cls).skip_checks() - if not CONF.service_available.trove: - skip_msg = ("%s skipped as trove is not available" % cls.__name__) - raise cls.skipException(skip_msg) - - @classmethod - def setup_clients(cls): - super(BaseDatabaseTest, cls).setup_clients() - cls.database_flavors_client = cls.os.database_flavors_client - cls.os_flavors_client = cls.os.flavors_client - cls.database_limits_client = cls.os.database_limits_client - cls.database_versions_client = cls.os.database_versions_client - - @classmethod - def resource_setup(cls): - super(BaseDatabaseTest, cls).resource_setup() - - cls.catalog_type = CONF.database.catalog_type - cls.db_flavor_ref = CONF.database.db_flavor_ref - cls.db_current_version = CONF.database.db_current_version diff --git a/tempest/api/database/flavors/__init__.py b/tempest/api/database/flavors/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py deleted file mode 100644 index bb7a0a4dc6..0000000000 --- a/tempest/api/database/flavors/test_flavors.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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.api.database import base -from tempest.lib import decorators -from tempest import test - - -class DatabaseFlavorsTest(base.BaseDatabaseTest): - - @classmethod - def setup_clients(cls): - super(DatabaseFlavorsTest, cls).setup_clients() - cls.client = cls.database_flavors_client - - @test.attr(type='smoke') - @test.idempotent_id('c94b825e-0132-4686-8049-8a4a2bc09525') - @decorators.skip_because(bug='1567134') - def test_get_db_flavor(self): - # The expected flavor details should be returned - flavor = (self.client.show_db_flavor(self.db_flavor_ref) - ['flavor']) - self.assertEqual(self.db_flavor_ref, str(flavor['id'])) - self.assertIn('ram', flavor) - self.assertIn('links', flavor) - self.assertIn('name', flavor) - - @test.attr(type='smoke') - @test.idempotent_id('685025d6-0cec-4673-8a8d-995cb8e0d3bb') - @decorators.skip_because(bug='1567134') - def test_list_db_flavors(self): - flavor = (self.client.show_db_flavor(self.db_flavor_ref) - ['flavor']) - # List of all flavors should contain the expected flavor - flavors = self.client.list_db_flavors()['flavors'] - self.assertIn(flavor, flavors) - - def _check_values(self, names, db_flavor, os_flavor, in_db=True): - for name in names: - self.assertIn(name, os_flavor) - if in_db: - self.assertIn(name, db_flavor) - self.assertEqual(str(db_flavor[name]), str(os_flavor[name]), - "DB flavor differs from OS on '%s' value" - % name) - else: - self.assertNotIn(name, db_flavor) - - @test.attr(type='smoke') - @test.idempotent_id('afb2667f-4ec2-4925-bcb7-313fdcffb80d') - @test.services('compute') - @decorators.skip_because(bug='1567134') - def test_compare_db_flavors_with_os(self): - db_flavors = self.client.list_db_flavors()['flavors'] - os_flavors = (self.os_flavors_client.list_flavors(detail=True) - ['flavors']) - self.assertEqual(len(os_flavors), len(db_flavors), - "OS flavors %s do not match DB flavors %s" % - (os_flavors, db_flavors)) - for os_flavor in os_flavors: - db_flavor =\ - self.client.show_db_flavor(os_flavor['id'])['flavor'] - self._check_values(['id', 'name', 'ram'], db_flavor, os_flavor) - self._check_values(['disk', 'vcpus', 'swap'], db_flavor, os_flavor, - in_db=False) diff --git a/tempest/api/database/flavors/test_flavors_negative.py b/tempest/api/database/flavors/test_flavors_negative.py deleted file mode 100644 index cd2981bd5d..0000000000 --- a/tempest/api/database/flavors/test_flavors_negative.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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.api.database import base -from tempest.lib import exceptions as lib_exc -from tempest import test - - -class DatabaseFlavorsNegativeTest(base.BaseDatabaseTest): - - @classmethod - def setup_clients(cls): - super(DatabaseFlavorsNegativeTest, cls).setup_clients() - cls.client = cls.database_flavors_client - - @test.attr(type=['negative']) - @test.idempotent_id('f8e7b721-373f-4a64-8e9c-5327e975af3e') - def test_get_non_existent_db_flavor(self): - # flavor details are not returned for non-existent flavors - self.assertRaises(lib_exc.NotFound, - self.client.show_db_flavor, -1) diff --git a/tempest/api/database/limits/__init__.py b/tempest/api/database/limits/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tempest/api/database/limits/test_limits.py b/tempest/api/database/limits/test_limits.py deleted file mode 100644 index ee51b1de6d..0000000000 --- a/tempest/api/database/limits/test_limits.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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.api.database import base -from tempest import test - - -class DatabaseLimitsTest(base.BaseDatabaseTest): - - @classmethod - def resource_setup(cls): - super(DatabaseLimitsTest, cls).resource_setup() - cls.client = cls.database_limits_client - - @test.attr(type='smoke') - @test.idempotent_id('73024538-f316-4829-b3e9-b459290e137a') - def test_absolute_limits(self): - # Test to verify if all absolute limit parameters are - # present when verb is ABSOLUTE - limits = self.client.list_db_limits()['limits'] - expected_abs_limits = ['max_backups', 'max_volumes', - 'max_instances', 'verb'] - absolute_limit = [l for l in limits - if l['verb'] == 'ABSOLUTE'] - self.assertEqual(1, len(absolute_limit), "One ABSOLUTE limit " - "verb is allowed. Fetched %s" - % len(absolute_limit)) - actual_abs_limits = absolute_limit[0].keys() - missing_abs_limit = set(expected_abs_limits) - set(actual_abs_limits) - self.assertEmpty(missing_abs_limit, - "Failed to find the following absolute limit(s)" - " in a fetched list: %s" % - ', '.join(str(a) for a in missing_abs_limit)) diff --git a/tempest/api/database/versions/__init__.py b/tempest/api/database/versions/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tempest/api/database/versions/test_versions.py b/tempest/api/database/versions/test_versions.py deleted file mode 100644 index ae568b1e93..0000000000 --- a/tempest/api/database/versions/test_versions.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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.api.database import base -from tempest import test - - -class DatabaseVersionsTest(base.BaseDatabaseTest): - - @classmethod - def setup_clients(cls): - super(DatabaseVersionsTest, cls).setup_clients() - cls.client = cls.database_versions_client - - @test.attr(type='smoke') - @test.idempotent_id('6952cd77-90cd-4dca-bb60-8e2c797940cf') - def test_list_db_versions(self): - versions = self.client.list_db_versions()['versions'] - self.assertTrue(len(versions) > 0, "No database versions found") - # List of all versions should contain the current version, and there - # should only be one 'current' version - current_versions = list() - for version in versions: - if 'CURRENT' == version['status']: - current_versions.append(version['id']) - self.assertEqual(1, len(current_versions)) - self.assertIn(self.db_current_version, current_versions) diff --git a/tempest/clients.py b/tempest/clients.py index b7bc4fab94..0b118f7dbc 100644 --- a/tempest/clients.py +++ b/tempest/clients.py @@ -25,7 +25,6 @@ from tempest.lib.services import network from tempest import manager from tempest.services import baremetal from tempest.services import data_processing -from tempest.services import database from tempest.services import identity from tempest.services import image from tempest.services import object_storage @@ -64,7 +63,6 @@ class Manager(manager.Manager): """ super(Manager, self).__init__(credentials=credentials, scope=scope) self._set_compute_clients() - self._set_database_clients() self._set_identity_clients() self._set_volume_clients() self._set_object_storage_clients() @@ -243,23 +241,6 @@ class Manager(manager.Manager): self.snapshots_extensions_client = compute.SnapshotsClient( self.auth_provider, **params_volume) - def _set_database_clients(self): - self.database_flavors_client = database.DatabaseFlavorsClient( - self.auth_provider, - CONF.database.catalog_type, - CONF.identity.region, - **self.default_params_with_timeout_values) - self.database_limits_client = database.DatabaseLimitsClient( - self.auth_provider, - CONF.database.catalog_type, - CONF.identity.region, - **self.default_params_with_timeout_values) - self.database_versions_client = database.DatabaseVersionsClient( - self.auth_provider, - CONF.database.catalog_type, - CONF.identity.region, - **self.default_params_with_timeout_values) - def _set_identity_clients(self): params = { 'service': CONF.identity.catalog_type, diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py index 4b12ecbe8a..77b88f92fd 100644 --- a/tempest/cmd/verify_tempest_config.py +++ b/tempest/cmd/verify_tempest_config.py @@ -285,7 +285,6 @@ def check_service_availability(os, update): 'data_processing': 'sahara', 'baremetal': 'ironic', 'identity': 'keystone', - 'database': 'trove' } # Get catalog list for endpoints to use for validation _token, auth_data = os.auth_provider.get_auth() diff --git a/tempest/config.py b/tempest/config.py index b3d409f79c..eb5e23a685 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -811,21 +811,6 @@ ObjectStoreFeaturesGroup = [ help="Execute discoverability tests"), ] -database_group = cfg.OptGroup(name='database', - title='Database Service Options') - -DatabaseGroup = [ - cfg.StrOpt('catalog_type', - default='database', - help="Catalog type of the Database service."), - cfg.StrOpt('db_flavor_ref', - default="1", - help="Valid primary flavor to use in database tests."), - cfg.StrOpt('db_current_version', - default="v1.0", - help="Current database version to use in database tests."), -] - orchestration_group = cfg.OptGroup(name='orchestration', title='Orchestration Service Options') @@ -1002,9 +987,6 @@ ServiceAvailableGroup = [ cfg.BoolOpt('ironic', default=False, help="Whether or not Ironic is expected to be available"), - cfg.BoolOpt('trove', - default=False, - help="Whether or not Trove is expected to be available"), ] debug_group = cfg.OptGroup(name="debug", @@ -1141,7 +1123,6 @@ _opts = [ (volume_feature_group, VolumeFeaturesGroup), (object_storage_group, ObjectStoreGroup), (object_storage_feature_group, ObjectStoreFeaturesGroup), - (database_group, DatabaseGroup), (orchestration_group, OrchestrationGroup), (data_processing_group, DataProcessingGroup), (data_processing_feature_group, DataProcessingFeaturesGroup), @@ -1208,7 +1189,6 @@ class TempestConfigPrivate(object): self.object_storage = _CONF['object-storage'] self.object_storage_feature_enabled = _CONF[ 'object-storage-feature-enabled'] - self.database = _CONF.database self.orchestration = _CONF.orchestration self.data_processing = _CONF['data-processing'] self.data_processing_feature_enabled = _CONF[ diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py index 09106d156e..e2d65851fc 100644 --- a/tempest/hacking/checks.py +++ b/tempest/hacking/checks.py @@ -19,7 +19,7 @@ import pep8 PYTHON_CLIENTS = ['cinder', 'glance', 'keystone', 'nova', 'swift', 'neutron', - 'trove', 'ironic', 'savanna', 'heat', 'sahara'] + 'ironic', 'savanna', 'heat', 'sahara'] PYTHON_CLIENT_RE = re.compile('import (%s)client' % '|'.join(PYTHON_CLIENTS)) TEST_DEFINITION = re.compile(r'^\s*def test.*') diff --git a/tempest/services/database/__init__.py b/tempest/services/database/__init__.py deleted file mode 100644 index 9a742d85b4..0000000000 --- a/tempest/services/database/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P. -# -# 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.services.database.json.flavors_client import \ - DatabaseFlavorsClient -from tempest.services.database.json.limits_client import \ - DatabaseLimitsClient -from tempest.services.database.json.versions_client import \ - DatabaseVersionsClient - -__all__ = ['DatabaseFlavorsClient', 'DatabaseLimitsClient', - 'DatabaseVersionsClient'] diff --git a/tempest/services/database/json/__init__.py b/tempest/services/database/json/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tempest/services/database/json/flavors_client.py b/tempest/services/database/json/flavors_client.py deleted file mode 100644 index bd8ffb0dc9..0000000000 --- a/tempest/services/database/json/flavors_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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 oslo_serialization import jsonutils as json -from six.moves import urllib - -from tempest.lib.common import rest_client - - -class DatabaseFlavorsClient(rest_client.RestClient): - - def list_db_flavors(self, params=None): - url = 'flavors' - if params: - url += '?%s' % urllib.parse.urlencode(params) - - resp, body = self.get(url) - self.expected_success(200, resp.status) - body = json.loads(body) - return rest_client.ResponseBody(resp, body) - - def show_db_flavor(self, db_flavor_id): - resp, body = self.get("flavors/%s" % db_flavor_id) - self.expected_success(200, resp.status) - body = json.loads(body) - return rest_client.ResponseBody(resp, body) diff --git a/tempest/services/database/json/limits_client.py b/tempest/services/database/json/limits_client.py deleted file mode 100644 index a1c58c2e18..0000000000 --- a/tempest/services/database/json/limits_client.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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 oslo_serialization import jsonutils as json -from six.moves.urllib import parse as urllib - -from tempest.lib.common import rest_client - - -class DatabaseLimitsClient(rest_client.RestClient): - - def list_db_limits(self, params=None): - """List all limits.""" - url = 'limits' - if params: - url += '?%s' % urllib.urlencode(params) - resp, body = self.get(url) - self.expected_success(200, resp.status) - body = json.loads(body) - return rest_client.ResponseBody(resp, body) diff --git a/tempest/services/database/json/versions_client.py b/tempest/services/database/json/versions_client.py deleted file mode 100644 index 2f282037c5..0000000000 --- a/tempest/services/database/json/versions_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014 OpenStack Foundation -# All Rights Reserved. -# -# 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 oslo_serialization import jsonutils as json -from six.moves.urllib import parse as urllib - -from tempest.lib.common import rest_client - - -class DatabaseVersionsClient(rest_client.RestClient): - - def __init__(self, auth_provider, service, region, **kwargs): - super(DatabaseVersionsClient, self).__init__( - auth_provider, service, region, **kwargs) - self.skip_path() - - def list_db_versions(self, params=None): - """List all versions.""" - url = '' - if params: - url += '?%s' % urllib.urlencode(params) - - resp, body = self.get(url) - self.expected_success(200, resp.status) - body = json.loads(body) - return rest_client.ResponseBody(resp, body) diff --git a/tempest/test.py b/tempest/test.py index 4e06db821b..f84bf6ba79 100644 --- a/tempest/test.py +++ b/tempest/test.py @@ -79,7 +79,6 @@ def get_service_list(): 'identity': True, 'object_storage': CONF.service_available.swift, 'data_processing': CONF.service_available.sahara, - 'database': CONF.service_available.trove } return service_list @@ -92,8 +91,7 @@ def services(*args): """ def decorator(f): services = ['compute', 'image', 'baremetal', 'volume', 'orchestration', - 'network', 'identity', 'object_storage', 'data_processing', - 'database'] + 'network', 'identity', 'object_storage', 'data_processing'] for service in args: if service not in services: raise exceptions.InvalidServiceTag('%s is not a valid '