Merge "Fix stress runner exit issues"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 1d368af..a2d3877 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -553,6 +553,9 @@
 # The mask bits for tenant ipv4 subnets (integer value)
 #tenant_network_mask_bits=28
 
+# Allow the execution of IPv6 tests (boolean value)
+#ipv6_enabled=true
+
 # The cidr block to allocate tenant ipv6 subnets from (string
 # value)
 #tenant_network_v6_cidr=2003::/64
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 9029b1f..aba2c8e 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -467,6 +467,14 @@
     _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
     _tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
 
+    @classmethod
+    def setUpClass(cls):
+        super(NetworksIpV6TestJSON, cls).setUpClass()
+        if not CONF.network.ipv6_enabled:
+            cls.tearDownClass()
+            skip_msg = "IPv6 Tests are disabled."
+            raise cls.skipException(skip_msg)
+
 
 class NetworksIpV6TestXML(NetworksIpV6TestJSON):
     _interface = 'xml'
diff --git a/tempest/config.py b/tempest/config.py
index a2d35a9..c92a04d 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -343,6 +343,9 @@
     cfg.IntOpt('tenant_network_mask_bits',
                default=28,
                help="The mask bits for tenant ipv4 subnets"),
+    cfg.BoolOpt('ipv6_enabled',
+                default=True,
+                help="Allow the execution of IPv6 tests"),
     cfg.StrOpt('tenant_network_v6_cidr',
                default="2003::/64",
                help="The cidr block to allocate tenant ipv6 subnets from"),