Skip scenario tests early to avoid unnecessary setup
This is change for the volume scenario test to
skip them early.
When we skip the test class using skip_checks(), it check
the conditions and skip the test class at first step
without creating any keystone credentials. But when
tests are skipped with other decorator at test level then
it does create keystone credentials, setup network resources
and service clients.
This will mostly help neutron gate where these volume
tests will be skipped in the initial stage only and will
not create the keystone and network resources.
One good example is TestEncryptedCinderVolumes which is skipped
- https://zuul.openstack.org/build/babcc06f24764a408ed77702365b4c5b/log/job-output.txt#28695
But it still does the resources setup
- https://zuul.openstack.org/build/babcc06f24764a408ed77702365b4c5b/log/controller/logs/tempest_log.txt#6374-6450
Related-Bug: #2004780
Change-Id: I59cd39c20b995bf2ed2f58f4522743c3ca51b516
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 5513f4d..6372c6b 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -38,6 +38,12 @@
* check command outputs
"""
+ @classmethod
+ def skip_checks(cls):
+ super(TestMinimumBasicScenario, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
def nova_show(self, server):
got_server = (self.servers_client.show_server(server['id'])
['server'])
diff --git a/tempest/scenario/test_server_volume_attachment.py b/tempest/scenario/test_server_volume_attachment.py
index 1d0d0d0..076b835 100644
--- a/tempest/scenario/test_server_volume_attachment.py
+++ b/tempest/scenario/test_server_volume_attachment.py
@@ -26,6 +26,13 @@
class BaseAttachmentTest(manager.ScenarioTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(BaseAttachmentTest, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
@classmethod
def setup_clients(cls):
super().setup_clients()
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 82f0341..92dbffb 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -51,6 +51,8 @@
@classmethod
def skip_checks(cls):
super(TestStampPattern, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
diff --git a/tempest/scenario/test_volume_backup_restore.py b/tempest/scenario/test_volume_backup_restore.py
index d0885cf..07ca38a 100644
--- a/tempest/scenario/test_volume_backup_restore.py
+++ b/tempest/scenario/test_volume_backup_restore.py
@@ -41,6 +41,8 @@
@classmethod
def skip_checks(cls):
super(TestVolumeBackupRestore, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.backup:
raise cls.skipException('Backup is not enable.')
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 5c5033a..6ebee48 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -31,6 +31,12 @@
# breathing room to get through deletes in the time allotted.
TIMEOUT_SCALING_FACTOR = 2
+ @classmethod
+ def skip_checks(cls):
+ super(TestVolumeBootPattern, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
def _delete_server(self, server):
self.servers_client.delete_server(server['id'])
waiters.wait_for_server_termination(self.servers_client, server['id'])
diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py
index 57d2a1a..5005346 100644
--- a/tempest/scenario/test_volume_migrate_attached.py
+++ b/tempest/scenario/test_volume_migrate_attached.py
@@ -48,6 +48,8 @@
@classmethod
def skip_checks(cls):
super(TestVolumeMigrateRetypeAttached, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.multi_backend:
raise cls.skipException("Cinder multi-backend feature disabled")