Skip creation of network resources for disabled IPv6 tests
In some cases SetUpClass is called prior to determining that
the test case needs to be skipped, and that is okay. However,
for the IPv6 test cases, this may lead to errors as the very
creation of v6 network resources may not be supported by the
underlying CI infrastructure; therefore, for these cases let's
skip the test as the first step, if required.
Related-bug: #1282387
Change-Id: I84ae3f6d389c42393691718776bf1be18772aca6
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index de44f4d..00754e4 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -364,11 +364,10 @@
@classmethod
def setUpClass(cls):
- super(NetworksIpV6TestJSON, cls).setUpClass()
if not CONF.network_feature_enabled.ipv6:
- cls.tearDownClass()
skip_msg = "IPv6 Tests are disabled."
raise cls.skipException(skip_msg)
+ super(NetworksIpV6TestJSON, cls).setUpClass()
class NetworksIpV6TestXML(NetworksIpV6TestJSON):
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index e924585..e6e6ea1 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -288,11 +288,10 @@
@classmethod
def setUpClass(cls):
- super(PortsAdminExtendedAttrsIpV6TestJSON, cls).setUpClass()
if not CONF.network_feature_enabled.ipv6:
- cls.tearDownClass()
skip_msg = "IPv6 Tests are disabled."
raise cls.skipException(skip_msg)
+ super(PortsAdminExtendedAttrsIpV6TestJSON, cls).setUpClass()
class PortsAdminExtendedAttrsIpV6TestXML(