Do not setUpClass or tearDownClass V3 tests if API is disabled
Bugs in performing tearDown may occur if v3 is
disabled as the skip would cause the setUp to be
incomplete, causing the tearDown to reference undefined
instance variables.
Change-Id: I69110c6149ee22aa3e0d6ee27c52ef0159e9a235
Closes-Bug: #1282839
Closes-Bug: #1282829
Closes-Bug: #1282827
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 9162926..c2663f8 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -313,14 +313,14 @@
"%s will be removed shortly" % cls.__name__)
raise cls.skipException(skip_msg)
- cls.set_network_resources()
- super(BaseV3ComputeTest, cls).setUpClass()
if not CONF.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)
+ cls.set_network_resources()
+ super(BaseV3ComputeTest, cls).setUpClass()
+
cls.servers_client = cls.os.servers_v3_client
cls.images_client = cls.os.image_client
cls.flavors_client = cls.os.flavors_v3_client