diff --git a/HACKING.rst b/HACKING.rst
index e57b670..7363e7f 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -8,7 +8,8 @@
 Tempest Specific Commandments
 ------------------------------
 
-- [T102] Cannot import OpenStack python clients in tempest/api tests
+- [T102] Cannot import OpenStack python clients in tempest/api &
+         tempest/scenario tests
 - [T104] Scenario tests require a services decorator
 - [T105] Unit tests cannot use setUpClass
 - [T106] vim configuration should not be kept in source files.
@@ -110,9 +111,9 @@
 Negative Tests
 --------------
 Newly added negative tests should use the negative test framework. First step
-is to create an interface description in a json file under `etc/schemas`.
-These descriptions consists of two important sections for the test
-(one of those is mandatory):
+is to create an interface description in a python file under
+`tempest/api_schema/request/`. These descriptions consists of two important
+sections for the test (one of those is mandatory):
 
  - A resource (part of the URL of the request): Resources needed for a test
  must be created in `setUpClass` and registered with `set_resource` e.g.:
@@ -125,21 +126,17 @@
 
     load_tests = test.NegativeAutoTest.load_tests
 
-    class SampeTestNegativeTestJSON(<your base class>, test.NegativeAutoTest):
-        _interface = 'json'
+    @test.SimpleNegativeAutoTest
+    class SampleTestNegativeTestJSON(<your base class>, test.NegativeAutoTest):
         _service = 'compute'
-        _schema_file = <your Schema file>
+        _schema = <your schema file>
 
-Negative tests must be marked with a negative attribute::
-
-    @test.attr(type=['negative', 'gate'])
-    def test_get_console_output(self):
-        self.execute(self._schema_file)
+The class decorator `SimpleNegativeAutoTest` will automatically generate test
+cases out of the given schema in the attribute `_schema`.
 
 All negative tests should be added into a separate negative test file.
 If such a file doesn't exist for the particular resource being tested a new
-test file should be added. Old XML based negative tests can be kept but should
-be renamed to `_xml.py`.
+test file should be added.
 
 Test skips because of Known Bugs
 --------------------------------
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 0f2b2cf..3c6eb44 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -78,7 +78,7 @@
 #
 
 # List of logger=LEVEL pairs. (list value)
-#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN
+#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN
 
 # Enables or disables fatal status of deprecations. (boolean value)
 #fatal_deprecations = false
@@ -467,9 +467,6 @@
 # [nova.vnc]->vnc_enabled in nova.conf (boolean value)
 #vnc_console = false
 
-# If false skip all v2 api tests with xml (boolean value)
-#xml_api_v2 = true
-
 
 [dashboard]
 
@@ -581,6 +578,10 @@
 # (string value)
 #auth_version = v2
 
+# Specify a CA bundle file to use in verifying a TLS (https) server
+# certificate. (string value)
+#ca_certificates_file = <None>
+
 # Catalog type of the Identity service. (string value)
 #catalog_type = identity
 
@@ -632,9 +633,6 @@
 # (boolean value)
 #trust = true
 
-# If false, skip all identity api tests with xml (boolean value)
-#xml_api = false
-
 
 [image]
 
@@ -810,9 +808,6 @@
 # attributes ipv6_ra_mode and ipv6_address_mode (boolean value)
 #ipv6_subnet_attributes = false
 
-# If false, skip all network api tests with xml (boolean value)
-#xml_api = false
-
 
 [object-storage]
 
diff --git a/requirements.txt b/requirements.txt
index 1e4c40b..ce5886e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,8 +5,7 @@
 anyjson>=0.3.3
 httplib2>=0.7.5
 jsonschema>=2.0.0,<3.0.0
-testtools>=0.9.36,!=1.2.0,!=1.4.0
-lxml>=2.3
+testtools>=0.9.36,!=1.2.0
 boto>=2.32.1
 paramiko>=1.13.0
 netaddr>=0.7.12
diff --git a/tempest/README.rst b/tempest/README.rst
index fb25151..d28c3f9 100644
--- a/tempest/README.rst
+++ b/tempest/README.rst
@@ -55,7 +55,8 @@
 functionality. They are typically a series of steps where complicated
 state requiring multiple services is set up exercised, and torn down.
 
-Scenario tests can and should use the OpenStack python clients.
+Scenario tests should not use the existing python clients for OpenStack,
+but should instead use the tempest implementations of clients.
 
 
 :ref:`stress_field_guide`
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index f33089c..7c2e604 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -221,9 +221,3 @@
                                                wait_until='ACTIVE')
         resp, body = admin_servers_client.get_server(server['id'])
         self.assertEqual(self.host, body[self._host_key])
