Merge "Add ability to skip disk_config tests regardless of extension status"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 020baa1..c4eec66 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -134,6 +134,11 @@
 # performed, which requires XenServer pools in case of using XS)
 use_block_migration_for_live_migration = false
 
+# By default, rely on the status of the diskConfig extension to
+# decide if to execute disk config tests. When set to false, tests
+# are forced to skip, regardless of the extension status
+disk_config_enabled_override = true
+
 [image]
 # This section contains configuration options used when executing tests
 # against the OpenStack Images API
diff --git a/tempest/config.py b/tempest/config.py
index 60da85c..6e8076b 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -294,6 +294,12 @@
         """Path to a private key file for SSH access to remote hosts"""
         return self.get("path_to_private_key")
 
+    @property
+    def disk_config_enabled_override(self):
+        """If false, skip config tests regardless of the extension status"""
+        return self.get("disk_config_enabled_override",
+                        'true').lower() == 'true'
+
 
 class ComputeAdminConfig(BaseConfig):
 
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index 7396833..53dc415 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -30,6 +30,7 @@
 CHANGE_PASSWORD_AVAILABLE = CONFIG.compute.change_password_available
 WHITEBOX_ENABLED = CONFIG.compute.whitebox_enabled
 DISK_CONFIG_ENABLED = False
+DISK_CONFIG_ENABLED_OVERRIDE = CONFIG.compute.disk_config_enabled_override
 FLAVOR_EXTRA_DATA_ENABLED = False
 MULTI_USER = False
 
@@ -43,7 +44,8 @@
     images_client = os.images_client
     flavors_client = os.flavors_client
     extensions_client = os.extensions_client
-    DISK_CONFIG_ENABLED = extensions_client.is_enabled('DiskConfig')
+    DISK_CONFIG_ENABLED = (DISK_CONFIG_ENABLED_OVERRIDE and
+                           extensions_client.is_enabled('DiskConfig'))
     FLAVOR_EXTRA_DATA_ENABLED = extensions_client.is_enabled('FlavorExtraData')
 
     # Validate reference data exists
diff --git a/tempest/tests/compute/servers/test_create_server.py b/tempest/tests/compute/servers/test_create_server.py
index 8964fc2..4fe4284 100644
--- a/tempest/tests/compute/servers/test_create_server.py
+++ b/tempest/tests/compute/servers/test_create_server.py
@@ -16,6 +16,7 @@
 #    under the License.
 
 import base64
+import nose
 
 from nose.plugins.attrib import attr
 import unittest2 as unittest