Add a config option to select compute xml api

This commit adds a config option to select whether the nova v2 api
has xml enabled.

Change-Id: I5db2b782e71d99705c9f071a14ab850afbeddeb8
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 96ef11a..b9dab26 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -386,6 +386,9 @@
 # If false, skip all nova v3 tests. (boolean value)
 #api_v3=false
 
+# If false skip all v2 api tests with xml (boolean value)
+#xml_api_v2=true
+
 # If false, skip disk config tests (boolean value)
 #disk_config=true
 
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index a3295eb..343a39a 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -37,6 +37,9 @@
     def setUpClass(cls):
         cls.set_network_resources()
         super(BaseComputeTest, cls).setUpClass()
+        if getattr(cls, '_interface', None) == 'xml' and cls._api_version == 2:
+            if not CONF.compute_feature_enabled.xml_api_v2:
+                raise cls.skipException('XML API is not enabled')
 
         # TODO(andreaf) WE should care also for the alt_manager here
         # but only once client lazy load in the manager is done
diff --git a/tempest/config.py b/tempest/config.py
index 7d195bf..2f6aa27 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -261,6 +261,9 @@
     cfg.BoolOpt('api_v3',
                 default=False,
                 help="If false, skip all nova v3 tests."),
+    cfg.BoolOpt('xml_api_v2',
+                default=True,
+                help="If false skip all v2 api tests with xml"),
     cfg.BoolOpt('disk_config',
                 default=True,
                 help="If false, skip disk config tests"),