From 781736cf52285dab06becf8c2ac7e181da59f2e2 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 26 Sep 2018 14:43:18 +0300 Subject: [PATCH] Remove deprecated NovaImages.list_images scenario This scenario was deprecated in Rally 0.10 Change-Id: I3afb4a4e78a6145ea95b37dfa7d5015ed4ae1a18 --- CHANGELOG.rst | 7 +-- rally-jobs/nova.yaml | 13 ------ rally_openstack/scenarios/nova/images.py | 44 ------------------- rally_openstack/scenarios/nova/utils.py | 16 ------- samples/tasks/scenarios/nova/list-images.json | 25 ----------- samples/tasks/scenarios/nova/list-images.yaml | 16 ------- tests/unit/scenarios/nova/test_images.py | 28 ------------ tests/unit/scenarios/nova/test_utils.py | 7 --- 8 files changed, 4 insertions(+), 152 deletions(-) delete mode 100644 rally_openstack/scenarios/nova/images.py delete mode 100644 samples/tasks/scenarios/nova/list-images.json delete mode 100644 samples/tasks/scenarios/nova/list-images.yaml delete mode 100644 tests/unit/scenarios/nova/test_images.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6b258983..2cecbcfc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -43,9 +43,9 @@ Changed * Error messages become more user-friendly in ``rally env check``. * Deprecate api_info argument of all clients which inherits from OSClient and deprecate api_version argument of cleanup.manager.cleanup, because - api information has been moved into credentails object. -* `Docker image `_ now supports - mysql and postgres as db backends. + api information has been moved into credentials object. +* `Docker image `_ now + supports mysql and postgres as db backends. Removed ~~~~~~~ @@ -59,6 +59,7 @@ Removed * Remove deprecated properties *insecure*, *cacert* (use *https_insecure* and *https_cacert* properties instead) and method *list_services* (use appropriate method of Clients object) of OpenStackCredentials object. +* Remove deprecated in Rally 0.10.0 ``NovaImages.list_images`` scenario. Fixed ~~~~~ diff --git a/rally-jobs/nova.yaml b/rally-jobs/nova.yaml index cb7ce151..1262afc9 100755 --- a/rally-jobs/nova.yaml +++ b/rally-jobs/nova.yaml @@ -749,19 +749,6 @@ users: tenants: 2 users_per_tenant: 2 - - - title: NovaImages.list_images tests - scenario: - NovaImages.list_images: - detailed: True - runner: - constant: - times: 4 - concurrency: 4 - contexts: - users: - tenants: 2 - users_per_tenant: 1 - title: NovaKeypair.create_and_delete_keypair tests workloads: diff --git a/rally_openstack/scenarios/nova/images.py b/rally_openstack/scenarios/nova/images.py deleted file mode 100644 index ff77cb51..00000000 --- a/rally_openstack/scenarios/nova/images.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2015: Workday, Inc. -# 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 rally.common.plugin import plugin -from rally.task import validation - -from rally_openstack import consts -from rally_openstack import scenario -from rally_openstack.scenarios.nova import utils - - -"""Scenarios for Nova images.""" - - -@plugin.deprecated("The image proxy-interface was removed from Nova-API. Use " - "Glance related scenarios instead " - "(i.e GlanceImages.list_images.", rally_version="0.10.0") -@validation.add("required_services", services=[consts.Service.NOVA]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(name="NovaImages.list_images", platform="openstack") -class ListImages(utils.NovaScenario): - - def run(self, detailed=True, **kwargs): - """[DEPRECATED] List all images. - - Measure the "nova image-list" command performance. - - :param detailed: True if the image listing - should contain detailed information - :param kwargs: Optional additional arguments for image listing - """ - self._list_images(detailed, **kwargs) diff --git a/rally_openstack/scenarios/nova/utils.py b/rally_openstack/scenarios/nova/utils.py index a9363854..d212135a 100644 --- a/rally_openstack/scenarios/nova/utils.py +++ b/rally_openstack/scenarios/nova/utils.py @@ -510,22 +510,6 @@ class NovaScenario(scenario.OpenStackScenario): ) return image - @atomic.action_timer("nova.list_images") - def _list_images(self, detailed=False, **kwargs): - """List all images. - - :param detailed: True if the image listing - should contain detailed information - :param kwargs: Optional additional arguments for image listing - - :returns: Image list - """ - LOG.warning("Method '_delete_image' of NovaScenario class is " - "deprecated since Rally 0.10.0. Use GlanceUtils instead.") - glance = image_service.Image(self._clients, - atomic_inst=self.atomic_actions()) - return glance.list_images() - @atomic.action_timer("nova.get_keypair") def _get_keypair(self, keypair): """Get a keypair. diff --git a/samples/tasks/scenarios/nova/list-images.json b/samples/tasks/scenarios/nova/list-images.json deleted file mode 100644 index 5401a2d7..00000000 --- a/samples/tasks/scenarios/nova/list-images.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "NovaImages.list_images": [ - { - "runner": { - "type": "constant", - "concurrency": 2, - "times": 10 - }, - "args": { - "detailed": true - }, - "context": { - "users": { - "tenants": 3, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/nova/list-images.yaml b/samples/tasks/scenarios/nova/list-images.yaml deleted file mode 100644 index f77ac5a9..00000000 --- a/samples/tasks/scenarios/nova/list-images.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- - NovaImages.list_images: - - - args: - detailed: True - runner: - type: "constant" - times: 10 - concurrency: 2 - context: - users: - tenants: 3 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/tests/unit/scenarios/nova/test_images.py b/tests/unit/scenarios/nova/test_images.py deleted file mode 100644 index 16401174..00000000 --- a/tests/unit/scenarios/nova/test_images.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright: 2015 Workday, Inc. -# 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. - -import mock - -from rally_openstack.scenarios.nova import images -from tests.unit import test - - -class NovaImagesTestCase(test.TestCase): - - def test_list_images(self): - scenario = images.ListImages() - scenario._list_images = mock.Mock() - scenario.run(detailed=False, fakearg="fakearg") - scenario._list_images.assert_called_once_with(False, fakearg="fakearg") diff --git a/tests/unit/scenarios/nova/test_utils.py b/tests/unit/scenarios/nova/test_utils.py index eeb8d0fc..68ccfed0 100644 --- a/tests/unit/scenarios/nova/test_utils.py +++ b/tests/unit/scenarios/nova/test_utils.py @@ -935,13 +935,6 @@ class NovaScenarioTestCase(test.ScenarioTestCase): self._test_atomic_action_timer(nova_scenario.atomic_actions(), "nova.list_interfaces") - @mock.patch("rally_openstack.scenarios.nova.utils.image_service") - def test__list_images(self, mock_image_service): - result = utils.NovaScenario(clients=mock.Mock())._list_images() - glance = mock_image_service.Image.return_value - self.assertEqual(glance.list_images.return_value, result) - glance.list_images.assert_called_once_with() - def test__lock_server(self): server = mock.Mock() nova_scenario = utils.NovaScenario(context=self.context)