Ensure no dangling resources are left if tests are skipped

When tenant isolation is enabled, some network resources are
provisioned even though some tests are skipped. This has
a bad effect because these resources (like ip allocations,
routers and such) may have quota's default values that are
low.

With this change we ensure resources are torn down correctly.

Closes-bug:  1254166
Related-bug: 1232971
Related-bug: 1253966

Change-Id: Id86841775a26f12a5ae8c520a086e5f1ebd63135
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 715ec16..1373eb0 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -224,6 +224,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 eada639..53141bc 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()