-
-
-class AggregatesAdminTestXML(AggregatesAdminTestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index ef6752b..219d12e 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -186,7 +186,3 @@
 
         self.assertRaises(exceptions.NotFound, self.client.remove_host,
                           aggregate['id'], non_exist_host)
-
-
-class AggregatesAdminNegativeTestXML(AggregatesAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 0a040d7..068a710 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -46,7 +46,3 @@
 
 class AZAdminV2TestJSON(AZAdminV3Test):
     _api_version = 2
-
-
-class AZAdminV2TestXML(AZAdminV2TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_availability_zone_negative.py b/tempest/api/compute/admin/test_availability_zone_negative.py
index ea157b3..d062b0c 100644
--- a/tempest/api/compute/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/admin/test_availability_zone_negative.py
@@ -35,7 +35,3 @@
         self.assertRaises(
             exceptions.Unauthorized,
             self.non_adm_client.get_availability_zone_list_detail)
-
-
-class AZAdminNegativeTestXML(AZAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index e7f269d..d1d13a0 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -58,7 +58,3 @@
         body = {"unreserve": "None"}
         resp, body = self.client.reserve_fixed_ip(self.ip, body)
         self.assertEqual(resp.status, 202)
-
-
-class FixedIPsTestXml(FixedIPsTestJson):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
index 8d6a7fc..e7022db 100644
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ b/tempest/api/compute/admin/test_fixed_ips_negative.py
@@ -82,7 +82,3 @@
         self.assertRaises(exceptions.BadRequest,
                           self.client.reserve_fixed_ip,
                           self.ip, body)
-
-
-class FixedIPsNegativeTestXml(FixedIPsNegativeTestJson):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 3307159..1953040 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -308,7 +308,3 @@
         self.assertEqual(flavor['disk'], self.disk)
         self.assertEqual(flavor['ram'], int(ram))
         self.assertEqual(int(flavor['id']), new_flavor_id)
-
-
-class FlavorsAdminTestXML(FlavorsAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 176a134..19707d0 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -96,7 +96,3 @@
         resp, flavors = self.flavors_client.list_flavors_with_detail()
         self.assertEqual(resp.status, 200)
         self.assertNotIn(new_flavor['id'], map(lambda x: x['id'], flavors))
-
-
-class FlavorsAdminTestXML(FlavorsAccessTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index 9cc2a92..c49652d 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -135,7 +135,3 @@
                           self.client.remove_flavor_access,
                           new_flavor['id'],
                           str(uuid.uuid4()))
-
-
-class FlavorsAdminNegativeTestXML(FlavorsAccessNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index c05abe2..5157d2e 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -121,7 +121,3 @@
         self.assertEqual(resp.status, 200)
         self.assertEqual(body['key1'], 'value1')
         self.assertNotIn('key2', body)
-
-
-class FlavorsExtraSpecsTestXML(FlavorsExtraSpecsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index 30adf73..20860c8 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -125,7 +125,3 @@
                           "key1",
                           key1="value",
                           key2="value")
-
-
-class FlavorsExtraSpecsNegativeTestXML(FlavorsExtraSpecsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors_negative.py b/tempest/api/compute/admin/test_flavors_negative.py
index 5bc3d10..fb27360 100644
--- a/tempest/api/compute/admin/test_flavors_negative.py
+++ b/tempest/api/compute/admin/test_flavors_negative.py
@@ -18,9 +18,13 @@
 from tempest.api.compute import base
 from tempest.api_schema.request.compute.v2 import flavors
 from tempest.common.utils import data_utils
+from tempest import config
 from tempest import exceptions
 from tempest import test
 
+
+CONF = config.CONF
+
 load_tests = test.NegativeAutoTest.load_tests
 
 
@@ -106,5 +110,5 @@
 class FlavorCreateNegativeTestJSON(base.BaseV2ComputeAdminTest,
                                    test.NegativeAutoTest):
     _interface = 'json'
-    _service = 'compute'
+    _service = CONF.compute.catalog_type
     _schema = flavors.flavor_create
diff --git a/tempest/api/compute/admin/test_flavors_negative_xml.py b/tempest/api/compute/admin/test_flavors_negative_xml.py
deleted file mode 100644
index a06b0e6..0000000
--- a/tempest/api/compute/admin/test_flavors_negative_xml.py
+++ /dev/null
@@ -1,268 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import uuid
-
-from tempest.api.compute.admin import test_flavors_negative
-from tempest.common.utils import data_utils
-from tempest import exceptions
-from tempest import test
-
-
-class FlavorsAdminNegativeTestXML(test_flavors_negative.
-                                  FlavorsAdminNegativeTestJSON):
-
-    """
-    Tests Flavors API Create and Delete that require admin privileges
-    """
-
-    _interface = 'xml'
-
-    def flavor_clean_up(self, flavor_id):
-        resp, body = self.client.delete_flavor(flavor_id)
-        self.assertEqual(resp.status, 202)
-        self.client.wait_for_resource_deletion(flavor_id)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_invalid_is_public_string(self):
-        # the 'is_public' parameter can be 'none/true/false' if it exists
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.list_flavors_with_detail,
-                          {'is_public': 'invalid'})
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_using_invalid_ram(self):
-        # the 'ram' attribute must be positive integer
-        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          flavor_name, -1, self.vcpus,
-                          self.disk, new_flavor_id)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_using_invalid_vcpus(self):
-        # the 'vcpu' attribute must be positive integer
-        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          flavor_name, self.ram, -1,
-                          self.disk, new_flavor_id)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_name_length_less_than_1(self):
-        # ensure name length >= 1
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          '',
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_name_length_exceeds_255(self):
-        # ensure name do not exceed 255 characters
-        new_flavor_name = 'a' * 256
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_name(self):
-        # the regex of flavor_name is '^[\w\.\- ]*$'
-        invalid_flavor_name = data_utils.rand_name('invalid-!@#$%-')
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          invalid_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_flavor_id(self):
-        # the regex of flavor_id is '^[\w\.\- ]*$', and it cannot contain
-        # leading and/or trailing whitespace
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        invalid_flavor_id = '!@#$%'
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          invalid_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_id_length_exceeds_255(self):
-        # the length of flavor_id should not exceed 255 characters
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        invalid_flavor_id = 'a' * 256
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          invalid_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_root_gb(self):
-        # root_gb attribute should be non-negative ( >= 0) integer
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          -1,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_ephemeral_gb(self):
-        # ephemeral_gb attribute should be non-negative ( >= 0) integer
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=-1,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_swap(self):
-        # swap attribute should be non-negative ( >= 0) integer
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=-1,
-                          rxtx=self.rxtx,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_rxtx_factor(self):
-        # rxtx_factor attribute should be a positive float
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=-1.5,
-                          is_public='False')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_with_invalid_is_public(self):
-        # is_public attribute should be boolean
-        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_flavor,
-                          new_flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx,
-                          is_public='Invalid')
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_flavor_already_exists(self):
-        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
-        new_flavor_id = str(uuid.uuid4())
-
-        resp, flavor = self.client.create_flavor(flavor_name,
-                                                 self.ram, self.vcpus,
-                                                 self.disk,
-                                                 new_flavor_id,
-                                                 ephemeral=self.ephemeral,
-                                                 swap=self.swap,
-                                                 rxtx=self.rxtx)
-        self.assertEqual(200, resp.status)
-        self.addCleanup(self.flavor_clean_up, flavor['id'])
-
-        self.assertRaises(exceptions.Conflict,
-                          self.client.create_flavor,
-                          flavor_name,
-                          self.ram, self.vcpus,
-                          self.disk,
-                          new_flavor_id,
-                          ephemeral=self.ephemeral,
-                          swap=self.swap,
-                          rxtx=self.rxtx)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_delete_nonexistent_flavor(self):
-        nonexistent_flavor_id = str(uuid.uuid4())
-
-        self.assertRaises(exceptions.NotFound,
-                          self.client.delete_flavor,
-                          nonexistent_flavor_id)
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index bcae492..25965fd 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -84,7 +84,3 @@
             self.assertIsNotNone(host_resource['memory_mb'])
             self.assertIsNotNone(host_resource['project'])
             self.assertEqual(hostname, host_resource['host'])
-
-
-class HostsAdminTestXML(HostsAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index 4111aba..055219f 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -66,7 +66,6 @@
                           status='enable',
                           maintenance_mode='enable')
 
-    @test.skip_because(bug="1261964", interface="xml")
     @test.attr(type=['negative', 'gate'])
     def test_update_host_with_extra_param(self):
         # only 'status' and 'maintenance_mode' are the valid params.
@@ -167,7 +166,3 @@
         self.assertRaises(exceptions.Unauthorized,
                           self.non_admin_client.reboot_host,
                           hostname)
-
-
-class HostsAdminNegativeTestXML(HostsAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index c51d0a5..de3debb 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -128,7 +128,3 @@
             hypers[0]['hypervisor_hostname'])
         self.assertEqual(200, resp.status)
         self.assertHypervisors(hypers)
-
-
-class HypervisorAdminTestXML(HypervisorAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index d3804e8..b1f2351 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -134,7 +134,3 @@
             exceptions.Unauthorized,
             self.non_adm_client.search_hypervisor,
             hypers[0]['hypervisor_hostname'])
-
-
-class HypervisorAdminNegativeTestXML(HypervisorAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 91f0b02..f7b5e43 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -54,7 +54,3 @@
                           'period_beginning', 'num_hosts_not_run']
         for item in expected_items:
             self.assertIn(item, body)
-
-
-class InstanceUsageAuditLogTestXML(InstanceUsageAuditLogTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
index 1af340d..c4905d9 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
@@ -45,8 +45,3 @@
         self.assertRaises(exceptions.BadRequest,
                           self.adm_client.get_instance_usage_audit_log,
                           "invalid_time")
-
-
-class InstanceUsageAuditLogNegativeTestXML(
-    InstanceUsageAuditLogNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 701e1c2..7c666a2 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -152,10 +152,6 @@
         self.assertEqual(ram_default, quota_set_new['ram'])
 
 
-class QuotasAdminTestXML(QuotasAdminTestJSON):
-    _interface = 'xml'
-
-
 class QuotaClassesAdminTestJSON(base.BaseV2ComputeAdminTest):
     """Tests the os-quota-class-sets API to update default quotas.
     """
@@ -202,7 +198,3 @@
         LOG.debug("assert that the response has all of the changed values")
         self.assertThat(update_body.items(),
                         matchers.ContainsAll(body.items()))
-
-
-class QuotaClassesAdminTestXML(QuotaClassesAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index a9ed7ce..532f195 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -156,7 +156,3 @@
         self.assertRaises((exceptions.OverLimit, exceptions.Unauthorized),
                           self.sg_client.create_security_group_rule,
                           secgroup_id, ip_protocol, 1025, 1025)
-
-
-class QuotasAdminNegativeTestXML(QuotasAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index 40ae236..b4615f2 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -90,7 +90,3 @@
             self.assertEqual(sec_group['tenant_id'], client_tenant_id,
                              "Failed to get all security groups for "
                              "non admin user.")
-
-
-class SecurityGroupsTestAdminXML(SecurityGroupsTestAdminJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 47aaee3..e3477f1 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -182,9 +182,3 @@
         resp, server = self.create_test_server(sched_hints=hints,
                                                wait_until='ACTIVE')
         self.assertEqual('202', resp['status'])
-
-
-class ServersAdminTestXML(ServersAdminTestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 9aa489c..2f0af72 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -148,7 +148,3 @@
         self.assertRaises(exceptions.Conflict,
                           self.client.migrate_server,
                           server_id)
-
-
-class ServersAdminNegativeTestXML(ServersAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 76153e7..e7a39f8 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -76,7 +76,3 @@
         self.assertEqual(1, len(services))
         self.assertEqual(host_name, services[0]['host'])
         self.assertEqual(binary_name, services[0]['binary'])
-
-
-class ServicesAdminTestXML(ServicesAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index 5331097..534afc5 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -60,7 +60,3 @@
         resp, services = self.client.list_services(params)
         self.assertEqual(200, resp.status)
         self.assertEqual(0, len(services))
-
-
-class ServicesAdminNegativeTestXML(ServicesAdminNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index 5d596ba..f6553b3 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -73,7 +73,3 @@
 
         self.assertEqual(200, resp.status)
         self.assertEqual(len(tenant_usage), 8)
-
-
-class TenantUsagesTestXML(TenantUsagesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
index 5e2c593..8c31d7c 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
@@ -63,7 +63,3 @@
                   'detailed': int(bool(True))}
         self.assertRaises(exceptions.Unauthorized,
                           self.client.list_tenant_usages, params)
-
-
-class TenantUsagesNegativeTestXML(TenantUsagesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 2f53a0b..6a3ee44 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -38,9 +38,6 @@
     def resource_setup(cls):
         cls.set_network_resources()
         super(BaseComputeTest, cls).resource_setup()
-        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/api/compute/certificates/test_certificates.py b/tempest/api/compute/certificates/test_certificates.py
index 0f921c5..5c55eec 100644
--- a/tempest/api/compute/certificates/test_certificates.py
+++ b/tempest/api/compute/certificates/test_certificates.py
@@ -39,7 +39,3 @@
 
 class CertificatesV2TestJSON(CertificatesV3Test):
     _api_version = 2
-
-
-class CertificatesV2TestXML(CertificatesV2TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 7beef23..86eeba3 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -132,7 +132,3 @@
     _api_version = 2
     _min_disk = 'minDisk'
     _min_ram = 'minRam'
-
-
-class FlavorsV2TestXML(FlavorsV2TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/flavors/test_flavors_negative.py b/tempest/api/compute/flavors/test_flavors_negative.py
index cae1ac4..83f8e19 100644
--- a/tempest/api/compute/flavors/test_flavors_negative.py
+++ b/tempest/api/compute/flavors/test_flavors_negative.py
@@ -15,23 +15,26 @@
 
 from tempest.api.compute import base
 from tempest.api_schema.request.compute.v2 import flavors
+from tempest import config
 from tempest import test
 
 
+CONF = config.CONF
+
 load_tests = test.NegativeAutoTest.load_tests
 
 
 @test.SimpleNegativeAutoTest
 class FlavorsListWithDetailsNegativeTestJSON(base.BaseV2ComputeTest,
                                              test.NegativeAutoTest):
-    _service = 'compute'
+    _service = CONF.compute.catalog_type
     _schema = flavors.flavor_list
 
 
 @test.SimpleNegativeAutoTest
 class FlavorDetailsNegativeTestJSON(base.BaseV2ComputeTest,
                                     test.NegativeAutoTest):
-    _service = 'compute'
+    _service = CONF.compute.catalog_type
     _schema = flavors.flavors_details
 
     @classmethod
diff --git a/tempest/api/compute/flavors/test_flavors_negative_xml.py b/tempest/api/compute/flavors/test_flavors_negative_xml.py
deleted file mode 100644
index 299b18a..0000000
--- a/tempest/api/compute/flavors/test_flavors_negative_xml.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import uuid
-
-from tempest.api.compute import base
-from tempest import exceptions
-from tempest import test
-
-
-class FlavorsNegativeTestXML(base.BaseV2ComputeTest):
-    _interface = 'xml'
-
-    @classmethod
-    def resource_setup(cls):
-        super(FlavorsNegativeTestXML, cls).resource_setup()
-        cls.client = cls.flavors_client
-
-    @test.attr(type=['negative', 'gate'])
-    def test_invalid_minRam_filter(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.list_flavors_with_detail,
-                          {'minRam': 'invalid'})
-
-    @test.attr(type=['negative', 'gate'])
-    def test_invalid_minDisk_filter(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.list_flavors_with_detail,
-                          {'minDisk': 'invalid'})
-
-    @test.attr(type=['negative', 'gate'])
-    def test_non_existent_flavor_id(self):
-        # flavor details are not returned for non-existent flavors
-        nonexistent_flavor_id = str(uuid.uuid4())
-        self.assertRaises(exceptions.NotFound, self.client.get_flavor_details,
-                          nonexistent_flavor_id)
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 3bb7d19..db382eb 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -134,7 +134,3 @@
                            exceptions.Conflict),
                           self.client.disassociate_floating_ip_from_server,
                           self.floating_ip, self.server_id)
-
-
-class FloatingIPsTestXML(FloatingIPsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index 104d130..2b0f268 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -93,7 +93,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.client.associate_floating_ip_to_server,
                           '', self.server_id)
-
-
-class FloatingIPsNegativeTestXML(FloatingIPsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index cb93177..7af9ca7 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -79,7 +79,3 @@
         self.assertEqual(200, resp.status)
         self.assertNotEqual(0, len(floating_ip_pools),
                             "Expected floating IP Pools. Got zero.")
-
-
-class FloatingIPDetailsTestXML(FloatingIPDetailsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
index 08819c2..c343018 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
@@ -43,7 +43,3 @@
             non_exist_id = data_utils.rand_int_id(start=999)
         self.assertRaises(exceptions.NotFound,
                           self.client.get_floating_ip_details, non_exist_id)
-
-
-class FloatingIPDetailsNegativeTestXML(FloatingIPDetailsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 1fa591f..5105e2f 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -107,7 +107,3 @@
         resp, resp_metadata = self.client.list_image_metadata(self.image_id)
         expected = {'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
-
-
-class ImagesMetadataTestXML(ImagesMetadataTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index 7f0bc4e..615b5d0 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -72,7 +72,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.client.delete_image_metadata_item,
                           data_utils.rand_uuid(), 'key1')
-
-
-class ImagesMetadataTestXML(ImagesMetadataTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 68f793a..51dae65 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -47,7 +47,3 @@
                                                     wait_until='SAVING')
         resp, body = self.client.delete_image(image['id'])
         self.assertEqual('204', resp['status'])
-
-
-class ImagesTestXML(ImagesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index e406374..9570ca5 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -131,7 +131,3 @@
         # Return an error while trying to delete image with id over limit
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           '11a22b9-12a9-5555-cc11-00ab112223fa-3fac')
-
-
-class ImagesNegativeTestXML(ImagesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 459d78b..91e0423 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -99,10 +99,6 @@
 
     @test.attr(type=['gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
-        if self.__class__._interface == "xml":
-            # NOTE(sdague): not entirely accurage, but we'd need a ton of work
-            # in our XML client to make this good
-            raise self.skipException("Not testable in XML")
         # prefix character is:
         # http://www.fileformat.info/info/unicode/char/1F4A9/index.htm
 
@@ -114,7 +110,3 @@
         image_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(self.client.delete_image, image_id)
         self.assertEqual('202', resp['status'])
-
-
-class ImagesOneServerTestXML(ImagesOneServerTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index dc3d6bc..ae6e712 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -131,7 +131,3 @@
         self.image_ids.remove(image_id)
 
         self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
-
-
-class ImagesOneServerNegativeTestXML(ImagesOneServerNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 30a99dd..ceab4f9 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -263,7 +263,3 @@
         params = {'changes-since': self.image1['created']}
         resp, images = self.client.list_images_with_detail(params)
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-
-
-class ListImageFiltersTestXML(ListImageFiltersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_list_image_filters_negative.py b/tempest/api/compute/images/test_list_image_filters_negative.py
index 53a21a0..a8f2ae7 100644
--- a/tempest/api/compute/images/test_list_image_filters_negative.py
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -37,7 +37,3 @@
         nonexistent_image = data_utils.rand_uuid()
         self.assertRaises(exceptions.NotFound, self.client.get_image,
                           nonexistent_image)
-
-
-class ListImageFiltersNegativeTestXML(ListImageFiltersNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index eceac82..22d64e9 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -49,7 +49,3 @@
         resp, images = self.client.list_images_with_detail()
         found = any([i for i in images if i['id'] == self.image_ref])
         self.assertTrue(found)
-
-
-class ListImagesTestXML(ListImagesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 2f0febf..de8cab9 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -117,7 +117,3 @@
 
 class KeyPairsV2TestJSON(KeyPairsV3Test):
     _api_version = 2
-
-
-class KeyPairsV2TestXML(KeyPairsV2TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py
index 0da449b..2cc6f00 100644
--- a/tempest/api/compute/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/keypairs/test_keypairs_negative.py
@@ -93,7 +93,3 @@
         k_name = 'key_/.\@:'
         self.assertRaises(exceptions.BadRequest, self._create_keypair,
                           k_name)
-
-
-class KeyPairsNegativeTestXML(KeyPairsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/limits/test_absolute_limits.py b/tempest/api/compute/limits/test_absolute_limits.py
index bac1a39..4420ac7 100644
--- a/tempest/api/compute/limits/test_absolute_limits.py
+++ b/tempest/api/compute/limits/test_absolute_limits.py
@@ -43,7 +43,3 @@
         self.assertEqual(0, len(missing_elements),
                          "Failed to find element %s in absolute limits list"
                          % ', '.join(ele for ele in missing_elements))
-
-
-class AbsoluteLimitsTestXML(AbsoluteLimitsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/limits/test_absolute_limits_negative.py b/tempest/api/compute/limits/test_absolute_limits_negative.py
index 2b41ea0..f729436 100644
--- a/tempest/api/compute/limits/test_absolute_limits_negative.py
+++ b/tempest/api/compute/limits/test_absolute_limits_negative.py
@@ -46,7 +46,3 @@
                           name='test', meta=meta_data,
                           flavor_ref=self.flavor_ref,
                           image_ref=self.image_ref)
-
-
-class AbsoluteLimitsNegativeTestXML(AbsoluteLimitsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index 4fd5c02..be06213 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -13,8 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import six
-
 from tempest.api.compute.security_groups import base
 from tempest import config
 from tempest import test
@@ -40,13 +38,6 @@
         to_port = cls.to_port
         group = {}
         ip_range = {}
-        if cls._interface == 'xml':
-            # NOTE: An XML response is different from the one of JSON
-            # like the following.
-            from_port = six.text_type(from_port)
-            to_port = six.text_type(to_port)
-            group = {'tenant_id': 'None', 'name': 'None'}
-            ip_range = {'cidr': 'None'}
         cls.expected = {
             'id': None,
             'parent_group_id': None,
@@ -195,7 +186,3 @@
             self.client.list_security_group_rules(sg1_id)
         # The group1 has no rules because group2 has deleted
         self.assertEqual(0, len(rules))
-
-
-class SecurityGroupRulesTestXML(SecurityGroupRulesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index 7850909..88a99b9 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -162,7 +162,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.client.delete_security_group_rule,
                           non_existent_rule_id)
-
-
-class SecurityGroupRulesNegativeTestXML(SecurityGroupRulesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 82dd4f0..1cfb16b 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -155,7 +155,3 @@
             self.client.get_security_group(securitygroup_id)
         self.assertEqual(s_new_name, fetched_group['name'])
         self.assertEqual(s_new_des, fetched_group['description'])
-
-
-class SecurityGroupsTestXML(SecurityGroupsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 3101052..ce06180 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -201,7 +201,3 @@
                           self.client.update_security_group,
                           non_exist_id, name=s_name,
                           description=s_description)
-
-
-class SecurityGroupsNegativeTestXML(SecurityGroupsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index d62d19f..049736c 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -157,7 +157,3 @@
         resp, body = self.client.remove_fixed_ip(server['id'],
                                                  fixed_ip)
         self.assertEqual(202, resp.status)
-
-
-class AttachInterfacesTestXML(AttachInterfacesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index 44bd7d3..28eb274 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -38,7 +38,3 @@
 
 class AZV2TestJSON(AZV3Test):
     _api_version = 2
-
-
-class AZV2TestXML(AZV2TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index d954c01..b561b4e 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -103,7 +103,6 @@
                                                   self.password)
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
-    @test.skip_because(bug="1306367", interface="xml")
     @test.attr(type='gate')
     def test_create_server_with_scheduler_hint_group(self):
         # Create a server with the scheduler hint "group".
@@ -128,9 +127,6 @@
     @testtools.skipUnless(CONF.service_available.neutron,
                           'Neutron service must be available.')
     def test_verify_multiple_nics_order(self):
-        if getattr(self, '_interface',
-                   None) == 'xml' and not CONF.network_feature_enabled.xml_api:
-            raise self.skipException('Neutron XML API is not enabled')
         # Verify that the networks order given at the server creation is
         # preserved within the server.
         name_net1 = data_utils.rand_name(self.__class__.__name__)
@@ -279,11 +275,3 @@
             msg = "DiskConfig extension not enabled."
             raise cls.skipException(msg)
         super(ServersTestManualDisk, cls).resource_setup()
-
-
-class ServersTestXML(ServersTestJSON):
-    _interface = 'xml'
-
-
-class ServersWithSpecificFlavorTestXML(ServersWithSpecificFlavorTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 55931a4..9d1ea9e 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -169,11 +169,3 @@
         resp, _ = self.admin_client.delete_server(server['id'])
         self.assertEqual('204', resp['status'])
         self.servers_client.wait_for_server_termination(server['id'])
-
-
-class DeleteServersTestXML(DeleteServersTestJSON):
-    _interface = 'xml'
-
-
-class DeleteServersAdminTestXML(DeleteServersAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index 51f2eb4..eeef0e5 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -132,7 +132,3 @@
         # Verify the disk_config attribute is set correctly
         resp, server = self.client.get_server(server['id'])
         self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
-
-
-class ServerDiskConfigTestXML(ServerDiskConfigTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index d11ce25..80b2a69 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -47,7 +47,3 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(self.server_id, body['instance_uuid'])
         self.assertEqual('create', body['action'])
-
-
-class InstanceActionsTestXML(InstanceActionsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index c706ad5..e92f04c 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -41,7 +41,3 @@
         # Get the action details of the provided server with invalid request
         self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
                           self.server_id, '999')
-
-
-class InstanceActionsNegativeTestXML(InstanceActionsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index e660f00..5ff39df 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -143,7 +143,6 @@
         # Verify only the expected number of servers are returned
         params = {'limit': 1}
         resp, servers = self.client.list_servers(params)
-        # when _interface='xml', one element for servers_links in servers
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
     @test.attr(type='gate')
@@ -293,7 +292,3 @@
         params = {'limit': 1}
         resp, servers = self.client.list_servers_with_detail(params)
         self.assertEqual(1, len(servers['servers']))
-
-
-class ListServerFiltersTestXML(ListServerFiltersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index f4d8dda..fd66d2b 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -147,7 +147,3 @@
                   if srv['id'] in deleted_ids]
         self.assertEqual('200', resp['status'])
         self.assertEqual([], actual)
-
-
-class ListServersNegativeTestXML(ListServersNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 40b9c16..6fd2a75 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -53,7 +53,3 @@
                                                    return_reservation_id=True)
         self.assertEqual(resp['status'], '202')
         self.assertIn('reservation_id', body)
-
-
-class MultipleCreateTestXML(MultipleCreateTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_multiple_create_negative.py b/tempest/api/compute/servers/test_multiple_create_negative.py
index 3dea521..55db605 100644
--- a/tempest/api/compute/servers/test_multiple_create_negative.py
+++ b/tempest/api/compute/servers/test_multiple_create_negative.py
@@ -66,7 +66,3 @@
         self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
                           min_count=min_count,
                           max_count=max_count)
-
-
-class MultipleCreateNegativeTestXML(MultipleCreateNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index b51b46e..28deaa7 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -498,7 +498,3 @@
             self.assertEqual(console_type, body['type'])
             self.assertNotEqual('', body['url'])
             self._validate_url(body['url'])
-
-
-class ServerActionsTestXML(ServerActionsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index a494896..3d1d964 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -65,7 +65,3 @@
             addr = addr[addr_type]
             for address in addresses[addr_type]:
                 self.assertTrue(any([a for a in addr if a == address]))
-
-
-class ServerAddressesTestXML(ServerAddressesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_addresses_negative.py b/tempest/api/compute/servers/test_server_addresses_negative.py
index c7e4c89..3087e59 100644
--- a/tempest/api/compute/servers/test_server_addresses_negative.py
+++ b/tempest/api/compute/servers/test_server_addresses_negative.py
@@ -42,7 +42,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.client.list_addresses_by_network,
                           self.server['id'], 'invalid')
-
-
-class ServerAddressesNegativeTestXML(ServerAddressesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index c265352..6fd6a6d 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -113,7 +113,3 @@
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
         expected = {'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
-
-
-class ServerMetadataTestXML(ServerMetadataTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 497b94b..8b074fd 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -40,7 +40,7 @@
         for sz in [256, 257, 511, 1023]:
             key = "k" * sz
             meta = {key: 'data1'}
-            self.assertRaises(exceptions.OverLimit,
+            self.assertRaises((exceptions.BadRequest, exceptions.OverLimit),
                               self.create_test_server,
                               meta=meta)
 
@@ -155,7 +155,3 @@
         self.assertRaises(exceptions.BadRequest,
                           self.client.set_server_metadata,
                           self.server_id, meta=meta, no_metadata_field=True)
-
-
-class ServerMetadataNegativeTestXML(ServerMetadataNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index aba9bb6..994caa4 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -35,7 +35,3 @@
     def test_delete_server_password(self):
         resp, body = self.client.delete_password(self.server['id'])
         self.assertEqual(204, resp.status)
-
-
-class ServerPasswordTestXML(ServerPasswordTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index effb52f..de5b6c1 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -61,7 +61,3 @@
             })
         resp, server = self.create_test_server(personality=person)
         self.assertEqual('202', resp['status'])
-
-
-class ServerPersonalityTestXML(ServerPersonalityTestJSON):
-    _interface = "xml"
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 5986f41..ee1e268 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -117,7 +117,3 @@
         resp, body = self.servers_client.remove_security_group(self.server_id,
                                                                self.sg_name)
         self.assertEqual(202, resp.status)
-
-
-class ServerRescueTestXML(ServerRescueTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index de43164..f1e2f7f 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -148,7 +148,3 @@
                           self.servers_client.detach_volume,
                           self.server_id,
                           volume['id'])
-
-
-class ServerRescueNegativeTestXML(ServerRescueNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index d501839..aba6dff 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -124,7 +124,3 @@
         self.client.wait_for_server_status(server['id'], 'ACTIVE')
         resp, server = self.client.get_server(server['id'])
         self.assertEqual('2001:2001::3', server['accessIPv6'])
-
-
-class ServersTestXML(ServersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 0349260..4e6dcda 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -181,10 +181,6 @@
 
     @test.attr(type=['negative', 'gate'])
     def test_create_numeric_server_name(self):
-        # Create a server with a numeric name
-        if self.__class__._interface == "xml":
-            raise self.skipException("Not testable in XML")
-
         server_name = 12345
         self.assertRaises(exceptions.BadRequest,
                           self.create_test_server,
@@ -223,7 +219,7 @@
         # Pass really long metadata while creating a server
 
         metadata = {'a': 'b' * 260}
-        self.assertRaises(exceptions.OverLimit,
+        self.assertRaises((exceptions.BadRequest, exceptions.OverLimit),
                           self.create_test_server,
                           meta=metadata)
 
@@ -471,7 +467,3 @@
         self.assertRaises(exceptions.Conflict,
                           self.client.unshelve_server,
                           self.server_id)
-
-
-class ServersNegativeTestXML(ServersNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index f205761..48af084 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -50,7 +50,3 @@
             mac_address = virt_iface['mac_address']
             self.assertTrue(netaddr.valid_mac(mac_address),
                             "Invalid mac address detected.")
-
-
-class VirtualInterfacesTestXML(VirtualInterfacesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
index 1f4a20e..e81ccc6 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
@@ -38,7 +38,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.client.list_virtual_interfaces,
                           invalid_server_id)
-
-
-class VirtualInterfacesNegativeTestXML(VirtualInterfacesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 175f008..1f4f124 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -379,7 +379,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.alt_client.get_console_output,
                           self.server['id'], 10)
-
-
-class AuthorizationTestXML(AuthorizationTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/test_extensions.py b/tempest/api/compute/test_extensions.py
index 674ca9a..25e14a8 100644
--- a/tempest/api/compute/test_extensions.py
+++ b/tempest/api/compute/test_extensions.py
@@ -52,7 +52,3 @@
         resp, extension = self.extensions_client.get_extension('os-consoles')
         self.assertEqual(200, resp.status)
         self.assertEqual('os-consoles', extension['alias'])
-
-
-class ExtensionsTestXML(ExtensionsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index 86b8395..cb75d07 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -130,9 +130,3 @@
         self._migrate_server_to(server_id, target_host)
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
-
-
-class LiveBlockMigrationTestXML(LiveBlockMigrationTestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
index 95eea19..281b2b3 100644
--- a/tempest/api/compute/test_live_block_migration_negative.py
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -51,9 +51,3 @@
         self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
                           server_id, target_host)
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
-
-
-class LiveBlockMigrationNegativeTestXML(LiveBlockMigrationNegativeTestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index e66b652..4177751 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -76,7 +76,3 @@
         resp, tenant_quota_set = self.client.get_quota_set(self.tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(defualt_quota_set, tenant_quota_set)
-
-
-class QuotasTestXML(QuotasTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 75f9795..1d22fbd 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -111,7 +111,6 @@
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
 
-    @test.skip_because(bug="1323591", interface="xml")
     @test.attr(type='gate')
     def test_list_get_volume_attachments(self):
         # Create Server, Volume and attach that Volume to Server
@@ -129,7 +128,3 @@
         self.assertEqual(self.server['id'], body['serverId'])
         self.assertEqual(self.volume['id'], body['volumeId'])
         self.assertEqual(self.attachment['id'], body['id'])
-
-
-class AttachVolumeTestXML(AttachVolumeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 4f77fa7..d441427 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -71,7 +71,3 @@
                         matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
-
-
-class VolumesGetTestXML(VolumesGetTestJSON):
-    _interface = "xml"
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index dc54c67..6bf9519 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -165,7 +165,3 @@
                              all_vol_list[index + params['offset']]['id'],
                              "Failed to list volume details by "
                              "offset and limit")
-
-
-class VolumesTestXML(VolumesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index ad94ea7..f0f9879 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -98,7 +98,3 @@
     def test_delete_volume_without_passing_volume_id(self):
         # Negative: Should not be able to delete volume when empty ID is passed
         self.assertRaises(exceptions.NotFound, self.client.delete_volume, '')
-
-
-class VolumesNegativeTestXML(VolumesNegativeTest):
-    _interface = "xml"
diff --git a/tempest/api/identity/admin/test_roles.py b/tempest/api/identity/admin/test_roles.py
index d87d5c1..fabc0ed 100644
--- a/tempest/api/identity/admin/test_roles.py
+++ b/tempest/api/identity/admin/test_roles.py
@@ -105,7 +105,3 @@
         self.client.assign_user_role(tenant['id'], user['id'], role['id'])
         _, roles = self.client.list_user_roles(tenant['id'], user['id'])
         self.assert_role_in_role_list(role, roles)
-
-
-class RolesTestXML(RolesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index 37a981e..d0eb334 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -223,7 +223,3 @@
                               user['id'])
         finally:
             self.client.auth_provider.clear_auth()
-
-
-class RolesTestXML(RolesNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_services.py b/tempest/api/identity/admin/test_services.py
index a9782a9..b8f09ad 100644
--- a/tempest/api/identity/admin/test_services.py
+++ b/tempest/api/identity/admin/test_services.py
@@ -98,7 +98,3 @@
         _, body = self.client.list_services()
         found = [serv for serv in body if serv['id'] in service_ids]
         self.assertEqual(len(found), len(services), 'Services not found')
-
-
-class ServicesTestXML(ServicesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_tenant_negative.py b/tempest/api/identity/admin/test_tenant_negative.py
index dcfacee..57a2fec 100644
--- a/tempest/api/identity/admin/test_tenant_negative.py
+++ b/tempest/api/identity/admin/test_tenant_negative.py
@@ -135,7 +135,3 @@
         self.assertRaises(exceptions.Unauthorized, self.client.update_tenant,
                           tenant['id'])
         self.client.auth_provider.clear_auth()
-
-
-class TenantsNegativeTestXML(TenantsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_tenants.py b/tempest/api/identity/admin/test_tenants.py
index 8d3b402..778bd5c 100644
--- a/tempest/api/identity/admin/test_tenants.py
+++ b/tempest/api/identity/admin/test_tenants.py
@@ -178,7 +178,3 @@
 
         self.client.delete_tenant(t_id)
         self.data.tenants.remove(tenant)
-
-
-class TenantsTestXML(TenantsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_tokens.py b/tempest/api/identity/admin/test_tokens.py
index 2c5fb74..bfdc7d6 100644
--- a/tempest/api/identity/admin/test_tokens.py
+++ b/tempest/api/identity/admin/test_tokens.py
@@ -104,7 +104,3 @@
         # Use the unscoped token to get a token scoped to tenant2
         _, body = self.token_client.auth_token(token_id,
                                                tenant=tenant2_name)
-
-
-class TokensTestXML(TokensTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index 66a1737..84a8103 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -206,7 +206,3 @@
         _, body = self.token_client.auth(self.data.test_user, new_pass,
                                          self.data.test_tenant)
         self.assertTrue('id' in body['token'])
-
-
-class UsersTestXML(UsersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index bad2b89..c039da6 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -227,7 +227,3 @@
         for invalid in invalid_id:
             self.assertRaises(exceptions.NotFound,
                               self.client.list_users_for_tenant, invalid)
-
-
-class UsersNegativeTestXML(UsersNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 7a0edb0..9b30166 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -105,7 +105,3 @@
         self.assertEqual(0, len(missing_creds),
                          "Failed to find cred %s in fetched list" %
                          ', '.join(m_cred for m_cred in missing_creds))
-
-
-class CredentialsTestXML(CredentialsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 5b73df1..286ef97 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -85,7 +85,3 @@
         self.assertEqual(new_name, fetched_domain['name'])
         self.assertEqual(new_desc, fetched_domain['description'])
         self.assertEqual('true', str(fetched_domain['enabled']).lower())
-
-
-class DomainsTestXML(DomainsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 676f101..6044d2b 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -122,7 +122,3 @@
         self.assertEqual(url2, endpoint['url'])
         self.assertEqual(region2, endpoint['region'])
         self.assertEqual('false', str(endpoint['enabled']).lower())
-
-
-class EndPointsTestXML(EndPointsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index b987d12..4308d44 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -88,7 +88,3 @@
     def test_update_with_enabled_True(self):
         # Enabled should be a boolean, not a string like 'True'
         self._assert_update_raises_bad_request('True')
-
-
-class EndpointsNegativeTestXML(EndpointsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 987a9d5..3f2069d 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -91,7 +91,3 @@
         _, user_groups = self.client.list_user_groups(user['id'])
         self.assertEqual(sorted(groups), sorted(user_groups))
         self.assertEqual(2, len(user_groups))
-
-
-class GroupsV3TestXML(GroupsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py
index be06c7f..2065de3 100644
--- a/tempest/api/identity/admin/v3/test_list_projects.py
+++ b/tempest/api/identity/admin/v3/test_list_projects.py
@@ -67,7 +67,3 @@
         resp, body = self.client.list_projects(params)
         self.assertIn(self.p1[key], map(lambda x: x[key], body))
         self.assertNotIn(self.p2[key], map(lambda x: x[key], body))
-
-
-class ListProjectsTestXML(ListProjectsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index 903ad5c..70c8ec6 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -94,7 +94,3 @@
         self.assertEqual(self.data.v3_users[0]['name'], user['name'])
         self.assertEqual(self.alt_email, user['email'])
         self.assertEqual(self.data.domain['id'], user['domain_id'])
-
-
-class UsersV3TestXML(UsersV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 65c5230..23df13d 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -32,13 +32,13 @@
         for _ in range(3):
             blob = data_utils.rand_name('BlobName-')
             policy_type = data_utils.rand_name('PolicyType-')
-            resp, policy = self.policy_client.create_policy(blob,
-                                                            policy_type)
+            policy = self.policy_client.create_policy(blob,
+                                                      policy_type)
             # Delete the Policy at the end of this method
             self.addCleanup(self._delete_policy, policy['id'])
             policy_ids.append(policy['id'])
         # List and Verify Policies
-        _, body = self.policy_client.list_policies()
+        body = self.policy_client.list_policies()
         for p in body:
             fetched_ids.append(p['id'])
         missing_pols = [p for p in policy_ids if p not in fetched_ids]
@@ -49,7 +49,7 @@
         # Test to update policy
         blob = data_utils.rand_name('BlobName-')
         policy_type = data_utils.rand_name('PolicyType-')
-        _, policy = self.policy_client.create_policy(blob, policy_type)
+        policy = self.policy_client.create_policy(blob, policy_type)
         self.addCleanup(self._delete_policy, policy['id'])
         self.assertIn('id', policy)
         self.assertIn('type', policy)
@@ -59,18 +59,14 @@
         self.assertEqual(policy_type, policy['type'])
         # Update policy
         update_type = data_utils.rand_name('UpdatedPolicyType-')
-        _, data = self.policy_client.update_policy(
+        data = self.policy_client.update_policy(
             policy['id'], type=update_type)
         self.assertIn('type', data)
         # Assertion for updated value with fetched value
-        _, fetched_policy = self.policy_client.get_policy(policy['id'])
+        fetched_policy = self.policy_client.get_policy(policy['id'])
         self.assertIn('id', fetched_policy)
         self.assertIn('blob', fetched_policy)
         self.assertIn('type', fetched_policy)
         self.assertEqual(fetched_policy['id'], policy['id'])
         self.assertEqual(fetched_policy['blob'], policy['blob'])
         self.assertEqual(update_type, fetched_policy['type'])
-
-
-class PoliciesTestXML(PoliciesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 5890eab..e7fd2b5 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -176,7 +176,3 @@
         self.assertEqual(project['id'],
                          new_user_get['project_id'])
         self.assertEqual(u_email, new_user_get['email'])
-
-
-class ProjectsTestXML(ProjectsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
index 9e8f613..da35ace 100644
--- a/tempest/api/identity/admin/v3/test_projects_negative.py
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -74,7 +74,3 @@
         # Attempt to delete a non existent project should fail
         self.assertRaises(exceptions.NotFound, self.client.delete_project,
                           data_utils.rand_uuid_hex())
-
-
-class ProjectsNegativeTestXML(ProjectsNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index c5d5824..4305060 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -89,7 +89,3 @@
         self.assertEqual(0, len(missing_regions),
                          "Failed to find region %s in fetched list" %
                          ', '.join(str(e) for e in missing_regions))
-
-
-class RegionsTestXML(RegionsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 5e14a04..3c0a180 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -173,7 +173,3 @@
         _, body = self.client.list_roles()
         found = [role for role in body if role in self.data.v3_roles]
         self.assertEqual(len(found), len(self.data.v3_roles))
-
-
-class RolesV3TestXML(RolesV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index 7e21cc3..a871f17 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -91,7 +91,3 @@
         fetched_ids = [service['id'] for service in services]
         found = [s for s in fetched_ids if s in service_ids]
         self.assertEqual(len(found), len(service_ids))
-
-
-class ServicesTestXML(ServicesTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 230e09f..aef8239 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -145,7 +145,3 @@
                          token_auth['token']['project']['id'])
         self.assertEqual(project2['name'],
                          token_auth['token']['project']['name'])
-
-
-class TokensV3TestXML(TokensV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 898bcd0..1b003c3 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -144,7 +144,3 @@
         self.data.setup_test_v3_user()
         _, user = self.client.get_user(self.data.v3_user['id'])
         self.assertEqual(self.data.v3_user['id'], user['id'])
-
-
-class UsersV3TestXML(UsersV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 244323e..1e4973b 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -31,9 +31,6 @@
     @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/api/identity/test_extension.py b/tempest/api/identity/test_extension.py
index a06ee53..829628a 100644
--- a/tempest/api/identity/test_extension.py
+++ b/tempest/api/identity/test_extension.py
@@ -30,7 +30,3 @@
         for value in body:
             for key in keys:
                 self.assertIn(key, value)
-
-
-class ExtensionTestXML(ExtensionTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 74baba6..76b6f17 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -15,7 +15,7 @@
 import cStringIO as StringIO
 
 from tempest import clients
-from tempest.common import isolated_creds
+from tempest.common import credentials
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
@@ -36,7 +36,7 @@
         super(BaseImageTest, cls).resource_setup()
         cls.created_images = []
         cls._interface = 'json'
-        cls.isolated_creds = isolated_creds.IsolatedCreds(
+        cls.isolated_creds = credentials.get_isolated_credentials(
             cls.__name__, network_resources=cls.network_resources)
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index 0d27afa..53b9ddd 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -83,7 +83,3 @@
         origin_agent = {'description': description}
         self.admin_client.update_agent(agent_id=self.agent['id'],
                                        agent_info=origin_agent)
-
-
-class AgentManagementTestXML(AgentManagementTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index 78f211d..a938fa6 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -93,7 +93,3 @@
                                                               network_id)
         self.assertTrue(self._check_network_in_dhcp_agent(
             network_id, agent))
-
-
-class DHCPAgentSchedulersTestXML(DHCPAgentSchedulersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 5e6d8f3..75ee217 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -118,7 +118,3 @@
                          (s['id'] for s in subnet_list))
         # Removes subnet from the cleanup list
         self.subnets.remove(subnet)
-
-
-class ExternalNetworksTestXML(ExternalNetworksTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py
index 46c5e76..2fe7bf8 100644
--- a/tempest/api/network/admin/test_floating_ips_admin_actions.py
+++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py
@@ -63,7 +63,3 @@
         self.assertNotIn(floating_ip_admin['floatingip']['id'],
                          floating_ip_ids)
         self.assertNotIn(floating_ip_alt['id'], floating_ip_ids)
-
-
-class FloatingIPAdminTestXML(FloatingIPAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index 567af24..8fccb1f 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -76,7 +76,3 @@
             router['router']['id'])
         # NOTE(afazekas): The deletion not asserted, because neutron
         # is not forbidden to reschedule the router to the same agent
-
-
-class L3AgentSchedulerTestXML(L3AgentSchedulerTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
index 1476f30..03296a4 100644
--- a/tempest/api/network/admin/test_lbaas_agent_scheduler.py
+++ b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
@@ -69,7 +69,3 @@
         _, body = self.admin_client.show_lbaas_agent_hosting_pool(
             self.pool['id'])
         self.assertEqual('Loadbalancer agent', body['agent']['agent_type'])
-
-
-class LBaaSAgentSchedulerTestXML(LBaaSAgentSchedulerTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/admin/test_load_balancer_admin_actions.py b/tempest/api/network/admin/test_load_balancer_admin_actions.py
index 6d115e8..15d06e3 100644
--- a/tempest/api/network/admin/test_load_balancer_admin_actions.py
+++ b/tempest/api/network/admin/test_load_balancer_admin_actions.py
@@ -109,7 +109,3 @@
         self.addCleanup(self.admin_client.delete_member, member['id'])
         self.assertIsNotNone(member['id'])
         self.assertEqual(self.tenant_id, member['tenant_id'])
-
-
-class LoadBalancerAdminTestXML(LoadBalancerAdminTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 4b5f107..b13dd22 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -62,9 +62,6 @@
         super(BaseNetworkTest, cls).resource_setup()
         if not CONF.service_available.neutron:
             raise cls.skipException("Neutron support is required")
-        if getattr(cls, '_interface', None) == 'xml':
-            if not CONF.network_feature_enabled.xml_api:
-                raise cls.skipException('XML API is not enabled')
         if cls._ip_version == 6 and not CONF.network_feature_enabled.ipv6:
             raise cls.skipException("IPv6 Tests are disabled.")
 
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index a1166c8..7b7a5db 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -129,7 +129,3 @@
 
 class AllowedAddressPairIpV6TestJSON(AllowedAddressPairTestJSON):
     _ip_version = 6
-
-
-class AllowedAddressPairTestXML(AllowedAddressPairTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py
index 715136c..1c7feb3 100644
--- a/tempest/api/network/test_extensions.py
+++ b/tempest/api/network/test_extensions.py
@@ -73,7 +73,3 @@
         for e in expected_alias:
             if test.is_extension_enabled(e, 'network'):
                 self.assertIn(e, actual_alias)
-
-
-class ExtensionsTestXML(ExtensionsTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 52672ea..9beae0a 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -213,7 +213,3 @@
         update_floating_ip = body['floatingip']
         self.assertEqual(update_floating_ip['fixed_ip_address'],
                          list_ips[1])
-
-
-class FloatingIPTestXML(FloatingIPTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_fwaas_extensions.py b/tempest/api/network/test_fwaas_extensions.py
index 8e2b7f5..12b8887 100644
--- a/tempest/api/network/test_fwaas_extensions.py
+++ b/tempest/api/network/test_fwaas_extensions.py
@@ -254,7 +254,3 @@
             fw_policy_id)
         return [ruleid for ruleid in fw_policy['firewall_policy']
                 ['firewall_rules']]
-
-
-class FWaaSExtensionTestXML(FWaaSExtensionTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index 8b8e3b1..41294f6 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -424,7 +424,3 @@
 
 class LoadBalancerIpV6TestJSON(LoadBalancerTestJSON):
     _ip_version = 6
-
-
-class LoadBalancerTestXML(LoadBalancerTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
index 07ebd8c..daf9948 100644
--- a/tempest/api/network/test_metering_extensions.py
+++ b/tempest/api/network/test_metering_extensions.py
@@ -147,7 +147,3 @@
 
 class MeteringIpV6JSON(MeteringJSON):
     _ip_version = 6
-
-
-class MeteringXML(MeteringJSON):
-    interface = 'xml'
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index be23a82..ccc489e 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -370,10 +370,6 @@
         self.assertEmpty(subnets, "Public subnets visible")
 
 
-class NetworksTestXML(NetworksTestJSON):
-    _interface = 'xml'
-
-
 class BulkNetworkOpsTestJSON(base.BaseNetworkTest):
     _interface = 'json'
 
@@ -495,10 +491,6 @@
             self.assertIn(n['id'], ports_list)
 
 
-class BulkNetworkOpsTestXML(BulkNetworkOpsTestJSON):
-    _interface = 'xml'
-
-
 class NetworksIpV6TestJSON(NetworksTestJSON):
     _ip_version = 6
 
@@ -577,7 +569,3 @@
         self._create_verify_delete_subnet(
             ipv6_ra_mode='dhcpv6-stateless',
             ipv6_address_mode='dhcpv6-stateless')
-
-
-class NetworksIpV6TestXML(NetworksIpV6TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index 53dfc52..bc3ab68 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -52,7 +52,3 @@
         non_exist_id = data_utils.rand_name('network')
         self.assertRaises(exceptions.NotFound, self.client.delete_network,
                           non_exist_id)
-
-
-class NetworksNegativeTestXML(NetworksNegativeTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 7c5bdfe..a03e587 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -186,9 +186,22 @@
             [data_utils.rand_name('secgroup'),
              data_utils.rand_name('secgroup')])
 
-
-class PortsTestXML(PortsTestJSON):
-    _interface = 'xml'
+    @test.attr(type='smoke')
+    def test_create_show_delete_port_user_defined_mac(self):
+        # Create a port for a legal mac
+        _, body = self.client.create_port(network_id=self.network['id'])
+        old_port = body['port']
+        free_mac_address = old_port['mac_address']
+        self.client.delete_port(old_port['id'])
+        # Create a new port with user defined mac
+        _, body = self.client.create_port(network_id=self.network['id'],
+                                          mac_address=free_mac_address)
+        self.addCleanup(self.client.delete_port, body['port']['id'])
+        port = body['port']
+        _, body = self.client.show_port(port['id'])
+        show_port = body['port']
+        self.assertEqual(free_mac_address,
+                         show_port['mac_address'])
 
 
 class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
@@ -267,25 +280,13 @@
                          show_port['binding:vif_details'])
 
 
-class PortsAdminExtendedAttrsTestXML(PortsAdminExtendedAttrsTestJSON):
-    _interface = 'xml'
-
-
 class PortsIpV6TestJSON(PortsTestJSON):
     _ip_version = 6
     _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
     _tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
 
 
-class PortsIpV6TestXML(PortsIpV6TestJSON):
-    _interface = 'xml'
-
-
 class PortsAdminExtendedAttrsIpV6TestJSON(PortsAdminExtendedAttrsTestJSON):
     _ip_version = 6
     _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
     _tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
-
-
-class PortsAdminExtendedAttrsIpV6TestXML(PortsAdminExtendedAttrsIpV6TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index 47f2b52..b995b1d 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -212,15 +212,25 @@
                                                 port_range_max,
                                                 remote_ip_prefix=ip_prefix)
 
-
-class SecGroupTestXML(SecGroupTest):
-    _interface = 'xml'
+    @test.attr(type='smoke')
+    def test_create_security_group_rule_with_protocol_integer_value(self):
+        # Verify creating security group rule with the
+        # protocol as integer value
+        # arguments : "protocol": 17
+        group_create_body, _ = self._create_security_group()
+        direction = 'ingress'
+        protocol = 17
+        security_group_id = group_create_body['security_group']['id']
+        _, rule_create_body = self.client.create_security_group_rule(
+            security_group_id=security_group_id,
+            direction=direction,
+            protocol=protocol
+        )
+        sec_group_rule = rule_create_body['security_group_rule']
+        self.assertEqual(sec_group_rule['direction'], direction)
+        self.assertEqual(int(sec_group_rule['protocol']), protocol)
 
 
 class SecGroupIPv6Test(SecGroupTest):
     _ip_version = 6
     _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
-
-
-class SecGroupIPv6TestXML(SecGroupIPv6Test):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index 42f7f71..b9e8666 100644
--- a/tempest/api/network/test_security_groups_negative.py
+++ b/tempest/api/network/test_security_groups_negative.py
@@ -138,6 +138,7 @@
 
         # Create rule for icmp protocol with invalid ports
         states = [(1, 256, 'Invalid value for ICMP code'),
+                  (None, 6, 'ICMP type (port-range-min) is missing'),
                   (300, 1, 'Invalid value for ICMP type')]
         for pmin, pmax, msg in states:
             ex = self.assertRaises(
@@ -189,14 +190,6 @@
                           direction='ingress', ethertype=self.ethertype)
 
 
-class NegativeSecGroupTestXML(NegativeSecGroupTest):
-    _interface = 'xml'
-
-
 class NegativeSecGroupIPv6Test(NegativeSecGroupTest):
     _ip_version = 6
     _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
-
-
-class NegativeSecGroupIPv6TestXML(NegativeSecGroupIPv6Test):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_service_type_management.py b/tempest/api/network/test_service_type_management.py
index 302069f..6695f47 100644
--- a/tempest/api/network/test_service_type_management.py
+++ b/tempest/api/network/test_service_type_management.py
@@ -28,7 +28,3 @@
     def test_service_provider_list(self):
         _, body = self.client.list_service_providers()
         self.assertIsInstance(body['service_providers'], list)
-
-
-class ServiceTypeManagementTestXML(ServiceTypeManagementTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
index 96b9804..46f10c4 100644
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ b/tempest/api/network/test_vpnaas_extensions.py
@@ -313,7 +313,3 @@
         _, body = self.client.show_ipsecpolicy(self.ipsecpolicy['id'])
         ipsecpolicy = body['ipsecpolicy']
         self._assertExpected(self.ipsecpolicy, ipsecpolicy)
-
-
-class VPNaaSTestXML(VPNaaSTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index 2e39cf9..7fabb7d 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -16,8 +16,8 @@
 
 from tempest.api.identity import base
 from tempest import clients
+from tempest.common import credentials
 from tempest.common import custom_matchers
-from tempest.common import isolated_creds
 from tempest import config
 from tempest import exceptions
 import tempest.test
@@ -34,7 +34,7 @@
         if not CONF.service_available.swift:
             skip_msg = ("%s skipped as swift is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
-        cls.isolated_creds = isolated_creds.IsolatedCreds(
+        cls.isolated_creds = credentials.get_isolated_credentials(
             cls.__name__, network_resources=cls.network_resources)
         # Get isolated creds for normal user
         cls.os = clients.Manager(cls.isolated_creds.get_primary_creds())
diff --git a/tempest/api/orchestration/stacks/templates/non_empty_stack.yaml b/tempest/api/orchestration/stacks/templates/non_empty_stack.yaml
index 8690941..4f9df91 100644
--- a/tempest/api/orchestration/stacks/templates/non_empty_stack.yaml
+++ b/tempest/api/orchestration/stacks/templates/non_empty_stack.yaml
@@ -7,6 +7,8 @@
     Default: not_yet
   image:
     Type: String
+  flavor:
+    Type: String
 Resources:
   fluffy:
     Type: AWS::AutoScaling::LaunchConfiguration
@@ -16,7 +18,7 @@
       - Stinky
     Properties:
       ImageId: {Ref: image}
-      InstanceType: not_used
+      InstanceType: {Ref: flavor}
       UserData:
         Fn::Replace:
         - variable_a: {Ref: trigger}
diff --git a/tempest/api/orchestration/stacks/test_non_empty_stack.py b/tempest/api/orchestration/stacks/test_non_empty_stack.py
index 759cbbe..bf6c79c 100644
--- a/tempest/api/orchestration/stacks/test_non_empty_stack.py
+++ b/tempest/api/orchestration/stacks/test_non_empty_stack.py
@@ -31,13 +31,15 @@
         template = cls.read_template('non_empty_stack')
         image_id = (CONF.orchestration.image_ref or
                     cls._create_image()['id'])
+        flavor = CONF.orchestration.instance_type
         # create the stack
         cls.stack_identifier = cls.create_stack(
             cls.stack_name,
             template,
             parameters={
                 'trigger': 'start',
-                'image': image_id
+                'image': image_id,
+                'flavor': flavor
             })
         cls.stack_id = cls.stack_identifier.split('/')[1]
         cls.resource_name = 'fluffy'
diff --git a/tempest/api/telemetry/test_telemetry_notification_api.py b/tempest/api/telemetry/test_telemetry_notification_api.py
index 42e2a2d..7267183 100644
--- a/tempest/api/telemetry/test_telemetry_notification_api.py
+++ b/tempest/api/telemetry/test_telemetry_notification_api.py
@@ -73,7 +73,3 @@
 
         for metric in self.glance_v2_notifications:
             self.await_samples(metric, query)
-
-
-class TelemetryNotificationAPITestXML(TelemetryNotificationAPITestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index 02a2526..31dc09f 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -128,11 +128,3 @@
 
 class SnapshotsActionsV1Test(SnapshotsActionsV2Test):
     _api_version = 1
-
-
-class SnapshotsActionsV1TestXML(SnapshotsActionsV1Test):
-    _interface = "xml"
-
-    def _get_progress_alias(self):
-        return '{http://docs.openstack.org/volume/ext' \
-               '/extended_snapshot_attributes/api/v1}progress'
diff --git a/tempest/api/volume/admin/test_volume_hosts.py b/tempest/api/volume/admin/test_volume_hosts.py
index c92a60c..e966613 100644
--- a/tempest/api/volume/admin/test_volume_hosts.py
+++ b/tempest/api/volume/admin/test_volume_hosts.py
@@ -29,7 +29,3 @@
 
 class VolumeHostsAdminV1TestsJSON(VolumeHostsAdminV2TestsJSON):
     _api_version = 1
-
-
-class VolumeHostsAdminV1TestsXML(VolumeHostsAdminV1TestsJSON):
-    _interface = 'xml'
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 6e45b0f..50bab56 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -22,13 +22,13 @@
 QUOTA_USAGE_KEYS = ['reserved', 'limit', 'in_use']
 
 
-class VolumeQuotasAdminTestJSON(base.BaseVolumeV1AdminTest):
+class BaseVolumeQuotasAdminV2TestJSON(base.BaseVolumeAdminTest):
     _interface = "json"
     force_tenant_isolation = True
 
     @classmethod
     def resource_setup(cls):
-        super(VolumeQuotasAdminTestJSON, cls).resource_setup()
+        super(BaseVolumeQuotasAdminV2TestJSON, cls).resource_setup()
         cls.demo_tenant_id = cls.isolated_creds.get_primary_creds().tenant_id
 
     @test.attr(type='gate')
@@ -115,5 +115,5 @@
         self.assertEqual(volume_default, quota_set_new['volumes'])
 
 
-class VolumeQuotasAdminTestXML(VolumeQuotasAdminTestJSON):
-    _interface = "xml"
+class VolumeQuotasAdminV1TestJSON(BaseVolumeQuotasAdminV2TestJSON):
+    _api_version = 1
diff --git a/tempest/api/volume/admin/test_volume_quotas_negative.py b/tempest/api/volume/admin/test_volume_quotas_negative.py
index 60a0adb..c367ebb 100644
--- a/tempest/api/volume/admin/test_volume_quotas_negative.py
+++ b/tempest/api/volume/admin/test_volume_quotas_negative.py
@@ -18,13 +18,13 @@
 from tempest import test
 
 
-class VolumeQuotasNegativeTestJSON(base.BaseVolumeV1AdminTest):
+class BaseVolumeQuotasNegativeV2TestJSON(base.BaseVolumeAdminTest):
     _interface = "json"
     force_tenant_isolation = True
 
     @classmethod
     def resource_setup(cls):
-        super(VolumeQuotasNegativeTestJSON, cls).resource_setup()
+        super(BaseVolumeQuotasNegativeV2TestJSON, cls).resource_setup()
         demo_user = cls.isolated_creds.get_primary_creds()
         cls.demo_tenant_id = demo_user.tenant_id
         cls.shared_quota_set = {'gigabytes': 3, 'volumes': 1, 'snapshots': 1}
@@ -78,5 +78,5 @@
                           self.volume['id'])
 
 
-class VolumeQuotasNegativeTestXML(VolumeQuotasNegativeTestJSON):
-    _interface = "xml"
+class VolumeQuotasNegativeV1TestJSON(BaseVolumeQuotasNegativeV2TestJSON):
+    _api_version = 1
diff --git a/tempest/api/volume/admin/test_volume_services.py b/tempest/api/volume/admin/test_volume_services.py
index 7820148..fffc5cb 100644
--- a/tempest/api/volume/admin/test_volume_services.py
+++ b/tempest/api/volume/admin/test_volume_services.py
@@ -17,7 +17,7 @@
 from tempest import test
 
 
-class VolumesServicesTestJSON(base.BaseVolumeV1AdminTest):
+class VolumesServicesV2TestJSON(base.BaseVolumeAdminTest):
     """
     Tests Volume Services API.
     volume service list requires admin privileges.
@@ -26,21 +26,20 @@
 
     @classmethod
     def resource_setup(cls):
-        super(VolumesServicesTestJSON, cls).resource_setup()
-        cls.client = cls.os_adm.volume_services_client
-        _, cls.services = cls.client.list_services()
+        super(VolumesServicesV2TestJSON, cls).resource_setup()
+        _, cls.services = cls.admin_volume_services_client.list_services()
         cls.host_name = cls.services[0]['host']
         cls.binary_name = cls.services[0]['binary']
 
     @test.attr(type='gate')
     def test_list_services(self):
-        _, services = self.client.list_services()
+        _, services = self.admin_volume_services_client.list_services()
         self.assertNotEqual(0, len(services))
 
     @test.attr(type='gate')
     def test_get_service_by_service_binary_name(self):
         params = {'binary': self.binary_name}
-        _, services = self.client.list_services(params)
+        _, services = self.admin_volume_services_client.list_services(params)
         self.assertNotEqual(0, len(services))
         for service in services:
             self.assertEqual(self.binary_name, service['binary'])
@@ -51,7 +50,7 @@
                             service['host'] == self.host_name]
         params = {'host': self.host_name}
 
-        _, services = self.client.list_services(params)
+        _, services = self.admin_volume_services_client.list_services(params)
 
         # we could have a periodic job checkin between the 2 service
         # lookups, so only compare binary lists.
@@ -65,7 +64,11 @@
     def test_get_service_by_service_and_host_name(self):
         params = {'host': self.host_name, 'binary': self.binary_name}
 
-        _, services = self.client.list_services(params)
+        _, services = self.admin_volume_services_client.list_services(params)
         self.assertEqual(1, len(services))
         self.assertEqual(self.host_name, services[0]['host'])
         self.assertEqual(self.binary_name, services[0]['binary'])
+
+
+class VolumesServicesV1TestJSON(VolumesServicesV2TestJSON):
+    _api_version = 1
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index e474aa0..40af37e 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -142,7 +142,3 @@
 
 class ExtraSpecsNegativeV1Test(ExtraSpecsNegativeV2Test):
     _api_version = 1
-
-
-class ExtraSpecsNegativeV1TestXML(ExtraSpecsNegativeV1Test):
-    _interface = 'xml'
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index 9c9913f..4144270 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -56,7 +56,3 @@
 
 class VolumeTypesNegativeV1Test(VolumeTypesNegativeV2Test):
     _api_version = 1
-
-
-class VolumeTypesNegativeV1TestXML(VolumeTypesNegativeV1Test):
-    _interface = 'xml'
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
index 1c3e04a..8db6106 100644
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -97,7 +97,3 @@
 
 class VolumesActionsV1Test(VolumesActionsV2Test):
     _api_version = 1
-
-
-class VolumesActionsV1TestXML(VolumesActionsV1Test):
-    _interface = "xml"
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index bf014a8..1357d31 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -23,17 +23,16 @@
 LOG = logging.getLogger(__name__)
 
 
-class VolumesBackupsTest(base.BaseVolumeV1AdminTest):
+class VolumesBackupsV2Test(base.BaseVolumeAdminTest):
     _interface = "json"
 
     @classmethod
     def resource_setup(cls):
-        super(VolumesBackupsTest, cls).resource_setup()
+        super(VolumesBackupsV2Test, cls).resource_setup()
 
         if not CONF.volume_feature_enabled.backup:
             raise cls.skipException("Cinder backup feature disabled")
 
-        cls.backups_adm_client = cls.os_adm.backups_client
         cls.volume = cls.create_volume()
 
     @test.attr(type='smoke')
@@ -71,3 +70,7 @@
                                                        'available')
         self.admin_volume_client.wait_for_volume_status(
             restore['volume_id'], 'available')
+
+
+class VolumesBackupsV1Test(VolumesBackupsV2Test):
+    _api_version = 1
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index f9f03ac..0e3cd92 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -165,26 +165,32 @@
 
         cls.qos_specs = []
 
-        cls.quotas_client = cls.os_adm.volume_quotas_client
-
         if cls._api_version == 1:
             if not CONF.volume_feature_enabled.api_v1:
                 msg = "Volume API v1 is disabled"
                 raise cls.skipException(msg)
             cls.volume_qos_client = cls.os_adm.volume_qos_client
+            cls.admin_volume_services_client = \
+                cls.os_adm.volume_services_client
             cls.volume_types_client = cls.os_adm.volume_types_client
             cls.admin_volume_client = cls.os_adm.volumes_client
             cls.hosts_client = cls.os_adm.volume_hosts_client
             cls.admin_snapshots_client = cls.os_adm.snapshots_client
+            cls.backups_adm_client = cls.os_adm.backups_client
+            cls.quotas_client = cls.os_adm.volume_quotas_client
         elif cls._api_version == 2:
             if not CONF.volume_feature_enabled.api_v2:
                 msg = "Volume API v2 is disabled"
                 raise cls.skipException(msg)
             cls.volume_qos_client = cls.os_adm.volume_qos_v2_client
+            cls.admin_volume_services_client = \
+                cls.os_adm.volume_services_v2_client
             cls.volume_types_client = cls.os_adm.volume_types_v2_client
             cls.admin_volume_client = cls.os_adm.volumes_v2_client
             cls.hosts_client = cls.os_adm.volume_hosts_v2_client
             cls.admin_snapshots_client = cls.os_adm.snapshots_v2_client
+            cls.backups_adm_client = cls.os_adm.backups_v2_client
+            cls.quotas_client = cls.os_adm.volume_quotas_v2_client
 
     @classmethod
     def resource_cleanup(cls):
diff --git a/tempest/api/volume/test_availability_zone.py b/tempest/api/volume/test_availability_zone.py
index 648bd8b..c3d5d02 100644
--- a/tempest/api/volume/test_availability_zone.py
+++ b/tempest/api/volume/test_availability_zone.py
@@ -35,13 +35,5 @@
         self.assertTrue(len(availability_zone) > 0)
 
 
-class AvailabilityZoneV2TestXML(AvailabilityZoneV2TestJSON):
-    _interface = 'xml'
-
-
 class AvailabilityZoneV1TestJSON(AvailabilityZoneV2TestJSON):
     _api_version = 1
-
-
-class AvailabilityZoneV1TestXML(AvailabilityZoneV1TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/volume/test_extensions.py b/tempest/api/volume/test_extensions.py
index 4fc6ee4..66ea9b7 100644
--- a/tempest/api/volume/test_extensions.py
+++ b/tempest/api/volume/test_extensions.py
@@ -44,13 +44,5 @@
             raise self.skipException('There are not any extensions configured')
 
 
-class ExtensionsV2TestXML(ExtensionsV2TestJSON):
-    _interface = 'xml'
-
-
 class ExtensionsV1TestJSON(ExtensionsV2TestJSON):
     _api_version = 1
-
-
-class ExtensionsV1TestXML(ExtensionsV1TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/volume/test_snapshot_metadata.py b/tempest/api/volume/test_snapshot_metadata.py
index 777d3de..0dceb3d 100644
--- a/tempest/api/volume/test_snapshot_metadata.py
+++ b/tempest/api/volume/test_snapshot_metadata.py
@@ -98,13 +98,5 @@
         self.assertEqual(expect, body)
 
 
-class SnapshotV2MetadataTestXML(SnapshotV2MetadataTestJSON):
-    _interface = "xml"
-
-
 class SnapshotV1MetadataTestJSON(SnapshotV2MetadataTestJSON):
     _api_version = 1
-
-
-class SnapshotV1MetadataTestXML(SnapshotV1MetadataTestJSON):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index 2ec8667..ac5d016 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -99,13 +99,5 @@
         self.assertThat(body.items(), matchers.ContainsAll(expect.items()))
 
 
-class VolumesV2MetadataTestXML(VolumesV2MetadataTest):
-    _interface = "xml"
-
-
 class VolumesV1MetadataTest(VolumesV2MetadataTest):
     _api_version = 1
-
-
-class VolumesV1MetadataTestXML(VolumesV1MetadataTest):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index fe217c1..2011c1b 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -102,13 +102,5 @@
         self.client.wait_for_volume_status(volume['id'], 'available')
 
 
-class VolumesV2TransfersTestXML(VolumesV2TransfersTest):
-    _interface = "xml"
-
-
 class VolumesV1TransfersTest(VolumesV2TransfersTest):
     _api_version = 1
-
-
-class VolumesV1TransfersTestXML(VolumesV1TransfersTest):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index a9bc70a..4fd27b1 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -142,13 +142,5 @@
         self.assertEqual(False, bool_flag)
 
 
-class VolumesV2ActionsTestXML(VolumesV2ActionsTest):
-    _interface = "xml"
-
-
 class VolumesV1ActionsTest(VolumesV2ActionsTest):
     _api_version = 1
-
-
-class VolumesV1ActionsTestXML(VolumesV1ActionsTest):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index edd497c..2b816ef 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -38,13 +38,5 @@
         self.assertEqual(int(volume['size']), extend_size)
 
 
-class VolumesV2ExtendTestXML(VolumesV2ExtendTest):
-    _interface = "xml"
-
-
 class VolumesV1ExtendTest(VolumesV2ExtendTest):
     _api_version = 1
-
-
-class VolumesV1ExtendTestXML(VolumesV1ExtendTest):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 033beb4..a9c10aa 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -149,13 +149,5 @@
         self._volume_create_get_update_delete(source_volid=origin['id'])
 
 
-class VolumesV2GetTestXML(VolumesV2GetTest):
-    _interface = "xml"
-
-
 class VolumesV1GetTest(VolumesV2GetTest):
     _api_version = 1
-
-
-class VolumesV1GetTestXML(VolumesV1GetTest):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 016e9ab..9c0d238 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -205,14 +205,6 @@
         self._list_by_param_value_and_assert(params, with_detail=True)
 
 
-class VolumesV2ListTestXML(VolumesV2ListTestJSON):
-    _interface = 'xml'
-
-
 class VolumesV1ListTestJSON(VolumesV2ListTestJSON):
     _api_version = 1
     VOLUME_FIELDS = ('id', 'display_name')
-
-
-class VolumesV1ListTestXML(VolumesV1ListTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index 2b43c63..5d3fdef 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -259,14 +259,6 @@
         self.assertEqual(0, len(fetched_volume))
 
 
-class VolumesV2NegativeTestXML(VolumesV2NegativeTest):
-    _interface = 'xml'
-
-
 class VolumesV1NegativeTest(VolumesV2NegativeTest):
     _api_version = 1
     _name = 'display_name'
-
-
-class VolumesV1NegativeTestXML(VolumesV1NegativeTest):
-    _interface = 'xml'
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 78df1df..21d0a86 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -178,13 +178,5 @@
         self.clear_snapshots()
 
 
-class VolumesV2SnapshotTestXML(VolumesV2SnapshotTestJSON):
-    _interface = "xml"
-
-
 class VolumesV1SnapshotTestJSON(VolumesV2SnapshotTestJSON):
     _api_version = 1
-
-
-class VolumesV1SnapshotTestXML(VolumesV1SnapshotTestJSON):
-    _interface = "xml"
diff --git a/tempest/api/volume/test_volumes_snapshots_negative.py b/tempest/api/volume/test_volumes_snapshots_negative.py
index 75a62a8..2d7b6de 100644
--- a/tempest/api/volume/test_volumes_snapshots_negative.py
+++ b/tempest/api/volume/test_volumes_snapshots_negative.py
@@ -47,13 +47,5 @@
                           None, display_name=s_name)
 
 
-class VolumesV2SnapshotNegativeTestXML(VolumesV2SnapshotNegativeTestJSON):
-    _interface = "xml"
-
-
 class VolumesV1SnapshotNegativeTestJSON(VolumesV2SnapshotNegativeTestJSON):
     _api_version = 1
-
-
-class VolumesV1SnapshotNegativeTestXML(VolumesV1SnapshotNegativeTestJSON):
-    _interface = "xml"
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index cc56873..c20f3d8 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -82,7 +82,3 @@
 
         _list_details_with_multiple_params()
         _list_details_with_multiple_params(sort_dir='desc')
-
-
-class VolumesV2ListTestXML(VolumesV2ListTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api_schema/response/compute/services.py b/tempest/api_schema/response/compute/services.py
index fc42b89..6f361ef 100644
--- a/tempest/api_schema/response/compute/services.py
+++ b/tempest/api_schema/response/compute/services.py
@@ -22,7 +22,8 @@
                 'items': {
                     'type': 'object',
                     'properties': {
-                        'id': {'type': 'integer'},
+                        'id': {'type': ['integer', 'string'],
+                               'pattern': '^[a-zA-Z!]*@[0-9]+$'},
                         'zone': {'type': 'string'},
                         'host': {'type': 'string'},
                         'state': {'type': 'string'},
diff --git a/tempest/auth.py b/tempest/auth.py
index b1ead29..022a450 100644
--- a/tempest/auth.py
+++ b/tempest/auth.py
@@ -26,8 +26,6 @@
 from tempest.openstack.common import log as logging
 from tempest.services.identity.json import identity_client as json_id
 from tempest.services.identity.v3.json import identity_client as json_v3id
-from tempest.services.identity.v3.xml import identity_client as xml_v3id
-from tempest.services.identity.xml import identity_client as xml_id
 
 
 CONF = config.CONF
@@ -44,15 +42,14 @@
         """
         :param credentials: credentials for authentication
         :param interface: 'json' or 'xml'. Applicable for tempest client only
+            (deprecated: only json now supported)
         """
         credentials = self._convert_credentials(credentials)
         if self.check_credentials(credentials):
             self.credentials = credentials
         else:
             raise TypeError("Invalid credentials")
-        self.interface = interface
-        if self.interface is None:
-            self.interface = 'json'
+        self.interface = 'json'
         self.cache = None
         self.alt_auth_data = None
         self.alt_part = None
@@ -255,10 +252,7 @@
     EXPIRY_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
 
     def _auth_client(self):
-        if self.interface == 'json':
-            return json_id.TokenClientJSON()
-        else:
-            return xml_id.TokenClientXML()
+        return json_id.TokenClientJSON()
 
     def _auth_params(self):
         return dict(
@@ -336,10 +330,7 @@
     EXPIRY_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
 
     def _auth_client(self):
-        if self.interface == 'json':
-            return json_v3id.V3TokenClientJSON()
-        else:
-            return xml_v3id.V3TokenClientXML()
+        return json_v3id.V3TokenClientJSON()
 
     def _auth_params(self):
         return dict(
diff --git a/tempest/cli/simple_read_only/network/test_neutron.py b/tempest/cli/simple_read_only/network/test_neutron.py
index 6090882..6cf0640 100644
--- a/tempest/cli/simple_read_only/network/test_neutron.py
+++ b/tempest/cli/simple_read_only/network/test_neutron.py
@@ -198,6 +198,31 @@
                                             'auth_mode', 'status'])
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='fwaas', service='network')
+    def test_neutron_firewall_list(self):
+        firewall_list = self.parser.listing(self.neutron
+                                            ('firewall-list'))
+        self.assertTableStruct(firewall_list, ['id', 'name',
+                                               'firewall_policy_id'])
+
+    @test.attr(type='smoke')
+    @test.requires_ext(extension='fwaas', service='network')
+    def test_neutron_firewall_policy_list(self):
+        firewall_policy = self.parser.listing(self.neutron
+                                              ('firewall-policy-list'))
+        self.assertTableStruct(firewall_policy, ['id', 'name',
+                                                 'firewall_rules'])
+
+    @test.attr(type='smoke')
+    @test.requires_ext(extension='fwaas', service='network')
+    def test_neutron_firewall_rule_list(self):
+        firewall_rule = self.parser.listing(self.neutron
+                                            ('firewall-rule-list'))
+        self.assertTableStruct(firewall_rule, ['id', 'name',
+                                               'firewall_policy_id',
+                                               'summary', 'enabled'])
+
+    @test.attr(type='smoke')
     def test_neutron_help(self):
         help_text = self.neutron('help')
         lines = help_text.split('\n')
diff --git a/tempest/clients.py b/tempest/clients.py
index 9546502..91dc5f7 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -16,7 +16,6 @@
 from tempest import auth
 from tempest.common import rest_client
 from tempest import config
-from tempest import exceptions
 from tempest import manager
 from tempest.openstack.common import log as logging
 from tempest.services.baremetal.v1.client_json import BaremetalClientJSON
@@ -87,35 +86,6 @@
     ServicesV3ClientJSON
 from tempest.services.compute.v3.json.version_client import \
     VersionV3ClientJSON
-from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
-from tempest.services.compute.xml.availability_zone_client import \
-    AvailabilityZoneClientXML
-from tempest.services.compute.xml.certificates_client import \
-    CertificatesClientXML
-from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
-from tempest.services.compute.xml.fixed_ips_client import FixedIPsClientXML
-from tempest.services.compute.xml.flavors_client import FlavorsClientXML
-from tempest.services.compute.xml.floating_ips_client import \
-    FloatingIPsClientXML
-from tempest.services.compute.xml.hosts_client import HostsClientXML
-from tempest.services.compute.xml.hypervisor_client import HypervisorClientXML
-from tempest.services.compute.xml.images_client import ImagesClientXML
-from tempest.services.compute.xml.instance_usage_audit_log_client import \
-    InstanceUsagesAuditLogClientXML
-from tempest.services.compute.xml.interfaces_client import \
-    InterfacesClientXML
-from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
-from tempest.services.compute.xml.limits_client import LimitsClientXML
-from tempest.services.compute.xml.quotas_client import QuotaClassesClientXML
-from tempest.services.compute.xml.quotas_client import QuotasClientXML
-from tempest.services.compute.xml.security_groups_client \
-    import SecurityGroupsClientXML
-from tempest.services.compute.xml.servers_client import ServersClientXML
-from tempest.services.compute.xml.services_client import ServicesClientXML
-from tempest.services.compute.xml.tenant_usages_client import \
-    TenantUsagesClientXML
-from tempest.services.compute.xml.volumes_extensions_client import \
-    VolumesExtensionsClientXML
 from tempest.services.data_processing.v1_1.client import DataProcessingClient
 from tempest.services.database.json.flavors_client import \
     DatabaseFlavorsClientJSON
@@ -134,24 +104,11 @@
 from tempest.services.identity.v3.json.region_client import RegionClientJSON
 from tempest.services.identity.v3.json.service_client import \
     ServiceClientJSON
-from tempest.services.identity.v3.xml.credentials_client import \
-    CredentialsClientXML
-from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
-from tempest.services.identity.v3.xml.identity_client import \
-    IdentityV3ClientXML
-from tempest.services.identity.v3.xml.identity_client import V3TokenClientXML
-from tempest.services.identity.v3.xml.policy_client import PolicyClientXML
-from tempest.services.identity.v3.xml.region_client import RegionClientXML
-from tempest.services.identity.v3.xml.service_client import \
-    ServiceClientXML
-from tempest.services.identity.xml.identity_client import IdentityClientXML
-from tempest.services.identity.xml.identity_client import TokenClientXML
 from tempest.services.image.v1.json.image_client import ImageClientJSON
 from tempest.services.image.v2.json.image_client import ImageClientV2JSON
 from tempest.services.messaging.json.messaging_client import \
     MessagingClientJSON
 from tempest.services.network.json.network_client import NetworkClientJSON
-from tempest.services.network.xml.network_client import NetworkClientXML
 from tempest.services.object_storage.account_client import AccountClient
 from tempest.services.object_storage.account_client import \
     AccountClientCustomizedHeader
@@ -163,8 +120,6 @@
     OrchestrationClient
 from tempest.services.telemetry.json.telemetry_client import \
     TelemetryClientJSON
-from tempest.services.telemetry.xml.telemetry_client import \
-    TelemetryClientXML
 from tempest.services.volume.json.admin.volume_hosts_client import \
     VolumeHostsClientJSON
 from tempest.services.volume.json.admin.volume_quotas_client import \
@@ -183,38 +138,21 @@
 from tempest.services.volume.json.volumes_client import VolumesClientJSON
 from tempest.services.volume.v2.json.admin.volume_hosts_client import \
     VolumeHostsV2ClientJSON
+from tempest.services.volume.v2.json.admin.volume_quotas_client import \
+    VolumeQuotasV2Client
+from tempest.services.volume.v2.json.admin.volume_services_client import \
+    VolumesServicesV2ClientJSON
 from tempest.services.volume.v2.json.admin.volume_types_client import \
     VolumeTypesV2ClientJSON
 from tempest.services.volume.v2.json.availability_zone_client import \
     VolumeV2AvailabilityZoneClientJSON
+from tempest.services.volume.v2.json.backups_client import BackupsClientV2JSON
 from tempest.services.volume.v2.json.extensions_client import \
     ExtensionsV2ClientJSON as VolumeV2ExtensionClientJSON
 from tempest.services.volume.v2.json.qos_client import QosSpecsV2ClientJSON
 from tempest.services.volume.v2.json.snapshots_client import \
     SnapshotsV2ClientJSON
 from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
-from tempest.services.volume.v2.xml.availability_zone_client import \
-    VolumeV2AvailabilityZoneClientXML
-from tempest.services.volume.v2.xml.extensions_client import \
-    ExtensionsV2ClientXML as VolumeV2ExtensionClientXML
-from tempest.services.volume.v2.xml.snapshots_client import \
-    SnapshotsV2ClientXML
-from tempest.services.volume.v2.xml.volumes_client import VolumesV2ClientXML
-from tempest.services.volume.xml.admin.volume_hosts_client import \
-    VolumeHostsClientXML
-from tempest.services.volume.xml.admin.volume_quotas_client import \
-    VolumeQuotasClientXML
-from tempest.services.volume.xml.admin.volume_services_client import \
-    VolumesServicesClientXML
-from tempest.services.volume.xml.admin.volume_types_client import \
-    VolumeTypesClientXML
-from tempest.services.volume.xml.availability_zone_client import \
-    VolumeAvailabilityZoneClientXML
-from tempest.services.volume.xml.backups_client import BackupsClientXML
-from tempest.services.volume.xml.extensions_client import \
-    ExtensionsClientXML as VolumeExtensionClientXML
-from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
-from tempest.services.volume.xml.volumes_client import VolumesClientXML
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -236,30 +174,19 @@
         self._set_identity_clients(self.interface)
         self._set_volume_clients(self.interface)
 
-        if self.interface == 'xml':
-            self.network_client = NetworkClientXML(self.auth_provider)
-            if CONF.service_available.ceilometer:
-                self.telemetry_client = TelemetryClientXML(
-                    self.auth_provider)
-
-        elif self.interface == 'json':
-            self.baremetal_client = BaremetalClientJSON(self.auth_provider)
-            self.network_client = NetworkClientJSON(self.auth_provider)
-            self.database_flavors_client = DatabaseFlavorsClientJSON(
+        self.baremetal_client = BaremetalClientJSON(self.auth_provider)
+        self.network_client = NetworkClientJSON(self.auth_provider)
+        self.database_flavors_client = DatabaseFlavorsClientJSON(
+            self.auth_provider)
+        self.database_versions_client = DatabaseVersionsClientJSON(
+            self.auth_provider)
+        self.messaging_client = MessagingClientJSON(self.auth_provider)
+        if CONF.service_available.ceilometer:
+            self.telemetry_client = TelemetryClientJSON(
                 self.auth_provider)
-            self.database_versions_client = DatabaseVersionsClientJSON(
-                self.auth_provider)
-            self.messaging_client = MessagingClientJSON(self.auth_provider)
-            if CONF.service_available.ceilometer:
-                self.telemetry_client = TelemetryClientJSON(
-                    self.auth_provider)
-            self.negative_client = rest_client.NegativeRestClient(
-                self.auth_provider)
-            self.negative_client.service = service
-
-        else:
-            msg = "Unsupported interface type `%s'" % interface
-            raise exceptions.InvalidConfiguration(msg)
+        self.negative_client = rest_client.NegativeRestClient(
+            self.auth_provider)
+        self.negative_client.service = service
 
         # TODO(andreaf) EC2 client still do their auth, v2 only
         ec2_client_args = (self.credentials.username,
@@ -286,10 +213,7 @@
             self.auth_provider)
 
     def _set_compute_clients(self, type):
-        if type == 'json':
-            self._set_compute_json_clients()
-        else:
-            self._set_compute_xml_clients()
+        self._set_compute_json_clients()
 
         # Common compute clients
         self.agents_client = AgentsClientJSON(self.auth_provider)
@@ -298,33 +222,6 @@
         self.security_group_default_rules_client = (
             SecurityGroupDefaultRulesClientJSON(self.auth_provider))
 
-    def _set_compute_xml_clients(self):
-        self.certificates_client = CertificatesClientXML(self.auth_provider)
-        self.servers_client = ServersClientXML(self.auth_provider)
-        self.limits_client = LimitsClientXML(self.auth_provider)
-        self.images_client = ImagesClientXML(self.auth_provider)
-        self.keypairs_client = KeyPairsClientXML(self.auth_provider)
-        self.quotas_client = QuotasClientXML(self.auth_provider)
-        self.quota_classes_client = QuotaClassesClientXML(self.auth_provider)
-        self.flavors_client = FlavorsClientXML(self.auth_provider)
-        self.extensions_client = ExtensionsClientXML(self.auth_provider)
-        self.volumes_extensions_client = VolumesExtensionsClientXML(
-            self.auth_provider)
-        self.floating_ips_client = FloatingIPsClientXML(self.auth_provider)
-        self.security_groups_client = SecurityGroupsClientXML(
-            self.auth_provider)
-        self.interfaces_client = InterfacesClientXML(self.auth_provider)
-        self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
-        self.availability_zone_client = AvailabilityZoneClientXML(
-            self.auth_provider)
-        self.aggregates_client = AggregatesClientXML(self.auth_provider)
-        self.services_client = ServicesClientXML(self.auth_provider)
-        self.tenant_usages_client = TenantUsagesClientXML(self.auth_provider)
-        self.hosts_client = HostsClientXML(self.auth_provider)
-        self.hypervisor_client = HypervisorClientXML(self.auth_provider)
-        self.instance_usages_audit_log_client = \
-            InstanceUsagesAuditLogClientXML(self.auth_provider)
-
     def _set_compute_json_clients(self):
         self.certificates_client = CertificatesClientJSON(self.auth_provider)
         self.certificates_v3_client = CertificatesV3ClientJSON(
@@ -370,22 +267,7 @@
             InstanceUsagesAuditLogClientJSON(self.auth_provider)
 
     def _set_identity_clients(self, type):
-        if type == 'json':
-            self._set_identity_json_clients()
-        else:
-            self._set_identity_xml_clients()
-
-    def _set_identity_xml_clients(self):
-        self.identity_client = IdentityClientXML(self.auth_provider)
-        self.identity_v3_client = IdentityV3ClientXML(self.auth_provider)
-        self.endpoints_client = EndPointClientXML(self.auth_provider)
-        self.service_client = ServiceClientXML(self.auth_provider)
-        self.policy_client = PolicyClientXML(self.auth_provider)
-        self.region_client = RegionClientXML(self.auth_provider)
-        self.token_client = TokenClientXML()
-        if CONF.identity_feature_enabled.api_v3:
-            self.token_v3_client = V3TokenClientXML()
-        self.credentials_client = CredentialsClientXML(self.auth_provider)
+        self._set_identity_json_clients()
 
     def _set_identity_json_clients(self):
         self.identity_client = IdentityClientJSON(self.auth_provider)
@@ -400,11 +282,7 @@
         self.credentials_client = CredentialsClientJSON(self.auth_provider)
 
     def _set_volume_clients(self, type):
-        if type == 'json':
-            self._set_volume_json_clients()
-        else:
-            self._set_volume_xml_clients()
-
+        self._set_volume_json_clients()
         # Common volume clients
         # NOTE : As XML clients are not implemented for Qos-specs.
         # So, setting the qos_client here. Once client are implemented,
@@ -413,29 +291,12 @@
         self.volume_qos_client = QosSpecsClientJSON(self.auth_provider)
         self.volume_qos_v2_client = QosSpecsV2ClientJSON(
             self.auth_provider)
-
-    def _set_volume_xml_clients(self):
-        self.backups_client = BackupsClientXML(self.auth_provider)
-        self.snapshots_client = SnapshotsClientXML(self.auth_provider)
-        self.snapshots_v2_client = SnapshotsV2ClientXML(self.auth_provider)
-        self.volumes_client = VolumesClientXML(self.auth_provider)
-        self.volumes_v2_client = VolumesV2ClientXML(self.auth_provider)
-        self.volume_types_client = VolumeTypesClientXML(self.auth_provider)
-        self.volume_services_client = VolumesServicesClientXML(
+        self.volume_services_v2_client = VolumesServicesV2ClientJSON(
             self.auth_provider)
-        self.volume_hosts_client = VolumeHostsClientXML(self.auth_provider)
-        self.volume_quotas_client = VolumeQuotasClientXML(self.auth_provider)
-        self.volumes_extension_client = VolumeExtensionClientXML(
-            self.auth_provider)
-        self.volumes_v2_extension_client = VolumeV2ExtensionClientXML(
-            self.auth_provider)
-        self.volume_availability_zone_client = \
-            VolumeAvailabilityZoneClientXML(self.auth_provider)
-        self.volume_v2_availability_zone_client = \
-            VolumeV2AvailabilityZoneClientXML(self.auth_provider)
 
     def _set_volume_json_clients(self):
         self.backups_client = BackupsClientJSON(self.auth_provider)
+        self.backups_v2_client = BackupsClientV2JSON(self.auth_provider)
         self.snapshots_client = SnapshotsClientJSON(self.auth_provider)
         self.snapshots_v2_client = SnapshotsV2ClientJSON(self.auth_provider)
         self.volumes_client = VolumesClientJSON(self.auth_provider)
@@ -447,6 +308,7 @@
         self.volume_hosts_v2_client = VolumeHostsV2ClientJSON(
             self.auth_provider)
         self.volume_quotas_client = VolumeQuotasClientJSON(self.auth_provider)
+        self.volume_quotas_v2_client = VolumeQuotasV2Client(self.auth_provider)
         self.volumes_extension_client = VolumeExtensionClientJSON(
             self.auth_provider)
         self.volumes_v2_extension_client = VolumeV2ExtensionClientJSON(
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index a305e42..f36ef56 100755
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -9,7 +9,7 @@
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 # License for the specific language governing permissions and limitations
 # under the License.
 
@@ -36,14 +36,14 @@
 **NOTE**: The _tenants_to_clean array in dry-run.json lists the
 tenants that cleanup will loop through and delete child objects, not
 delete the tenant itself. This may differ from the tenants array as you
-can clean the tempest and alternate tempest tenants but not delete the
-tenants themselves.  This is actually the default behavior.
+can clean the tempest and alternate tempest tenants but by default,
+cleanup deletes the objects in the tempest and alternate tempest tenants
+but does not delete those tenants unless the --delete-tempest-conf-objects
+flag is used to force their deletion.
 
 **Normal mode**: running with no arguments, will query your deployment and
-build a list of objects to delete after filtering out out the objects
-found in saved_state.json and based on the
---preserve-tempest-conf-objects and
---delete-tempest-conf-objects flags.
+build a list of objects to delete after filtering out the objects found in
+saved_state.json and based on the --delete-tempest-conf-objects flag.
 
 By default the tempest and alternate tempest users and tenants are not
 deleted and the admin user specified in tempest.conf is never deleted.
@@ -84,7 +84,6 @@
         # available services
         self.tenant_services = cleanup_service.get_tenant_cleanup_services()
         self.global_services = cleanup_service.get_global_cleanup_services()
-        cleanup_service.init_conf()
 
     def run(self):
         opts = self.options
@@ -98,7 +97,7 @@
     def _cleanup(self):
         LOG.debug("Begin cleanup")
         is_dry_run = self.options.dry_run
-        is_preserve = self.options.preserve_tempest_conf_objects
+        is_preserve = not self.options.delete_tempest_conf_objects
         is_save_state = False
 
         if is_dry_run:
@@ -149,7 +148,7 @@
         LOG.debug("Cleaning tenant:  %s " % tenant['name'])
         is_dry_run = self.options.dry_run
         dry_run_data = self.dry_run_data
-        is_preserve = self.options.preserve_tempest_conf_objects
+        is_preserve = not self.options.delete_tempest_conf_objects
         tenant_id = tenant['id']
         tenant_name = tenant['name']
         tenant_data = None
@@ -194,23 +193,16 @@
                             dest='init_saved_state', default=False,
                             help="Creates JSON file: " + SAVED_STATE_JSON +
                             ", representing the current state of your "
-                            "deployment,  specifically objects types "
-                            "Tempest creates and destroys during a run. "
+                            "deployment,  specifically object types "
+                            "tempest creates and destroys during a run. "
                             "You must run with this flag prior to "
-                            "executing cleanup.")
-        parser.add_argument('--preserve-tempest-conf-objects',
-                            action="store_true",
-                            dest='preserve_tempest_conf_objects',
-                            default=True, help="Do not delete the "
-                            "tempest and alternate tempest users and "
-                            "tenants, so they may be used for future "
-                            "tempest runs. By default this is argument "
-                            "is true.")
+                            "executing cleanup in normal mode, which is with "
+                            "no arguments.")
         parser.add_argument('--delete-tempest-conf-objects',
-                            action="store_false",
-                            dest='preserve_tempest_conf_objects',
+                            action="store_true",
+                            dest='delete_tempest_conf_objects',
                             default=False,
-                            help="Delete the tempest and "
+                            help="Force deletion of the tempest and "
                             "alternate tempest users and tenants.")
         parser.add_argument('--dry-run', action="store_true",
                             dest='dry_run', default=False,
@@ -291,6 +283,7 @@
 
 
 def main():
+    cleanup_service.init_conf()
     cleanup = Cleanup()
     cleanup.run()
     LOG.info('Cleanup finished!')
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 8adfbef..67843e6 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
 # Copyright 2014 Dell Inc.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -12,6 +14,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import clients
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest import test
@@ -19,13 +22,14 @@
 LOG = logging.getLogger(__name__)
 CONF = config.CONF
 
-CONF_USERS = None
-CONF_TENANTS = None
-CONF_PUB_NETWORK = None
-CONF_PRIV_NETWORK_NAME = None
-CONF_PUB_ROUTER = None
 CONF_FLAVORS = None
 CONF_IMAGES = None
+CONF_NETWORKS = []
+CONF_PRIV_NETWORK_NAME = None
+CONF_PUB_NETWORK = None
+CONF_PUB_ROUTER = None
+CONF_TENANTS = None
+CONF_USERS = None
 
 IS_CEILOMETER = None
 IS_CINDER = None
@@ -36,14 +40,15 @@
 
 
 def init_conf():
-    global CONF_USERS
-    global CONF_TENANTS
-    global CONF_PUB_NETWORK
-    global CONF_PRIV_NETWORK_NAME
-    global CONF_PUB_ROUTER
     global CONF_FLAVORS
     global CONF_IMAGES
-
+    global CONF_NETWORKS
+    global CONF_PRIV_NETWORK
+    global CONF_PRIV_NETWORK_NAME
+    global CONF_PUB_NETWORK
+    global CONF_PUB_ROUTER
+    global CONF_TENANTS
+    global CONF_USERS
     global IS_CEILOMETER
     global IS_CINDER
     global IS_GLANCE
@@ -51,17 +56,6 @@
     global IS_NEUTRON
     global IS_NOVA
 
-    CONF_USERS = [CONF.identity.admin_username, CONF.identity.username,
-                  CONF.identity.alt_username]
-    CONF_TENANTS = [CONF.identity.admin_tenant_name,
-                    CONF.identity.tenant_name,
-                    CONF.identity.alt_tenant_name]
-    CONF_PUB_NETWORK = CONF.network.public_network_id
-    CONF_PRIV_NETWORK_NAME = CONF.compute.fixed_network_name
-    CONF_PUB_ROUTER = CONF.network.public_router_id
-    CONF_FLAVORS = [CONF.compute.flavor_ref, CONF.compute.flavor_ref_alt]
-    CONF_IMAGES = [CONF.compute.image_ref, CONF.compute.image_ref_alt]
-
     IS_CEILOMETER = CONF.service_available.ceilometer
     IS_CINDER = CONF.service_available.cinder
     IS_GLANCE = CONF.service_available.glance
@@ -69,6 +63,38 @@
     IS_NEUTRON = CONF.service_available.neutron
     IS_NOVA = CONF.service_available.nova
 
+    CONF_FLAVORS = [CONF.compute.flavor_ref, CONF.compute.flavor_ref_alt]
+    CONF_IMAGES = [CONF.compute.image_ref, CONF.compute.image_ref_alt]
+    CONF_PRIV_NETWORK_NAME = CONF.compute.fixed_network_name
+    CONF_PUB_NETWORK = CONF.network.public_network_id
+    CONF_PUB_ROUTER = CONF.network.public_router_id
+    CONF_TENANTS = [CONF.identity.admin_tenant_name,
+                    CONF.identity.tenant_name,
+                    CONF.identity.alt_tenant_name]
+    CONF_USERS = [CONF.identity.admin_username, CONF.identity.username,
+                  CONF.identity.alt_username]
+
+    if IS_NEUTRON:
+        CONF_PRIV_NETWORK = _get_priv_net_id(CONF.compute.fixed_network_name,
+                                             CONF.identity.tenant_name)
+        CONF_NETWORKS = [CONF_PUB_NETWORK, CONF_PRIV_NETWORK]
+
+
+def _get_priv_net_id(prv_net_name, tenant_name):
+    am = clients.AdminManager()
+    net_cl = am.network_client
+    id_cl = am.identity_client
+
+    _, networks = net_cl.list_networks()
+    tenant = id_cl.get_tenant_by_name(tenant_name)
+    t_id = tenant['id']
+    n_id = None
+    for net in networks['networks']:
+        if (net['tenant_id'] == t_id and net['name'] == prv_net_name):
+            n_id = net['id']
+            break
+    return n_id
+
 
 class BaseService(object):
     def __init__(self, kwargs):
@@ -84,11 +110,8 @@
                 or 'tenant_id' not in item_list[0]):
             return item_list
 
-        _filtered_list = []
-        for item in item_list:
-            if item['tenant_id'] == self.tenant_id:
-                _filtered_list.append(item)
-        return _filtered_list
+        return [item for item in item_list
+                if item['tenant_id'] == self.tenant_id]
 
     def list(self):
         pass
@@ -325,6 +348,13 @@
         super(NetworkService, self).__init__(kwargs)
         self.client = manager.network_client
 
+    def _filter_by_conf_networks(self, item_list):
+        if not item_list or not all(('network_id' in i for i in item_list)):
+            return item_list
+
+        return [item for item in item_list if item['network_id']
+                not in CONF_NETWORKS]
+
     def list(self):
         client = self.client
         _, networks = client.list_networks()
@@ -332,8 +362,7 @@
         # filter out networks declared in tempest.conf
         if self.is_preserve:
             networks = [network for network in networks
-                        if (network['name'] != CONF_PRIV_NETWORK_NAME
-                            and network['id'] != CONF_PUB_NETWORK)]
+                        if network['id'] not in CONF_NETWORKS]
         LOG.debug("List count, %s Networks" % networks)
         return networks
 
@@ -527,7 +556,7 @@
                 for port in ports:
                     subid = port['fixed_ips'][0]['subnet_id']
                     client.remove_router_interface_with_subnet_id(rid, subid)
-                    client.delete_router(rid)
+                client.delete_router(rid)
             except Exception as e:
                 LOG.exception("Delete Router exception: %s" % e)
                 pass
@@ -694,6 +723,8 @@
         _, ports = client.list_ports()
         ports = ports['ports']
         ports = self._filter_by_tenant_id(ports)
+        if self.is_preserve:
+            ports = self._filter_by_conf_networks(ports)
         LOG.debug("List count, %s Ports" % len(ports))
         return ports
 
@@ -719,6 +750,8 @@
         _, subnets = client.list_subnets()
         subnets = subnets['subnets']
         subnets = self._filter_by_tenant_id(subnets)
+        if self.is_preserve:
+            subnets = self._filter_by_conf_networks(subnets)
         LOG.debug("List count, %s Subnets" % len(subnets))
         return subnets
 
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 228e47c..1ce1e39 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -203,9 +203,8 @@
                 if 'overlaps with another subnet' not in str(e):
                     raise
         else:
-            e = exceptions.BuildErrorException()
-            e.message = 'Available CIDR for subnet creation could not be found'
-            raise e
+            message = 'Available CIDR for subnet creation could not be found'
+            raise Exception(message)
         return resp_body['subnet']
 
     def _create_router(self, router_name, tenant_id):
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 6f2e1bd..4c3905c 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -21,12 +21,10 @@
 import time
 
 import jsonschema
-from lxml import etree
 import six
 
 from tempest.common import http
 from tempest.common.utils import misc as misc_utils
-from tempest.common import xml_utils as common
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
@@ -54,6 +52,40 @@
         return text
 
 
+class ResponseBody(dict):
+    """Class that wraps an http response and dict body into a single value.
+
+    Callers that receive this object will normally use it as a dict but
+    can extract the response if needed.
+    """
+
+    def __init__(self, response, body=None):
+        body_data = body or {}
+        self.update(body_data)
+        self.response = response
+
+    def __str__(self):
+        body = super.__str__(self)
+        return "response: %s\nBody: %s" % (self.response, body)
+
+
+class ResponseBodyList(list):
+    """Class that wraps an http response and list body into a single value.
+
+    Callers that receive this object will normally use it as a list but
+    can extract the response if needed.
+    """
+
+    def __init__(self, response, body=None):
+        body_data = body or []
+        self.extend(body_data)
+        self.response = response
+
+    def __str__(self):
+        body = super.__str__(self)
+        return "response: %s\nBody: %s" % (self.response, body)
+
+
 class RestClient(object):
 
     TYPE = "json"
@@ -91,8 +123,9 @@
                                        'retry-after', 'server',
                                        'vary', 'www-authenticate'))
         dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
         self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
+            disable_ssl_certificate_validation=dscv, ca_certs=ca_certs)
 
     def _get_type(self):
         return self.TYPE
@@ -328,48 +361,30 @@
                                req_body, resp_body, caller_name, extra)
 
     def _parse_resp(self, body):
-        if self._get_type() is "json":
-            body = json.loads(body)
+        body = json.loads(body)
 
-            # We assume, that if the first value of the deserialized body's
-            # item set is a dict or a list, that we just return the first value
-            # of deserialized body.
-            # Essentially "cutting out" the first placeholder element in a body
-            # that looks like this:
-            #
-            #  {
-            #    "users": [
-            #      ...
-            #    ]
-            #  }
-            try:
-                # Ensure there are not more than one top-level keys
-                if len(body.keys()) > 1:
-                    return body
-                # Just return the "wrapped" element
-                first_key, first_item = body.items()[0]
-                if isinstance(first_item, (dict, list)):
-                    return first_item
-            except (ValueError, IndexError):
-                pass
-            return body
-        elif self._get_type() is "xml":
-            element = etree.fromstring(body)
-            if any(s in element.tag for s in self.dict_tags):
-                # Parse dictionary-like xmls (metadata, etc)
-                dictionary = {}
-                for el in element.getchildren():
-                    dictionary[u"%s" % el.get("key")] = u"%s" % el.text
-                return dictionary
-            if any(s in element.tag for s in self.list_tags):
-                # Parse list-like xmls (users, roles, etc)
-                array = []
-                for child in element.getchildren():
-                    array.append(common.xml_to_json(child))
-                return array
-
-            # Parse one-item-like xmls (user, role, etc)
-            return common.xml_to_json(element)
+        # We assume, that if the first value of the deserialized body's
+        # item set is a dict or a list, that we just return the first value
+        # of deserialized body.
+        # Essentially "cutting out" the first placeholder element in a body
+        # that looks like this:
+        #
+        #  {
+        #    "users": [
+        #      ...
+        #    ]
+        #  }
+        try:
+            # Ensure there are not more than one top-level keys
+            if len(body.keys()) > 1:
+                return body
+            # Just return the "wrapped" element
+            first_key, first_item = body.items()[0]
+            if isinstance(first_item, (dict, list)):
+                return first_item
+        except (ValueError, IndexError):
+            pass
+        return body
 
     def response_checker(self, method, resp, resp_body):
         if (resp.status in set((204, 205, 304)) or resp.status < 200 or
diff --git a/tempest/common/xml_utils.py b/tempest/common/xml_utils.py
deleted file mode 100644
index 7d460a4..0000000
--- a/tempest/common/xml_utils.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import collections
-import copy
-
-XMLNS_11 = "http://docs.openstack.org/compute/api/v1.1"
-XMLNS_V3 = "http://docs.openstack.org/compute/api/v1.1"
-
-NEUTRON_NAMESPACES = {
-    'binding': "http://docs.openstack.org/ext/binding/api/v1.0",
-    'router': "http://docs.openstack.org/ext/neutron/router/api/v1.0",
-    'provider': 'http://docs.openstack.org/ext/provider/api/v1.0',
-}
-
-
-# NOTE(danms): This is just a silly implementation to help make generating
-# XML faster for prototyping. Could be replaced with proper etree gorp
-# if desired
-class Element(object):
-    def __init__(self, element_name, *args, **kwargs):
-        self.element_name = element_name
-        self._attrs = kwargs
-        self._elements = list(args)
-
-    def add_attr(self, name, value):
-        self._attrs[name] = value
-
-    def append(self, element):
-        self._elements.append(element)
-
-    def __str__(self):
-        args = " ".join(['%s="%s"' %
-                        (k, v if v is not None else "")
-                        for k, v in self._attrs.items()])
-        string = '<%s %s' % (self.element_name, args)
-        if not self._elements:
-            string += '/>'
-            return string
-
-        string += '>'
-
-        for element in self._elements:
-            string += str(element)
-
-        string += '</%s>' % self.element_name
-
-        return string
-
-    def __getitem__(self, name):
-        for element in self._elements:
-            if element.element_name == name:
-                return element
-        raise KeyError("No such element `%s'" % name)
-
-    def __getattr__(self, name):
-        if name in self._attrs:
-            return self._attrs[name]
-        return object.__getattr__(self, name)
-
-    def attributes(self):
-        return self._attrs.items()
-
-    def children(self):
-        return self._elements
-
-
-class Document(Element):
-    def __init__(self, *args, **kwargs):
-        Element.__init__(self, '?xml', *args, **kwargs)
-
-    def __str__(self):
-        attrs = copy.copy(self._attrs)
-        # pop the required standard attrs out and render in required
-        # order.
-        vers = attrs.pop('version', '1.0')
-        enc = attrs.pop('encoding', 'UTF-8')
-        args = 'version="%s" encoding="%s"' % (vers, enc)
-        if attrs:
-            args = " ".join([args] + ['%s="%s"' %
-                            (k, v if v is not None else "")
-                            for k, v in attrs.items()])
-        string = '<?xml %s?>\n' % args
-        for element in self._elements:
-            string += str(element)
-        return string
-
-
-class Text(Element):
-    def __init__(self, content=""):
-        Element.__init__(self, None)
-        self.__content = content
-
-    def __str__(self):
-        return self.__content
-
-
-def parse_array(node, plurals=None):
-    array = []
-    for child in node.getchildren():
-        array.append(xml_to_json(child,
-                     plurals))
-    return array
-
-
-def xml_to_json(node, plurals=None):
-    """This does a really braindead conversion of an XML tree to
-    something that looks like a json dump. In cases where the XML
-    and json structures are the same, then this "just works". In
-    others, it requires a little hand-editing of the result.
-    """
-    json = {}
-    bool_flag = False
-    int_flag = False
-    long_flag = False
-    for attr in node.keys():
-        if not attr.startswith("xmlns"):
-            json[attr] = node.get(attr)
-            if json[attr] == 'bool':
-                bool_flag = True
-            elif json[attr] == 'int':
-                int_flag = True
-            elif json[attr] == 'long':
-                long_flag = True
-    if not node.getchildren():
-        if bool_flag:
-            return node.text == 'True'
-        elif int_flag:
-            return int(node.text)
-        elif long_flag:
-            return long(node.text)
-        else:
-            return node.text or json
-    for child in node.getchildren():
-        tag = child.tag
-        if tag.startswith("{"):
-            ns, tag = tag.split("}", 1)
-            for key, uri in NEUTRON_NAMESPACES.iteritems():
-                if uri == ns[1:]:
-                    tag = key + ":" + tag
-        if plurals is not None and tag in plurals:
-                json[tag] = parse_array(child, plurals)
-        else:
-            json[tag] = xml_to_json(child, plurals)
-    return json
-
-
-def deep_dict_to_xml(dest, source):
-    """Populates the ``dest`` xml element with the ``source`` ``Mapping``
-       elements, if the source Mapping's value is also a ``Mapping``
-       they will be recursively added as a child elements.
-       :param source: A python ``Mapping`` (dict)
-       :param dest: XML child element will be added to the ``dest``
-    """
-    for element, content in source.iteritems():
-        if isinstance(content, collections.Mapping):
-            xml_element = Element(element)
-            deep_dict_to_xml(xml_element, content)
-            dest.append(xml_element)
-        else:
-            dest.append(Element(element, content))
diff --git a/tempest/config.py b/tempest/config.py
index 616a476..03346c9 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -71,6 +71,10 @@
     cfg.BoolOpt('disable_ssl_certificate_validation',
                 default=False,
                 help="Set to True if using self-signed SSL certificates."),
+    cfg.StrOpt('ca_certificates_file',
+               default=None,
+               help='Specify a CA bundle file to use in verifying a '
+                    'TLS (https) server certificate.'),
     cfg.StrOpt('uri',
                help="Full URI of the OpenStack Identity API (Keystone), v2"),
     cfg.StrOpt('uri_v3',
@@ -143,9 +147,6 @@
     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',
@@ -280,9 +281,6 @@
     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"),
@@ -491,9 +489,6 @@
                      "the extended IPv6 attributes ipv6_ra_mode "
                      "and ipv6_address_mode"
                 ),
-    cfg.BoolOpt('xml_api',
-                default=False,
-                help='If false, skip all network api tests with xml')
 ]
 
 messaging_group = cfg.OptGroup(name='messaging',
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index 6014cff..29898a9 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -30,18 +30,18 @@
 mutable_default_args = re.compile(r"^\s*def .+\((.+=\{\}|.+=\[\])")
 
 
-def import_no_clients_in_api(physical_line, filename):
-    """Check for client imports from tempest/api tests
+def import_no_clients_in_api_and_scenario_tests(physical_line, filename):
+    """Check for client imports from tempest/api & tempest/scenario tests
 
     T102: Cannot import OpenStack python clients
     """
 
-    if "tempest/api" in filename:
+    if "tempest/api" in filename or "tempest/scenario" in filename:
         res = PYTHON_CLIENT_RE.match(physical_line)
         if res:
             return (physical_line.find(res.group(1)),
                     ("T102: python clients import not allowed"
-                     " in tempest/api/* tests"))
+                     " in tempest/api/* or tempest/scenario/* tests"))
 
 
 def scenario_tests_need_service_tags(physical_line, filename,
@@ -117,7 +117,7 @@
 
 
 def factory(register):
-    register(import_no_clients_in_api)
+    register(import_no_clients_in_api_and_scenario_tests)
     register(scenario_tests_need_service_tags)
     register(no_setup_teardown_class_for_tests)
     register(no_vi_headers)
diff --git a/tempest/openstack/common/__init__.py b/tempest/openstack/common/__init__.py
index d1223ea..e69de29 100644
--- a/tempest/openstack/common/__init__.py
+++ b/tempest/openstack/common/__init__.py
@@ -1,17 +0,0 @@
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import six
-
-
-six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox'))
diff --git a/tempest/openstack/common/_i18n.py b/tempest/openstack/common/_i18n.py
new file mode 100644
index 0000000..fdc8327
--- /dev/null
+++ b/tempest/openstack/common/_i18n.py
@@ -0,0 +1,45 @@
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+"""oslo.i18n integration module.
+
+See http://docs.openstack.org/developer/oslo.i18n/usage.html
+
+"""
+
+try:
+    import oslo.i18n
+
+    # NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
+    # application name when this module is synced into the separate
+    # repository. It is OK to have more than one translation function
+    # using the same domain, since there will still only be one message
+    # catalog.
+    _translators = oslo.i18n.TranslatorFactory(domain='tempest')
+
+    # The primary translation function using the well-known name "_"
+    _ = _translators.primary
+
+    # Translators for log levels.
+    #
+    # The abbreviated names are meant to reflect the usual use of a short
+    # name like '_'. The "L" is for "log" and the other letter comes from
+    # the level.
+    _LI = _translators.log_info
+    _LW = _translators.log_warning
+    _LE = _translators.log_error
+    _LC = _translators.log_critical
+except ImportError:
+    # NOTE(dims): Support for cases where a project wants to use
+    # code from tempest-incubator, but is not ready to be internationalized
+    # (like tempest)
+    _ = _LI = _LW = _LE = _LC = lambda x: x
diff --git a/tempest/openstack/common/log.py b/tempest/openstack/common/log.py
index 44102c0..26cd6ad 100644
--- a/tempest/openstack/common/log.py
+++ b/tempest/openstack/common/log.py
@@ -33,20 +33,20 @@
 import logging.config
 import logging.handlers
 import os
+import socket
 import sys
 import traceback
 
 from oslo.config import cfg
+from oslo.serialization import jsonutils
+from oslo.utils import importutils
 import six
 from six import moves
 
-from tempest.openstack.common.gettextutils import _
-from tempest.openstack.common import importutils
-from tempest.openstack.common import jsonutils
+_PY26 = sys.version_info[0:2] == (2, 6)
+
+from tempest.openstack.common._i18n import _
 from tempest.openstack.common import local
-# NOTE(flaper87): Pls, remove when graduating this module
-# from the incubator.
-from tempest.openstack.common.strutils import mask_password  # noqa
 
 
 _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
@@ -124,7 +124,9 @@
                       'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO',
                       'oslo.messaging=INFO', 'iso8601=WARN',
                       'requests.packages.urllib3.connectionpool=WARN',
-                      'urllib3.connectionpool=WARN']
+                      'urllib3.connectionpool=WARN', 'websocket=WARN',
+                      "keystonemiddleware=WARN", "routes.middleware=WARN",
+                      "stevedore=WARN"]
 
 log_opts = [
     cfg.StrOpt('logging_context_format_string',
@@ -227,6 +229,15 @@
     def audit(self, msg, *args, **kwargs):
         self.log(logging.AUDIT, msg, *args, **kwargs)
 
+    def isEnabledFor(self, level):
+        if _PY26:
+            # This method was added in python 2.7 (and it does the exact
+            # same logic, so we need to do the exact same logic so that
+            # python 2.6 has this capability as well).
+            return self.logger.isEnabledFor(level)
+        else:
+            return super(BaseLoggerAdapter, self).isEnabledFor(level)
+
 
 class LazyAdapter(BaseLoggerAdapter):
     def __init__(self, name='unknown', version='unknown'):
@@ -289,11 +300,10 @@
         self.warn(stdmsg, *args, **kwargs)
 
     def process(self, msg, kwargs):
-        # NOTE(mrodden): catch any Message/other object and
-        #                coerce to unicode before they can get
-        #                to the python logging and possibly
-        #                cause string encoding trouble
-        if not isinstance(msg, six.string_types):
+        # NOTE(jecarey): If msg is not unicode, coerce it into unicode
+        #                before it can get to the python logging and
+        #                possibly cause string encoding trouble
+        if not isinstance(msg, six.text_type):
             msg = six.text_type(msg)
 
         if 'extra' not in kwargs:
@@ -410,18 +420,20 @@
     sys.excepthook = _create_logging_excepthook(product_name)
 
 
-def set_defaults(logging_context_format_string,
+def set_defaults(logging_context_format_string=None,
                  default_log_levels=None):
     # Just in case the caller is not setting the
     # default_log_level. This is insurance because
     # we introduced the default_log_level parameter
     # later in a backwards in-compatible change
-    if default_log_levels is None:
-        default_log_levels = DEFAULT_LOG_LEVELS
-    cfg.set_defaults(
+    if default_log_levels is not None:
+        cfg.set_defaults(
             log_opts,
-            logging_context_format_string=logging_context_format_string,
             default_log_levels=default_log_levels)
+    if logging_context_format_string is not None:
+        cfg.set_defaults(
+            log_opts,
+            logging_context_format_string=logging_context_format_string)
 
 
 def _find_facility_from_conf():
@@ -470,18 +482,6 @@
     for handler in log_root.handlers:
         log_root.removeHandler(handler)
 
-    if CONF.use_syslog:
-        facility = _find_facility_from_conf()
-        # TODO(bogdando) use the format provided by RFCSysLogHandler
-        #   after existing syslog format deprecation in J
-        if CONF.use_syslog_rfc_format:
-            syslog = RFCSysLogHandler(address='/dev/log',
-                                      facility=facility)
-        else:
-            syslog = logging.handlers.SysLogHandler(address='/dev/log',
-                                                    facility=facility)
-        log_root.addHandler(syslog)
-
     logpath = _get_log_file_path()
     if logpath:
         filelog = logging.handlers.WatchedFileHandler(logpath)
@@ -540,6 +540,20 @@
         else:
             logger.setLevel(level_name)
 
+    if CONF.use_syslog:
+        try:
+            facility = _find_facility_from_conf()
+            # TODO(bogdando) use the format provided by RFCSysLogHandler
+            #   after existing syslog format deprecation in J
+            if CONF.use_syslog_rfc_format:
+                syslog = RFCSysLogHandler(facility=facility)
+            else:
+                syslog = logging.handlers.SysLogHandler(facility=facility)
+            log_root.addHandler(syslog)
+        except socket.error:
+            log_root.error('Unable to add syslog handler. Verify that syslog '
+                           'is running.')
+
 
 _loggers = {}
 
@@ -609,6 +623,12 @@
     def format(self, record):
         """Uses contextstring if request_id is set, otherwise default."""
 
+        # NOTE(jecarey): If msg is not unicode, coerce it into unicode
+        #                before it can get to the python logging and
+        #                possibly cause string encoding trouble
+        if not isinstance(record.msg, six.text_type):
+            record.msg = six.text_type(record.msg)
+
         # store project info
         record.project = self.project
         record.version = self.version
diff --git a/tempest/scenario/README.rst b/tempest/scenario/README.rst
index 5a287d6..38e0de9 100644
--- a/tempest/scenario/README.rst
+++ b/tempest/scenario/README.rst
@@ -29,9 +29,9 @@
 
 Scope of these tests
 --------------------
-Scenario tests should use the official python client libraries for
-OpenStack, as they provide a more realistic approach in how people
-will interact with the services.
+Scenario tests should always use the Tempest implementation of the
+OpenStack API, as we want to ensure that bugs aren't hidden by the
+official clients.
 
 Tests should be tagged with which services they exercise, as
 determined by which client libraries are used directly by the test.
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index ea4365e..522aa43 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -456,6 +456,68 @@
 
         return tempest.test.call_until_true(ping, timeout, 1)
 
+    def check_vm_connectivity(self, ip_address,
+                              username=None,
+                              private_key=None,
+                              should_connect=True):
+        """
+        :param ip_address: server to test against
+        :param username: server's ssh username
+        :param private_key: server's ssh private key to be used
+        :param should_connect: True/False indicates positive/negative test
+            positive - attempt ping and ssh
+            negative - attempt ping and fail if succeed
+
+        :raises: AssertError if the result of the connectivity check does
+            not match the value of the should_connect param
+        """
+        if should_connect:
+            msg = "Timed out waiting for %s to become reachable" % ip_address
+        else:
+            msg = "ip address %s is reachable" % ip_address
+        self.assertTrue(self.ping_ip_address(ip_address,
+                                             should_succeed=should_connect),
+                        msg=msg)
+        if should_connect:
+            # no need to check ssh for negative connectivity
+            self.get_remote_client(ip_address, username, private_key)
+
+    def check_public_network_connectivity(self, ip_address, username,
+                                          private_key, should_connect=True,
+                                          msg=None, servers=None):
+        # The target login is assumed to have been configured for
+        # key-based authentication by cloud-init.
+        LOG.debug('checking network connections to IP %s with user: %s' %
+                  (ip_address, username))
+        try:
+            self.check_vm_connectivity(ip_address,
+                                       username,
+                                       private_key,
+                                       should_connect=should_connect)
+        except Exception as e:
+            ex_msg = 'Public network connectivity check failed'
+            if msg:
+                ex_msg += ": " + msg
+            LOG.exception(ex_msg)
+            self._log_console_output(servers)
+            # network debug is called as part of ssh init
+            if not isinstance(e, exceptions.SSHTimeout):
+                debug.log_net_debug()
+            raise
+
+    def create_floating_ip(self, thing, pool_name=None):
+        """Creates a floating IP and associates to a server using
+        Nova clients
+        """
+
+        _, floating_ip = self.floating_ips_client.create_floating_ip(pool_name)
+        self.addCleanup(self.delete_wrapper,
+                        self.floating_ips_client.delete_floating_ip,
+                        floating_ip['id'])
+        self.floating_ips_client.associate_floating_ip_to_server(
+            floating_ip['ip'], thing['id'])
+        return floating_ip
+
 
 class NetworkScenarioTest(ScenarioTest):
     """Base class for network scenario tests.
@@ -591,8 +653,13 @@
         net = self._list_networks(name=network_name)
         return net_resources.AttributeDict(net[0])
 
-    def _create_floating_ip(self, thing, external_network_id, port_id=None,
-                            client=None):
+    def create_floating_ip(self, thing, external_network_id=None,
+                           port_id=None, client=None):
+        """Creates a floating IP and associates to a resource/port using
+        Neutron client
+        """
+        if not external_network_id:
+            external_network_id = CONF.network.public_network_id
         if not client:
             client = self.network_client
         if not port_id:
@@ -645,53 +712,6 @@
         LOG.info("FloatingIP: {fp} is at status: {st}"
                  .format(fp=floating_ip, st=status))
 
-    def _check_vm_connectivity(self, ip_address,
-                               username=None,
-                               private_key=None,
-                               should_connect=True):
-        """
-        :param ip_address: server to test against
-        :param username: server's ssh username
-        :param private_key: server's ssh private key to be used
-        :param should_connect: True/False indicates positive/negative test
-            positive - attempt ping and ssh
-            negative - attempt ping and fail if succeed
-
-        :raises: AssertError if the result of the connectivity check does
-            not match the value of the should_connect param
-        """
-        if should_connect:
-            msg = "Timed out waiting for %s to become reachable" % ip_address
-        else:
-            msg = "ip address %s is reachable" % ip_address
-        self.assertTrue(self.ping_ip_address(ip_address,
-                                             should_succeed=should_connect),
-                        msg=msg)
-        if should_connect:
-            # no need to check ssh for negative connectivity
-            self.get_remote_client(ip_address, username, private_key)
-
-    def _check_public_network_connectivity(self, ip_address, username,
-                                           private_key, should_connect=True,
-                                           msg=None, servers=None):
-        # The target login is assumed to have been configured for
-        # key-based authentication by cloud-init.
-        LOG.debug('checking network connections to IP %s with user: %s' %
-                  (ip_address, username))
-        try:
-            self._check_vm_connectivity(ip_address,
-                                        username,
-                                        private_key,
-                                        should_connect=should_connect)
-        except Exception as e:
-            ex_msg = 'Public network connectivity check failed'
-            if msg:
-                ex_msg += ": " + msg
-            LOG.exception(ex_msg)
-            self._log_console_output(servers)
-            self._log_net_info(e)
-            raise
-
     def _check_tenant_network_connectivity(self, server,
                                            username,
                                            private_key,
@@ -706,10 +726,10 @@
         try:
             for net_name, ip_addresses in server['networks'].iteritems():
                 for ip_address in ip_addresses:
-                    self._check_vm_connectivity(ip_address,
-                                                username,
-                                                private_key,
-                                                should_connect=should_connect)
+                    self.check_vm_connectivity(ip_address,
+                                               username,
+                                               private_key,
+                                               should_connect=should_connect)
         except Exception as e:
             LOG.exception('Tenant network connectivity check failed')
             self._log_console_output(servers_for_debug)
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 875a1d9..2014293 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -12,11 +12,10 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import HTMLParser
 import urllib
 import urllib2
 
-from lxml import html
-
 from tempest import config
 from tempest.scenario import manager
 from tempest import test
@@ -24,6 +23,30 @@
 CONF = config.CONF
 
 
+class HorizonHTMLParser(HTMLParser.HTMLParser):
+    csrf_token = None
+    region = None
+
+    def _find_name(self, attrs, name):
+        for attrpair in attrs:
+            if attrpair[0] == 'name' and attrpair[1] == name:
+                return True
+        return False
+
+    def _find_value(self, attrs):
+        for attrpair in attrs:
+            if attrpair[0] == 'value':
+                return attrpair[1]
+        return None
+
+    def handle_starttag(self, tag, attrs):
+        if tag == 'input':
+            if self._find_name(attrs, 'csrfmiddlewaretoken'):
+                self.csrf_token = self._find_value(attrs)
+            if self._find_name(attrs, 'region'):
+                self.region = self._find_value(attrs)
+
+
 class TestDashboardBasicOps(manager.ScenarioTest):
 
     """
@@ -42,17 +65,15 @@
 
     def check_login_page(self):
         response = urllib2.urlopen(CONF.dashboard.dashboard_url)
-        self.assertIn("<h3>Log In</h3>", response.read())
+        self.assertIn("Log In", response.read())
 
     def user_login(self):
         self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
         response = self.opener.open(CONF.dashboard.dashboard_url).read()
 
         # Grab the CSRF token and default region
-        csrf_token = html.fromstring(response).xpath(
-            '//input[@name="csrfmiddlewaretoken"]/@value')[0]
-        region = html.fromstring(response).xpath(
-            '//input[@name="region"]/@value')[0]
+        parser = HorizonHTMLParser()
+        parser.feed(response)
 
         # Prepare login form request
         req = urllib2.Request(CONF.dashboard.login_url)
@@ -60,8 +81,8 @@
         req.add_header('Referer', CONF.dashboard.dashboard_url)
         params = {'username': CONF.identity.username,
                   'password': CONF.identity.password,
-                  'region': region,
-                  'csrfmiddlewaretoken': csrf_token}
+                  'region': parser.region,
+                  'csrfmiddlewaretoken': parser.csrf_token}
         self.opener.open(req, urllib.urlencode(params))
 
     def check_home_page(self):
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 91b95a8..60fd2bd 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -12,6 +12,7 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+from tempest_lib import exceptions
 
 from tempest.common.utils import data_utils
 from tempest import config
@@ -44,6 +45,22 @@
                                     "instances")
         cls.set_network_resources()
         super(TestLargeOpsScenario, cls).resource_setup()
+        # list of cleanup calls to be executed in reverse order
+        cls._cleanup_resources = []
+
+    @classmethod
+    def resource_cleanup(cls):
+        while cls._cleanup_resources:
+            function, args, kwargs = cls._cleanup_resources.pop(-1)
+            try:
+                function(*args, **kwargs)
+            except exceptions.NotFound:
+                pass
+        super(TestLargeOpsScenario, cls).resource_cleanup()
+
+    @classmethod
+    def addCleanupClass(cls, function, *arguments, **keywordArguments):
+        cls._cleanup_resources.append((function, arguments, keywordArguments))
 
     def _wait_for_server_status(self, status):
         for server in self.servers:
@@ -54,13 +71,20 @@
     def nova_boot(self):
         name = data_utils.rand_name('scenario-server-')
         flavor_id = CONF.compute.flavor_ref
-        secgroup = self._create_security_group()
+        # Explicitly create secgroup to avoid cleanup at the end of testcases.
+        # Since no traffic is tested, we don't need to actually add rules to
+        # secgroup
+        _, secgroup = self.security_groups_client.create_security_group(
+            'secgroup-%s' % name, 'secgroup-desc-%s' % name)
+        self.addCleanupClass(self.security_groups_client.delete_security_group,
+                             secgroup['id'])
+
         self.servers_client.create_server(
             name,
             self.image,
             flavor_id,
             min_count=CONF.scenario.large_ops_number,
-            security_groups=[secgroup])
+            security_groups=[{'name': secgroup['name']}])
         # needed because of bug 1199788
         params = {'name': name}
         _, server_list = self.servers_client.list_servers(params)
@@ -68,15 +92,12 @@
         for server in self.servers:
             # after deleting all servers - wait for all servers to clear
             # before cleanup continues
-            self.addCleanup(self.servers_client.wait_for_server_termination,
-                            server['id'])
+            self.addCleanupClass(self.servers_client.
+                                 wait_for_server_termination,
+                                 server['id'])
         for server in self.servers:
-            self.addCleanup_with_wait(
-                waiter_callable=(self.servers_client.
-                                 wait_for_server_termination),
-                thing_id=server['id'], thing_id_param='server_id',
-                cleanup_callable=self.delete_wrapper,
-                cleanup_args=[self.servers_client.delete_server, server['id']])
+            self.addCleanupClass(self.servers_client.delete_server,
+                                 server['id'])
         self._wait_for_server_status('ACTIVE')
 
     def _large_ops_scenario(self):
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 9e404c8..4b2dacd 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -123,10 +123,10 @@
 
     def _create_server(self, name):
         keypair = self.create_keypair()
-        security_groups = [self.security_group]
+        security_groups = [{'name': self.security_group['name']}]
         create_kwargs = {
-            'nics': [
-                {'net-id': self.network['id']},
+            'networks': [
+                {'uuid': self.network['id']},
             ],
             'key_name': keypair['name'],
             'security_groups': security_groups,
@@ -137,7 +137,7 @@
         if (config.network.public_network_id and not
                 config.network.tenant_networks_reachable):
             public_network_id = config.network.public_network_id
-            floating_ip = self._create_floating_ip(
+            floating_ip = self.create_floating_ip(
                 server, public_network_id)
             self.floating_ips[floating_ip] = server
             self.server_ips[server['id']] = floating_ip.floating_ip_address
@@ -170,9 +170,9 @@
                 private_key=private_key)
 
             # Write a backend's response into a file
-            resp = """echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 7\r\n""" \
-                   """Connection: close\r\nContent-Type: text/html; """ \
-                   """charset=UTF-8\r\n\r\n%s"; cat >/dev/null"""
+            resp = ('echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 7\r\n'
+                    'Connection: close\r\nContent-Type: text/html; '
+                    'charset=UTF-8\r\n\r\n%s"; cat >/dev/null')
 
             with tempfile.NamedTemporaryFile() as script:
                 script.write(resp % server_name)
@@ -186,8 +186,9 @@
                                                username, key.name)
 
             # Start netcat
-            start_server = """sudo nc -ll -p %(port)s -e sh """ \
-                           """/tmp/%(script)s &"""
+            start_server = ('while true; do '
+                            'sudo nc -l -p %(port)s -e sh /tmp/%(script)s; '
+                            'done &')
             cmd = start_server % {'port': self.port1,
                                   'script': 'script1'}
             ssh_client.exec_command(cmd)
@@ -215,6 +216,8 @@
                 return False
             except IOError:
                 return False
+            except urllib2.HTTPError:
+                return False
         timeout = config.compute.ping_timeout
         start = time.time()
         while not try_connect(check_ip, port):
@@ -257,8 +260,8 @@
     def _assign_floating_ip_to_vip(self, vip):
         public_network_id = config.network.public_network_id
         port_id = vip.port_id
-        floating_ip = self._create_floating_ip(vip, public_network_id,
-                                               port_id=port_id)
+        floating_ip = self.create_floating_ip(vip, public_network_id,
+                                              port_id=port_id)
         self.floating_ips.setdefault(vip.id, [])
         self.floating_ips[vip.id].append(floating_ip)
 
@@ -297,8 +300,13 @@
     def _send_requests(self, vip_ip, servers):
         counters = dict.fromkeys(servers, 0)
         for i in range(self.num):
-            server = urllib2.urlopen("http://{0}/".format(vip_ip)).read()
-            counters[server] += 1
+            try:
+                server = urllib2.urlopen("http://{0}/".format(vip_ip)).read()
+                counters[server] += 1
+            # HTTP exception means fail of server, so don't increase counter
+            # of success and continue connection tries
+            except urllib2.HTTPError:
+                continue
         # Assert that each member of the pool gets balanced at least once
         for member, counter in counters.iteritems():
             self.assertGreater(counter, 0, 'Member %s never balanced' % member)
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index ead021e..59af6b3 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -89,16 +89,6 @@
         self.servers_client.reboot(self.server['id'], 'SOFT')
         self._wait_for_server_status('ACTIVE')
 
-    def nova_floating_ip_create(self):
-        _, self.floating_ip = self.floating_ips_client.create_floating_ip()
-        self.addCleanup(self.delete_wrapper,
-                        self.floating_ips_client.delete_floating_ip,
-                        self.floating_ip['id'])
-
-    def nova_floating_ip_add(self):
-        self.floating_ips_client.associate_floating_ip_to_server(
-            self.floating_ip['ip'], self.server['id'])
-
     def ssh_to_server(self):
         try:
             self.linux_client = self.get_remote_client(self.floating_ip['ip'])
@@ -155,8 +145,7 @@
         self.addCleanup(self.nova_volume_detach)
         self.cinder_show()
 
-        self.nova_floating_ip_create()
-        self.nova_floating_ip_add()
+        self.floating_ip = self.create_floating_ip(self.server)
         self.create_and_add_security_group()
         self.ssh_to_server()
         self.nova_reboot()
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 0c48334..61c710e 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -65,13 +65,13 @@
                 {'uuid': network.id},
             ],
             'key_name': self.keypair['name'],
-            'security_groups': [security_group],
+            'security_groups': [{'name': security_group['name']}],
         }
         server_name = data_utils.rand_name('server-smoke')
         self.server = self.create_server(name=server_name,
                                          create_kwargs=create_kwargs)
-        self.floating_ip = self._create_floating_ip(self.server,
-                                                    public_network_id)
+        self.floating_ip = self.create_floating_ip(self.server,
+                                                   public_network_id)
         # Verify that we can indeed connect to the server before we mess with
         # it's state
         self._wait_server_status_and_check_network_connectivity()
@@ -84,9 +84,9 @@
             should_connect=should_connect,
             servers_for_debug=[self.server])
         floating_ip = self.floating_ip.floating_ip_address
-        self._check_public_network_connectivity(floating_ip, username,
-                                                private_key, should_connect,
-                                                servers=[self.server])
+        self.check_public_network_connectivity(floating_ip, username,
+                                               private_key, should_connect,
+                                               servers=[self.server])
         self.check_floating_ip_status(self.floating_ip, 'ACTIVE')
 
     def _wait_server_status_and_check_network_connectivity(self):
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index e3f87e9..9618124 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -112,7 +112,8 @@
         server = self._create_server(name, self.network)
         self._check_tenant_network_connectivity()
 
-        self._create_and_associate_floating_ips(server)
+        floating_ip = self.create_floating_ip(server)
+        self.floating_ip_tuple = Floating_IP_tuple(floating_ip, server)
 
     def check_networks(self):
         """
@@ -145,7 +146,7 @@
     def _create_server(self, name, network):
         keypair = self.create_keypair()
         self.keypairs[keypair['name']] = keypair
-        security_groups = [self.security_group]
+        security_groups = [{'name': self.security_group['name']}]
         create_kwargs = {
             'networks': [
                 {'uuid': network.id},
@@ -169,13 +170,8 @@
                     server, ssh_login, self._get_server_key(server),
                     servers_for_debug=self.servers)
 
-    def _create_and_associate_floating_ips(self, server):
-        public_network_id = CONF.network.public_network_id
-        floating_ip = self._create_floating_ip(server, public_network_id)
-        self.floating_ip_tuple = Floating_IP_tuple(floating_ip, server)
-
-    def _check_public_network_connectivity(self, should_connect=True,
-                                           msg=None):
+    def check_public_network_connectivity(self, should_connect=True,
+                                          msg=None):
         """Verifies connectivty to a VM via public network and floating IP,
         and verifies floating IP has resource status is correct.
 
@@ -194,7 +190,7 @@
             private_key = self._get_server_key(server)
             floatingip_status = 'ACTIVE'
         # call the common method in the parent class
-        super(TestNetworkBasicOps, self)._check_public_network_connectivity(
+        super(TestNetworkBasicOps, self).check_public_network_connectivity(
             ip_address, ssh_login, private_key, should_connect, msg,
             self.servers)
         self.check_floating_ip_status(floating_ip, floatingip_status)
@@ -367,17 +363,17 @@
 
         """
         self._setup_network_and_servers()
-        self._check_public_network_connectivity(should_connect=True)
+        self.check_public_network_connectivity(should_connect=True)
         self._check_network_internal_connectivity(network=self.network)
         self._check_network_external_connectivity()
         self._disassociate_floating_ips()
-        self._check_public_network_connectivity(should_connect=False,
-                                                msg="after disassociate "
-                                                    "floating ip")
+        self.check_public_network_connectivity(should_connect=False,
+                                               msg="after disassociate "
+                                                   "floating ip")
         self._reassociate_floating_ips()
-        self._check_public_network_connectivity(should_connect=True,
-                                                msg="after re-associate "
-                                                    "floating ip")
+        self.check_public_network_connectivity(should_connect=True,
+                                               msg="after re-associate "
+                                                   "floating ip")
 
     @testtools.skipUnless(CONF.compute_feature_enabled.interface_attach,
                           'NIC hotplug not available')
@@ -393,7 +389,7 @@
 
         """
         self._setup_network_and_servers()
-        self._check_public_network_connectivity(should_connect=True)
+        self.check_public_network_connectivity(should_connect=True)
         self._create_new_network()
         self._hotplug_server()
         self._check_network_internal_connectivity(network=self.new_net)
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 6ea3253..7e6805c 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -230,12 +230,13 @@
         self._set_compute_context(tenant)
         if security_groups is None:
             security_groups = [tenant.security_groups['default']]
+        security_groups_names = [{'name': s['name']} for s in security_groups]
         create_kwargs = {
             'networks': [
                 {'uuid': tenant.network.id},
             ],
             'key_name': tenant.keypair['name'],
-            'security_groups': security_groups,
+            'security_groups': security_groups_names,
             'tenant_id': tenant.creds.tenant_id
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
@@ -271,7 +272,7 @@
 
     def _assign_floating_ips(self, tenant, server):
         public_network_id = CONF.network.public_network_id
-        floating_ip = self._create_floating_ip(
+        floating_ip = self.create_floating_ip(
             server, public_network_id,
             client=tenant.manager.network_client)
         self.floating_ips.setdefault(server['id'], floating_ip)
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index eb636f7..7e512a9 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -68,7 +68,7 @@
 
     def boot_instance(self):
         # Create server with image and flavor from input scenario
-        security_groups = [self.security_group]
+        security_groups = [{'name': self.security_group['name']}]
         create_kwargs = {
             'key_name': self.keypair['name'],
             'security_groups': security_groups
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
new file mode 100644
index 0000000..8882177
--- /dev/null
+++ b/tempest/scenario/test_shelve_instance.py
@@ -0,0 +1,97 @@
+# Copyright 2014 Scality
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import testtools
+
+from tempest import config
+from tempest.openstack.common import log
+from tempest.scenario import manager
+from tempest import test
+
+CONF = config.CONF
+
+LOG = log.getLogger(__name__)
+
+
+class TestShelveInstance(manager.ScenarioTest):
+    """
+    This test shelves then unshelves a Nova instance
+    The following is the scenario outline:
+     * boot a instance and create a timestamp file in it
+     * shelve the instance
+     * unshelve the instance
+     * check the existence of the timestamp file in the unshelved instance
+
+    """
+
+    def _write_timestamp(self, server_or_ip):
+        ssh_client = self.get_remote_client(server_or_ip)
+        ssh_client.exec_command('date > /tmp/timestamp; sync')
+        self.timestamp = ssh_client.exec_command('cat /tmp/timestamp')
+
+    def _check_timestamp(self, server_or_ip):
+        ssh_client = self.get_remote_client(server_or_ip)
+        got_timestamp = ssh_client.exec_command('cat /tmp/timestamp')
+        self.assertEqual(self.timestamp, got_timestamp)
+
+    def _shelve_then_unshelve_server(self, server):
+        self.servers_client.shelve_server(server['id'])
+        offload_time = CONF.compute.shelved_offload_time
+        if offload_time >= 0:
+            self.servers_client.wait_for_server_status(
+                server['id'], 'SHELVED_OFFLOADED', extra_timeout=offload_time)
+        else:
+            self.servers_client.wait_for_server_status(server['id'], 'SHELVED')
+            self.servers_client.shelve_offload_server(server['id'])
+            self.servers_client.wait_for_server_status(server['id'],
+                                                       'SHELVED_OFFLOADED')
+        self.servers_client.unshelve_server(server['id'])
+        self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
+
+    @testtools.skipUnless(CONF.compute_feature_enabled.shelve,
+                          'Shelve is not available.')
+    @test.services('compute', 'network', 'image')
+    def test_shelve_instance(self):
+        self.keypair = self.create_keypair()
+
+        self.security_group = self._create_security_group()
+        security_groups = [{'name': self.security_group['name']}]
+
+        create_kwargs = {
+            'key_name': self.keypair['name'],
+            'security_groups': security_groups
+        }
+        server = self.create_server(image=CONF.compute.image_ref,
+                                    create_kwargs=create_kwargs)
+
+        if CONF.compute.use_floatingip_for_ssh:
+            _, floating_ip = self.floating_ips_client.create_floating_ip()
+            self.addCleanup(self.delete_wrapper,
+                            self.floating_ips_client.delete_floating_ip,
+                            floating_ip['id'])
+            self.floating_ips_client.associate_floating_ip_to_server(
+                floating_ip['ip'], server['id'])
+            self._write_timestamp(floating_ip['ip'])
+        else:
+            self._write_timestamp(server)
+
+        # Prevent bug #1257594 from coming back
+        # Unshelve used to boot the instance with the original image, not
+        # with the instance snapshot
+        self._shelve_then_unshelve_server(server)
+        if CONF.compute.use_floatingip_for_ssh:
+            self._check_timestamp(floating_ip['ip'])
+        else:
+            self._check_timestamp(server)
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index dc32edc..159585b 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -37,7 +37,7 @@
     """
 
     def _boot_image(self, image_id):
-        security_groups = [self.security_group]
+        security_groups = [{'name': self.security_group['name']}]
         create_kwargs = {
             'key_name': self.keypair['name'],
             'security_groups': security_groups
@@ -65,17 +65,6 @@
         got_timestamp = ssh_client.exec_command('cat /tmp/timestamp')
         self.assertEqual(self.timestamp, got_timestamp)
 
-    def _create_floating_ip(self):
-        _, floating_ip = self.floating_ips_client.create_floating_ip()
-        self.addCleanup(self.delete_wrapper,
-                        self.floating_ips_client.delete_floating_ip,
-                        floating_ip['id'])
-        return floating_ip
-
-    def _set_floating_ip_to_server(self, server, floating_ip):
-        self.floating_ips_client.associate_floating_ip_to_server(
-            floating_ip['ip'], server['id'])
-
     @testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
                           'Snapshotting is not available.')
     @test.services('compute', 'network', 'image')
@@ -87,8 +76,7 @@
         # boot a instance and create a timestamp file in it
         server = self._boot_image(CONF.compute.image_ref)
         if CONF.compute.use_floatingip_for_ssh:
-            fip_for_server = self._create_floating_ip()
-            self._set_floating_ip_to_server(server, fip_for_server)
+            fip_for_server = self.create_floating_ip(server)
             self._write_timestamp(fip_for_server['ip'])
         else:
             self._write_timestamp(server)
@@ -101,9 +89,7 @@
 
         # check the existence of the timestamp file in the second instance
         if CONF.compute.use_floatingip_for_ssh:
-            fip_for_snapshot = self._create_floating_ip()
-            self._set_floating_ip_to_server(server_from_snapshot,
-                                            fip_for_snapshot)
+            fip_for_snapshot = self.create_floating_ip(server_from_snapshot)
             self._check_timestamp(fip_for_snapshot['ip'])
         else:
             self._check_timestamp(server_from_snapshot)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index e30c824..cfc1d37 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -61,7 +61,7 @@
                                                        status)
 
     def _boot_image(self, image_id):
-        security_groups = [self.security_group]
+        security_groups = [{'name': self.security_group['name']}]
         create_kwargs = {
             'key_name': self.keypair['name'],
             'security_groups': security_groups
@@ -71,17 +71,6 @@
     def _add_keypair(self):
         self.keypair = self.create_keypair()
 
-    def _create_floating_ip(self):
-        _, floating_ip = self.floating_ips_client.create_floating_ip()
-        self.addCleanup(self.delete_wrapper,
-                        self.floating_ips_client.delete_floating_ip,
-                        floating_ip['id'])
-        return floating_ip
-
-    def _add_floating_ip(self, server, floating_ip):
-        self.floating_ips_client.associate_floating_ip_to_server(
-            floating_ip['ip'], server['id'])
-
     def _ssh_to_server(self, server_or_ip):
         return self.get_remote_client(server_or_ip)
 
@@ -163,8 +152,7 @@
 
         # create and add floating IP to server1
         if CONF.compute.use_floatingip_for_ssh:
-            floating_ip_for_server = self._create_floating_ip()
-            self._add_floating_ip(server, floating_ip_for_server)
+            floating_ip_for_server = self.create_floating_ip(server)
             ip_for_server = floating_ip_for_server['ip']
         else:
             ip_for_server = server
@@ -189,9 +177,8 @@
 
         # create and add floating IP to server_from_snapshot
         if CONF.compute.use_floatingip_for_ssh:
-            floating_ip_for_snapshot = self._create_floating_ip()
-            self._add_floating_ip(server_from_snapshot,
-                                  floating_ip_for_snapshot)
+            floating_ip_for_snapshot = self.create_floating_ip(
+                server_from_snapshot)
             ip_for_snapshot = floating_ip_for_snapshot['ip']
         else:
             ip_for_snapshot = server_from_snapshot
diff --git a/tempest/scenario/test_swift_basic_ops.py b/tempest/scenario/test_swift_basic_ops.py
index fcb9505..312fbc6 100644
--- a/tempest/scenario/test_swift_basic_ops.py
+++ b/tempest/scenario/test_swift_basic_ops.py
@@ -65,7 +65,10 @@
         obj_name, _ = self.upload_object_to_container(container_name)
         obj_url = '%s/%s/%s' % (self.object_client.base_url,
                                 container_name, obj_name)
-        http_client = http.ClosingHttp()
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
+        http_client = http.ClosingHttp(
+            disable_ssl_certificate_validation=dscv, ca_certs=ca_certs)
         resp, _ = http_client.request(obj_url, 'GET')
         self.assertEqual(resp.status, 401)
         self.change_container_acl(container_name, '.r:*')
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 62876c4..dd115e7 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -136,6 +136,7 @@
         actual = self._get_content(ssh_client)
         self.assertEqual(expected, actual)
 
+    @test.skip_because(bug='1373513')
     @test.services('compute', 'volume', 'image')
     def test_volume_boot_pattern(self):
         keypair = self.create_keypair()
diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py
index 7af904b..f581e89 100644
--- a/tempest/services/botoclients.py
+++ b/tempest/services/botoclients.py
@@ -38,6 +38,7 @@
         # FIXME(andreaf) replace credentials and auth_url with auth_provider
 
         insecure_ssl = CONF.identity.disable_ssl_certificate_validation
+        ca_cert = CONF.identity.ca_certificates_file
 
         self.connection_timeout = str(CONF.boto.http_socket_timeout)
         self.num_retries = str(CONF.boto.num_retries)
@@ -46,7 +47,8 @@
                         "password": password,
                         "auth_url": auth_url,
                         "tenant_name": tenant_name,
-                        "insecure": insecure_ssl}
+                        "insecure": insecure_ssl,
+                        "cacert": ca_cert}
 
     def _keystone_aws_get(self):
         # FIXME(andreaf) Move EC2 credentials to AuthProvider
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index 309dc5b..b23b20b 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -73,10 +73,9 @@
         metadata: A dictionary of values to be used as metadata.
         """
         post_body = {
-            'size': size,
-            'display_name': kwargs.get('display_name'),
-            'metadata': kwargs.get('metadata'),
+            'size': size
         }
+        post_body.update(kwargs)
 
         post_body = json.dumps({'volume': post_body})
         resp, body = self.post('os-volumes', post_body)
@@ -93,7 +92,6 @@
     def wait_for_volume_status(self, volume_id, status):
         """Waits for a Volume to reach a given status."""
         resp, body = self.get_volume(volume_id)
-        volume_name = body['displayName']
         volume_status = body['status']
         start = int(time.time())
 
@@ -107,7 +105,7 @@
             if int(time.time()) - start >= self.build_timeout:
                 message = ('Volume %s failed to reach %s status within '
                            'the required time (%s s).' %
-                           (volume_name, status, self.build_timeout))
+                           (volume_id, status, self.build_timeout))
                 raise exceptions.TimeoutException(message)
 
     def is_resource_deleted(self, id):
diff --git a/tempest/services/compute/xml/__init__.py b/tempest/services/compute/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/compute/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py
deleted file mode 100644
index 47cde65..0000000
--- a/tempest/services/compute/xml/aggregates_client.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 2013 NEC Corporation.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class AggregatesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(AggregatesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _format_aggregate(self, g):
-        agg = xml_utils.xml_to_json(g)
-        aggregate = {}
-        for key, value in agg.items():
-            if key == 'hosts':
-                aggregate['hosts'] = []
-                for k, v in value.items():
-                    aggregate['hosts'].append(v)
-            elif key == 'availability_zone':
-                aggregate[key] = None if value == 'None' else value
-            else:
-                aggregate[key] = value
-        return aggregate
-
-    def _parse_array(self, node):
-        return [self._format_aggregate(x) for x in node]
-
-    def list_aggregates(self):
-        """Get aggregate list."""
-        resp, body = self.get("os-aggregates")
-        aggregates = self._parse_array(etree.fromstring(body))
-        return resp, aggregates
-
-    def get_aggregate(self, aggregate_id):
-        """Get details of the given aggregate."""
-        resp, body = self.get("os-aggregates/%s" % str(aggregate_id))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def create_aggregate(self, name, availability_zone=None):
-        """Creates a new aggregate."""
-        if availability_zone is not None:
-            post_body = xml_utils.Element("aggregate", name=name,
-                                          availability_zone=availability_zone)
-        else:
-            post_body = xml_utils.Element("aggregate", name=name)
-        resp, body = self.post('os-aggregates',
-                               str(xml_utils.Document(post_body)))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def update_aggregate(self, aggregate_id, name, availability_zone=None):
-        """Update a aggregate."""
-        if availability_zone is not None:
-            put_body = xml_utils.Element("aggregate", name=name,
-                                         availability_zone=availability_zone)
-        else:
-            put_body = xml_utils.Element("aggregate", name=name)
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              str(xml_utils.Document(put_body)))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def delete_aggregate(self, aggregate_id):
-        """Deletes the given aggregate."""
-        return self.delete("os-aggregates/%s" % str(aggregate_id))
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_aggregate(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'aggregate'
-
-    def add_host(self, aggregate_id, host):
-        """Adds a host to the given aggregate."""
-        post_body = xml_utils.Element("add_host", host=host)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(xml_utils.Document(post_body)))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def remove_host(self, aggregate_id, host):
-        """Removes a host from the given aggregate."""
-        post_body = xml_utils.Element("remove_host", host=host)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(xml_utils.Document(post_body)))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def set_metadata(self, aggregate_id, meta):
-        """Replaces the aggregate's existing metadata with new metadata."""
-        post_body = xml_utils.Element("set_metadata")
-        metadata = xml_utils.Element("metadata")
-        post_body.append(metadata)
-        for k, v in meta.items():
-            meta = xml_utils.Element(k)
-            meta.append(xml_utils.Text(v))
-            metadata.append(meta)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(xml_utils.Document(post_body)))
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py
deleted file mode 100644
index 38446b8..0000000
--- a/tempest/services/compute/xml/availability_zone_client.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class AvailabilityZoneClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(AvailabilityZoneClientXML, self).__init__(
-            auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        return [xml_utils.xml_to_json(x) for x in node]
-
-    def get_availability_zone_list(self):
-        resp, body = self.get('os-availability-zone')
-        availability_zone = self._parse_array(etree.fromstring(body))
-        return resp, availability_zone
-
-    def get_availability_zone_list_detail(self):
-        resp, body = self.get('os-availability-zone/detail')
-        availability_zone = self._parse_array(etree.fromstring(body))
-        return resp, availability_zone
diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py
deleted file mode 100644
index 24ffca8..0000000
--- a/tempest/services/compute/xml/certificates_client.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2013 IBM Corp
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-
-from tempest.common import rest_client
-from tempest import config
-
-CONF = config.CONF
-
-
-class CertificatesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(CertificatesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def get_certificate(self, id):
-        url = "os-certificates/%s" % (id)
-        resp, body = self.get(url)
-        body = self._parse_resp(body)
-        return resp, body
-
-    def create_certificate(self):
-        """create certificates."""
-        url = "os-certificates"
-        resp, body = self.post(url, None)
-        body = self._parse_resp(body)
-        return resp, body
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
deleted file mode 100644
index d924dff..0000000
--- a/tempest/services/compute/xml/extensions_client.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class ExtensionsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(ExtensionsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node:
-            array.append(xml_utils.xml_to_json(child))
-        return array
-
-    def list_extensions(self):
-        url = 'extensions'
-        resp, body = self.get(url)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def is_enabled(self, extension):
-        _, extensions = self.list_extensions()
-        exts = extensions['extensions']
-        return any([e for e in exts if e['name'] == extension])
-
-    def get_extension(self, extension_alias):
-        resp, body = self.get('extensions/%s' % extension_alias)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py
deleted file mode 100644
index e14ced6..0000000
--- a/tempest/services/compute/xml/fixed_ips_client.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2013 IBM Corp
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class FixedIPsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(FixedIPsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def get_fixed_ip_details(self, fixed_ip):
-        url = "os-fixed-ips/%s" % (fixed_ip)
-        resp, body = self.get(url)
-        body = self._parse_resp(body)
-        return resp, body
-
-    def reserve_fixed_ip(self, ip, body):
-        """This reserves and unreserves fixed ips."""
-        url = "os-fixed-ips/%s/action" % (ip)
-        # NOTE(maurosr): First converts the dict body to a json string then
-        # accept any action key value here to permit tests to cover cases with
-        # invalid actions raising badrequest.
-        key, value = body.popitem()
-        xml_body = xml_utils.Element(key)
-        xml_body.append(xml_utils.Text(value))
-        resp, body = self.post(url, str(xml_utils.Document(xml_body)))
-        return resp, body
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
deleted file mode 100644
index 63d1a4d..0000000
--- a/tempest/services/compute/xml/flavors_client.py
+++ /dev/null
@@ -1,216 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS_OS_FLV_EXT_DATA = \
-    "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1"
-XMLNS_OS_FLV_ACCESS = \
-    "http://docs.openstack.org/compute/ext/flavor_access/api/v2"
-
-
-class FlavorsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(FlavorsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _format_flavor(self, f):
-        flavor = {'links': []}
-        for k, v in f.items():
-            if k == 'id':
-                flavor['id'] = v
-                continue
-
-            if k == 'link':
-                flavor['links'].append(v)
-                continue
-
-            if k == '{%s}ephemeral' % XMLNS_OS_FLV_EXT_DATA:
-                k = 'OS-FLV-EXT-DATA:ephemeral'
-
-            if k == '{%s}is_public' % XMLNS_OS_FLV_ACCESS:
-                k = 'os-flavor-access:is_public'
-                v = True if v == 'True' else False
-
-            if k == 'extra_specs':
-                k = 'OS-FLV-WITH-EXT-SPECS:extra_specs'
-                flavor[k] = dict(v)
-                continue
-
-            try:
-                v = int(v)
-            except ValueError:
-                try:
-                    v = float(v)
-                except ValueError:
-                    pass
-
-            flavor[k] = v
-
-        return flavor
-
-    def _parse_array(self, node):
-        return [self._format_flavor(xml_utils.xml_to_json(x)) for x in node]
-
-    def _list_flavors(self, url, params):
-        if params:
-            url += "?%s" % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        flavors = self._parse_array(etree.fromstring(body))
-        return resp, flavors
-
-    def list_flavors(self, params=None):
-        url = 'flavors'
-        return self._list_flavors(url, params)
-
-    def list_flavors_with_detail(self, params=None):
-        url = 'flavors/detail'
-        return self._list_flavors(url, params)
-
-    def get_flavor_details(self, flavor_id):
-        resp, body = self.get("flavors/%s" % str(flavor_id))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        flavor = self._format_flavor(body)
-        return resp, flavor
-
-    def create_flavor(self, name, ram, vcpus, disk, flavor_id, **kwargs):
-        """Creates a new flavor or instance type."""
-        flavor = xml_utils.Element("flavor",
-                                   xmlns=xml_utils.XMLNS_11,
-                                   ram=ram,
-                                   vcpus=vcpus,
-                                   disk=disk,
-                                   id=flavor_id,
-                                   name=name)
-        if kwargs.get('rxtx'):
-            flavor.add_attr('rxtx_factor', kwargs.get('rxtx'))
-        if kwargs.get('swap'):
-            flavor.add_attr('swap', kwargs.get('swap'))
-        if kwargs.get('ephemeral'):
-            flavor.add_attr('OS-FLV-EXT-DATA:ephemeral',
-                            kwargs.get('ephemeral'))
-        if kwargs.get('is_public'):
-            flavor.add_attr('os-flavor-access:is_public',
-                            kwargs.get('is_public'))
-        flavor.add_attr('xmlns:OS-FLV-EXT-DATA', XMLNS_OS_FLV_EXT_DATA)
-        flavor.add_attr('xmlns:os-flavor-access', XMLNS_OS_FLV_ACCESS)
-        resp, body = self.post('flavors', str(xml_utils.Document(flavor)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        flavor = self._format_flavor(body)
-        return resp, flavor
-
-    def delete_flavor(self, flavor_id):
-        """Deletes the given flavor."""
-        return self.delete("flavors/%s" % str(flavor_id))
-
-    def is_resource_deleted(self, id):
-        # Did not use get_flavor_details(id) for verification as it gives
-        # 200 ok even for deleted id. LP #981263
-        # we can remove the loop here and use get by ID when bug gets sortedout
-        resp, flavors = self.list_flavors_with_detail()
-        for flavor in flavors:
-            if flavor['id'] == id:
-                return False
-        return True
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'flavor'
-
-    def set_flavor_extra_spec(self, flavor_id, specs):
-        """Sets extra Specs to the mentioned flavor."""
-        extra_specs = xml_utils.Element("extra_specs")
-        for key in specs.keys():
-            extra_specs.add_attr(key, specs[key])
-        resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               str(xml_utils.Document(extra_specs)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def get_flavor_extra_spec(self, flavor_id):
-        """Gets extra Specs of the mentioned flavor."""
-        resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def get_flavor_extra_spec_with_key(self, flavor_id, key):
-        """Gets extra Specs key-value of the mentioned flavor and key."""
-        resp, xml_body = self.get('flavors/%s/os-extra_specs/%s' %
-                                  (str(flavor_id), key))
-        body = {}
-        element = etree.fromstring(xml_body)
-        key = element.get('key')
-        body[key] = xml_utils.xml_to_json(element)
-        return resp, body
-
-    def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
-        """Update extra Specs details of the mentioned flavor and key."""
-        doc = xml_utils.Document()
-        for (k, v) in kwargs.items():
-            element = xml_utils.Element(k)
-            doc.append(element)
-            value = xml_utils.Text(v)
-            element.append(value)
-
-        resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key), str(doc))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, {key: body}
-
-    def unset_flavor_extra_spec(self, flavor_id, key):
-        """Unsets an extra spec based on the mentioned flavor and key."""
-        return self.delete('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
-                           key))
-
-    def _parse_array_access(self, node):
-        return [xml_utils.xml_to_json(x) for x in node]
-
-    def list_flavor_access(self, flavor_id):
-        """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % str(flavor_id))
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def add_flavor_access(self, flavor_id, tenant_id):
-        """Add flavor access for the specified tenant."""
-        doc = xml_utils.Document()
-        server = xml_utils.Element("addTenantAccess")
-        doc.append(server)
-        server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
-        body = self._parse_array_access(etree.fromstring(body))
-        return resp, body
-
-    def remove_flavor_access(self, flavor_id, tenant_id):
-        """Remove flavor access from the specified tenant."""
-        doc = xml_utils.Document()
-        server = xml_utils.Element("removeTenantAccess")
-        doc.append(server)
-        server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
-        body = self._parse_array_access(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
deleted file mode 100644
index 84f06ab..0000000
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class FloatingIPsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(FloatingIPsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(xml_utils.xml_to_json(child))
-        return array
-
-    def _parse_floating_ip(self, body):
-        json = xml_utils.xml_to_json(body)
-        return json
-
-    def list_floating_ips(self, params=None):
-        """Returns a list of all floating IPs filtered by any parameters."""
-        url = 'os-floating-ips'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_floating_ip_details(self, floating_ip_id):
-        """Get the details of a floating IP."""
-        url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.get(url)
-        body = self._parse_floating_ip(etree.fromstring(body))
-        if resp.status == 404:
-            raise exceptions.NotFound(body)
-        return resp, body
-
-    def create_floating_ip(self, pool_name=None):
-        """Allocate a floating IP to the project."""
-        url = 'os-floating-ips'
-        if pool_name:
-            doc = xml_utils.Document()
-            pool = xml_utils.Element("pool")
-            pool.append(xml_utils.Text(pool_name))
-            doc.append(pool)
-            resp, body = self.post(url, str(doc))
-        else:
-            resp, body = self.post(url, None)
-        body = self._parse_floating_ip(etree.fromstring(body))
-        return resp, body
-
-    def delete_floating_ip(self, floating_ip_id):
-        """Deletes the provided floating IP from the project."""
-        url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.delete(url)
-        return resp, body
-
-    def associate_floating_ip_to_server(self, floating_ip, server_id):
-        """Associate the provided floating IP to a specific server."""
-        url = "servers/%s/action" % str(server_id)
-        doc = xml_utils.Document()
-        server = xml_utils.Element("addFloatingIp")
-        doc.append(server)
-        server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc))
-        return resp, body
-
-    def disassociate_floating_ip_from_server(self, floating_ip, server_id):
-        """Disassociate the provided floating IP from a specific server."""
-        url = "servers/%s/action" % str(server_id)
-        doc = xml_utils.Document()
-        server = xml_utils.Element("removeFloatingIp")
-        doc.append(server)
-        server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc))
-        return resp, body
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_floating_ip_details(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'floating_ip'
-
-    def list_floating_ip_pools(self, params=None):
-        """Returns a list of all floating IP Pools."""
-        url = 'os-floating-ip-pools'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py
deleted file mode 100644
index ddb92b6..0000000
--- a/tempest/services/compute/xml/hosts_client.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class HostsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(HostsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def list_hosts(self, params=None):
-        """Lists all hosts."""
-
-        url = 'os-hosts'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
-
-    def show_host_detail(self, hostname):
-        """Show detail information for the host."""
-
-        resp, body = self.get("os-hosts/%s" % str(hostname))
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(node)]
-        return resp, body
-
-    def update_host(self, hostname, **kwargs):
-        """Update a host."""
-
-        request_body = xml_utils.Element("updates")
-        if kwargs:
-            for k, v in kwargs.iteritems():
-                request_body.append(xml_utils.Element(k, v))
-        resp, body = self.put("os-hosts/%s" % str(hostname),
-                              str(xml_utils.Document(request_body)))
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
-
-    def startup_host(self, hostname):
-        """Startup a host."""
-
-        resp, body = self.get("os-hosts/%s/startup" % str(hostname))
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
-
-    def shutdown_host(self, hostname):
-        """Shutdown a host."""
-
-        resp, body = self.get("os-hosts/%s/shutdown" % str(hostname))
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
-
-    def reboot_host(self, hostname):
-        """Reboot a host."""
-
-        resp, body = self.get("os-hosts/%s/reboot" % str(hostname))
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py
deleted file mode 100644
index 1452708..0000000
--- a/tempest/services/compute/xml/hypervisor_client.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class HypervisorClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(HypervisorClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        return [xml_utils.xml_to_json(x) for x in node]
-
-    def get_hypervisor_list(self):
-        """List hypervisors information."""
-        resp, body = self.get('os-hypervisors')
-        hypervisors = self._parse_array(etree.fromstring(body))
-        return resp, hypervisors
-
-    def get_hypervisor_list_details(self):
-        """Show detailed hypervisors information."""
-        resp, body = self.get('os-hypervisors/detail')
-        hypervisors = self._parse_array(etree.fromstring(body))
-        return resp, hypervisors
-
-    def get_hypervisor_show_details(self, hyper_id):
-        """Display the details of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s' % hyper_id)
-        hypervisor = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, hypervisor
-
-    def get_hypervisor_servers(self, hyper_name):
-        """List instances belonging to the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/servers' % hyper_name)
-        hypervisors = self._parse_array(etree.fromstring(body))
-        return resp, hypervisors
-
-    def get_hypervisor_stats(self):
-        """Get hypervisor statistics over all compute nodes."""
-        resp, body = self.get('os-hypervisors/statistics')
-        stats = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, stats
-
-    def get_hypervisor_uptime(self, hyper_id):
-        """Display the uptime of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
-        uptime = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, uptime
-
-    def search_hypervisor(self, hyper_name):
-        """Search specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/search' % hyper_name)
-        hypervisors = self._parse_array(etree.fromstring(body))
-        return resp, hypervisors
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
deleted file mode 100644
index ce37b07..0000000
--- a/tempest/services/compute/xml/images_client.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import waiters
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class ImagesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(ImagesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-        self.build_interval = CONF.compute.build_interval
-        self.build_timeout = CONF.compute.build_timeout
-
-    def _parse_server(self, node):
-        data = xml_utils.xml_to_json(node)
-        return self._parse_links(node, data)
-
-    def _parse_image(self, node):
-        """Parses detailed XML image information into dictionary."""
-        data = xml_utils.xml_to_json(node)
-
-        self._parse_links(node, data)
-
-        # parse all metadata
-        if 'metadata' in data:
-            tag = node.find('{%s}metadata' % xml_utils.XMLNS_11)
-            data['metadata'] = dict((x.get('key'), x.text)
-                                    for x in tag.getchildren())
-
-        # parse server information
-        if 'server' in data:
-            tag = node.find('{%s}server' % xml_utils.XMLNS_11)
-            data['server'] = self._parse_server(tag)
-        return data
-
-    def _parse_links(self, node, data):
-        """Append multiple links under a list."""
-        # look for links
-        if 'link' in data:
-            # remove single link element
-            del data['link']
-            data['links'] = [xml_utils.xml_to_json(x) for x in
-                             node.findall('{http://www.w3.org/2005/Atom}link')]
-        return data
-
-    def _parse_images(self, xml):
-        data = {'images': []}
-        images = xml.getchildren()
-        for image in images:
-            data['images'].append(self._parse_image(image))
-        return data
-
-    def _parse_key_value(self, node):
-        """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
-        data = {}
-        for node in node.getchildren():
-            data[node.get('key')] = node.text
-        return data
-
-    def _parse_metadata(self, node):
-        """Parse the response body without children."""
-        data = {}
-        data[node.get('key')] = node.text
-        return data
-
-    def create_image(self, server_id, name, meta=None):
-        """Creates an image of the original server."""
-        post_body = xml_utils.Element('createImage', name=name)
-
-        if meta:
-            metadata = xml_utils.Element('metadata')
-            post_body.append(metadata)
-            for k, v in meta.items():
-                data = xml_utils.Element('meta', key=k)
-                data.append(xml_utils.Text(v))
-                metadata.append(data)
-        resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(xml_utils.Document(post_body)))
-        return resp, body
-
-    def list_images(self, params=None):
-        """Returns a list of all images filtered by any parameters."""
-        url = 'images'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = self._parse_images(etree.fromstring(body))
-        return resp, body['images']
-
-    def list_images_with_detail(self, params=None):
-        """Returns a detailed list of images filtered by any parameters."""
-        url = 'images/detail'
-        if params:
-            param_list = urllib.urlencode(params)
-
-            url = "images/detail?" + param_list
-
-        resp, body = self.get(url)
-        body = self._parse_images(etree.fromstring(body))
-        return resp, body['images']
-
-    def get_image(self, image_id):
-        """Returns the details of a single image."""
-        resp, body = self.get("images/%s" % str(image_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_image(etree.fromstring(body))
-        return resp, body
-
-    def delete_image(self, image_id):
-        """Deletes the provided image."""
-        return self.delete("images/%s" % str(image_id))
-
-    def wait_for_image_status(self, image_id, status):
-        """Waits for an image to reach a given status."""
-        waiters.wait_for_image_status(self, image_id, status)
-
-    def _metadata_body(self, meta):
-        post_body = xml_utils.Element('metadata')
-        for k, v in meta.items():
-            data = xml_utils.Element('meta', key=k)
-            data.append(xml_utils.Text(v))
-            post_body.append(data)
-        return post_body
-
-    def list_image_metadata(self, image_id):
-        """Lists all metadata items for an image."""
-        resp, body = self.get("images/%s/metadata" % str(image_id))
-        body = self._parse_key_value(etree.fromstring(body))
-        return resp, body
-
-    def set_image_metadata(self, image_id, meta):
-        """Sets the metadata for an image."""
-        post_body = self._metadata_body(meta)
-        resp, body = self.put('images/%s/metadata' % image_id,
-                              str(xml_utils.Document(post_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        return resp, body
-
-    def update_image_metadata(self, image_id, meta):
-        """Updates the metadata for an image."""
-        post_body = self._metadata_body(meta)
-        resp, body = self.post('images/%s/metadata' % str(image_id),
-                               str(xml_utils.Document(post_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        return resp, body
-
-    def get_image_metadata_item(self, image_id, key):
-        """Returns the value for a specific image metadata key."""
-        resp, body = self.get("images/%s/metadata/%s.xml" %
-                              (str(image_id), key))
-        body = self._parse_metadata(etree.fromstring(body))
-        return resp, body
-
-    def set_image_metadata_item(self, image_id, key, meta):
-        """Sets the value for a specific image metadata key."""
-        for k, v in meta.items():
-            post_body = xml_utils.Element('meta', key=key)
-            post_body.append(xml_utils.Text(v))
-        resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              str(xml_utils.Document(post_body)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def update_image_metadata_item(self, image_id, key, meta):
-        """Sets the value for a specific image metadata key."""
-        post_body = xml_utils.Document('meta', xml_utils.Text(meta), key=key)
-        resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              post_body)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body['meta']
-
-    def delete_image_metadata_item(self, image_id, key):
-        """Deletes a single image metadata key/value pair."""
-        return self.delete("images/%s/metadata/%s" % (str(image_id), key))
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_image(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'image'
diff --git a/tempest/services/compute/xml/instance_usage_audit_log_client.py b/tempest/services/compute/xml/instance_usage_audit_log_client.py
deleted file mode 100644
index b139db1..0000000
--- a/tempest/services/compute/xml/instance_usage_audit_log_client.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class InstanceUsagesAuditLogClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(InstanceUsagesAuditLogClientXML, self).__init__(
-            auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def list_instance_usage_audit_logs(self):
-        url = 'os-instance_usage_audit_log'
-        resp, body = self.get(url)
-        instance_usage_audit_logs = xml_utils.xml_to_json(
-            etree.fromstring(body))
-        return resp, instance_usage_audit_logs
-
-    def get_instance_usage_audit_log(self, time_before):
-        url = 'os-instance_usage_audit_log/%s' % time_before
-        resp, body = self.get(url)
-        instance_usage_audit_log = xml_utils.xml_to_json(
-            etree.fromstring(body))
-        return resp, instance_usage_audit_log
diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py
deleted file mode 100644
index e30a97c..0000000
--- a/tempest/services/compute/xml/interfaces_client.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright 2013 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class InterfacesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(InterfacesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _process_xml_interface(self, node):
-        iface = xml_utils.xml_to_json(node)
-        # NOTE(danms): if multiple addresses per interface is ever required,
-        # xml_utils.xml_to_json will need to be fixed or replaced in this case
-        iface['fixed_ips'] = [dict(iface['fixed_ips']['fixed_ip'].items())]
-        return iface
-
-    def list_interfaces(self, server):
-        resp, body = self.get('servers/%s/os-interface' % server)
-        node = etree.fromstring(body)
-        interfaces = [self._process_xml_interface(x)
-                      for x in node.getchildren()]
-        return resp, interfaces
-
-    def create_interface(self, server, port_id=None, network_id=None,
-                         fixed_ip=None):
-        doc = xml_utils.Document()
-        iface = xml_utils.Element('interfaceAttachment')
-        if port_id:
-            _port_id = xml_utils.Element('port_id')
-            _port_id.append(xml_utils.Text(port_id))
-            iface.append(_port_id)
-        if network_id:
-            _network_id = xml_utils.Element('net_id')
-            _network_id.append(xml_utils.Text(network_id))
-            iface.append(_network_id)
-        if fixed_ip:
-            _fixed_ips = xml_utils.Element('fixed_ips')
-            _fixed_ip = xml_utils.Element('fixed_ip')
-            _ip_address = xml_utils.Element('ip_address')
-            _ip_address.append(xml_utils.Text(fixed_ip))
-            _fixed_ip.append(_ip_address)
-            _fixed_ips.append(_fixed_ip)
-            iface.append(_fixed_ips)
-        doc.append(iface)
-        resp, body = self.post('servers/%s/os-interface' % server,
-                               body=str(doc))
-        body = self._process_xml_interface(etree.fromstring(body))
-        return resp, body
-
-    def show_interface(self, server, port_id):
-        resp, body = self.get('servers/%s/os-interface/%s' % (server, port_id))
-        body = self._process_xml_interface(etree.fromstring(body))
-        return resp, body
-
-    def delete_interface(self, server, port_id):
-        resp, body = self.delete('servers/%s/os-interface/%s' % (server,
-                                                                 port_id))
-        return resp, body
-
-    def wait_for_interface_status(self, server, port_id, status):
-        """Waits for a interface to reach a given status."""
-        resp, body = self.show_interface(server, port_id)
-        interface_status = body['port_state']
-        start = int(time.time())
-
-        while(interface_status != status):
-            time.sleep(self.build_interval)
-            resp, body = self.show_interface(server, port_id)
-            interface_status = body['port_state']
-
-            timed_out = int(time.time()) - start >= self.build_timeout
-
-            if interface_status != status and timed_out:
-                message = ('Interface %s failed to reach %s status within '
-                           'the required time (%s s).' %
-                           (port_id, status, self.build_timeout))
-                raise exceptions.TimeoutException(message)
-        return resp, body
-
-    def add_fixed_ip(self, server_id, network_id):
-        """Add a fixed IP to input server instance."""
-        post_body = xml_utils.Element("addFixedIp",
-                                      xmlns=xml_utils.XMLNS_11,
-                                      networkId=network_id)
-        resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(xml_utils.Document(post_body)))
-        return resp, body
-
-    def remove_fixed_ip(self, server_id, ip_address):
-        """Remove input fixed IP from input server instance."""
-        post_body = xml_utils.Element("removeFixedIp",
-                                      xmlns=xml_utils.XMLNS_11,
-                                      address=ip_address)
-        resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(xml_utils.Document(post_body)))
-        return resp, body
diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
deleted file mode 100644
index 8ff37ac..0000000
--- a/tempest/services/compute/xml/keypairs_client.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class KeyPairsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(KeyPairsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def list_keypairs(self):
-        resp, body = self.get("os-keypairs")
-        node = etree.fromstring(body)
-        body = [{'keypair': xml_utils.xml_to_json(x)} for x in
-                node.getchildren()]
-        return resp, body
-
-    def get_keypair(self, key_name):
-        resp, body = self.get("os-keypairs/%s" % str(key_name))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def create_keypair(self, name, pub_key=None):
-        doc = xml_utils.Document()
-
-        keypair_element = xml_utils.Element("keypair")
-
-        if pub_key:
-            public_key_element = xml_utils.Element("public_key")
-            public_key_text = xml_utils.Text(pub_key)
-            public_key_element.append(public_key_text)
-            keypair_element.append(public_key_element)
-
-        name_element = xml_utils.Element("name")
-        name_text = xml_utils.Text(name)
-        name_element.append(name_text)
-        keypair_element.append(name_element)
-
-        doc.append(keypair_element)
-
-        resp, body = self.post("os-keypairs", body=str(doc))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def delete_keypair(self, key_name):
-        return self.delete("os-keypairs/%s" % str(key_name))
diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
deleted file mode 100644
index 2327626..0000000
--- a/tempest/services/compute/xml/limits_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import objectify
-
-from tempest.common import rest_client
-from tempest import config
-
-CONF = config.CONF
-
-NS = "{http://docs.openstack.org/common/api/v1.0}"
-
-
-class LimitsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(LimitsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def get_absolute_limits(self):
-        resp, body = self.get("limits")
-        body = objectify.fromstring(body)
-        lim = NS + 'absolute'
-        ret = {}
-
-        for el in body[lim].iterchildren():
-            attributes = el.attrib
-            ret[attributes['name']] = attributes['value']
-        return resp, ret
-
-    def get_specific_absolute_limit(self, absolute_limit):
-        resp, body = self.get("limits")
-        body = objectify.fromstring(body)
-        lim = NS + 'absolute'
-        ret = {}
-
-        for el in body[lim].iterchildren():
-            attributes = el.attrib
-            ret[attributes['name']] = attributes['value']
-        if absolute_limit not in ret:
-            return None
-        else:
-            return ret[absolute_limit]
diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py
deleted file mode 100644
index 7f87248..0000000
--- a/tempest/services/compute/xml/quotas_client.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# Copyright 2012 NTT Data
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-def format_quota(q):
-    quota = {}
-    for k, v in q.items():
-        try:
-            v = int(v)
-        except ValueError:
-            pass
-
-        quota[k] = v
-
-    return quota
-
-
-class QuotasClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(QuotasClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def get_quota_set(self, tenant_id, user_id=None):
-        """List the quota set for a tenant."""
-
-        url = 'os-quota-sets/%s' % str(tenant_id)
-        if user_id:
-            url += '?user_id=%s' % str(user_id)
-        resp, body = self.get(url)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        body = format_quota(body)
-        return resp, body
-
-    def get_default_quota_set(self, tenant_id):
-        """List the default quota set for a tenant."""
-
-        url = 'os-quota-sets/%s/defaults' % str(tenant_id)
-        resp, body = self.get(url)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        body = format_quota(body)
-        return resp, body
-
-    def update_quota_set(self, tenant_id, user_id=None,
-                         force=None, injected_file_content_bytes=None,
-                         metadata_items=None, ram=None, floating_ips=None,
-                         fixed_ips=None, key_pairs=None, instances=None,
-                         security_group_rules=None, injected_files=None,
-                         cores=None, injected_file_path_bytes=None,
-                         security_groups=None):
-        """
-        Updates the tenant's quota limits for one or more resources
-        """
-        post_body = xml_utils.Element("quota_set",
-                                      xmlns=xml_utils.XMLNS_11)
-
-        if force is not None:
-            post_body.add_attr('force', force)
-
-        if injected_file_content_bytes is not None:
-            post_body.add_attr('injected_file_content_bytes',
-                               injected_file_content_bytes)
-
-        if metadata_items is not None:
-            post_body.add_attr('metadata_items', metadata_items)
-
-        if ram is not None:
-            post_body.add_attr('ram', ram)
-
-        if floating_ips is not None:
-            post_body.add_attr('floating_ips', floating_ips)
-
-        if fixed_ips is not None:
-            post_body.add_attr('fixed_ips', fixed_ips)
-
-        if key_pairs is not None:
-            post_body.add_attr('key_pairs', key_pairs)
-
-        if instances is not None:
-            post_body.add_attr('instances', instances)
-
-        if security_group_rules is not None:
-            post_body.add_attr('security_group_rules', security_group_rules)
-
-        if injected_files is not None:
-            post_body.add_attr('injected_files', injected_files)
-
-        if cores is not None:
-            post_body.add_attr('cores', cores)
-
-        if injected_file_path_bytes is not None:
-            post_body.add_attr('injected_file_path_bytes',
-                               injected_file_path_bytes)
-
-        if security_groups is not None:
-            post_body.add_attr('security_groups', security_groups)
-
-        if user_id:
-            resp, body = self.put('os-quota-sets/%s?user_id=%s' %
-                                  (str(tenant_id), str(user_id)),
-                                  str(xml_utils.Document(post_body)))
-        else:
-            resp, body = self.put('os-quota-sets/%s' % str(tenant_id),
-                                  str(xml_utils.Document(post_body)))
-
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        body = format_quota(body)
-        return resp, body
-
-    def delete_quota_set(self, tenant_id):
-        """Delete the tenant's quota set."""
-        return self.delete('os-quota-sets/%s' % str(tenant_id))
-
-
-class QuotaClassesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(QuotaClassesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def get_quota_class_set(self, quota_class_id):
-        """List the quota class set for a quota class."""
-
-        url = 'os-quota-class-sets/%s' % str(quota_class_id)
-        resp, body = self.get(url)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        body = format_quota(body)
-        return resp, body
-
-    def update_quota_class_set(self, quota_class_id, **kwargs):
-        """
-        Updates the quota class's limits for one or more resources.
-        """
-        post_body = xml_utils.Element("quota_class_set",
-                                      xmlns=xml_utils.XMLNS_11,
-                                      **kwargs)
-
-        resp, body = self.put('os-quota-class-sets/%s' % str(quota_class_id),
-                              str(xml_utils.Document(post_body)))
-
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        body = format_quota(body)
-        return resp, body
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
deleted file mode 100644
index e529623..0000000
--- a/tempest/services/compute/xml/security_groups_client.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class SecurityGroupsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(SecurityGroupsClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(xml_utils.xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        json = xml_utils.xml_to_json(body)
-        return json
-
-    def list_security_groups(self, params=None):
-        """List all security groups for a user."""
-
-        url = 'os-security-groups'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_security_group(self, security_group_id):
-        """Get the details of a Security Group."""
-        url = "os-security-groups/%s" % str(security_group_id)
-        resp, body = self.get(url)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def create_security_group(self, name, description):
-        """
-        Creates a new security group.
-        name (Required): Name of security group.
-        description (Required): Description of security group.
-        """
-        security_group = xml_utils.Element("security_group", name=name)
-        des = xml_utils.Element("description")
-        des.append(xml_utils.Text(content=description))
-        security_group.append(des)
-        resp, body = self.post('os-security-groups',
-                               str(xml_utils.Document(security_group)))
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_security_group(self, security_group_id, name=None,
-                              description=None):
-        """
-        Update a security group.
-        security_group_id: a security_group to update
-        name: new name of security group
-        description: new description of security group
-        """
-        security_group = xml_utils.Element("security_group")
-        if name:
-            sg_name = xml_utils.Element("name")
-            sg_name.append(xml_utils.Text(content=name))
-            security_group.append(sg_name)
-        if description:
-            des = xml_utils.Element("description")
-            des.append(xml_utils.Text(content=description))
-            security_group.append(des)
-        resp, body = self.put('os-security-groups/%s' %
-                              str(security_group_id),
-                              str(xml_utils.Document(security_group)))
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_security_group(self, security_group_id):
-        """Deletes the provided Security Group."""
-        return self.delete('os-security-groups/%s' % str(security_group_id))
-
-    def create_security_group_rule(self, parent_group_id, ip_proto, from_port,
-                                   to_port, **kwargs):
-        """
-        Creating a new security group rules.
-        parent_group_id :ID of Security group
-        ip_protocol : ip_proto (icmp, tcp, udp).
-        from_port: Port at start of range.
-        to_port  : Port at end of range.
-        Following optional keyword arguments are accepted:
-        cidr     : CIDR for address range.
-        group_id : ID of the Source group
-        """
-        group_rule = xml_utils.Element("security_group_rule")
-
-        elements = dict()
-        elements['cidr'] = kwargs.get('cidr')
-        elements['group_id'] = kwargs.get('group_id')
-        elements['parent_group_id'] = parent_group_id
-        elements['ip_protocol'] = ip_proto
-        elements['from_port'] = from_port
-        elements['to_port'] = to_port
-
-        for k, v in elements.items():
-            if v is not None:
-                element = xml_utils.Element(k)
-                element.append(xml_utils.Text(content=str(v)))
-                group_rule.append(element)
-
-        url = 'os-security-group-rules'
-        resp, body = self.post(url, str(xml_utils.Document(group_rule)))
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_security_group_rule(self, group_rule_id):
-        """Deletes the provided Security Group rule."""
-        return self.delete('os-security-group-rules/%s' %
-                           str(group_rule_id))
-
-    def list_security_group_rules(self, security_group_id):
-        """List all rules for a security group."""
-        url = "os-security-groups"
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        secgroups = body.getchildren()
-        for secgroup in secgroups:
-            if secgroup.get('id') == security_group_id:
-                node = secgroup.find('{%s}rules' % xml_utils.XMLNS_11)
-                rules = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-                return resp, rules
-        raise exceptions.NotFound('No such Security Group')
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_security_group(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'security_group'
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
deleted file mode 100644
index 06f1b83..0000000
--- a/tempest/services/compute/xml/servers_client.py
+++ /dev/null
@@ -1,673 +0,0 @@
-# Copyright 2012 IBM Corp.
-# Copyright 2013 Hewlett-Packard Development Company, L.P.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import waiters
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-from tempest.openstack.common import log as logging
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-def _translate_ip_xml_json(ip):
-    """
-    Convert the address version to int.
-    """
-    ip = dict(ip)
-    version = ip.get('version')
-    if version:
-        ip['version'] = int(version)
-    # NOTE(maurosr): just a fast way to avoid the xml version with the
-    # expanded xml namespace.
-    type_ns_prefix = ('{http://docs.openstack.org/compute/ext/extended_ips/'
-                      'api/v1.1}type')
-    mac_ns_prefix = ('{http://docs.openstack.org/compute/ext/extended_ips_mac'
-                     '/api/v1.1}mac_addr')
-
-    if type_ns_prefix in ip:
-        ip['OS-EXT-IPS:type'] = ip.pop(type_ns_prefix)
-
-    if mac_ns_prefix in ip:
-        ip['OS-EXT-IPS-MAC:mac_addr'] = ip.pop(mac_ns_prefix)
-    return ip
-
-
-def _translate_network_xml_to_json(network):
-    return [_translate_ip_xml_json(ip.attrib)
-            for ip in network.findall('{%s}ip' % xml_utils.XMLNS_11)]
-
-
-def _translate_addresses_xml_to_json(xml_addresses):
-    return dict((network.attrib['id'], _translate_network_xml_to_json(network))
-                for network in xml_addresses.findall('{%s}network' %
-                                                     xml_utils.XMLNS_11))
-
-
-def _translate_server_xml_to_json(xml_dom):
-    """Convert server XML to server JSON.
-
-    The addresses collection does not convert well by the dumb xml_to_json.
-    This method does some pre and post-processing to deal with that.
-
-    Translate XML addresses subtree to JSON.
-
-    Having xml_doc similar to
-    <api:server  xmlns:api="http://docs.openstack.org/compute/api/v1.1">
-        <api:addresses>
-            <api:network id="foo_novanetwork">
-                <api:ip version="4" addr="192.168.0.4"/>
-            </api:network>
-            <api:network id="bar_novanetwork">
-                <api:ip version="4" addr="10.1.0.4"/>
-                <api:ip version="6" addr="2001:0:0:1:2:3:4:5"/>
-            </api:network>
-        </api:addresses>
-    </api:server>
-
-    the _translate_server_xml_to_json(etree.fromstring(xml_doc)) should produce
-    something like
-
-    {'addresses': {'bar_novanetwork': [{'addr': '10.1.0.4', 'version': 4},
-                                       {'addr': '2001:0:0:1:2:3:4:5',
-                                        'version': 6}],
-                   'foo_novanetwork': [{'addr': '192.168.0.4', 'version': 4}]}}
-    """
-    nsmap = {'api': xml_utils.XMLNS_11}
-    addresses = xml_dom.xpath('/api:server/api:addresses', namespaces=nsmap)
-    if addresses:
-        if len(addresses) > 1:
-            raise ValueError('Expected only single `addresses` element.')
-        json_addresses = _translate_addresses_xml_to_json(addresses[0])
-        json = xml_utils.xml_to_json(xml_dom)
-        json['addresses'] = json_addresses
-    else:
-        json = xml_utils.xml_to_json(xml_dom)
-    diskConfig = ('{http://docs.openstack.org'
-                  '/compute/ext/disk_config/api/v1.1}diskConfig')
-    terminated_at = ('{http://docs.openstack.org/'
-                     'compute/ext/server_usage/api/v1.1}terminated_at')
-    launched_at = ('{http://docs.openstack.org'
-                   '/compute/ext/server_usage/api/v1.1}launched_at')
-    power_state = ('{http://docs.openstack.org'
-                   '/compute/ext/extended_status/api/v1.1}power_state')
-    availability_zone = ('{http://docs.openstack.org'
-                         '/compute/ext/extended_availability_zone/api/v2}'
-                         'availability_zone')
-    vm_state = ('{http://docs.openstack.org'
-                '/compute/ext/extended_status/api/v1.1}vm_state')
-    task_state = ('{http://docs.openstack.org'
-                  '/compute/ext/extended_status/api/v1.1}task_state')
-    if 'tenantId' in json:
-        json['tenant_id'] = json.pop('tenantId')
-    if 'userId' in json:
-        json['user_id'] = json.pop('userId')
-    if diskConfig in json:
-        json['OS-DCF:diskConfig'] = json.pop(diskConfig)
-    if terminated_at in json:
-        json['OS-SRV-USG:terminated_at'] = json.pop(terminated_at)
-    if launched_at in json:
-        json['OS-SRV-USG:launched_at'] = json.pop(launched_at)
-    if power_state in json:
-        json['OS-EXT-STS:power_state'] = json.pop(power_state)
-    if availability_zone in json:
-        json['OS-EXT-AZ:availability_zone'] = json.pop(availability_zone)
-    if vm_state in json:
-        json['OS-EXT-STS:vm_state'] = json.pop(vm_state)
-    if task_state in json:
-        json['OS-EXT-STS:task_state'] = json.pop(task_state)
-    return json
-
-
-class ServersClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(ServersClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_key_value(self, node):
-        """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
-        data = {}
-        for node in node.getchildren():
-            data[node.get('key')] = node.text
-        return data
-
-    def _parse_links(self, node, json):
-        del json['link']
-        json['links'] = []
-        for linknode in node.findall('{http://www.w3.org/2005/Atom}link'):
-            json['links'].append(xml_utils.xml_to_json(linknode))
-
-    def _parse_server(self, body):
-        json = _translate_server_xml_to_json(body)
-
-        if 'metadata' in json and json['metadata']:
-            # NOTE(danms): if there was metadata, we need to re-parse
-            # that as a special type
-            metadata_tag = body.find('{%s}metadata' % xml_utils.XMLNS_11)
-            json["metadata"] = self._parse_key_value(metadata_tag)
-        if 'link' in json:
-            self._parse_links(body, json)
-        for sub in ['image', 'flavor']:
-            if sub in json and 'link' in json[sub]:
-                self._parse_links(body, json[sub])
-        return json
-
-    def _parse_xml_virtual_interfaces(self, xml_dom):
-        """
-        Return server's virtual interfaces XML as JSON.
-        """
-        data = {"virtual_interfaces": []}
-        for iface in xml_dom.getchildren():
-            data["virtual_interfaces"].append(
-                {"id": iface.get("id"),
-                 "mac_address": iface.get("mac_address")})
-        return data
-
-    def get_server(self, server_id):
-        """Returns the details of an existing server."""
-        resp, body = self.get("servers/%s" % str(server_id))
-        server = self._parse_server(etree.fromstring(body))
-        return resp, server
-
-    def migrate_server(self, server_id, **kwargs):
-        """Migrates the given server ."""
-        return self.action(server_id, 'migrate', None, **kwargs)
-
-    def lock_server(self, server_id, **kwargs):
-        """Locks the given server."""
-        return self.action(server_id, 'lock', None, **kwargs)
-
-    def unlock_server(self, server_id, **kwargs):
-        """Unlocks the given server."""
-        return self.action(server_id, 'unlock', None, **kwargs)
-
-    def suspend_server(self, server_id, **kwargs):
-        """Suspends the provided server."""
-        return self.action(server_id, 'suspend', None, **kwargs)
-
-    def resume_server(self, server_id, **kwargs):
-        """Un-suspends the provided server."""
-        return self.action(server_id, 'resume', None, **kwargs)
-
-    def pause_server(self, server_id, **kwargs):
-        """Pauses the provided server."""
-        return self.action(server_id, 'pause', None, **kwargs)
-
-    def unpause_server(self, server_id, **kwargs):
-        """Un-pauses the provided server."""
-        return self.action(server_id, 'unpause', None, **kwargs)
-
-    def shelve_server(self, server_id, **kwargs):
-        """Shelves the provided server."""
-        return self.action(server_id, 'shelve', None, **kwargs)
-
-    def unshelve_server(self, server_id, **kwargs):
-        """Un-shelves the provided server."""
-        return self.action(server_id, 'unshelve', None, **kwargs)
-
-    def shelve_offload_server(self, server_id, **kwargs):
-        """Shelve-offload the provided server."""
-        return self.action(server_id, 'shelveOffload', None, **kwargs)
-
-    def reset_state(self, server_id, state='error'):
-        """Resets the state of a server to active/error."""
-        return self.action(server_id, 'os-resetState', None, state=state)
-
-    def delete_server(self, server_id):
-        """Deletes the given server."""
-        return self.delete("servers/%s" % str(server_id))
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(xml_utils.xml_to_json(child))
-        return array
-
-    def _parse_server_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(self._parse_server(child))
-        return array
-
-    def list_servers(self, params=None):
-        url = 'servers'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        servers = self._parse_server_array(etree.fromstring(body))
-        return resp, {"servers": servers}
-
-    def list_servers_with_detail(self, params=None):
-        url = 'servers/detail'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        servers = self._parse_server_array(etree.fromstring(body))
-        return resp, {"servers": servers}
-
-    def update_server(self, server_id, name=None, meta=None, accessIPv4=None,
-                      accessIPv6=None, disk_config=None):
-        doc = xml_utils.Document()
-        server = xml_utils.Element("server")
-        doc.append(server)
-
-        if name is not None:
-            server.add_attr("name", name)
-        if accessIPv4 is not None:
-            server.add_attr("accessIPv4", accessIPv4)
-        if accessIPv6 is not None:
-            server.add_attr("accessIPv6", accessIPv6)
-        if disk_config is not None:
-            server.add_attr('xmlns:OS-DCF', "http://docs.openstack.org/"
-                            "compute/ext/disk_config/api/v1.1")
-            server.add_attr("OS-DCF:diskConfig", disk_config)
-        if meta is not None:
-            metadata = xml_utils.Element("metadata")
-            server.append(metadata)
-            for k, v in meta:
-                meta = xml_utils.Element("meta", key=k)
-                meta.append(xml_utils.Text(v))
-                metadata.append(meta)
-
-        resp, body = self.put('servers/%s' % str(server_id), str(doc))
-        return resp, xml_utils.xml_to_json(etree.fromstring(body))
-
-    def create_server(self, name, image_ref, flavor_ref, **kwargs):
-        """
-        Creates an instance of a server.
-        name (Required): The name of the server.
-        image_ref (Required): Reference to the image used to build the server.
-        flavor_ref (Required): The flavor used to build the server.
-        Following optional keyword arguments are accepted:
-        adminPass: Sets the initial root password.
-        key_name: Key name of keypair that was created earlier.
-        meta: A dictionary of values to be used as metadata.
-        personality: A list of dictionaries for files to be injected into
-        the server.
-        security_groups: A list of security group dicts.
-        networks: A list of network dicts with UUID and fixed_ip.
-        user_data: User data for instance.
-        availability_zone: Availability zone in which to launch instance.
-        accessIPv4: The IPv4 access address for the server.
-        accessIPv6: The IPv6 access address for the server.
-        min_count: Count of minimum number of instances to launch.
-        max_count: Count of maximum number of instances to launch.
-        disk_config: Determines if user or admin controls disk configuration.
-        block_device_mapping: Block device mapping for the server.
-        """
-        server = xml_utils.Element("server",
-                                   xmlns=xml_utils.XMLNS_11,
-                                   imageRef=image_ref,
-                                   flavorRef=flavor_ref,
-                                   name=name)
-
-        for attr in ["adminPass", "accessIPv4", "accessIPv6", "key_name",
-                     "user_data", "availability_zone", "min_count",
-                     "max_count", "return_reservation_id",
-                     "block_device_mapping"]:
-            if attr in kwargs:
-                server.add_attr(attr, kwargs[attr])
-
-        if 'disk_config' in kwargs:
-            server.add_attr('xmlns:OS-DCF', "http://docs.openstack.org/"
-                            "compute/ext/disk_config/api/v1.1")
-            server.add_attr('OS-DCF:diskConfig', kwargs['disk_config'])
-
-        if 'security_groups' in kwargs:
-            secgroups = xml_utils.Element("security_groups")
-            server.append(secgroups)
-            for secgroup in kwargs['security_groups']:
-                s = xml_utils.Element("security_group", name=secgroup['name'])
-                secgroups.append(s)
-
-        if 'networks' in kwargs:
-            networks = xml_utils.Element("networks")
-            server.append(networks)
-            for network in kwargs['networks']:
-                if 'fixed_ip' in network:
-                    s = xml_utils.Element("network", uuid=network['uuid'],
-                                          fixed_ip=network['fixed_ip'])
-                else:
-                    s = xml_utils.Element("network", uuid=network['uuid'])
-                networks.append(s)
-
-        if 'meta' in kwargs:
-            metadata = xml_utils.Element("metadata")
-            server.append(metadata)
-            for k, v in kwargs['meta'].items():
-                meta = xml_utils.Element("meta", key=k)
-                meta.append(xml_utils.Text(v))
-                metadata.append(meta)
-
-        if 'personality' in kwargs:
-            personality = xml_utils.Element('personality')
-            server.append(personality)
-            for k in kwargs['personality']:
-                temp = xml_utils.Element('file', path=k['path'])
-                temp.append(xml_utils.Text(k['contents']))
-                personality.append(temp)
-
-        if 'sched_hints' in kwargs:
-            sched_hints = kwargs.get('sched_hints')
-            hints = xml_utils.Element("os:scheduler_hints")
-            hints.add_attr('xmlns:os', xml_utils.XMLNS_11)
-            for attr in sched_hints:
-                p1 = xml_utils.Element(attr)
-                p1.append(sched_hints[attr])
-                hints.append(p1)
-            server.append(hints)
-        resp, body = self.post('servers', str(xml_utils.Document(server)))
-        server = self._parse_server(etree.fromstring(body))
-        return resp, server
-
-    def wait_for_server_status(self, server_id, status, extra_timeout=0,
-                               raise_on_error=True):
-        """Waits for a server to reach a given status."""
-        return waiters.wait_for_server_status(self, server_id, status,
-                                              extra_timeout=extra_timeout,
-                                              raise_on_error=raise_on_error)
-
-    def wait_for_server_termination(self, server_id, ignore_error=False):
-        """Waits for server to reach termination."""
-        start_time = int(time.time())
-        while True:
-            try:
-                resp, body = self.get_server(server_id)
-            except exceptions.NotFound:
-                return
-
-            server_status = body['status']
-            if server_status == 'ERROR' and not ignore_error:
-                raise exceptions.BuildErrorException(server_id=server_id)
-
-            if int(time.time()) - start_time >= self.build_timeout:
-                raise exceptions.TimeoutException
-
-            time.sleep(self.build_interval)
-
-    def _parse_network(self, node):
-        addrs = []
-        for child in node.getchildren():
-            addrs.append({'version': int(child.get('version')),
-                         'addr': child.get('addr')})
-        return {node.get('id'): addrs}
-
-    def list_addresses(self, server_id):
-        """Lists all addresses for a server."""
-        resp, body = self.get("servers/%s/ips" % str(server_id))
-
-        networks = {}
-        xml_list = etree.fromstring(body)
-        for child in xml_list.getchildren():
-            network = self._parse_network(child)
-            networks.update(**network)
-
-        return resp, networks
-
-    def list_addresses_by_network(self, server_id, network_id):
-        """Lists all addresses of a specific network type for a server."""
-        resp, body = self.get("servers/%s/ips/%s" % (str(server_id),
-                                                     network_id))
-        network = self._parse_network(etree.fromstring(body))
-
-        return resp, network
-
-    def action(self, server_id, action_name, response_key, **kwargs):
-        if 'xmlns' not in kwargs:
-            kwargs['xmlns'] = xml_utils.XMLNS_11
-        doc = xml_utils.Document((xml_utils.Element(action_name, **kwargs)))
-        resp, body = self.post("servers/%s/action" % server_id, str(doc))
-        if response_key is not None:
-            body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def create_backup(self, server_id, backup_type, rotation, name):
-        """Backup a server instance."""
-        return self.action(server_id, "createBackup", None,
-                           backup_type=backup_type,
-                           rotation=rotation,
-                           name=name)
-
-    def change_password(self, server_id, password):
-        return self.action(server_id, "changePassword", None,
-                           adminPass=password)
-
-    def get_password(self, server_id):
-        resp, body = self.get("servers/%s/os-server-password" % str(server_id))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def delete_password(self, server_id):
-        """
-        Removes the encrypted server password from the metadata server
-        Note that this does not actually change the instance server
-        password.
-        """
-        return self.delete("servers/%s/os-server-password" % str(server_id))
-
-    def reboot(self, server_id, reboot_type):
-        return self.action(server_id, "reboot", None, type=reboot_type)
-
-    def rebuild(self, server_id, image_ref, **kwargs):
-        kwargs['imageRef'] = image_ref
-        if 'disk_config' in kwargs:
-            kwargs['OS-DCF:diskConfig'] = kwargs['disk_config']
-            del kwargs['disk_config']
-            kwargs['xmlns:OS-DCF'] = "http://docs.openstack.org/"\
-                                     "compute/ext/disk_config/api/v1.1"
-            kwargs['xmlns:atom'] = "http://www.w3.org/2005/Atom"
-        if 'xmlns' not in kwargs:
-            kwargs['xmlns'] = xml_utils.XMLNS_11
-
-        attrs = kwargs.copy()
-        if 'metadata' in attrs:
-            del attrs['metadata']
-        rebuild = xml_utils.Element("rebuild", **attrs)
-
-        if 'metadata' in kwargs:
-            metadata = xml_utils.Element("metadata")
-            rebuild.append(metadata)
-            for k, v in kwargs['metadata'].items():
-                meta = xml_utils.Element("meta", key=k)
-                meta.append(xml_utils.Text(v))
-                metadata.append(meta)
-
-        resp, body = self.post('servers/%s/action' % server_id,
-                               str(xml_utils.Document(rebuild)))
-        server = self._parse_server(etree.fromstring(body))
-        return resp, server
-
-    def resize(self, server_id, flavor_ref, **kwargs):
-        if 'disk_config' in kwargs:
-            kwargs['OS-DCF:diskConfig'] = kwargs['disk_config']
-            del kwargs['disk_config']
-            kwargs['xmlns:OS-DCF'] = "http://docs.openstack.org/"\
-                                     "compute/ext/disk_config/api/v1.1"
-            kwargs['xmlns:atom'] = "http://www.w3.org/2005/Atom"
-        kwargs['flavorRef'] = flavor_ref
-        return self.action(server_id, 'resize', None, **kwargs)
-
-    def confirm_resize(self, server_id, **kwargs):
-        return self.action(server_id, 'confirmResize', None, **kwargs)
-
-    def revert_resize(self, server_id, **kwargs):
-        return self.action(server_id, 'revertResize', None, **kwargs)
-
-    def stop(self, server_id, **kwargs):
-        return self.action(server_id, 'os-stop', None, **kwargs)
-
-    def start(self, server_id, **kwargs):
-        return self.action(server_id, 'os-start', None, **kwargs)
-
-    def create_image(self, server_id, name):
-        return self.action(server_id, 'createImage', None, name=name)
-
-    def add_security_group(self, server_id, name):
-        return self.action(server_id, 'addSecurityGroup', None, name=name)
-
-    def remove_security_group(self, server_id, name):
-        return self.action(server_id, 'removeSecurityGroup', None, name=name)
-
-    def live_migrate_server(self, server_id, dest_host, use_block_migration):
-        """This should be called with administrator privileges ."""
-
-        req_body = xml_utils.Element("os-migrateLive",
-                                     xmlns=xml_utils.XMLNS_11,
-                                     disk_over_commit=False,
-                                     block_migration=use_block_migration,
-                                     host=dest_host)
-
-        resp, body = self.post("servers/%s/action" % str(server_id),
-                               str(xml_utils.Document(req_body)))
-        return resp, body
-
-    def list_server_metadata(self, server_id):
-        resp, body = self.get("servers/%s/metadata" % str(server_id))
-        body = self._parse_key_value(etree.fromstring(body))
-        return resp, body
-
-    def set_server_metadata(self, server_id, meta, no_metadata_field=False):
-        doc = xml_utils.Document()
-        if not no_metadata_field:
-            metadata = xml_utils.Element("metadata")
-            doc.append(metadata)
-            for k, v in meta.items():
-                meta_element = xml_utils.Element("meta", key=k)
-                meta_element.append(xml_utils.Text(v))
-                metadata.append(meta_element)
-        resp, body = self.put('servers/%s/metadata' % str(server_id), str(doc))
-        return resp, xml_utils.xml_to_json(etree.fromstring(body))
-
-    def update_server_metadata(self, server_id, meta):
-        doc = xml_utils.Document()
-        metadata = xml_utils.Element("metadata")
-        doc.append(metadata)
-        for k, v in meta.items():
-            meta_element = xml_utils.Element("meta", key=k)
-            meta_element.append(xml_utils.Text(v))
-            metadata.append(meta_element)
-        resp, body = self.post("/servers/%s/metadata" % str(server_id),
-                               str(doc))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def get_server_metadata_item(self, server_id, key):
-        resp, body = self.get("servers/%s/metadata/%s" % (str(server_id), key))
-        return resp, dict([(etree.fromstring(body).attrib['key'],
-                            xml_utils.xml_to_json(etree.fromstring(body)))])
-
-    def set_server_metadata_item(self, server_id, key, meta):
-        doc = xml_utils.Document()
-        for k, v in meta.items():
-            meta_element = xml_utils.Element("meta", key=k)
-            meta_element.append(xml_utils.Text(v))
-            doc.append(meta_element)
-        resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              str(doc))
-        return resp, xml_utils.xml_to_json(etree.fromstring(body))
-
-    def delete_server_metadata_item(self, server_id, key):
-        resp, body = self.delete("servers/%s/metadata/%s" %
-                                 (str(server_id), key))
-        return resp, body
-
-    def get_console_output(self, server_id, length):
-        kwargs = {'length': length} if length else {}
-        return self.action(server_id, 'os-getConsoleOutput', 'output',
-                           **kwargs)
-
-    def list_virtual_interfaces(self, server_id):
-        """
-        List the virtual interfaces used in an instance.
-        """
-        resp, body = self.get('/'.join(['servers', server_id,
-                              'os-virtual-interfaces']))
-        virt_int = self._parse_xml_virtual_interfaces(etree.fromstring(body))
-        return resp, virt_int
-
-    def rescue_server(self, server_id, **kwargs):
-        """Rescue the provided server."""
-        return self.action(server_id, 'rescue', None, **kwargs)
-
-    def unrescue_server(self, server_id):
-        """Unrescue the provided server."""
-        return self.action(server_id, 'unrescue', None)
-
-    def attach_volume(self, server_id, volume_id, device='/dev/vdz'):
-        post_body = xml_utils.Element("volumeAttachment", volumeId=volume_id,
-                                      device=device)
-        resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
-                               str(xml_utils.Document(post_body)))
-        return resp, body
-
-    def detach_volume(self, server_id, volume_id):
-        headers = {'Content-Type': 'application/xml',
-                   'Accept': 'application/xml'}
-        resp, body = self.delete('servers/%s/os-volume_attachments/%s' %
-                                 (server_id, volume_id), headers)
-        return resp, body
-
-    def get_server_diagnostics(self, server_id):
-        """Get the usage data for a server."""
-        resp, body = self.get("servers/%s/diagnostics" % server_id)
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def list_instance_actions(self, server_id):
-        """List the provided server action."""
-        resp, body = self.get("servers/%s/os-instance-actions" % server_id)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_instance_action(self, server_id, request_id):
-        """Returns the action details of the provided server."""
-        resp, body = self.get("servers/%s/os-instance-actions/%s" %
-                              (server_id, request_id))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def force_delete_server(self, server_id, **kwargs):
-        """Force delete a server."""
-        return self.action(server_id, 'forceDelete', None, **kwargs)
-
-    def restore_soft_deleted_server(self, server_id, **kwargs):
-        """Restore a soft-deleted server."""
-        return self.action(server_id, 'restore', None, **kwargs)
-
-    def reset_network(self, server_id, **kwargs):
-        """Resets the Network of a server"""
-        return self.action(server_id, 'resetNetwork', None, **kwargs)
-
-    def inject_network_info(self, server_id, **kwargs):
-        """Inject the Network Info into server"""
-        return self.action(server_id, 'injectNetworkInfo', None, **kwargs)
-
-    def get_vnc_console(self, server_id, console_type):
-        """Get URL of VNC console."""
-        return self.action(server_id, "os-getVNCConsole",
-                           "console", type=console_type)
diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py
deleted file mode 100644
index e1e78d0..0000000
--- a/tempest/services/compute/xml/services_client.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 2013 NEC Corporation
-# Copyright 2013 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class ServicesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(ServicesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def list_services(self, params=None):
-        url = 'os-services'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        return resp, body
-
-    def enable_service(self, host_name, binary):
-        """
-        Enable service on a host
-        host_name: Name of host
-        binary: Service binary
-        """
-        post_body = xml_utils.Element("service")
-        post_body.add_attr('binary', binary)
-        post_body.add_attr('host', host_name)
-
-        resp, body = self.put('os-services/enable', str(
-            xml_utils.Document(post_body)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def disable_service(self, host_name, binary):
-        """
-        Disable service on a host
-        host_name: Name of host
-        binary: Service binary
-        """
-        post_body = xml_utils.Element("service")
-        post_body.add_attr('binary', binary)
-        post_body.add_attr('host', host_name)
-
-        resp, body = self.put('os-services/disable', str(
-            xml_utils.Document(post_body)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py
deleted file mode 100644
index 0b19f63..0000000
--- a/tempest/services/compute/xml/tenant_usages_client.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class TenantUsagesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(TenantUsagesClientXML, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_type
-
-    def _parse_array(self, node):
-        json = xml_utils.xml_to_json(node)
-        return json
-
-    def list_tenant_usages(self, params=None):
-        url = 'os-simple-tenant-usage'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        tenant_usage = self._parse_array(etree.fromstring(body))
-        return resp, tenant_usage['tenant_usage']
-
-    def get_tenant_usage(self, tenant_id, params=None):
-        url = 'os-simple-tenant-usage/%s' % tenant_id
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        tenant_usage = self._parse_array(etree.fromstring(body))
-        return resp, tenant_usage
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
deleted file mode 100644
index da1764a..0000000
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class VolumesExtensionsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(VolumesExtensionsClientXML, self).__init__(
-            auth_provider)
-        self.service = CONF.compute.catalog_type
-        self.build_interval = CONF.compute.build_interval
-        self.build_timeout = CONF.compute.build_timeout
-
-    def _parse_volume(self, body):
-        vol = dict((attr, body.get(attr)) for attr in body.keys())
-
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                ns, tag = tag.split("}", 1)
-            if tag == 'metadata':
-                vol['metadata'] = dict((meta.get('key'),
-                                        meta.text) for meta in list(child))
-            else:
-                vol[tag] = xml_utils.xml_to_json(child)
-        return vol
-
-    def list_volumes(self, params=None):
-        """List all the volumes created."""
-        url = 'os-volumes'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume(vol) for vol in list(body)]
-        return resp, volumes
-
-    def list_volumes_with_detail(self, params=None):
-        """List all the details of volumes."""
-        url = 'os-volumes/detail'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume(vol) for vol in list(body)]
-        return resp, volumes
-
-    def get_volume(self, volume_id):
-        """Returns the details of a single volume."""
-        url = "os-volumes/%s" % str(volume_id)
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        return resp, self._parse_volume(body)
-
-    def create_volume(self, size, display_name=None, metadata=None):
-        """Creates a new Volume.
-
-        :param size: Size of volume in GB. (Required)
-        :param display_name: Optional Volume Name.
-        :param metadata: An optional dictionary of values for metadata.
-        """
-        volume = xml_utils.Element("volume",
-                                   xmlns=xml_utils.XMLNS_11,
-                                   size=size)
-        if display_name:
-            volume.add_attr('display_name', display_name)
-
-        if metadata:
-            _metadata = xml_utils.Element('metadata')
-            volume.append(_metadata)
-            for key, value in metadata.items():
-                meta = xml_utils.Element('meta')
-                meta.add_attr('key', key)
-                meta.append(xml_utils.Text(value))
-                _metadata.append(meta)
-
-        resp, body = self.post('os-volumes', str(xml_utils.Document(volume)))
-        body = xml_utils.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def delete_volume(self, volume_id):
-        """Deletes the Specified Volume."""
-        return self.delete("os-volumes/%s" % str(volume_id))
-
-    def wait_for_volume_status(self, volume_id, status):
-        """Waits for a Volume to reach a given status."""
-        resp, body = self.get_volume(volume_id)
-        volume_name = body['displayName']
-        volume_status = body['status']
-        start = int(time.time())
-
-        while volume_status != status:
-            time.sleep(self.build_interval)
-            resp, body = self.get_volume(volume_id)
-            volume_status = body['status']
-            if volume_status == 'error':
-                raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
-
-            if int(time.time()) - start >= self.build_timeout:
-                message = 'Volume %s failed to reach %s status within '\
-                          'the required time (%s s).' % (volume_name, status,
-                                                         self.build_timeout)
-                raise exceptions.TimeoutException(message)
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_volume(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'volume'
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index e093260..579243c 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -39,14 +39,14 @@
         resp, body = self.post('policies', post_body)
         self.expected_success(201, resp.status)
         body = json.loads(body)
-        return resp, body['policy']
+        return rest_client.ResponseBody(resp, body['policy'])
 
     def list_policies(self):
         """Lists the policies."""
         resp, body = self.get('policies')
         self.expected_success(200, resp.status)
         body = json.loads(body)
-        return resp, body['policies']
+        return rest_client.ResponseBodyList(resp, body['policies'])
 
     def get_policy(self, policy_id):
         """Lists out the given policy."""
@@ -54,7 +54,7 @@
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
         body = json.loads(body)
-        return resp, body['policy']
+        return rest_client.ResponseBody(resp, body['policy'])
 
     def update_policy(self, policy_id, **kwargs):
         """Updates a policy."""
@@ -67,11 +67,11 @@
         resp, body = self.patch(url, post_body)
         self.expected_success(200, resp.status)
         body = json.loads(body)
-        return resp, body['policy']
+        return rest_client.ResponseBody(resp, body['policy'])
 
     def delete_policy(self, policy_id):
         """Deletes the policy."""
         url = "policies/%s" % policy_id
         resp, body = self.delete(url)
         self.expected_success(204, resp.status)
-        return resp, body
+        return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v3/xml/__init__.py b/tempest/services/identity/v3/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/identity/v3/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
deleted file mode 100644
index 37513d0..0000000
--- a/tempest/services/identity/v3/xml/credentials_client.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import json
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class CredentialsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(CredentialsClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_body(self, body):
-        data = common.xml_to_json(body)
-        return data
-
-    def _parse_creds(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "credential":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def create_credential(self, access_key, secret_key, user_id, project_id):
-        """Creates a credential."""
-        cred_type = 'ec2'
-        access = "&quot;access&quot;: &quot;%s&quot;" % access_key
-        secret = "&quot;secret&quot;: &quot;%s&quot;" % secret_key
-        blob = common.Element('blob',
-                              xmlns=XMLNS)
-        blob.append(common.Text("{%s , %s}"
-                                % (access, secret)))
-        credential = common.Element('credential', project_id=project_id,
-                                    type=cred_type, user_id=user_id)
-        credential.append(blob)
-        resp, body = self.post('credentials', str(common.Document(credential)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        body['blob'] = json.loads(body['blob'])
-        return resp, body
-
-    def update_credential(self, credential_id, **kwargs):
-        """Updates a credential."""
-        _, body = self.get_credential(credential_id)
-        cred_type = kwargs.get('type', body['type'])
-        access_key = kwargs.get('access_key', body['blob']['access'])
-        secret_key = kwargs.get('secret_key', body['blob']['secret'])
-        project_id = kwargs.get('project_id', body['project_id'])
-        user_id = kwargs.get('user_id', body['user_id'])
-        access = "&quot;access&quot;: &quot;%s&quot;" % access_key
-        secret = "&quot;secret&quot;: &quot;%s&quot;" % secret_key
-        blob = common.Element('blob',
-                              xmlns=XMLNS)
-        blob.append(common.Text("{%s , %s}"
-                                % (access, secret)))
-        credential = common.Element('credential', project_id=project_id,
-                                    type=cred_type, user_id=user_id)
-        credential.append(blob)
-        resp, body = self.patch('credentials/%s' % credential_id,
-                                str(common.Document(credential)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        body['blob'] = json.loads(body['blob'])
-        return resp, body
-
-    def get_credential(self, credential_id):
-        """To GET Details of a credential."""
-        resp, body = self.get('credentials/%s' % credential_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        body['blob'] = json.loads(body['blob'])
-        return resp, body
-
-    def list_credentials(self):
-        """Lists out all the available credentials."""
-        resp, body = self.get('credentials')
-        self.expected_success(200, resp.status)
-        body = self._parse_creds(etree.fromstring(body))
-        return resp, body
-
-    def delete_credential(self, credential_id):
-        """Deletes a credential."""
-        resp, body = self.delete('credentials/%s' % credential_id)
-        self.expected_success(204, resp.status)
-        return resp, body
diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py
deleted file mode 100644
index 892fb58..0000000
--- a/tempest/services/identity/v3/xml/endpoints_client.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import http
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class EndPointClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(EndPointClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "endpoint":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        json = common.xml_to_json(body)
-        return json
-
-    def request(self, method, url, extra_headers=False, headers=None,
-                body=None, wait=None):
-        """Overriding the existing HTTP request in super class RestClient."""
-        if extra_headers:
-            try:
-                headers.update(self.get_headers())
-            except (ValueError, TypeError):
-                headers = self.get_headers()
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
-        return super(EndPointClientXML, self).request(method, url,
-                                                      extra_headers,
-                                                      headers=headers,
-                                                      body=body)
-
-    def list_endpoints(self):
-        """Get the list of endpoints."""
-        resp, body = self.get("endpoints")
-        self.expected_success(200, resp.status)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def create_endpoint(self, service_id, interface, url, **kwargs):
-        """Create endpoint.
-
-        Normally this function wouldn't allow setting values that are not
-        allowed for 'enabled'. Use `force_enabled` to set a non-boolean.
-
-        """
-        region = kwargs.get('region', None)
-        if 'force_enabled' in kwargs:
-            enabled = kwargs['force_enabled']
-        else:
-            enabled = kwargs.get('enabled', None)
-            if enabled is not None:
-                enabled = str(enabled).lower()
-        create_endpoint = common.Element("endpoint",
-                                         xmlns=XMLNS,
-                                         service_id=service_id,
-                                         interface=interface,
-                                         url=url, region=region,
-                                         enabled=enabled)
-        resp, body = self.post('endpoints',
-                               str(common.Document(create_endpoint)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_endpoint(self, endpoint_id, service_id=None, interface=None,
-                        url=None, region=None, enabled=None, **kwargs):
-        """Updates an endpoint with given parameters.
-
-        Normally this function wouldn't allow setting values that are not
-        allowed for 'enabled'. Use `force_enabled` to set a non-boolean.
-
-        """
-        doc = common.Document()
-        endpoint = common.Element("endpoint")
-        doc.append(endpoint)
-
-        if service_id:
-            endpoint.add_attr("service_id", service_id)
-        if interface:
-            endpoint.add_attr("interface", interface)
-        if url:
-            endpoint.add_attr("url", url)
-        if region:
-            endpoint.add_attr("region", region)
-
-        if 'force_enabled' in kwargs:
-            endpoint.add_attr("enabled", kwargs['force_enabled'])
-        elif enabled is not None:
-            endpoint.add_attr("enabled", str(enabled).lower())
-
-        resp, body = self.patch('endpoints/%s' % str(endpoint_id), str(doc))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_endpoint(self, endpoint_id):
-        """Delete endpoint."""
-        resp_header, resp_body = self.delete('endpoints/%s' % endpoint_id)
-        self.expected_success(204, resp_header.status)
-        return resp_header, resp_body
diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py
deleted file mode 100644
index fdc0a0a..0000000
--- a/tempest/services/identity/v3/xml/identity_client.py
+++ /dev/null
@@ -1,632 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import json
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class IdentityV3ClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(IdentityV3ClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_projects(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "project":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_domains(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "domain":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_groups(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "group":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_group_users(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "user":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_roles(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "role":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_users(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "user":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        _json = common.xml_to_json(body)
-        return _json
-
-    def create_user(self, user_name, password=None, project_id=None,
-                    email=None, domain_id='default', **kwargs):
-        """Creates a user."""
-        en = kwargs.get('enabled', 'true')
-        description = kwargs.get('description', None)
-        post_body = common.Element("user",
-                                   xmlns=XMLNS,
-                                   name=user_name,
-                                   password=password,
-                                   description=description,
-                                   email=email,
-                                   enabled=str(en).lower(),
-                                   project_id=project_id,
-                                   domain_id=domain_id)
-        resp, body = self.post('users', str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_user(self, user_id, name, **kwargs):
-        """Updates a user."""
-        _, body = self.get_user(user_id)
-        email = kwargs.get('email', body['email'])
-        en = kwargs.get('enabled', body['enabled'])
-        project_id = kwargs.get('project_id', body['project_id'])
-        description = kwargs.get('description', body['description'])
-        domain_id = kwargs.get('domain_id', body['domain_id'])
-        update_user = common.Element("user",
-                                     xmlns=XMLNS,
-                                     name=name,
-                                     email=email,
-                                     project_id=project_id,
-                                     domain_id=domain_id,
-                                     description=description,
-                                     enabled=str(en).lower())
-        resp, body = self.patch('users/%s' % user_id,
-                                str(common.Document(update_user)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_user_password(self, user_id, password, original_password):
-        """Updates a user password."""
-        update_user = common.Element("user",
-                                     xmlns=XMLNS,
-                                     password=password,
-                                     original_password=original_password)
-        resp, _ = self.post('users/%s/password' % user_id,
-                            str(common.Document(update_user)))
-        self.expected_success(204, resp.status)
-        return resp
-
-    def list_user_projects(self, user_id):
-        """Lists the projects on which a user has roles assigned."""
-        resp, body = self.get('users/%s/projects' % user_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_projects(etree.fromstring(body))
-        return resp, body
-
-    def get_users(self, params=None):
-        """Get the list of users."""
-        url = 'users'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_users(etree.fromstring(body))
-        return resp, body
-
-    def get_user(self, user_id):
-        """GET a user."""
-        resp, body = self.get("users/%s" % user_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_user(self, user_id):
-        """Deletes a User."""
-        resp, body = self.delete("users/%s" % user_id)
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def create_project(self, name, **kwargs):
-        """Creates a project."""
-        description = kwargs.get('description', None)
-        en = kwargs.get('enabled', 'true')
-        domain_id = kwargs.get('domain_id', 'default')
-        post_body = common.Element("project",
-                                   xmlns=XMLNS,
-                                   description=description,
-                                   domain_id=domain_id,
-                                   enabled=str(en).lower(),
-                                   name=name)
-        resp, body = self.post('projects',
-                               str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_projects(self, params=None):
-        """Get the list of projects."""
-        url = 'projects'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_projects(etree.fromstring(body))
-        return resp, body
-
-    def update_project(self, project_id, **kwargs):
-        """Updates a Project."""
-        resp, body = self.get_project(project_id)
-        name = kwargs.get('name', body['name'])
-        desc = kwargs.get('description', body['description'])
-        en = kwargs.get('enabled', body['enabled'])
-        domain_id = kwargs.get('domain_id', body['domain_id'])
-        post_body = common.Element("project",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=desc,
-                                   enabled=str(en).lower(),
-                                   domain_id=domain_id)
-        resp, body = self.patch('projects/%s' % project_id,
-                                str(common.Document(post_body)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_project(self, project_id):
-        """GET a Project."""
-        resp, body = self.get("projects/%s" % project_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_project(self, project_id):
-        """Delete a project."""
-        resp, body = self.delete('projects/%s' % str(project_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def create_role(self, name):
-        """Create a Role."""
-        post_body = common.Element("role",
-                                   xmlns=XMLNS,
-                                   name=name)
-        resp, body = self.post('roles', str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_role(self, role_id):
-        """GET a Role."""
-        resp, body = self.get('roles/%s' % str(role_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_roles(self):
-        """Get the list of Roles."""
-        resp, body = self.get("roles")
-        self.expected_success(200, resp.status)
-        body = self._parse_roles(etree.fromstring(body))
-        return resp, body
-
-    def update_role(self, name, role_id):
-        """Updates a Role."""
-        post_body = common.Element("role",
-                                   xmlns=XMLNS,
-                                   name=name)
-        resp, body = self.patch('roles/%s' % str(role_id),
-                                str(common.Document(post_body)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_role(self, role_id):
-        """Delete a role."""
-        resp, body = self.delete('roles/%s' % str(role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def assign_user_role(self, project_id, user_id, role_id):
-        """Add roles to a user on a tenant."""
-        resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def create_domain(self, name, **kwargs):
-        """Creates a domain."""
-        description = kwargs.get('description', None)
-        en = kwargs.get('enabled', True)
-        post_body = common.Element("domain",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=description,
-                                   enabled=str(en).lower())
-        resp, body = self.post('domains', str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_domains(self):
-        """Get the list of domains."""
-        resp, body = self.get("domains")
-        self.expected_success(200, resp.status)
-        body = self._parse_domains(etree.fromstring(body))
-        return resp, body
-
-    def delete_domain(self, domain_id):
-        """Delete a domain."""
-        resp, body = self.delete('domains/%s' % domain_id)
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def update_domain(self, domain_id, **kwargs):
-        """Updates a domain."""
-        _, body = self.get_domain(domain_id)
-        description = kwargs.get('description', body['description'])
-        en = kwargs.get('enabled', body['enabled'])
-        name = kwargs.get('name', body['name'])
-        post_body = common.Element("domain",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=description,
-                                   enabled=str(en).lower())
-        resp, body = self.patch('domains/%s' % domain_id,
-                                str(common.Document(post_body)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_domain(self, domain_id):
-        """Get Domain details."""
-        resp, body = self.get('domains/%s' % domain_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_token(self, resp_token):
-        """GET a Token Details."""
-        headers = {'Content-Type': 'application/xml',
-                   'Accept': 'application/xml',
-                   'X-Subject-Token': resp_token}
-        resp, body = self.get("auth/tokens", headers=headers)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_token(self, resp_token):
-        """Delete a Given Token."""
-        headers = {'X-Subject-Token': resp_token}
-        resp, body = self.delete("auth/tokens", headers=headers)
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def create_group(self, name, **kwargs):
-        """Creates a group."""
-        description = kwargs.get('description', None)
-        domain_id = kwargs.get('domain_id', 'default')
-        project_id = kwargs.get('project_id', None)
-        post_body = common.Element("group",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=description,
-                                   domain_id=domain_id,
-                                   project_id=project_id)
-        resp, body = self.post('groups', str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_group(self, group_id):
-        """Get group details."""
-        resp, body = self.get('groups/%s' % group_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_group(self, group_id, **kwargs):
-        """Updates a group."""
-        _, body = self.get_group(group_id)
-        name = kwargs.get('name', body['name'])
-        description = kwargs.get('description', body['description'])
-        post_body = common.Element("group",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=description)
-        resp, body = self.patch('groups/%s' % group_id,
-                                str(common.Document(post_body)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_group(self, group_id):
-        """Delete a group."""
-        resp, body = self.delete('groups/%s' % group_id)
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def add_group_user(self, group_id, user_id):
-        """Add user into group."""
-        resp, body = self.put('groups/%s/users/%s' % (group_id, user_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def list_group_users(self, group_id):
-        """List users in group."""
-        resp, body = self.get('groups/%s/users' % group_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_group_users(etree.fromstring(body))
-        return resp, body
-
-    def list_user_groups(self, user_id):
-        """Lists the groups which a user belongs to."""
-        resp, body = self.get('users/%s/groups' % user_id)
-        self.expected_success(200, resp.status)
-        body = self._parse_groups(etree.fromstring(body))
-        return resp, body
-
-    def delete_group_user(self, group_id, user_id):
-        """Delete user in group."""
-        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def assign_user_role_on_project(self, project_id, user_id, role_id):
-        """Add roles to a user on a project."""
-        resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def assign_user_role_on_domain(self, domain_id, user_id, role_id):
-        """Add roles to a user on a domain."""
-        resp, body = self.put('domains/%s/users/%s/roles/%s' %
-                              (domain_id, user_id, role_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def list_user_roles_on_project(self, project_id, user_id):
-        """list roles of a user on a project."""
-        resp, body = self.get('projects/%s/users/%s/roles' %
-                              (project_id, user_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_roles(etree.fromstring(body))
-        return resp, body
-
-    def list_user_roles_on_domain(self, domain_id, user_id):
-        """list roles of a user on a domain."""
-        resp, body = self.get('domains/%s/users/%s/roles' %
-                              (domain_id, user_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_roles(etree.fromstring(body))
-        return resp, body
-
-    def revoke_role_from_user_on_project(self, project_id, user_id, role_id):
-        """Delete role of a user on a project."""
-        resp, body = self.delete('projects/%s/users/%s/roles/%s' %
-                                 (project_id, user_id, role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def revoke_role_from_user_on_domain(self, domain_id, user_id, role_id):
-        """Delete role of a user on a domain."""
-        resp, body = self.delete('domains/%s/users/%s/roles/%s' %
-                                 (domain_id, user_id, role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def assign_group_role_on_project(self, project_id, group_id, role_id):
-        """Add roles to a user on a project."""
-        resp, body = self.put('projects/%s/groups/%s/roles/%s' %
-                              (project_id, group_id, role_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def assign_group_role_on_domain(self, domain_id, group_id, role_id):
-        """Add roles to a user on a domain."""
-        resp, body = self.put('domains/%s/groups/%s/roles/%s' %
-                              (domain_id, group_id, role_id), '')
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def list_group_roles_on_project(self, project_id, group_id):
-        """list roles of a user on a project."""
-        resp, body = self.get('projects/%s/groups/%s/roles' %
-                              (project_id, group_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_roles(etree.fromstring(body))
-        return resp, body
-
-    def list_group_roles_on_domain(self, domain_id, group_id):
-        """list roles of a user on a domain."""
-        resp, body = self.get('domains/%s/groups/%s/roles' %
-                              (domain_id, group_id))
-        self.expected_success(200, resp.status)
-        body = self._parse_roles(etree.fromstring(body))
-        return resp, body
-
-    def revoke_role_from_group_on_project(self, project_id, group_id, role_id):
-        """Delete role of a user on a project."""
-        resp, body = self.delete('projects/%s/groups/%s/roles/%s' %
-                                 (project_id, group_id, role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def revoke_role_from_group_on_domain(self, domain_id, group_id, role_id):
-        """Delete role of a user on a domain."""
-        resp, body = self.delete('domains/%s/groups/%s/roles/%s' %
-                                 (domain_id, group_id, role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-
-class V3TokenClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self):
-        super(V3TokenClientXML, self).__init__(None)
-        auth_url = CONF.identity.uri_v3
-        if not auth_url:
-            raise exceptions.InvalidConfiguration('you must specify a v3 uri '
-                                                  'if using the v3 identity '
-                                                  'api')
-        if 'auth/tokens' not in auth_url:
-            auth_url = auth_url.rstrip('/') + '/auth/tokens'
-
-        self.auth_url = auth_url
-
-    def auth(self, user=None, password=None, tenant=None, user_type='id',
-             domain=None, token=None):
-        """
-        :param user: user id or name, as specified in user_type
-        :param domain: the user and tenant domain
-        :param token: a token to re-scope.
-
-        Accepts different combinations of credentials. Restrictions:
-        - tenant and domain are only name (no id)
-        - user domain and tenant domain are assumed identical
-        - domain scope is not supported here
-        Sample sample valid combinations:
-        - token
-        - token, tenant, domain
-        - user_id, password
-        - username, password, domain
-        - username, password, tenant, domain
-        Validation is left to the server side.
-        """
-
-        methods = common.Element('methods')
-        identity = common.Element('identity')
-
-        if token:
-            method = common.Element('method')
-            method.append(common.Text('token'))
-            methods.append(method)
-
-            token = common.Element('token', id=token)
-            identity.append(token)
-
-        if user and password:
-            if user_type == 'id':
-                _user = common.Element('user', id=user, password=password)
-            else:
-                _user = common.Element('user', name=user, password=password)
-            if domain is not None:
-                _domain = common.Element('domain', name=domain)
-                _user.append(_domain)
-
-            password = common.Element('password')
-            password.append(_user)
-            method = common.Element('method')
-            method.append(common.Text('password'))
-            methods.append(method)
-            identity.append(password)
-
-        identity.append(methods)
-
-        auth = common.Element('auth')
-        auth.append(identity)
-
-        if tenant is not None:
-            project = common.Element('project', name=tenant)
-            _domain = common.Element('domain', name=domain)
-            project.append(_domain)
-            scope = common.Element('scope')
-            scope.append(project)
-            auth.append(scope)
-
-        resp, body = self.post(self.auth_url, body=str(common.Document(auth)))
-        self.expected_success(201, resp.status)
-        return resp, body
-
-    def request(self, method, url, extra_headers=False, headers=None,
-                body=None):
-        """A simple HTTP request interface."""
-        if headers is None:
-            # Always accept 'json', for xml token client too.
-            # Because XML response is not easily
-            # converted to the corresponding JSON one
-            headers = self.get_headers(accept_type="json")
-        elif extra_headers:
-            try:
-                headers.update(self.get_headers(accept_type="json"))
-            except (ValueError, TypeError):
-                headers = self.get_headers(accept_type="json")
-        resp, resp_body = self.http_obj.request(url, method,
-                                                headers=headers, body=body)
-        self._log_request(method, url, resp)
-
-        if resp.status in [401, 403]:
-            resp_body = json.loads(resp_body)
-            raise exceptions.Unauthorized(resp_body['error']['message'])
-        elif resp.status not in [200, 201, 204]:
-            raise exceptions.IdentityError(
-                'Unexpected status code {0}'.format(resp.status))
-
-        return resp, json.loads(resp_body)
-
-    def get_token(self, user, password, tenant, domain='Default',
-                  auth_data=False):
-        """
-        :param user: username
-        Returns (token id, token data) for supplied credentials
-        """
-        resp, body = self.auth(user, password, tenant, user_type='name',
-                               domain=domain)
-
-        token = resp.get('x-subject-token')
-        if auth_data:
-            return token, body['token']
-        else:
-            return token
diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py
deleted file mode 100644
index 41bbfe5..0000000
--- a/tempest/services/identity/v3/xml/policy_client.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import http
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class PolicyClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(PolicyClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "policy":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        json = common.xml_to_json(body)
-        return json
-
-    def request(self, method, url, extra_headers=False, headers=None,
-                body=None, wait=None):
-        """Overriding the existing HTTP request in super class RestClient."""
-        if extra_headers:
-            try:
-                headers.update(self.get_headers())
-            except (ValueError, TypeError):
-                headers = self.get_headers()
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
-        return super(PolicyClientXML, self).request(method, url,
-                                                    extra_headers,
-                                                    headers=headers,
-                                                    body=body)
-
-    def create_policy(self, blob, type):
-        """Creates a Policy."""
-        create_policy = common.Element("policy", xmlns=XMLNS,
-                                       blob=blob, type=type)
-        resp, body = self.post('policies', str(common.Document(create_policy)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_policies(self):
-        """Lists the policies."""
-        resp, body = self.get('policies')
-        self.expected_success(200, resp.status)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_policy(self, policy_id):
-        """Lists out the given policy."""
-        url = 'policies/%s' % policy_id
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_policy(self, policy_id, **kwargs):
-        """Updates a policy."""
-        type = kwargs.get('type')
-        update_policy = common.Element("policy", xmlns=XMLNS, type=type)
-        url = 'policies/%s' % policy_id
-        resp, body = self.patch(url, str(common.Document(update_policy)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_policy(self, policy_id):
-        """Deletes the policy."""
-        url = "policies/%s" % policy_id
-        resp, body = self.delete(url)
-        self.expected_success(204, resp.status)
-        return resp, body
diff --git a/tempest/services/identity/v3/xml/region_client.py b/tempest/services/identity/v3/xml/region_client.py
deleted file mode 100644
index 7669678..0000000
--- a/tempest/services/identity/v3/xml/region_client.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 2014 Hewlett-Packard Development Company, L.P
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import http
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class RegionClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(RegionClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.region_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "region":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        json = common.xml_to_json(body)
-        return json
-
-    def request(self, method, url, extra_headers=False, headers=None,
-                body=None, wait=None):
-        """Overriding the existing HTTP request in super class RestClient."""
-        if extra_headers:
-            try:
-                headers.update(self.get_headers())
-            except (ValueError, TypeError):
-                headers = self.get_headers()
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
-        return super(RegionClientXML, self).request(method, url,
-                                                    extra_headers,
-                                                    headers=headers,
-                                                    body=body)
-
-    def create_region(self, description, **kwargs):
-        """Create region."""
-        create_region = common.Element("region",
-                                       xmlns=XMLNS,
-                                       description=description)
-        if 'parent_region_id' in kwargs:
-            create_region.append(common.Element(
-                'parent_region_id', kwargs.get('parent_region_id')))
-        if 'unique_region_id' in kwargs:
-            resp, body = self.put(
-                'regions/%s' % kwargs.get('unique_region_id'),
-                str(common.Document(create_region)))
-        else:
-            resp, body = self.post('regions',
-                                   str(common.Document(create_region)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def update_region(self, region_id, **kwargs):
-        """Updates an region with given parameters.
-        """
-        description = kwargs.get('description', None)
-        update_region = common.Element("region",
-                                       xmlns=XMLNS,
-                                       description=description)
-        if 'parent_region_id' in kwargs:
-            update_region.append(common.Element('parent_region_id',
-                                 kwargs.get('parent_region_id')))
-
-        resp, body = self.patch('regions/%s' % str(region_id),
-                                str(common.Document(update_region)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_region(self, region_id):
-        """Get Region."""
-        url = 'regions/%s' % region_id
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_regions(self, params=None):
-        """Get the list of regions."""
-        url = 'regions'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def delete_region(self, region_id):
-        """Delete region."""
-        resp, body = self.delete('regions/%s' % region_id)
-        self.expected_success(204, resp.status)
-        return resp, body
diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py
deleted file mode 100644
index 14adfac..0000000
--- a/tempest/services/identity/v3/xml/service_client.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v3"
-
-
-class ServiceClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(ServiceClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-        self.api_version = "v3"
-
-    def _parse_body(self, body):
-        data = common.xml_to_json(body)
-        return data
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[1] == "service":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def update_service(self, service_id, **kwargs):
-        """Updates a service_id."""
-        resp, body = self.get_service(service_id)
-        name = kwargs.get('name', body['name'])
-        description = kwargs.get('description', body['description'])
-        type = kwargs.get('type', body['type'])
-        update_service = common.Element("service",
-                                        xmlns=XMLNS,
-                                        id=service_id,
-                                        name=name,
-                                        description=description,
-                                        type=type)
-        resp, body = self.patch('services/%s' % service_id,
-                                str(common.Document(update_service)))
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_service(self, service_id):
-        """Get Service."""
-        url = 'services/%s' % service_id
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def create_service(self, serv_type, name=None, description=None):
-        post_body = common.Element("service",
-                                   xmlns=XMLNS,
-                                   name=name,
-                                   description=description,
-                                   type=serv_type)
-        resp, body = self.post("services", str(common.Document(post_body)))
-        self.expected_success(201, resp.status)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_service(self, serv_id):
-        url = "services/" + serv_id
-        resp, body = self.delete(url)
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def list_services(self):
-        resp, body = self.get('services')
-        self.expected_success(200, resp.status)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/identity/xml/__init__.py b/tempest/services/identity/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/identity/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
deleted file mode 100644
index eaf9390..0000000
--- a/tempest/services/identity/xml/identity_client.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-from tempest.common import xml_utils as xml
-from tempest import config
-from tempest.services.identity.json import identity_client
-
-CONF = config.CONF
-
-XMLNS = "http://docs.openstack.org/identity/api/v2.0"
-
-
-class IdentityClientXML(identity_client.IdentityClientJSON):
-    TYPE = "xml"
-
-    def create_role(self, name):
-        """Create a role."""
-        create_role = xml.Element("role", xmlns=XMLNS, name=name)
-        resp, body = self.post('OS-KSADM/roles',
-                               str(xml.Document(create_role)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def get_role(self, role_id):
-        """Get a role by its id."""
-        resp, body = self.get('OS-KSADM/roles/%s' % role_id)
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def create_tenant(self, name, **kwargs):
-        """
-        Create a tenant
-        name (required): New tenant name
-        description: Description of new tenant (default is none)
-        enabled <true|false>: Initial tenant status (default is true)
-        """
-        en = kwargs.get('enabled', 'true')
-        create_tenant = xml.Element("tenant",
-                                    xmlns=XMLNS,
-                                    name=name,
-                                    description=kwargs.get('description', ''),
-                                    enabled=str(en).lower())
-        resp, body = self.post('tenants', str(xml.Document(create_tenant)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def list_tenants(self):
-        """Returns tenants."""
-        resp, body = self.get('tenants')
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def update_tenant(self, tenant_id, **kwargs):
-        """Updates a tenant."""
-        _, body = self.get_tenant(tenant_id)
-        name = kwargs.get('name', body['name'])
-        desc = kwargs.get('description', body['description'])
-        en = kwargs.get('enabled', body['enabled'])
-        update_tenant = xml.Element("tenant",
-                                    xmlns=XMLNS,
-                                    id=tenant_id,
-                                    name=name,
-                                    description=desc,
-                                    enabled=str(en).lower())
-
-        resp, body = self.post('tenants/%s' % tenant_id,
-                               str(xml.Document(update_tenant)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def create_user(self, name, password, tenant_id, email, **kwargs):
-        """Create a user."""
-        create_user = xml.Element("user",
-                                  xmlns=XMLNS,
-                                  name=name,
-                                  password=password,
-                                  email=email)
-        if tenant_id:
-            create_user.add_attr('tenantId', tenant_id)
-        if 'enabled' in kwargs:
-            create_user.add_attr('enabled', str(kwargs['enabled']).lower())
-
-        resp, body = self.post('users', str(xml.Document(create_user)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def update_user(self, user_id, **kwargs):
-        """Updates a user."""
-        if 'enabled' in kwargs:
-            kwargs['enabled'] = str(kwargs['enabled']).lower()
-        update_user = xml.Element("user", xmlns=XMLNS, **kwargs)
-
-        resp, body = self.put('users/%s' % user_id,
-                              str(xml.Document(update_user)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def enable_disable_user(self, user_id, enabled):
-        """Enables or disables a user."""
-        enable_user = xml.Element("user", enabled=str(enabled).lower())
-        resp, body = self.put('users/%s/enabled' % user_id,
-                              str(xml.Document(enable_user)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def create_service(self, name, service_type, **kwargs):
-        """Create a service."""
-        OS_KSADM = "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
-        create_service = xml.Element("service",
-                                     xmlns=OS_KSADM,
-                                     name=name,
-                                     type=service_type,
-                                     description=kwargs.get('description'))
-        resp, body = self.post('OS-KSADM/services',
-                               str(xml.Document(create_service)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def update_user_password(self, user_id, new_pass):
-        """Update User Password."""
-        put_body = xml.Element("user",
-                               id=user_id,
-                               password=new_pass)
-        resp, body = self.put('users/%s/OS-KSADM/password' % user_id,
-                              str(xml.Document(put_body)))
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-    def list_extensions(self):
-        """List all the extensions."""
-        resp, body = self.get('/extensions')
-        self.expected_success(200, resp.status)
-        return resp, self._parse_resp(body)
-
-
-class TokenClientXML(identity_client.TokenClientJSON):
-    TYPE = "xml"
-
-    def auth(self, user, password, tenant=None):
-        passwordCreds = xml.Element('passwordCredentials',
-                                    username=user,
-                                    password=password)
-        auth_kwargs = {}
-        if tenant:
-            auth_kwargs['tenantName'] = tenant
-        auth = xml.Element('auth', **auth_kwargs)
-        auth.append(passwordCreds)
-        resp, body = self.post(self.auth_url, body=str(xml.Document(auth)))
-        self.expected_success(200, resp.status)
-        return resp, body['access']
-
-    def auth_token(self, token_id, tenant=None):
-        tokenCreds = xml.Element('token', id=token_id)
-        auth_kwargs = {}
-        if tenant:
-            auth_kwargs['tenantName'] = tenant
-        auth = xml.Element('auth', **auth_kwargs)
-        auth.append(tokenCreds)
-        resp, body = self.post(self.auth_url, body=str(xml.Document(auth)))
-        self.expected_success(200, resp.status)
-        return resp, body['access']
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index d0d32e5..d60c9d9 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -106,9 +106,10 @@
 
     def _get_http(self):
         dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
         return glance_http.HTTPClient(auth_provider=self.auth_provider,
                                       filters=self.filters,
-                                      insecure=dscv)
+                                      insecure=dscv, ca_certs=ca_certs)
 
     def _create_with_data(self, headers, data):
         resp, body_iter = self.http.raw_request('POST', '/v1/images',
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 4865073..7421508 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -35,9 +35,10 @@
 
     def _get_http(self):
         dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
         return glance_http.HTTPClient(auth_provider=self.auth_provider,
                                       filters=self.filters,
-                                      insecure=dscv)
+                                      insecure=dscv, ca_certs=ca_certs)
 
     def _validate_schema(self, body, type='image'):
         if type in ['image', 'images']:
diff --git a/tempest/services/network/xml/__init__.py b/tempest/services/network/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/network/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
deleted file mode 100644
index 4a8dddc..0000000
--- a/tempest/services/network/xml/network_client.py
+++ /dev/null
@@ -1,320 +0,0 @@
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import xml.etree.ElementTree as ET
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest.services.network import network_client_base as client_base
-
-
-class NetworkClientXML(client_base.NetworkClientBase):
-    TYPE = "xml"
-
-    # list of plurals used for xml serialization
-    PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools',
-               'fixed_ips', 'extensions', 'extra_dhcp_opts', 'pools',
-               'health_monitors', 'vips', 'members', 'allowed_address_pairs',
-               'firewall_rules', 'security_groups']
-
-    def get_rest_client(self, auth_provider):
-        rc = rest_client.RestClient(auth_provider)
-        rc.TYPE = self.TYPE
-        return rc
-
-    def deserialize_list(self, body):
-        return common.parse_array(etree.fromstring(body), self.PLURALS)
-
-    def deserialize_single(self, body):
-        return _root_tag_fetcher_and_xml_to_json_parse(body)
-
-    def serialize(self, body):
-        # TODO(enikanorov): implement better json to xml conversion
-        # expecting the dict with single key
-        root = body.keys()[0]
-        post_body = common.Element(root)
-        post_body.add_attr('xmlns:xsi',
-                           'http://www.w3.org/2001/XMLSchema-instance')
-        elements = set()
-        for name, attr in body[root].items():
-            elt = self._get_element(name, attr)
-            post_body.append(elt)
-            if ":" in name:
-                elements.add(name.split(":")[0])
-        if elements:
-            self._add_namespaces(post_body, elements)
-        return str(common.Document(post_body))
-
-    def serialize_list(self, body, root_name=None, item_name=None):
-        # expecting dict in form
-        # body = {'resources': [res_dict1, res_dict2, ...]
-        post_body = common.Element(root_name)
-        post_body.add_attr('xmlns:xsi',
-                           'http://www.w3.org/2001/XMLSchema-instance')
-        for item in body[body.keys()[0]]:
-            elt = common.Element(item_name)
-            for name, attr in item.items():
-                elt_content = self._get_element(name, attr)
-                elt.append(elt_content)
-            post_body.append(elt)
-        return str(common.Document(post_body))
-
-    def _get_element(self, name, value):
-        if value is None:
-            xml_elem = common.Element(name)
-            xml_elem.add_attr("xsi:nil", "true")
-            return xml_elem
-        elif isinstance(value, dict):
-            dict_element = common.Element(name)
-            for key, value in value.iteritems():
-                elem = self._get_element(key, value)
-                dict_element.append(elem)
-            return dict_element
-        elif isinstance(value, list):
-            list_element = common.Element(name)
-            for element in value:
-                elem = self._get_element(name[:-1], element)
-                list_element.append(elem)
-            return list_element
-        else:
-            return common.Element(name, value)
-
-    def _add_namespaces(self, root, elements):
-        for element in elements:
-            root.add_attr('xmlns:%s' % element,
-                          common.NEUTRON_NAMESPACES[element])
-
-    def associate_health_monitor_with_pool(self, health_monitor_id,
-                                           pool_id):
-        uri = '%s/lb/pools/%s/health_monitors' % (self.uri_prefix,
-                                                  pool_id)
-        post_body = common.Element("health_monitor")
-        p1 = common.Element("id", health_monitor_id,)
-        post_body.append(p1)
-        resp, body = self.post(uri, str(common.Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        self.rest_client.expected_success(201, resp.status)
-        return resp, body
-
-    def disassociate_health_monitor_with_pool(self, health_monitor_id,
-                                              pool_id):
-        uri = '%s/lb/pools/%s/health_monitors/%s' % (self.uri_prefix, pool_id,
-                                                     health_monitor_id)
-        resp, body = self.delete(uri)
-        self.rest_client.expected_success(204, resp.status)
-        return resp, body
-
-    def show_extension_details(self, ext_alias):
-        uri = '%s/extensions/%s' % (self.uri_prefix, str(ext_alias))
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_router(self, name, **kwargs):
-        uri = '%s/routers' % (self.uri_prefix)
-        router = common.Element("router")
-        router.append(common.Element("name", name))
-        common.deep_dict_to_xml(router, kwargs)
-        resp, body = self.post(uri, str(common.Document(router)))
-        self.rest_client.expected_success(201, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_router(self, router_id, **kwargs):
-        uri = '%s/routers/%s' % (self.uri_prefix, router_id)
-        router = common.Element("router")
-        for element, content in kwargs.iteritems():
-            router.append(common.Element(element, content))
-        resp, body = self.put(uri, str(common.Document(router)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def add_router_interface_with_subnet_id(self, router_id, subnet_id):
-        uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
-                                                      router_id)
-        subnet = common.Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(common.Document(subnet)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def add_router_interface_with_port_id(self, router_id, port_id):
-        uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
-                                                      router_id)
-        port = common.Element("port_id", port_id)
-        resp, body = self.put(uri, str(common.Document(port)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def remove_router_interface_with_subnet_id(self, router_id, subnet_id):
-        uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
-                                                         router_id)
-        subnet = common.Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(common.Document(subnet)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def remove_router_interface_with_port_id(self, router_id, port_id):
-        uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
-                                                         router_id)
-        port = common.Element("port_id", port_id)
-        resp, body = self.put(uri, str(common.Document(port)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def list_router_interfaces(self, uuid):
-        uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        ports = common.parse_array(etree.fromstring(body), self.PLURALS)
-        ports = {"ports": ports}
-        return resp, ports
-
-    def update_agent(self, agent_id, agent_info):
-        uri = '%s/agents/%s' % (self.uri_prefix, agent_id)
-        agent = common.Element('agent')
-        for (key, value) in agent_info.items():
-            p = common.Element(key, value)
-            agent.append(p)
-        resp, body = self.put(uri, str(common.Document(agent)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
-        uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        pools = common.parse_array(etree.fromstring(body))
-        body = {'pools': pools}
-        return resp, body
-
-    def show_lbaas_agent_hosting_pool(self, pool_id):
-        uri = ('%s/lb/pools/%s/loadbalancer-agent' %
-               (self.uri_prefix, pool_id))
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def list_routers_on_l3_agent(self, agent_id):
-        uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        routers = common.parse_array(etree.fromstring(body))
-        body = {'routers': routers}
-        return resp, body
-
-    def list_l3_agents_hosting_router(self, router_id):
-        uri = '%s/routers/%s/l3-agents' % (self.uri_prefix, router_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        agents = common.parse_array(etree.fromstring(body))
-        body = {'agents': agents}
-        return resp, body
-
-    def add_router_to_l3_agent(self, agent_id, router_id):
-        uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
-        router = (common.Element("router_id", router_id))
-        resp, body = self.post(uri, str(common.Document(router)))
-        self.rest_client.expected_success(201, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def remove_router_from_l3_agent(self, agent_id, router_id):
-        uri = '%s/agents/%s/l3-routers/%s' % (
-            self.uri_prefix, agent_id, router_id)
-        resp, body = self.delete(uri)
-        self.rest_client.expected_success(204, resp.status)
-        return resp, body
-
-    def list_dhcp_agent_hosting_network(self, network_id):
-        uri = '%s/networks/%s/dhcp-agents' % (self.uri_prefix, network_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        agents = common.parse_array(etree.fromstring(body))
-        body = {'agents': agents}
-        return resp, body
-
-    def list_networks_hosted_by_one_dhcp_agent(self, agent_id):
-        uri = '%s/agents/%s/dhcp-networks' % (self.uri_prefix, agent_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        networks = common.parse_array(etree.fromstring(body))
-        body = {'networks': networks}
-        return resp, body
-
-    def remove_network_from_dhcp_agent(self, agent_id, network_id):
-        uri = '%s/agents/%s/dhcp-networks/%s' % (self.uri_prefix, agent_id,
-                                                 network_id)
-        resp, body = self.delete(uri)
-        self.rest_client.expected_success(204, resp.status)
-        return resp, body
-
-    def list_lb_pool_stats(self, pool_id):
-        uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
-        resp, body = self.get(uri)
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def add_dhcp_agent_to_network(self, agent_id, network_id):
-        uri = '%s/agents/%s/dhcp-networks' % (self.uri_prefix, agent_id)
-        network = common.Element("network_id", network_id)
-        resp, body = self.post(uri, str(common.Document(network)))
-        self.rest_client.expected_success(201, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def insert_firewall_rule_in_policy(self, firewall_policy_id,
-                                       firewall_rule_id, insert_after="",
-                                       insert_before=""):
-        uri = '%s/fw/firewall_policies/%s/insert_rule' % (self.uri_prefix,
-                                                          firewall_policy_id)
-        rule = common.Element("firewall_rule_id", firewall_rule_id)
-        resp, body = self.put(uri, str(common.Document(rule)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def remove_firewall_rule_from_policy(self, firewall_policy_id,
-                                         firewall_rule_id):
-        uri = '%s/fw/firewall_policies/%s/remove_rule' % (self.uri_prefix,
-                                                          firewall_policy_id)
-        rule = common.Element("firewall_rule_id", firewall_rule_id)
-        resp, body = self.put(uri, str(common.Document(rule)))
-        self.rest_client.expected_success(200, resp.status)
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-
-def _root_tag_fetcher_and_xml_to_json_parse(xml_returned_body):
-    body = ET.fromstring(xml_returned_body)
-    root_tag = body.tag
-    if root_tag.startswith("{"):
-        ns, root_tag = root_tag.split("}", 1)
-    body = common.xml_to_json(etree.fromstring(xml_returned_body),
-                              NetworkClientXML.PLURALS)
-    nil = '{http://www.w3.org/2001/XMLSchema-instance}nil'
-    for key, val in body.iteritems():
-        if isinstance(val, dict):
-            if (nil in val and val[nil] == 'true'):
-                body[key] = None
-    body = {root_tag: body}
-    return body
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 4417e3b..a2044ef 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -181,7 +181,11 @@
     def request(self, method, url, extra_headers=False, headers=None,
                 body=None):
         """A simple HTTP request interface."""
-        self.http_obj = http.ClosingHttp()
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
+        self.http_obj = http.ClosingHttp(
+            disable_ssl_certificate_validation=dscv,
+            ca_certs=ca_certs)
         if headers is None:
             headers = {}
         elif extra_headers:
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 2231407..7a69fa8 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -197,8 +197,10 @@
                 body=None):
         """A simple HTTP request interface."""
         dscv = CONF.identity.disable_ssl_certificate_validation
+        ca_certs = CONF.identity.ca_certificates_file
         self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
+            disable_ssl_certificate_validation=dscv,
+            ca_certs=ca_certs)
         if headers is None:
             headers = {}
         elif extra_headers:
diff --git a/tempest/services/telemetry/xml/__init__.py b/tempest/services/telemetry/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/telemetry/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
deleted file mode 100644
index 3bee8bf..0000000
--- a/tempest/services/telemetry/xml/telemetry_client.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2014 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-import tempest.services.telemetry.telemetry_client_base as client
-
-
-class TelemetryClientXML(client.TelemetryClientBase):
-    TYPE = "xml"
-
-    def get_rest_client(self, auth_provider):
-        rc = rest_client.RestClient(auth_provider)
-        rc.TYPE = self.TYPE
-        return rc
-
-    def _parse_array(self, body):
-        array = []
-        for child in body.getchildren():
-            array.append(common.xml_to_json(child))
-        return array
-
-    def serialize(self, body):
-        return str(common.Document(body))
-
-    def deserialize(self, body):
-        return self._parse_array(etree.fromstring(body))
diff --git a/tempest/services/volume/json/admin/volume_quotas_client.py b/tempest/services/volume/json/admin/volume_quotas_client.py
index 90790e3..5b49040 100644
--- a/tempest/services/volume/json/admin/volume_quotas_client.py
+++ b/tempest/services/volume/json/admin/volume_quotas_client.py
@@ -23,7 +23,7 @@
 CONF = config.CONF
 
 
-class VolumeQuotasClientJSON(rest_client.RestClient):
+class BaseVolumeQuotasClientJSON(rest_client.RestClient):
     """
     Client class to send CRUD Volume Quotas API requests to a Cinder endpoint
     """
@@ -31,7 +31,7 @@
     TYPE = "json"
 
     def __init__(self, auth_provider):
-        super(VolumeQuotasClientJSON, self).__init__(auth_provider)
+        super(BaseVolumeQuotasClientJSON, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
@@ -85,3 +85,9 @@
         """Delete the tenant's quota set."""
         resp, body = self.delete('os-quota-sets/%s' % tenant_id)
         self.expected_success(200, resp.status)
+
+
+class VolumeQuotasClientJSON(BaseVolumeQuotasClientJSON):
+    """
+    Client class to send CRUD Volume Type API V1 requests to a Cinder endpoint
+    """
diff --git a/tempest/services/volume/json/admin/volume_services_client.py b/tempest/services/volume/json/admin/volume_services_client.py
index c9b8bcc..88c6db0 100644
--- a/tempest/services/volume/json/admin/volume_services_client.py
+++ b/tempest/services/volume/json/admin/volume_services_client.py
@@ -22,10 +22,10 @@
 CONF = config.CONF
 
 
-class VolumesServicesClientJSON(rest_client.RestClient):
+class BaseVolumesServicesClientJSON(rest_client.RestClient):
 
     def __init__(self, auth_provider):
-        super(VolumesServicesClientJSON, self).__init__(auth_provider)
+        super(BaseVolumesServicesClientJSON, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
 
     def list_services(self, params=None):
@@ -37,3 +37,7 @@
         body = json.loads(body)
         self.expected_success(200, resp.status)
         return resp, body['services']
+
+
+class VolumesServicesClientJSON(BaseVolumesServicesClientJSON):
+    """Volume V1 volume services client"""
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index 63fc646..da47639 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -23,13 +23,13 @@
 CONF = config.CONF
 
 
-class BackupsClientJSON(rest_client.RestClient):
+class BaseBackupsClientJSON(rest_client.RestClient):
     """
     Client class to send CRUD Volume backup API requests to a Cinder endpoint
     """
 
     def __init__(self, auth_provider):
-        super(BackupsClientJSON, self).__init__(auth_provider)
+        super(BaseBackupsClientJSON, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
         self.build_timeout = CONF.volume.build_timeout
@@ -99,3 +99,7 @@
                            'the required time (%s s).' %
                            (backup_id, status, self.build_timeout))
                 raise exceptions.TimeoutException(message)
+
+
+class BackupsClientJSON(BaseBackupsClientJSON):
+    """Volume V1 Backups client"""
diff --git a/tempest/services/volume/v2/xml/availability_zone_client.py b/tempest/services/volume/v2/json/admin/volume_quotas_client.py
similarity index 66%
rename from tempest/services/volume/v2/xml/availability_zone_client.py
rename to tempest/services/volume/v2/json/admin/volume_quotas_client.py
index 68ca39b..64f4f33 100644
--- a/tempest/services/volume/v2/xml/availability_zone_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_quotas_client.py
@@ -1,4 +1,4 @@
-# Copyright 2014 IBM Corp.
+# Copyright 2014 OpenStack Foundation
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -13,14 +13,15 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.services.volume.xml import availability_zone_client
+from tempest.services.volume.json.admin import volume_quotas_client
 
 
-class VolumeV2AvailabilityZoneClientXML(
-        availability_zone_client.BaseVolumeAvailabilityZoneClientXML):
+class VolumeQuotasV2Client(volume_quotas_client.BaseVolumeQuotasClientJSON):
+    """
+    Client class to send CRUD Volume V2 API requests to a Cinder endpoint
+    """
 
     def __init__(self, auth_provider):
-        super(VolumeV2AvailabilityZoneClientXML, self).__init__(
-            auth_provider)
+        super(VolumeQuotasV2Client, self).__init__(auth_provider)
 
         self.api_version = "v2"
diff --git a/tempest/services/volume/v2/xml/availability_zone_client.py b/tempest/services/volume/v2/json/admin/volume_services_client.py
similarity index 65%
copy from tempest/services/volume/v2/xml/availability_zone_client.py
copy to tempest/services/volume/v2/json/admin/volume_services_client.py
index 68ca39b..dc3c8ea 100644
--- a/tempest/services/volume/v2/xml/availability_zone_client.py
+++ b/tempest/services/volume/v2/json/admin/volume_services_client.py
@@ -1,4 +1,4 @@
-# Copyright 2014 IBM Corp.
+# Copyright 2014 OpenStack Foundation
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -13,14 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.services.volume.xml import availability_zone_client
+from tempest.services.volume.json.admin import volume_services_client as vs_cli
 
 
-class VolumeV2AvailabilityZoneClientXML(
-        availability_zone_client.BaseVolumeAvailabilityZoneClientXML):
+class VolumesServicesV2ClientJSON(vs_cli.BaseVolumesServicesClientJSON):
+    """
+    Client class to send CRUD Volume V2 API requests to a Cinder endpoint
+    """
 
     def __init__(self, auth_provider):
-        super(VolumeV2AvailabilityZoneClientXML, self).__init__(
-            auth_provider)
-
+        super(VolumesServicesV2ClientJSON, self).__init__(auth_provider)
         self.api_version = "v2"
diff --git a/tempest/services/volume/xml/backups_client.py b/tempest/services/volume/v2/json/backups_client.py
similarity index 72%
rename from tempest/services/volume/xml/backups_client.py
rename to tempest/services/volume/v2/json/backups_client.py
index a691a25..9698075 100644
--- a/tempest/services/volume/xml/backups_client.py
+++ b/tempest/services/volume/v2/json/backups_client.py
@@ -16,11 +16,11 @@
 from tempest.services.volume.json import backups_client
 
 
-class BackupsClientXML(backups_client.BackupsClientJSON):
+class BackupsClientV2JSON(backups_client.BaseBackupsClientJSON):
     """
-    Client class to send CRUD Volume Backup API requests to a Cinder endpoint
+    Client class to send CRUD Volume V2 API requests to a Cinder endpoint
     """
-    TYPE = "xml"
 
-    # TODO(gfidente): XML client isn't yet implemented because of bug 1270589
-    pass
+    def __init__(self, auth_provider):
+        super(BackupsClientV2JSON, self).__init__(auth_provider)
+        self.api_version = "v2"
diff --git a/tempest/services/volume/v2/xml/__init__.py b/tempest/services/volume/v2/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/volume/v2/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/volume/v2/xml/extensions_client.py b/tempest/services/volume/v2/xml/extensions_client.py
deleted file mode 100644
index 13f333c..0000000
--- a/tempest/services/volume/v2/xml/extensions_client.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.services.volume.xml import extensions_client
-
-
-class ExtensionsV2ClientXML(extensions_client.BaseExtensionsClientXML):
-
-    def __init__(self, auth_provider):
-        super(ExtensionsV2ClientXML, self).__init__(auth_provider)
-
-        self.api_version = "v2"
diff --git a/tempest/services/volume/v2/xml/snapshots_client.py b/tempest/services/volume/v2/xml/snapshots_client.py
deleted file mode 100644
index b29d86c..0000000
--- a/tempest/services/volume/v2/xml/snapshots_client.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.services.volume.xml import snapshots_client
-
-
-class SnapshotsV2ClientXML(snapshots_client.BaseSnapshotsClientXML):
-    """Client class to send CRUD Volume V2 API requests."""
-
-    def __init__(self, auth_provider):
-        super(SnapshotsV2ClientXML, self).__init__(auth_provider)
-
-        self.api_version = "v2"
-        self.create_resp = 202
diff --git a/tempest/services/volume/v2/xml/volumes_client.py b/tempest/services/volume/v2/xml/volumes_client.py
deleted file mode 100644
index b3133af..0000000
--- a/tempest/services/volume/v2/xml/volumes_client.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import xml_utils as common
-from tempest.services.volume.xml import volumes_client
-
-
-class VolumesV2ClientXML(volumes_client.BaseVolumesClientXML):
-    """
-    Client class to send CRUD Volume API V2 requests to a Cinder endpoint
-    """
-
-    def __init__(self, auth_provider):
-        super(VolumesV2ClientXML, self).__init__(auth_provider)
-
-        self.api_version = "v2"
-        self.create_resp = 202
-
-    def _parse_volume(self, body):
-        vol = dict((attr, body.get(attr)) for attr in body.keys())
-
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                ns, tag = tag.split("}", 1)
-            if tag == 'metadata':
-                vol['metadata'] = dict((meta.get('key'),
-                                       meta.text) for meta in
-                                       child.getchildren())
-            else:
-                vol[tag] = common.xml_to_json(child)
-        self._translate_attributes_to_json(vol)
-        return vol
-
-    def list_volumes_with_detail(self, params=None):
-        """List all the details of volumes."""
-        url = 'volumes/detail'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume(vol) for vol in list(body)]
-        for v in volumes:
-            v = self._check_if_bootable(v)
-        self.expected_success(200, resp.status)
-        return resp, volumes
-
-    def get_volume(self, volume_id):
-        """Returns the details of a single volume."""
-        url = "volumes/%s" % str(volume_id)
-        resp, body = self.get(url)
-        body = self._parse_volume(etree.fromstring(body))
-        body = self._check_if_bootable(body)
-        self.expected_success(200, resp.status)
-        return resp, body
diff --git a/tempest/services/volume/xml/__init__.py b/tempest/services/volume/xml/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/volume/xml/__init__.py
+++ /dev/null
diff --git a/tempest/services/volume/xml/admin/__init__.py b/tempest/services/volume/xml/admin/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/volume/xml/admin/__init__.py
+++ /dev/null
diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py
deleted file mode 100644
index 583b2c5..0000000
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 2013 OpenStack Foundation.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-
-class BaseVolumeHostsClientXML(rest_client.RestClient):
-    """
-    Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
-    """
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseVolumeHostsClientXML, self).__init__(auth_provider)
-        self.service = CONF.volume.catalog_type
-        self.build_interval = CONF.compute.build_interval
-        self.build_timeout = CONF.compute.build_timeout
-
-    def _parse_array(self, node):
-        """
-        This method is to parse the "list" response body
-        Eg:
-
-        <?xml version='1.0' encoding='UTF-8'?>
-        <hosts>
-        <host service-status="available" service="cinder-scheduler"/>
-        <host service-status="available" service="cinder-volume"/>
-        </hosts>
-
-        This method will append the details of specified tag,
-        here it is "host"
-        Return value would be list of hosts as below
-
-        [{'service-status': 'available', 'service': 'cinder-scheduler'},
-         {'service-status': 'available', 'service': 'cinder-volume'}]
-        """
-        array = []
-        for child in node.getchildren():
-            tag_list = child.tag.split('}', 1)
-            if tag_list[0] == "host":
-                array.append(common.xml_to_json(child))
-        return array
-
-    def list_hosts(self, params=None):
-        """List all the hosts."""
-        url = 'os-hosts'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-
-class VolumeHostsClientXML(BaseVolumeHostsClientXML):
-    """
-    Client class to send CRUD Volume Host API V1 requests to a Cinder endpoint
-    """
diff --git a/tempest/services/volume/xml/admin/volume_quotas_client.py b/tempest/services/volume/xml/admin/volume_quotas_client.py
deleted file mode 100644
index acf9102..0000000
--- a/tempest/services/volume/xml/admin/volume_quotas_client.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
-#
-# Author: Sylvain Baubeau <sylvain.baubeau@enovance.com>
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import ast
-
-from lxml import etree
-
-from tempest.common import xml_utils as xml
-from tempest import config
-from tempest.services.volume.json.admin import volume_quotas_client
-
-CONF = config.CONF
-
-
-class VolumeQuotasClientXML(volume_quotas_client.VolumeQuotasClientJSON):
-    """
-    Client class to send CRUD Volume Quotas API requests to a Cinder endpoint
-    """
-
-    TYPE = "xml"
-
-    def _format_quota(self, q):
-        quota = {}
-        for k, v in q.items():
-            try:
-                v = ast.literal_eval(v)
-            except (ValueError, SyntaxError):
-                pass
-
-            quota[k] = v
-
-        return quota
-
-    def get_quota_usage(self, tenant_id):
-        """List the quota set for a tenant."""
-
-        resp, body = self.get_quota_set(tenant_id, params={'usage': True})
-        self.expected_success(200, resp.status)
-        return resp, self._format_quota(body)
-
-    def update_quota_set(self, tenant_id, gigabytes=None, volumes=None,
-                         snapshots=None):
-        post_body = {}
-        element = xml.Element("quota_set")
-
-        if gigabytes is not None:
-            post_body['gigabytes'] = gigabytes
-
-        if volumes is not None:
-            post_body['volumes'] = volumes
-
-        if snapshots is not None:
-            post_body['snapshots'] = snapshots
-
-        xml.deep_dict_to_xml(element, post_body)
-        resp, body = self.put('os-quota-sets/%s' % tenant_id,
-                              str(xml.Document(element)))
-        body = xml.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, self._format_quota(body)
-
-    def delete_quota_set(self, tenant_id):
-        """Delete the tenant's quota set."""
-        resp, body = self.delete('os-quota-sets/%s' % tenant_id)
-        self.expected_success(200, resp.status)
diff --git a/tempest/services/volume/xml/admin/volume_services_client.py b/tempest/services/volume/xml/admin/volume_services_client.py
deleted file mode 100644
index 2ecb590..0000000
--- a/tempest/services/volume/xml/admin/volume_services_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2014 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class VolumesServicesClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(VolumesServicesClientXML, self).__init__(auth_provider)
-        self.service = CONF.volume.catalog_type
-
-    def list_services(self, params=None):
-        url = 'os-services'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        node = etree.fromstring(body)
-        body = [xml_utils.xml_to_json(x) for x in node.getchildren()]
-        self.expected_success(200, resp.status)
-        return resp, body
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
deleted file mode 100644
index 03d39a8..0000000
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ /dev/null
@@ -1,218 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-
-class BaseVolumeTypesClientXML(rest_client.RestClient):
-    """
-    Client class to send CRUD Volume Types API requests to a Cinder endpoint
-    """
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseVolumeTypesClientXML, self).__init__(auth_provider)
-        self.service = CONF.volume.catalog_type
-        self.build_interval = CONF.compute.build_interval
-        self.build_timeout = CONF.compute.build_timeout
-
-    def _parse_volume_type(self, body):
-        vol_type = dict((attr, body.get(attr)) for attr in body.keys())
-
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                ns, tag = tag.split("}", 1)
-            if tag == 'extra_specs':
-                vol_type['extra_specs'] = dict((meta.get('key'),
-                                                meta.text)
-                                               for meta in list(child))
-            else:
-                vol_type[tag] = common.xml_to_json(child)
-            return vol_type
-
-    def _parse_volume_type_extra_specs(self, body):
-        extra_spec = dict((attr, body.get(attr)) for attr in body.keys())
-
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                ns, tag = tag.split("}", 1)
-            else:
-                extra_spec[tag] = common.xml_to_json(child)
-            return extra_spec
-
-    def list_volume_types(self, params=None):
-        """List all the volume_types created."""
-        url = 'types'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volume_types = []
-        if body is not None:
-            volume_types += [self._parse_volume_type(vol)
-                             for vol in list(body)]
-        self.expected_success(200, resp.status)
-        return resp, volume_types
-
-    def get_volume_type(self, type_id):
-        """Returns the details of a single volume_type."""
-        url = "types/%s" % str(type_id)
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        self.expected_success(200, resp.status)
-        return resp, self._parse_volume_type(body)
-
-    def create_volume_type(self, name, **kwargs):
-        """
-        Creates a new Volume_type.
-        name(Required): Name of volume_type.
-        Following optional keyword arguments are accepted:
-        extra_specs: A dictionary of values to be used as extra_specs.
-        """
-        vol_type = common.Element("volume_type", xmlns=common.XMLNS_11)
-        if name:
-            vol_type.add_attr('name', name)
-
-        extra_specs = kwargs.get('extra_specs')
-        if extra_specs:
-            _extra_specs = common.Element('extra_specs')
-            vol_type.append(_extra_specs)
-            for key, value in extra_specs.items():
-                spec = common.Element('extra_spec')
-                spec.add_attr('key', key)
-                spec.append(common.Text(value))
-                _extra_specs.append(spec)
-
-        resp, body = self.post('types', str(common.Document(vol_type)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def delete_volume_type(self, type_id):
-        """Deletes the Specified Volume_type."""
-        resp, body = self.delete("types/%s" % str(type_id))
-        self.expected_success(202, resp.status)
-
-    def list_volume_types_extra_specs(self, vol_type_id, params=None):
-        """List all the volume_types extra specs created."""
-        url = 'types/%s/extra_specs' % str(vol_type_id)
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        extra_specs = []
-        if body is not None:
-            extra_specs += [self._parse_volume_type_extra_specs(spec)
-                            for spec in list(body)]
-        self.expected_success(200, resp.status)
-        return resp, extra_specs
-
-    def get_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
-        """Returns the details of a single volume_type extra spec."""
-        url = "types/%s/extra_specs/%s" % (str(vol_type_id),
-                                           str(extra_spec_name))
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        self.expected_success(200, resp.status)
-        return resp, self._parse_volume_type_extra_specs(body)
-
-    def create_volume_type_extra_specs(self, vol_type_id, extra_spec):
-        """
-        Creates a new Volume_type extra spec.
-        vol_type_id: Id of volume_type.
-        extra_specs: A dictionary of values to be used as extra_specs.
-        """
-        url = "types/%s/extra_specs" % str(vol_type_id)
-        extra_specs = common.Element("extra_specs", xmlns=common.XMLNS_11)
-        if extra_spec:
-            if isinstance(extra_spec, list):
-                extra_specs.append(extra_spec)
-            else:
-                for key, value in extra_spec.items():
-                    spec = common.Element('extra_spec')
-                    spec.add_attr('key', key)
-                    spec.append(common.Text(value))
-                    extra_specs.append(spec)
-        else:
-            extra_specs = None
-
-        resp, body = self.post(url, str(common.Document(extra_specs)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def delete_volume_type_extra_specs(self, vol_id, extra_spec_name):
-        """Deletes the Specified Volume_type extra spec."""
-        resp, body = self.delete("types/%s/extra_specs/%s" % (
-            (str(vol_id)), str(extra_spec_name)))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def update_volume_type_extra_specs(self, vol_type_id, extra_spec_name,
-                                       extra_spec):
-        """
-        Update a volume_type extra spec.
-        vol_type_id: Id of volume_type.
-        extra_spec_name: Name of the extra spec to be updated.
-        extra_spec: A dictionary of with key as extra_spec_name and the
-                    updated value.
-        """
-        url = "types/%s/extra_specs/%s" % (str(vol_type_id),
-                                           str(extra_spec_name))
-        extra_specs = common.Element("extra_specs", xmlns=common.XMLNS_11)
-
-        if extra_spec is not None:
-            for key, value in extra_spec.items():
-                spec = common.Element('extra_spec')
-                spec.add_attr('key', key)
-                spec.append(common.Text(value))
-                extra_specs.append(spec)
-
-        resp, body = self.put(url, str(common.Document(extra_specs)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_volume_type(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'volume-type'
-
-
-class VolumeTypesClientXML(BaseVolumeTypesClientXML):
-    """
-    Client class to send CRUD Volume Type API V1 requests to a Cinder endpoint
-    """
diff --git a/tempest/services/volume/xml/availability_zone_client.py b/tempest/services/volume/xml/availability_zone_client.py
deleted file mode 100644
index b956d3f..0000000
--- a/tempest/services/volume/xml/availability_zone_client.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2014 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils
-from tempest import config
-
-CONF = config.CONF
-
-
-class BaseVolumeAvailabilityZoneClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseVolumeAvailabilityZoneClientXML, self).__init__(
-            auth_provider)
-        self.service = CONF.volume.catalog_type
-
-    def _parse_array(self, node):
-        return [xml_utils.xml_to_json(x) for x in node]
-
-    def get_availability_zone_list(self):
-        resp, body = self.get('os-availability-zone')
-        availability_zone = self._parse_array(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, availability_zone
-
-
-class VolumeAvailabilityZoneClientXML(BaseVolumeAvailabilityZoneClientXML):
-    """
-    Volume V1 availability zone client.
-    """
diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py
deleted file mode 100644
index f2b2e02..0000000
--- a/tempest/services/volume/xml/extensions_client.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-
-CONF = config.CONF
-
-
-class BaseExtensionsClientXML(rest_client.RestClient):
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseExtensionsClientXML, self).__init__(auth_provider)
-        self.service = CONF.volume.catalog_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node:
-            array.append(common.xml_to_json(child))
-        return array
-
-    def list_extensions(self):
-        url = 'extensions'
-        resp, body = self.get(url)
-        body = self._parse_array(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-
-class ExtensionsClientXML(BaseExtensionsClientXML):
-    """
-    Volume V1 extensions client.
-    """
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
deleted file mode 100644
index fb591b1..0000000
--- a/tempest/services/volume/xml/snapshots_client.py
+++ /dev/null
@@ -1,255 +0,0 @@
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-import urllib
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-from tempest import exceptions
-from tempest.openstack.common import log as logging
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class BaseSnapshotsClientXML(rest_client.RestClient):
-    """Base Client class to send CRUD Volume API requests."""
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseSnapshotsClientXML, self).__init__(auth_provider)
-
-        self.service = CONF.volume.catalog_type
-        self.build_interval = CONF.volume.build_interval
-        self.build_timeout = CONF.volume.build_timeout
-        self.create_resp = 200
-
-    def list_snapshots(self, params=None):
-        """List all snapshot."""
-        url = 'snapshots'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        snapshots = []
-        for snap in body:
-            snapshots.append(common.xml_to_json(snap))
-        self.expected_success(200, resp.status)
-        return resp, snapshots
-
-    def list_snapshots_with_detail(self, params=None):
-        """List all the details of snapshot."""
-        url = 'snapshots/detail'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        snapshots = []
-        for snap in body:
-            snapshots.append(common.xml_to_json(snap))
-        self.expected_success(200, resp.status)
-        return resp, snapshots
-
-    def get_snapshot(self, snapshot_id):
-        """Returns the details of a single snapshot."""
-        url = "snapshots/%s" % str(snapshot_id)
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        self.expected_success(200, resp.status)
-        return resp, common.xml_to_json(body)
-
-    def create_snapshot(self, volume_id, **kwargs):
-        """Creates a new snapshot.
-        volume_id(Required): id of the volume.
-        force: Create a snapshot even if the volume attached (Default=False)
-        display_name: Optional snapshot Name.
-        display_description: User friendly snapshot description.
-        """
-        # NOTE(afazekas): it should use the volume namespace
-        snapshot = common.Element("snapshot", xmlns=common.XMLNS_11,
-                                  volume_id=volume_id)
-        for key, value in kwargs.items():
-            snapshot.add_attr(key, value)
-        resp, body = self.post('snapshots',
-                               str(common.Document(snapshot)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(self.create_resp, resp.status)
-        return resp, body
-
-    def update_snapshot(self, snapshot_id, **kwargs):
-        """Updates a snapshot."""
-        put_body = common.Element("snapshot", xmlns=common.XMLNS_11, **kwargs)
-
-        resp, body = self.put('snapshots/%s' % snapshot_id,
-                              str(common.Document(put_body)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    # NOTE(afazekas): just for the wait function
-    def _get_snapshot_status(self, snapshot_id):
-        resp, body = self.get_snapshot(snapshot_id)
-        status = body['status']
-        # NOTE(afazekas): snapshot can reach an "error"
-        # state in a "normal" lifecycle
-        if (status == 'error'):
-            raise exceptions.SnapshotBuildErrorException(
-                snapshot_id=snapshot_id)
-
-        return status
-
-    # NOTE(afazkas): Wait reinvented again. It is not in the correct layer
-    def wait_for_snapshot_status(self, snapshot_id, status):
-        """Waits for a Snapshot to reach a given status."""
-        start_time = time.time()
-        old_value = value = self._get_snapshot_status(snapshot_id)
-        while True:
-            dtime = time.time() - start_time
-            time.sleep(self.build_interval)
-            if value != old_value:
-                LOG.info('Value transition from "%s" to "%s"'
-                         'in %d second(s).', old_value,
-                         value, dtime)
-            if (value == status):
-                return value
-
-            if dtime > self.build_timeout:
-                message = ('Time Limit Exceeded! (%ds)'
-                           'while waiting for %s, '
-                           'but we got %s.' %
-                           (self.build_timeout, status, value))
-                raise exceptions.TimeoutException(message)
-            time.sleep(self.build_interval)
-            old_value = value
-            value = self._get_snapshot_status(snapshot_id)
-
-    def delete_snapshot(self, snapshot_id):
-        """Delete Snapshot."""
-        resp, body = self.delete("snapshots/%s" % str(snapshot_id))
-        self.expected_success(202, resp.status)
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_snapshot(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'volume-snapshot'
-
-    def reset_snapshot_status(self, snapshot_id, status):
-        """Reset the specified snapshot's status."""
-        post_body = common.Element("os-reset_status", status=status)
-        url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def update_snapshot_status(self, snapshot_id, status, progress):
-        """Update the specified snapshot's status."""
-        post_body = common.Element("os-update_snapshot_status",
-                                   status=status,
-                                   progress=progress
-                                   )
-        url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def _metadata_body(self, meta):
-        post_body = common.Element('metadata')
-        for k, v in meta.items():
-            data = common.Element('meta', key=k)
-            data.append(common.Text(v))
-            post_body.append(data)
-        return post_body
-
-    def _parse_key_value(self, node):
-        """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
-        data = {}
-        for node in node.getchildren():
-            data[node.get('key')] = node.text
-        return data
-
-    def create_snapshot_metadata(self, snapshot_id, metadata):
-        """Create metadata for the snapshot."""
-        post_body = self._metadata_body(metadata)
-        resp, body = self.post('snapshots/%s/metadata' % snapshot_id,
-                               str(common.Document(post_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def get_snapshot_metadata(self, snapshot_id):
-        """Get metadata of the snapshot."""
-        url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.get(url)
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def update_snapshot_metadata(self, snapshot_id, metadata):
-        """Update metadata for the snapshot."""
-        put_body = self._metadata_body(metadata)
-        url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.put(url, str(common.Document(put_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def update_snapshot_metadata_item(self, snapshot_id, id, meta_item):
-        """Update metadata item for the snapshot."""
-        for k, v in meta_item.items():
-            put_body = common.Element('meta', key=k)
-            put_body.append(common.Text(v))
-        url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.put(url, str(common.Document(put_body)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def delete_snapshot_metadata_item(self, snapshot_id, id):
-        """Delete metadata item for the snapshot."""
-        url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.delete(url)
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def force_delete_snapshot(self, snapshot_id):
-        """Force Delete Snapshot."""
-        post_body = common.Element("os-force_delete")
-        url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-
-class SnapshotsClientXML(BaseSnapshotsClientXML):
-    """Client class to send CRUD Volume V1 API requests."""
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
deleted file mode 100644
index 0fe7e0d..0000000
--- a/tempest/services/volume/xml/volumes_client.py
+++ /dev/null
@@ -1,472 +0,0 @@
-# Copyright 2012 IBM Corp.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-import urllib
-from xml.sax import saxutils
-
-from lxml import etree
-
-from tempest.common import rest_client
-from tempest.common import xml_utils as common
-from tempest import config
-from tempest import exceptions
-
-CONF = config.CONF
-
-VOLUME_NS_BASE = 'http://docs.openstack.org/volume/ext/'
-VOLUME_HOST_NS = VOLUME_NS_BASE + 'volume_host_attribute/api/v1'
-VOLUME_MIG_STATUS_NS = VOLUME_NS_BASE + 'volume_mig_status_attribute/api/v1'
-VOLUMES_TENANT_NS = VOLUME_NS_BASE + 'volume_tenant_attribute/api/v1'
-
-
-class BaseVolumesClientXML(rest_client.RestClient):
-    """
-    Base client class to send CRUD Volume API requests to a Cinder endpoint
-    """
-    TYPE = "xml"
-
-    def __init__(self, auth_provider):
-        super(BaseVolumesClientXML, self).__init__(auth_provider)
-        self.service = CONF.volume.catalog_type
-        self.build_interval = CONF.compute.build_interval
-        self.build_timeout = CONF.compute.build_timeout
-        self.create_resp = 200
-
-    def _translate_attributes_to_json(self, volume):
-        volume_host_attr = '{' + VOLUME_HOST_NS + '}host'
-        volume_mig_stat_attr = '{' + VOLUME_MIG_STATUS_NS + '}migstat'
-        volume_mig_name_attr = '{' + VOLUME_MIG_STATUS_NS + '}name_id'
-        volume_tenant_id_attr = '{' + VOLUMES_TENANT_NS + '}tenant_id'
-        if volume_host_attr in volume:
-            volume['os-vol-host-attr:host'] = volume.pop(volume_host_attr)
-        if volume_mig_stat_attr in volume:
-            volume['os-vol-mig-status-attr:migstat'] = volume.pop(
-                volume_mig_stat_attr)
-        if volume_mig_name_attr in volume:
-            volume['os-vol-mig-status-attr:name_id'] = volume.pop(
-                volume_mig_name_attr)
-        if volume_tenant_id_attr in volume:
-            volume['os-vol-tenant-attr:tenant_id'] = volume.pop(
-                volume_tenant_id_attr)
-
-    def _parse_volume(self, body):
-        vol = dict((attr, body.get(attr)) for attr in body.keys())
-
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                ns, tag = tag.split("}", 1)
-            if tag == 'metadata':
-                vol['metadata'] = dict((meta.get('key'),
-                                       meta.text) for meta in
-                                       child.getchildren())
-            else:
-                vol[tag] = common.xml_to_json(child)
-        self._translate_attributes_to_json(vol)
-        self._check_if_bootable(vol)
-        return vol
-
-    def get_attachment_from_volume(self, volume):
-        """Return the element 'attachment' from input volumes."""
-        return volume['attachments']['attachment']
-
-    def _check_if_bootable(self, volume):
-        """
-        Check if the volume is bootable, also change the value
-        of 'bootable' from string to boolean.
-        """
-
-        # NOTE(jdg): Version 1 of Cinder API uses lc strings
-        # We should consider being explicit in this check to
-        # avoid introducing bugs like: LP #1227837
-
-        if volume['bootable'].lower() == 'true':
-            volume['bootable'] = True
-        elif volume['bootable'].lower() == 'false':
-            volume['bootable'] = False
-        else:
-            raise ValueError(
-                'bootable flag is supposed to be either True or False,'
-                'it is %s' % volume['bootable'])
-        return volume
-
-    def list_volumes(self, params=None):
-        """List all the volumes created."""
-        url = 'volumes'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume(vol) for vol in list(body)]
-        self.expected_success(200, resp.status)
-        return resp, volumes
-
-    def list_volumes_with_detail(self, params=None):
-        """List all the details of volumes."""
-        url = 'volumes/detail'
-
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume(vol) for vol in list(body)]
-        self.expected_success(200, resp.status)
-        return resp, volumes
-
-    def get_volume(self, volume_id):
-        """Returns the details of a single volume."""
-        url = "volumes/%s" % str(volume_id)
-        resp, body = self.get(url)
-        body = self._parse_volume(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def create_volume(self, size=None, **kwargs):
-        """Creates a new Volume.
-
-        :param size: Size of volume in GB.
-        :param display_name: Optional Volume Name(only for V1).
-        :param name: Optional Volume Name(only for V2).
-        :param display_name: Optional Volume Name.
-        :param metadata: An optional dictionary of values for metadata.
-        :param volume_type: Optional Name of volume_type for the volume
-        :param snapshot_id: When specified the volume is created from
-                            this snapshot
-        :param imageRef: When specified the volume is created from this
-                         image
-        """
-        # for bug #1293885:
-        # If no size specified, read volume size from CONF
-        if size is None:
-            size = CONF.volume.volume_size
-        # NOTE(afazekas): it should use a volume namespace
-        volume = common.Element("volume", xmlns=common.XMLNS_11, size=size)
-
-        if 'metadata' in kwargs:
-            _metadata = common.Element('metadata')
-            volume.append(_metadata)
-            for key, value in kwargs['metadata'].items():
-                meta = common.Element('meta')
-                meta.add_attr('key', key)
-                meta.append(common.Text(value))
-                _metadata.append(meta)
-            attr_to_add = kwargs.copy()
-            del attr_to_add['metadata']
-        else:
-            attr_to_add = kwargs
-
-        for key, value in attr_to_add.items():
-            volume.add_attr(key, value)
-
-        resp, body = self.post('volumes', str(common.Document(volume)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(self.create_resp, resp.status)
-        return resp, body
-
-    def update_volume(self, volume_id, **kwargs):
-        """Updates the Specified Volume."""
-        put_body = common.Element("volume", xmlns=common.XMLNS_11, **kwargs)
-
-        resp, body = self.put('volumes/%s' % volume_id,
-                              str(common.Document(put_body)))
-        body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def delete_volume(self, volume_id):
-        """Deletes the Specified Volume."""
-        resp, body = self.delete("volumes/%s" % str(volume_id))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def wait_for_volume_status(self, volume_id, status):
-        """Waits for a Volume to reach a given status."""
-        resp, body = self.get_volume(volume_id)
-        volume_status = body['status']
-        start = int(time.time())
-
-        while volume_status != status:
-            time.sleep(self.build_interval)
-            resp, body = self.get_volume(volume_id)
-            volume_status = body['status']
-            if volume_status == 'error':
-                raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
-
-            if int(time.time()) - start >= self.build_timeout:
-                message = 'Volume %s failed to reach %s status within '\
-                          'the required time (%s s).' % (volume_id,
-                                                         status,
-                                                         self.build_timeout)
-                raise exceptions.TimeoutException(message)
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_volume(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'volume'
-
-    def attach_volume(self, volume_id, instance_uuid, mountpoint):
-        """Attaches a volume to a given instance on a given mountpoint."""
-        post_body = common.Element("os-attach",
-                                   instance_uuid=instance_uuid,
-                                   mountpoint=mountpoint
-                                   )
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def detach_volume(self, volume_id):
-        """Detaches a volume from an instance."""
-        post_body = common.Element("os-detach")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def upload_volume(self, volume_id, image_name, disk_format):
-        """Uploads a volume in Glance."""
-        post_body = common.Element("os-volume_upload_image",
-                                   image_name=image_name,
-                                   disk_format=disk_format)
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        volume = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, volume
-
-    def extend_volume(self, volume_id, extend_size):
-        """Extend a volume."""
-        post_body = common.Element("os-extend",
-                                   new_size=extend_size)
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def reset_volume_status(self, volume_id, status):
-        """Reset the Specified Volume's Status."""
-        post_body = common.Element("os-reset_status",
-                                   status=status
-                                   )
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def volume_begin_detaching(self, volume_id):
-        """Volume Begin Detaching."""
-        post_body = common.Element("os-begin_detaching")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def volume_roll_detaching(self, volume_id):
-        """Volume Roll Detaching."""
-        post_body = common.Element("os-roll_detaching")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def reserve_volume(self, volume_id):
-        """Reserves a volume."""
-        post_body = common.Element("os-reserve")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def unreserve_volume(self, volume_id):
-        """Restore a reserved volume ."""
-        post_body = common.Element("os-unreserve")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def create_volume_transfer(self, vol_id, display_name=None):
-        """Create a volume transfer."""
-        post_body = common.Element("transfer",
-                                   volume_id=vol_id)
-        if display_name:
-            post_body.add_attr('name', display_name)
-        resp, body = self.post('os-volume-transfer',
-                               str(common.Document(post_body)))
-        volume = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, volume
-
-    def get_volume_transfer(self, transfer_id):
-        """Returns the details of a volume transfer."""
-        url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url)
-        volume = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, volume
-
-    def list_volume_transfers(self, params=None):
-        """List all the volume transfers created."""
-        url = 'os-volume-transfer'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = etree.fromstring(body)
-        volumes = []
-        if body is not None:
-            volumes += [self._parse_volume_transfer(vol) for vol in list(body)]
-        self.expected_success(200, resp.status)
-        return resp, volumes
-
-    def _parse_volume_transfer(self, body):
-        vol = dict((attr, body.get(attr)) for attr in body.keys())
-        for child in body.getchildren():
-            tag = child.tag
-            if tag.startswith("{"):
-                tag = tag.split("}", 1)
-            vol[tag] = common.xml_to_json(child)
-        return vol
-
-    def delete_volume_transfer(self, transfer_id):
-        """Delete a volume transfer."""
-        resp, body = self.delete("os-volume-transfer/%s" % str(transfer_id))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def accept_volume_transfer(self, transfer_id, transfer_auth_key):
-        """Accept a volume transfer."""
-        post_body = common.Element("accept", auth_key=transfer_auth_key)
-        url = 'os-volume-transfer/%s/accept' % transfer_id
-        resp, body = self.post(url, str(common.Document(post_body)))
-        volume = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, volume
-
-    def update_volume_readonly(self, volume_id, readonly):
-        """Update the Specified Volume readonly."""
-        post_body = common.Element("os-update_readonly_flag",
-                                   readonly=readonly)
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def force_delete_volume(self, volume_id):
-        """Force Delete Volume."""
-        post_body = common.Element("os-force_delete")
-        url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(common.Document(post_body)))
-        if body:
-            body = common.xml_to_json(etree.fromstring(body))
-        self.expected_success(202, resp.status)
-        return resp, body
-
-    def _metadata_body(self, meta):
-        post_body = common.Element('metadata')
-        for k, v in meta.items():
-            data = common.Element('meta', key=k)
-            # Escape value to allow for special XML chars
-            data.append(common.Text(saxutils.escape(v)))
-            post_body.append(data)
-        return post_body
-
-    def _parse_key_value(self, node):
-        """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
-        data = {}
-        for node in node.getchildren():
-            data[node.get('key')] = node.text
-        return data
-
-    def create_volume_metadata(self, volume_id, metadata):
-        """Create metadata for the volume."""
-        post_body = self._metadata_body(metadata)
-        resp, body = self.post('volumes/%s/metadata' % volume_id,
-                               str(common.Document(post_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def get_volume_metadata(self, volume_id):
-        """Get metadata of the volume."""
-        url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url)
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def update_volume_metadata(self, volume_id, metadata):
-        """Update metadata for the volume."""
-        put_body = self._metadata_body(metadata)
-        url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, str(common.Document(put_body)))
-        body = self._parse_key_value(etree.fromstring(body))
-        self.expected_success(200, resp.status)
-        return resp, body
-
-    def update_volume_metadata_item(self, volume_id, id, meta_item):
-        """Update metadata item for the volume."""
-        for k, v in meta_item.items():
-            put_body = common.Element('meta', key=k)
-            put_body.append(common.Text(v))
-        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, str(common.Document(put_body)))
-        self.expected_success(200, resp.status)
-        body = common.xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def delete_volume_metadata_item(self, volume_id, id):
-        """Delete metadata item for the volume."""
-        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.delete(url)
-        self.expected_success(200, resp.status)
-        return resp, body
-
-
-class VolumesClientXML(BaseVolumesClientXML):
-    """
-    Client class to send CRUD Volume API V1 requests to a Cinder endpoint
-    """
diff --git a/tempest/test.py b/tempest/test.py
index 14cf3bb..7db0376 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -414,12 +414,8 @@
         else:
             standard_tests, module, loader = args
         for test in testtools.iterate_tests(standard_tests):
-            schema_file = getattr(test, '_schema_file', None)
             schema = getattr(test, '_schema', None)
-            if schema_file is not None:
-                setattr(test, 'scenarios',
-                        NegativeAutoTest.generate_scenario(schema_file))
-            elif schema is not None:
+            if schema is not None:
                 setattr(test, 'scenarios',
                         NegativeAutoTest.generate_scenario(schema))
         return testscenarios.load_tests_apply_scenarios(*args)
diff --git a/tempest/tests/test_compute_xml_common.py b/tempest/tests/test_compute_xml_common.py
deleted file mode 100644
index 1561931..0000000
--- a/tempest/tests/test_compute_xml_common.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-from lxml import etree
-
-from tempest.common import xml_utils as common
-from tempest.tests import base
-
-
-class TestXMLParser(base.TestCase):
-
-    def test_xml_to_json_parser_bool_value(self):
-        node = etree.fromstring('''<health_monitor
-        xmlns="http://openstack.org/quantum/api/v2.0"
-         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-           <admin_state_up quantum:type="bool">False</admin_state_up>
-          <fake_state_up quantum:type="bool">True</fake_state_up>
-          </health_monitor>''')
-        body = common.xml_to_json(node)
-        self.assertEqual(body['admin_state_up'], False)
-        self.assertEqual(body['fake_state_up'], True)
-
-    def test_xml_to_json_parser_int_value(self):
-        node = etree.fromstring('''<health_monitor
-        xmlns="http://openstack.org/quantum/api/v2.0"
-         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-          <delay quantum:type="long">4</delay>
-          <max_retries quantum:type="int">3</max_retries>
-          </health_monitor>''')
-        body = common.xml_to_json(node)
-        self.assertEqual(body['delay'], 4L)
-        self.assertEqual(body['max_retries'], 3)
-
-    def test_xml_to_json_parser_text_value(self):
-        node = etree.fromstring('''<health_monitor
-        xmlns="http://openstack.org/quantum/api/v2.0"
-         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-          <status>ACTIVE</status>
-          </health_monitor>''')
-        body = common.xml_to_json(node)
-        self.assertEqual(body['status'], 'ACTIVE')
-
-    def test_xml_to_json_parser_list_as_value(self):
-        node = etree.fromstring('''<health_monitor
-        xmlns="http://openstack.org/quantum/api/v2.0"
-         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-          <elements>
-          <element>first_element</element>
-          <element>second_element</element>
-          </elements>
-          </health_monitor>''')
-        body = common.xml_to_json(node, 'elements')
-        self.assertEqual(body['elements'], ['first_element', 'second_element'])
diff --git a/tempest/tests/test_hacking.py b/tempest/tests/test_hacking.py
index 6857461..fd01887 100644
--- a/tempest/tests/test_hacking.py
+++ b/tempest/tests/test_hacking.py
@@ -69,13 +69,18 @@
         self.assertFalse(checks.no_setup_teardown_class_for_tests(
             "  def tearDownClass(cls):", './tempest/test.py'))
 
-    def test_import_no_clients_in_api(self):
+    def test_import_no_clients_in_api_and_scenario_tests(self):
         for client in checks.PYTHON_CLIENTS:
             string = "import " + client + "client"
-            self.assertTrue(checks.import_no_clients_in_api(
-                string, './tempest/api/fake_test.py'))
-            self.assertFalse(checks.import_no_clients_in_api(
-                string, './tempest/scenario/fake_test.py'))
+            self.assertTrue(
+                checks.import_no_clients_in_api_and_scenario_tests(
+                    string, './tempest/api/fake_test.py'))
+            self.assertTrue(
+                checks.import_no_clients_in_api_and_scenario_tests(
+                    string, './tempest/scenario/fake_test.py'))
+            self.assertFalse(
+                checks.import_no_clients_in_api_and_scenario_tests(
+                    string, './tempest/test.py'))
 
     def test_scenario_tests_need_service_tags(self):
         self.assertFalse(checks.scenario_tests_need_service_tags(
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index 5f55ca2..bb463e5 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -18,7 +18,6 @@
 from oslotest import mockpatch
 
 from tempest.common import rest_client
-from tempest.common import xml_utils as xml
 from tempest import config
 from tempest import exceptions
 from tempest.tests import base
@@ -236,29 +235,8 @@
         )
 
 
-class TestRestClientHeadersXML(TestRestClientHeadersJSON):
-    TYPE = "xml"
-
-    # These two tests are needed in one exemplar
-    def test_send_json_accept_xml(self):
-        resp, __ = self.rest_client.get(self.url,
-                                        self.rest_client.get_headers("xml",
-                                                                     "json"))
-        resp = dict((k.lower(), v) for k, v in resp.iteritems())
-        self.assertEqual("application/json", resp["content-type"])
-        self.assertEqual("application/xml", resp["accept"])
-
-    def test_send_xml_accept_json(self):
-        resp, __ = self.rest_client.get(self.url,
-                                        self.rest_client.get_headers("json",
-                                                                     "xml"))
-        resp = dict((k.lower(), v) for k, v in resp.iteritems())
-        self.assertEqual("application/json", resp["accept"])
-        self.assertEqual("application/xml", resp["content-type"])
-
-
-class TestRestClientParseRespXML(BaseRestClientTestClass):
-    TYPE = "xml"
+class TestRestClientParseRespJSON(BaseRestClientTestClass):
+    TYPE = "json"
 
     keys = ["fake_key1", "fake_key2"]
     values = ["fake_value1", "fake_value2"]
@@ -274,39 +252,10 @@
 
     def setUp(self):
         self.fake_http = fake_http.fake_httplib2()
-        super(TestRestClientParseRespXML, self).setUp()
+        super(TestRestClientParseRespJSON, self).setUp()
         self.rest_client.TYPE = self.TYPE
 
     def test_parse_resp_body_item(self):
-        body_item = xml.Element("item", **self.item_expected)
-        body = self.rest_client._parse_resp(str(xml.Document(body_item)))
-        self.assertEqual(self.item_expected, body)
-
-    def test_parse_resp_body_list(self):
-        self.rest_client.list_tags = ["fake_list", ]
-        body_list = xml.Element(self.rest_client.list_tags[0])
-        for i in range(2):
-            body_list.append(xml.Element("fake_item",
-                                         **self.list_expected["body_list"][i]))
-        body = self.rest_client._parse_resp(str(xml.Document(body_list)))
-        self.assertEqual(self.list_expected["body_list"], body)
-
-    def test_parse_resp_body_dict(self):
-        self.rest_client.dict_tags = ["fake_dict", ]
-        body_dict = xml.Element(self.rest_client.dict_tags[0])
-
-        for i in range(2):
-            body_dict.append(xml.Element("fake_item", xml.Text(self.values[i]),
-                                         key=self.keys[i]))
-
-        body = self.rest_client._parse_resp(str(xml.Document(body_dict)))
-        self.assertEqual(self.dict_expected["body_dict"], body)
-
-
-class TestRestClientParseRespJSON(TestRestClientParseRespXML):
-    TYPE = "json"
-
-    def test_parse_resp_body_item(self):
         body = self.rest_client._parse_resp(json.dumps(self.item_expected))
         self.assertEqual(self.item_expected, body)
 
@@ -426,10 +375,6 @@
                           **self.set_data("402"))
 
 
-class TestRestClientErrorCheckerXML(TestRestClientErrorCheckerJSON):
-    c_type = "application/xml"
-
-
 class TestRestClientErrorCheckerTEXT(TestRestClientErrorCheckerJSON):
     c_type = "text/plain"
 
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 27c45c2..df9719b 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -21,9 +21,7 @@
 from tempest import exceptions
 from tempest.openstack.common.fixture import mockpatch
 from tempest.services.identity.json import identity_client as json_iden_client
-from tempest.services.identity.xml import identity_client as xml_iden_client
 from tempest.services.network.json import network_client as json_network_client
-from tempest.services.network.xml import network_client as xml_network_client
 from tempest.tests import base
 from tempest.tests import fake_config
 from tempest.tests import fake_http
@@ -49,14 +47,6 @@
         self.assertTrue(isinstance(iso_creds.network_admin_client,
                                    json_network_client.NetworkClientJSON))
 
-    def test_tempest_client_xml(self):
-        iso_creds = isolated_creds.IsolatedCreds('test class', interface='xml')
-        self.assertEqual(iso_creds.interface, 'xml')
-        self.assertTrue(isinstance(iso_creds.identity_admin_client,
-                                   xml_iden_client.IdentityClientXML))
-        self.assertTrue(isinstance(iso_creds.network_admin_client,
-                                   xml_network_client.NetworkClientXML))
-
     def _mock_user_create(self, id, name):
         user_fix = self.useFixture(mockpatch.PatchObject(
             json_iden_client.IdentityClientJSON,
diff --git a/tempest/tests/test_xml_utils.py b/tempest/tests/test_xml_utils.py
deleted file mode 100644
index 53e31c4..0000000
--- a/tempest/tests/test_xml_utils.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright 2014 Hewlett-Packard Development Company, L.P.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from tempest.common import xml_utils
-from tempest.tests import base
-
-
-class TestDocumentXML(base.TestCase):
-    def test_xml_document_ordering_version_encoding(self):
-        expected = '<?xml version="1.0" encoding="UTF-8"?>'
-        xml_out = str(xml_utils.Document())
-        self.assertEqual(expected, xml_out.strip())
-
-        xml_out = str(xml_utils.Document(encoding='UTF-8', version='1.0'))
-        self.assertEqual(expected, xml_out.strip())
-
-        xml_out = str(xml_utils.Document(version='1.0', encoding='UTF-8'))
-        self.assertEqual(expected, xml_out.strip())
-
-    def test_xml_document_additonal_attrs(self):
-        expected = '<?xml version="1.0" encoding="UTF-8" foo="bar"?>'
-        xml_out = str(xml_utils.Document(foo='bar'))
-        self.assertEqual(expected, xml_out.strip())
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index f3f11fd..00b17d9 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -306,8 +306,7 @@
 
         volume.detach()
 
-        self.assertVolumeStatusWait(_volume_state, "available")
-        wait.re_search_wait(_volume_state, "available")
+        self.assertVolumeStatusWait(volume, "available")
 
         wait.state_wait(_part_state, 'DECREASE')
 
diff --git a/tox.ini b/tox.ini
index f75e868..edfee15 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,7 +17,9 @@
 whitelist_externals = *
 deps = -r{toxinidir}/requirements.txt
        -r{toxinidir}/test-requirements.txt
-commands = bash tools/pretty_tox.sh '{posargs}'
+commands =
+         find . -type f -name "*.pyc" -delete
+         bash tools/pretty_tox.sh '{posargs}'
 
 [testenv:genconfig]
 commands = oslo-config-generator --config-file tools/config/config-generator.tempest.conf
@@ -33,6 +35,7 @@
          OS_TEST_TIMEOUT=1200
 deps = {[tempestenv]deps}
 commands =
+  find . -type f -name "*.pyc" -delete
   bash tools/pretty_tox.sh '{posargs}'
 
 [testenv:full]
@@ -42,6 +45,7 @@
 # The regex below is used to select which tests to run and exclude the slow tag:
 # See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
 commands =
+  find . -type f -name "*.pyc" -delete
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
 [testenv:full-serial]
@@ -51,6 +55,7 @@
 # The regex below is used to select which tests to run and exclude the slow tag:
 # See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
 commands =
+  find . -type f -name "*.pyc" -delete
   bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
 [testenv:heat-slow]
@@ -60,6 +65,7 @@
 deps = {[tempestenv]deps}
 # The regex below is used to select heat api/scenario tests tagged as slow.
 commands =
+  find . -type f -name "*.pyc" -delete
   bash tools/pretty_tox.sh '(?=.*\[.*\bslow\b.*\])(^tempest\.(api|scenario)\.orchestration) {posargs}'
 
 [testenv:large-ops]
@@ -67,6 +73,7 @@
 setenv = {[tempestenv]setenv}
 deps = {[tempestenv]deps}
 commands =
+  find . -type f -name "*.pyc" -delete
   python setup.py testr --slowest --testr-args='tempest.scenario.test_large_ops {posargs}'
 
 [testenv:smoke]
@@ -74,6 +81,7 @@
 setenv = {[tempestenv]setenv}
 deps = {[tempestenv]deps}
 commands =
+  find . -type f -name "*.pyc" -delete
    bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
 
 [testenv:smoke-serial]
@@ -84,6 +92,7 @@
 # https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
 # job would fail if we moved it to parallel.
 commands =
+  find . -type f -name "*.pyc" -delete
    bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
 
 [testenv:stress]
