Add config options for XML support in Keystone

This will allow us to remove XML support from Keystone in Kilo, but keep
testing XML support for previous releases.

Devstack patch for stable/icehouse:
  Ibb402640c5b744f1ea38ce548994079996c72508

Devstack patch for stable/juno:
  I576c93303575812c44afa36ad18205ecbc494e5f

Change-Id: I823fda34081f28863fcc6a3889f5f04a87134b38
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index d5311a9..a6dd0af 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -629,6 +629,9 @@
 # (boolean value)
 #trust = true
 
+# If false, skip all identity api tests with xml (boolean value)
+#xml_api = false
+
 
 [image]
 
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 1e4973b..244323e 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -31,6 +31,9 @@
     @classmethod
     def resource_setup(cls):
         super(BaseIdentityAdminTest, cls).resource_setup()
+        if getattr(cls, '_interface', None) == 'xml':
+            if not CONF.identity_feature_enabled.xml_api:
+                raise cls.skipException('XML API is not enabled')
         cls.os_adm = clients.AdminManager(interface=cls._interface)
         cls.os = clients.Manager(interface=cls._interface)
 
diff --git a/tempest/config.py b/tempest/config.py
index 163817c..77e8fff 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -143,6 +143,9 @@
     cfg.BoolOpt('api_v3',
                 default=True,
                 help='Is the v3 identity API enabled'),
+    cfg.BoolOpt('xml_api',
+                default=False,
+                help='If false, skip all identity api tests with xml'),
 ]
 
 compute_group = cfg.OptGroup(name='compute',