From e1d5c715306a2ce8523c29c48efb41db7ea205cd Mon Sep 17 00:00:00 2001 From: Luong Anh Tuan Date: Mon, 16 Oct 2017 16:27:04 +0700 Subject: [PATCH] Update tests to do not use deprecated test.services() Function 'tempest.test.services()' has moved to 'tempest.common.utils.services()' in version 'Pike'. This commit update tests accordingly. Change-Id: Iddb7475089274a95a2714b85cad51ff292f1e83d --- .../tests/tempest/api/test_telemetry_notification_api.py | 8 ++++---- .../scenario/test_object_storage_telemetry_middleware.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ceilometer/tests/tempest/api/test_telemetry_notification_api.py b/ceilometer/tests/tempest/api/test_telemetry_notification_api.py index 65a86ad33e..ec754c8378 100644 --- a/ceilometer/tests/tempest/api/test_telemetry_notification_api.py +++ b/ceilometer/tests/tempest/api/test_telemetry_notification_api.py @@ -16,10 +16,10 @@ import six import testtools from ceilometer.tests.tempest.api import base +from tempest.common import utils from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import decorators -from tempest import test CONF = config.CONF @@ -37,7 +37,7 @@ class TelemetryNotificationAPITest(base.BaseTelemetryTest): raise cls.skipException(skip_msg) @decorators.idempotent_id('d7f8c1c8-d470-4731-8604-315d3956caae') - @test.services('compute') + @utils.services('compute') def test_check_nova_notification(self): body = self.create_server() @@ -48,7 +48,7 @@ class TelemetryNotificationAPITest(base.BaseTelemetryTest): self.await_samples(metric, query) @decorators.idempotent_id('c240457d-d943-439b-8aea-85e26d64fe8f') - @test.services("image") + @utils.services("image") @testtools.skipIf(not CONF.image_feature_enabled.api_v2, "Glance api v2 is disabled") def test_check_glance_v2_notifications(self): @@ -77,7 +77,7 @@ class TelemetryNotificationAdminAPITest(base.BaseTelemetryAdminTest): raise cls.skipException(skip_msg) @decorators.idempotent_id('29604198-8b45-4fc0-8af8-1cae4f94ebea') - @test.services('compute') + @utils.services('compute') def test_check_nova_notification_event_and_meter(self): body = self.create_server() diff --git a/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py b/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py index c399a6f47e..4a1c9a60a0 100644 --- a/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py +++ b/ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py @@ -15,6 +15,7 @@ # under the License. from oslo_log import log as logging +from tempest.common import utils from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import test_utils @@ -138,7 +139,7 @@ class TestObjectStorageTelemetry(test.BaseTestCase): return obj_name @decorators.idempotent_id('6d6b88e5-3e38-41bc-b34a-79f713a6cb85') - @test.services('object_storage') + @utils.services('object_storage') def test_swift_middleware_notifies(self): container_name = self.create_container() obj_name = self.upload_object_to_container(container_name)