Merge "Ensure no dangling resources are left if tests are skipped"
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 4c823ad..bc44a2e 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -225,6 +225,7 @@
def setUpClass(cls):
super(BaseV3ComputeTest, cls).setUpClass()
if not cls.config.compute_feature_enabled.api_v3:
+ cls.tearDownClass()
skip_msg = ("%s skipped as nova v3 api is not available" %
cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index 6bc350a..03e8469 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -29,6 +29,7 @@
def setUpClass(cls):
super(VolumeMultiBackendTest, cls).setUpClass()
if not cls.config.volume_feature_enabled.multi_backend:
+ cls.tearDownClass()
raise cls.skipException("Cinder multi-backend feature disabled")
cls.backend1_name = cls.config.volume.backend1_name
@@ -89,12 +90,14 @@
@classmethod
def tearDownClass(cls):
# volumes deletion
- for volume_id in cls.volume_id_list:
+ volume_id_list = getattr(cls, 'volume_id_list', [])
+ for volume_id in volume_id_list:
cls.volume_client.delete_volume(volume_id)
cls.volume_client.wait_for_resource_deletion(volume_id)
# volume types deletion
- for volume_type_id in cls.volume_type_id_list:
+ volume_type_id_list = getattr(cls, 'volume_type_id_list', [])
+ for volume_type_id in volume_type_id_list:
cls.type_client.delete_volume_type(volume_type_id)
super(VolumeMultiBackendTest, cls).tearDownClass()