Split resource_setup for telemetry tests
Split up the resource_setup method for all the telemetry tests, as per the
latest spec.
Partially-implements bp:resource-cleanup
Change-Id: I3d5af988c28bc7d80d2aabf9327e9abf588a2403
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index 7ec0646..c521b37 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -28,18 +28,29 @@
"""Base test case class for all Telemetry API tests."""
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(BaseTelemetryTest, cls).skip_checks()
if not CONF.service_available.ceilometer:
raise cls.skipException("Ceilometer support is required")
- cls.set_network_resources()
- super(BaseTelemetryTest, cls).resource_setup()
- os = cls.get_client_manager()
- cls.telemetry_client = os.telemetry_client
- cls.servers_client = os.servers_client
- cls.flavors_client = os.flavors_client
- cls.image_client = os.image_client
- cls.image_client_v2 = os.image_client_v2
+ @classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources()
+ super(BaseTelemetryTest, cls).setup_credentials()
+ cls.os = cls.get_client_manager()
+
+ @classmethod
+ def setup_clients(cls):
+ super(BaseTelemetryTest, cls).setup_clients()
+ cls.telemetry_client = cls.os.telemetry_client
+ cls.servers_client = cls.os.servers_client
+ cls.flavors_client = cls.os.flavors_client
+ cls.image_client = cls.os.image_client
+ cls.image_client_v2 = cls.os.image_client_v2
+
+ @classmethod
+ def resource_setup(cls):
+ super(BaseTelemetryTest, cls).resource_setup()
cls.nova_notifications = ['memory', 'vcpus', 'disk.root.size',
'disk.ephemeral.size']
diff --git a/tempest/api/telemetry/test_telemetry_notification_api.py b/tempest/api/telemetry/test_telemetry_notification_api.py
index 048e305..a0256af 100644
--- a/tempest/api/telemetry/test_telemetry_notification_api.py
+++ b/tempest/api/telemetry/test_telemetry_notification_api.py
@@ -23,11 +23,11 @@
class TelemetryNotificationAPITestJSON(base.BaseTelemetryTest):
@classmethod
- def resource_setup(cls):
+ def skip_checks(cls):
+ super(TelemetryNotificationAPITestJSON, cls).skip_checks()
if CONF.telemetry.too_slow_to_test:
raise cls.skipException("Ceilometer feature for fast work mysql "
"is disabled")
- super(TelemetryNotificationAPITestJSON, cls).resource_setup()
@test.attr(type="gate")
@testtools.skipIf(not CONF.service_available.nova,