diff --git a/README.rst b/README.rst
index 4098e32..bff2bf8 100644
--- a/README.rst
+++ b/README.rst
@@ -63,13 +63,13 @@
 used tool. After setting up your configuration file, you can execute
 the set of Tempest tests by using ``testr`` ::
 
-    $> testr run --parallel tempest
+    $> testr run --parallel
 
 To run one single test  ::
 
     $> testr run --parallel tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_reboot_non_existent_server
 
-Alternatively, you can use the run_tests.sh script which will create a venv
+Alternatively, you can use the run_tempest.sh script which will create a venv
 and run the tests or use tox to do the same.
 
 Configuration
@@ -101,3 +101,20 @@
 For the moment, the best solution is to provide the same image uuid for
 both image_ref and image_ref_alt. Tempest will skip tests as needed if it
 detects that both images are the same.
+
+Unit Tests
+----------
+
+Tempest also has a set of unit tests which test the tempest code itself. These
+tests can be run by specifing the test discovery path::
+
+    $> OS_TEST_PATH=./tempest/tests testr run --parallel
+
+By setting OS_TEST_PATH to ./tempest/tests it specifies that test discover
+should only be run on the unit test directory. The default value of OS_TEST_PATH
+is OS_TEST_PATH=./tempest/test_discover which will only run test discover on the
+tempest suite.
+
+Alternatively, you can use the run_tests.sh script which will create a venv and
+run the unit tests. There are also the py26, py27, or py33 tox jobs which will
+run the unit tests with the corresponding version of python.
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index bb9a68e..21c8506 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -226,7 +226,7 @@
 
 # Timeout in seconds to wait for ping to succeed. (integer
 # value)
-#ping_timeout=60
+#ping_timeout=120
 
 # Timeout in seconds to wait for authentication to succeed.
 # (integer value)
diff --git a/etc/whitelist.yaml b/etc/whitelist.yaml
index 1c12b6c..2d8b741 100644
--- a/etc/whitelist.yaml
+++ b/etc/whitelist.yaml
@@ -78,6 +78,8 @@
 ceilometer-acentral:
     - module: "ceilometer.central.manager"
       message: "403 Forbidden"
+    - module: "ceilometer.central.manager"
+      message: "get_samples\\(\\) got an unexpected keyword argument 'resources'"
 
 ceilometer-alarm-evaluator:
     - module: "ceilometer.alarm.service"
@@ -133,6 +135,8 @@
       message: "but the actual state is deleting to caller"
     - module: "nova.openstack.common.rpc.common"
       message: "Traceback \\(most recent call last"
+    - module: "nova.openstack.common.threadgroup"
+      message: "Service with host .* topic conductor exists."
 
 n-sch:
     - module: "nova.scheduler.filter_scheduler"
diff --git a/run_tempest.sh b/run_tempest.sh
index be9b38a..f6c330d 100755
--- a/run_tempest.sh
+++ b/run_tempest.sh
@@ -13,7 +13,7 @@
   echo "  -t, --serial             Run testr serially"
   echo "  -C, --config             Config file location"
   echo "  -h, --help               Print this usage message"
-  echo "  -d, --debug              Debug this script -- set -o xtrace"
+  echo "  -d, --debug              Run tests with testtools instead of testr. This allows you to use PDB"
   echo "  -l, --logging            Enable logging"
   echo "  -L, --logging-config     Logging config file location.  Default is etc/logging.conf"
   echo "  -- [TESTROPTIONS]        After the first '--' you can pass arbitrary arguments to testr "
@@ -26,6 +26,7 @@
 always_venv=0
 never_venv=0
 no_site_packages=0
+debug=0
 force=0
 wrapper=""
 config_file=""
@@ -50,7 +51,7 @@
     -n|--no-site-packages) no_site_packages=1;;
     -f|--force) force=1;;
     -u|--update) update=1;;
-    -d|--debug) set -o xtrace;;
+    -d|--debug) debug=1;;
     -C|--config) config_file=$2; shift;;
     -s|--smoke) testrargs+="smoke"; noseargs+="--attr=type=smoke";;
     -t|--serial) serial=1;;
@@ -94,6 +95,14 @@
   testr_init
   ${wrapper} find . -type f -name "*.pyc" -delete
   export OS_TEST_PATH=./tempest/test_discover
+  if [ $debug -eq 1 ]; then
+      if [ "$testrargs" = "" ]; then
+           testrargs="discover ./tempest/test_discover"
+      fi
+      ${wrapper} python -m testtools.run $testrargs
+      return $?
+  fi
+
   if [ $serial -eq 1 ]; then
       ${wrapper} testr run --subunit $testrargs | ${wrapper} subunit-2to1 | ${wrapper} tools/colorizer.py
   else
diff --git a/run_tests.sh b/run_tests.sh
index 3f00453..eaa7fd7 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -13,7 +13,7 @@
   echo "  -p, --pep8               Just run pep8"
   echo "  -c, --coverage           Generate coverage report"
   echo "  -h, --help               Print this usage message"
-  echo "  -d, --debug              Debug this script -- set -o xtrace"
+  echo "  -d, --debug              Run tests with testtools instead of testr. This allows you to use PDB"
   echo "  -- [TESTROPTIONS]        After the first '--' you can pass arbitrary arguments to testr "
 }
 
@@ -25,6 +25,7 @@
 always_venv=0
 never_venv=0
 no_site_packages=0
+debug=0
 force=0
 coverage=0
 wrapper=""
@@ -48,7 +49,7 @@
     -n|--no-site-packages) no_site_packages=1;;
     -f|--force) force=1;;
     -u|--update) update=1;;
-    -d|--debug) set -o xtrace;;
+    -d|--debug) debug=1;;
     -p|--pep8) let just_pep8=1;;
     -c|--coverage) coverage=1;;
     -t|--serial) serial=1;;
@@ -75,6 +76,14 @@
   testr_init
   ${wrapper} find . -type f -name "*.pyc" -delete
   export OS_TEST_PATH=./tempest/tests
+  if [ $debug -eq 1 ]; then
+      if [ "$testrargs" = "" ]; then
+          testrargs="discover ./tempest/tests"
+      fi
+      ${wrapper} python -m testtools.run $testrargs
+      return $?
+  fi
+
   if [ $serial -eq 1 ]; then
       ${wrapper} testr run --subunit $testrargs | ${wrapper} subunit-2to1 | ${wrapper} tools/colorizer.py
   else
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index dfcc6a9..d4a32e6 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -15,12 +15,7 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest import config
-from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
-
-CONF = config.CONF
+from tempest import test
 
 
 class QuotasAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -30,11 +25,8 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminTestJSON, cls).setUpClass()
-        cls.auth_url = cls.config.identity.uri
         cls.client = cls.os.quotas_client
         cls.adm_client = cls.os_adm.quotas_client
-        cls.identity_admin_client = cls._get_identity_admin_client()
-        cls.sg_client = cls.security_groups_client
 
         # NOTE(afazekas): these test cases should always create and use a new
         # tenant most of them should be skipped if we can't do that
@@ -49,7 +41,7 @@
                                      'instances', 'security_group_rules',
                                      'cores', 'security_groups'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_default_quotas(self):
         # Admin can get the default resource quota set for a tenant
         expected_quota_set = self.default_quota_set | set(['id'])
@@ -60,7 +52,7 @@
                          sorted(quota_set.keys()))
         self.assertEqual(quota_set['id'], self.demo_tenant_id)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_all_quota_resources_for_tenant(self):
         # Admin can update all the resource quota limits for a tenant
         resp, default_quota_set = self.client.get_default_quota_set(
@@ -84,7 +76,7 @@
         self.assertEqual(new_quota_set, quota_set)
 
     # TODO(afazekas): merge these test cases
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_updated_quotas(self):
         # Verify that GET shows the updated quota set
         tenant_name = data_utils.rand_name('cpu_quota_tenant_')
@@ -102,119 +94,6 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(quota_set['ram'], 5120)
 
-    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
-    # it can be moved into the setUpClass as well
-    @attr(type='gate')
-    def test_create_server_when_cpu_quota_is_full(self):
-        # Disallow server creation when tenant's vcpu quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_vcpu_quota = quota_set['cores']
-        vcpu_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
-                                                           force=True,
-                                                           cores=vcpu_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        cores=default_vcpu_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @attr(type='gate')
-    def test_create_server_when_memory_quota_is_full(self):
-        # Disallow server creation when tenant's memory quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_mem_quota = quota_set['ram']
-        mem_quota = 0  # Set the quota to zero to conserve resources
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         ram=mem_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        ram=default_mem_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @attr(type='gate')
-    def test_update_quota_normal_user(self):
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.update_quota_set,
-                          self.demo_tenant_id,
-                          ram=0)
-
-    @attr(type=['negative', 'gate'])
-    def test_create_server_when_instances_quota_is_full(self):
-        # Once instances quota limit is reached, disallow server creation
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_instances_quota = quota_set['instances']
-        instances_quota = 0  # Set quota to zero to disallow server creation
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         instances=instances_quota)
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        instances=default_instances_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @skip_because(bug="1186354",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'gate'])
-    def test_security_groups_exceed_limit(self):
-        # Negative test: Creation Security Groups over limit should FAIL
-
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_sg_quota = quota_set['security_groups']
-        sg_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set =\
-            self.adm_client.update_quota_set(self.demo_tenant_id,
-                                             force=True,
-                                             security_groups=sg_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set,
-                        self.demo_tenant_id,
-                        security_groups=default_sg_quota)
-
-        # Check we cannot create anymore
-        self.assertRaises(exceptions.OverLimit,
-                          self.sg_client.create_security_group,
-                          "sg-overlimit", "sg-desc")
-
-    @skip_because(bug="1186354",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'gate'])
-    def test_security_groups_rules_exceed_limit(self):
-        # Negative test: Creation of Security Group Rules should FAIL
-        # when we reach limit maxSecurityGroupRules
-
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_sg_rules_quota = quota_set['security_group_rules']
-        sg_rules_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set =\
-            self.adm_client.update_quota_set(
-                self.demo_tenant_id,
-                force=True,
-                security_group_rules=sg_rules_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set,
-                        self.demo_tenant_id,
-                        security_group_rules=default_sg_rules_quota)
-
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup =\
-            self.sg_client.create_security_group(s_name, s_description)
-        self.addCleanup(self.sg_client.delete_security_group,
-                        securitygroup['id'])
-
-        secgroup_id = securitygroup['id']
-        ip_protocol = 'tcp'
-
-        # Check we cannot create SG rule anymore
-        self.assertRaises(exceptions.OverLimit,
-                          self.sg_client.create_security_group_rule,
-                          secgroup_id, ip_protocol, 1025, 1025)
-
 
 class QuotasAdminTestXML(QuotasAdminTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
new file mode 100644
index 0000000..d3696a1
--- /dev/null
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -0,0 +1,155 @@
+# 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 tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class QuotasAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
+    _interface = 'json'
+    force_tenant_isolation = True
+
+    @classmethod
+    def setUpClass(cls):
+        super(QuotasAdminNegativeTestJSON, cls).setUpClass()
+        cls.client = cls.os.quotas_client
+        cls.adm_client = cls.os_adm.quotas_client
+        cls.sg_client = cls.security_groups_client
+
+        # NOTE(afazekas): these test cases should always create and use a new
+        # tenant most of them should be skipped if we can't do that
+        cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
+            'tenantId')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_quota_normal_user(self):
+        self.assertRaises(exceptions.Unauthorized,
+                          self.client.update_quota_set,
+                          self.demo_tenant_id,
+                          ram=0)
+
+    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
+    # it can be moved into the setUpClass as well
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_cpu_quota_is_full(self):
+        # Disallow server creation when tenant's vcpu quota is full
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_vcpu_quota = quota_set['cores']
+        vcpu_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
+                                                           force=True,
+                                                           cores=vcpu_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        cores=default_vcpu_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_memory_quota_is_full(self):
+        # Disallow server creation when tenant's memory quota is full
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_mem_quota = quota_set['ram']
+        mem_quota = 0  # Set the quota to zero to conserve resources
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         ram=mem_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        ram=default_mem_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_instances_quota_is_full(self):
+        # Once instances quota limit is reached, disallow server creation
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_instances_quota = quota_set['instances']
+        instances_quota = 0  # Set quota to zero to disallow server creation
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         instances=instances_quota)
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        instances=default_instances_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.skip_because(bug="1186354",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
+    def test_security_groups_exceed_limit(self):
+        # Negative test: Creation Security Groups over limit should FAIL
+
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_sg_quota = quota_set['security_groups']
+        sg_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set =\
+            self.adm_client.update_quota_set(self.demo_tenant_id,
+                                             force=True,
+                                             security_groups=sg_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set,
+                        self.demo_tenant_id,
+                        security_groups=default_sg_quota)
+
+        # Check we cannot create anymore
+        self.assertRaises(exceptions.OverLimit,
+                          self.sg_client.create_security_group,
+                          "sg-overlimit", "sg-desc")
+
+    @test.skip_because(bug="1186354",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type=['negative', 'gate'])
+    def test_security_groups_rules_exceed_limit(self):
+        # Negative test: Creation of Security Group Rules should FAIL
+        # when we reach limit maxSecurityGroupRules
+
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_sg_rules_quota = quota_set['security_group_rules']
+        sg_rules_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set =\
+            self.adm_client.update_quota_set(
+                self.demo_tenant_id,
+                force=True,
+                security_group_rules=sg_rules_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set,
+                        self.demo_tenant_id,
+                        security_group_rules=default_sg_rules_quota)
+
+        s_name = data_utils.rand_name('securitygroup-')
+        s_description = data_utils.rand_name('description-')
+        resp, securitygroup =\
+            self.sg_client.create_security_group(s_name, s_description)
+        self.addCleanup(self.sg_client.delete_security_group,
+                        securitygroup['id'])
+
+        secgroup_id = securitygroup['id']
+        ip_protocol = 'tcp'
+
+        # Check we cannot create SG rule anymore
+        self.assertRaises(exceptions.OverLimit,
+                          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_servers.py b/tempest/api/compute/admin/test_servers.py
index 10484a9..2cee78a 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -99,6 +99,18 @@
         self.servers_client.wait_for_server_termination(server['id'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 872a841..5539894 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -33,9 +33,6 @@
     @classmethod
     def setUpClass(cls):
         super(BaseComputeTest, cls).setUpClass()
-        if not cls.config.service_available.nova:
-            skip_msg = ("%s skipped as nova is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
 
         os = cls.get_client_manager()
 
@@ -261,6 +258,11 @@
     @classmethod
     def setUpClass(cls):
         # By default compute tests do not create network resources
+        if cls._interface == "xml":
+            skip_msg = ("XML interface is being removed from Nova v3. "
+                        "%s will be removed shortly" % cls.__name__)
+            raise cls.skipException(skip_msg)
+
         cls.set_network_resources()
         super(BaseV3ComputeTest, cls).setUpClass()
         if not cls.config.compute_feature_enabled.api_v3:
diff --git a/tempest/api/compute/floating_ips/base.py b/tempest/api/compute/floating_ips/base.py
index e2c9b04..fd76e62 100644
--- a/tempest/api/compute/floating_ips/base.py
+++ b/tempest/api/compute/floating_ips/base.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2014 OpenStack Foundation
 # All Rights Reserved.
 #
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 8ace879..c04729c 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -220,7 +220,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
 
     @attr(type=['negative', 'gate'])
-    def test_get_nonexistant_image(self):
+    def test_get_nonexistent_image(self):
         # Negative test: GET on non-existent image should fail
         self.assertRaises(exceptions.NotFound, self.client.get_image, 999)
 
diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py
index 85b8505..93b0692 100644
--- a/tempest/api/compute/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/keypairs/test_keypairs_negative.py
@@ -41,9 +41,9 @@
                           self._create_keypair, k_name, pub_key)
 
     @test.attr(type=['negative', 'gate'])
-    def test_keypair_delete_nonexistant_key(self):
-        # Non-existant key deletion should throw a proper error
-        k_name = data_utils.rand_name("keypair-non-existant-")
+    def test_keypair_delete_nonexistent_key(self):
+        # Non-existent key deletion should throw a proper error
+        k_name = data_utils.rand_name("keypair-non-existent-")
         self.assertRaises(exceptions.NotFound, self.client.delete_keypair,
                           k_name)
 
diff --git a/tempest/api/compute/security_groups/base.py b/tempest/api/compute/security_groups/base.py
index 66f2600..6838ce1 100644
--- a/tempest/api/compute/security_groups/base.py
+++ b/tempest/api/compute/security_groups/base.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2012 OpenStack Foundation
 # All Rights Reserved.
 #
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 582faf8..fea8dd5 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -84,7 +84,8 @@
             # Log in and verify the boot time has changed
             linux_client = RemoteClient(server, self.ssh_user, self.password)
             new_boot_time = linux_client.get_boot_time()
-            self.assertGreater(new_boot_time, boot_time)
+            self.assertTrue(new_boot_time > boot_time,
+                            '%s > %s' % (new_boot_time, boot_time))
 
     @skip_because(bug="1014647")
     @attr(type='smoke')
@@ -104,7 +105,8 @@
             # Log in and verify the boot time has changed
             linux_client = RemoteClient(server, self.ssh_user, self.password)
             new_boot_time = linux_client.get_boot_time()
-            self.assertGreater(new_boot_time, boot_time)
+            self.assertTrue(new_boot_time > boot_time,
+                            '%s > %s' % (new_boot_time, boot_time))
 
     @attr(type='smoke')
     def test_rebuild_server(self):
@@ -230,7 +232,7 @@
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
-        backup1 = data_utils.rand_name('backup')
+        backup1 = data_utils.rand_name('backup-1')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
                                                     2,
@@ -247,7 +249,7 @@
         self.assertEqual(202, resp.status)
         self.os.image_client.wait_for_image_status(image1_id, 'active')
 
-        backup2 = data_utils.rand_name('backup')
+        backup2 = data_utils.rand_name('backup-2')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -266,6 +268,7 @@
         }
         resp, image_list = self.os.image_client.image_list_detail(
             properties,
+            status='active',
             sort_key='created_at',
             sort_dir='asc')
         self.assertEqual(200, resp.status)
@@ -275,7 +278,7 @@
 
         # create the third one, due to the rotation is 2,
         # the first one will be deleted
-        backup3 = data_utils.rand_name('backup')
+        backup3 = data_utils.rand_name('backup-3')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -290,10 +293,15 @@
         oldest_backup_exist = False
         resp, image_list = self.os.image_client.image_list_detail(
             properties,
+            status='active',
             sort_key='created_at',
             sort_dir='asc')
         self.assertEqual(200, resp.status)
-        self.assertEqual(2, len(image_list))
+        self.assertEqual(2, len(image_list),
+                         'Unexpected number of images for '
+                         'v2:test_create_backup; was the oldest backup not '
+                         'yet deleted? Image list: %s' %
+                         [image['name'] for image in image_list])
         self.assertEqual((backup2, backup3),
                          (image_list[0]['name'], image_list[1]['name']))
 
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 80ac4da..ad4931c 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -14,8 +14,7 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class ServerMetadataTestJSON(base.BaseV2ComputeTest):
@@ -28,8 +27,6 @@
         cls.quotas = cls.quotas_client
         cls.admin_client = cls._get_identity_admin_client()
         resp, tenants = cls.admin_client.list_tenants()
-        cls.tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
-                         cls.client.tenant_name][0]
         resp, server = cls.create_test_server(meta={}, wait_until='ACTIVE')
 
         cls.server_id = server['id']
@@ -40,7 +37,7 @@
         resp, _ = self.client.set_server_metadata(self.server_id, meta)
         self.assertEqual(resp.status, 200)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_server_metadata(self):
         # All metadata key/value pairs for a server should be returned
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
@@ -50,7 +47,7 @@
         expected = {'key1': 'value1', 'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_set_server_metadata(self):
         # The server's metadata should be replaced with the provided values
         # Create a new set of metadata for the server
@@ -64,22 +61,7 @@
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
         self.assertEqual(resp_metadata, req_metadata)
 
-    @attr(type='gate')
-    def test_server_create_metadata_key_too_long(self):
-        # Attempt to start a server with a meta-data key that is > 255
-        # characters
-
-        # Try a few values
-        for sz in [256, 257, 511, 1023]:
-            key = "k" * sz
-            meta = {key: 'data1'}
-            self.assertRaises(exceptions.OverLimit,
-                              self.create_test_server,
-                              meta=meta)
-
-        # no teardown - all creates should fail
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_server_metadata(self):
         # The server's metadata values should be updated to the
         # provided values
@@ -93,7 +75,7 @@
         expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_metadata_empty_body(self):
         # The original metadata should not be lost if empty metadata body is
         # passed
@@ -103,14 +85,14 @@
         expected = {'key1': 'value1', 'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_server_metadata_item(self):
         # The value for a specific metadata key should be returned
         resp, meta = self.client.get_server_metadata_item(self.server_id,
                                                           'key2')
         self.assertEqual('value2', meta['key2'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_set_server_metadata_item(self):
         # The item's value should be updated to the provided value
         # Update the metadata value
@@ -124,7 +106,7 @@
         expected = {'key1': 'value1', 'key2': 'value2', 'nova': 'alt'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_server_metadata_item(self):
         # The metadata value/key pair should be deleted from the server
         resp, meta = self.client.delete_server_metadata_item(self.server_id,
@@ -136,80 +118,6 @@
         expected = {'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type=['negative', 'gate'])
-    def test_server_metadata_negative(self):
-        # Blank key should trigger an error.
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.create_test_server,
-                          meta=meta)
-
-        # GET on a non-existent server should not succeed
-        self.assertRaises(exceptions.NotFound,
-                          self.client.get_server_metadata_item, 999, 'test2')
-
-        # List metadata on a non-existent server should not succeed
-        self.assertRaises(exceptions.NotFound,
-                          self.client.list_server_metadata, 999)
-
-        # Raise BadRequest if key in uri does not match
-        # the key passed in body.
-        meta = {'testkey': 'testvalue'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata_item,
-                          self.server_id, 'key', meta)
-
-        # Set metadata on a non-existent server should not succeed
-        meta = {'meta1': 'data1'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.set_server_metadata, 999, meta)
-
-        # An update should not happen for a non-existent image
-        meta = {'key1': 'value1', 'key2': 'value2'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.update_server_metadata, 999, meta)
-
-        # Blank key should trigger an error
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.update_server_metadata,
-                          self.server_id, meta=meta)
-
-        # Should not be able to delete metadata item from a non-existent server
-        self.assertRaises(exceptions.NotFound,
-                          self.client.delete_server_metadata_item, 999, 'd')
-
-        # Raise a 413 OverLimit exception while exceeding metadata items limit
-        # for tenant.
-        _, quota_set = self.quotas.get_quota_set(self.tenant_id)
-        quota_metadata = quota_set['metadata_items']
-        req_metadata = {}
-        for num in range(1, quota_metadata + 2):
-            req_metadata['key' + str(num)] = 'val' + str(num)
-        self.assertRaises(exceptions.OverLimit,
-                          self.client.set_server_metadata,
-                          self.server_id, req_metadata)
-
-        # Raise a 413 OverLimit exception while exceeding metadata items limit
-        # for tenant (update).
-        self.assertRaises(exceptions.OverLimit,
-                          self.client.update_server_metadata,
-                          self.server_id, req_metadata)
-
-        # Raise a bad request error for blank key.
-        # set_server_metadata will replace all metadata with new value
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata,
-                          self.server_id, meta=meta)
-
-        # Raise a bad request error for a missing metadata field
-        # set_server_metadata will replace all metadata with new value
-        meta = {'meta1': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata,
-                          self.server_id, meta=meta, no_metadata_field=True)
-
 
 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
new file mode 100644
index 0000000..d12f91c
--- /dev/null
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -0,0 +1,165 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# 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 tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(ServerMetadataNegativeTestJSON, cls).setUpClass()
+        cls.client = cls.servers_client
+        cls.quotas = cls.quotas_client
+        cls.admin_client = cls._get_identity_admin_client()
+        resp, tenants = cls.admin_client.list_tenants()
+        cls.tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
+                         cls.client.tenant_name][0]
+        resp, server = cls.create_test_server(meta={}, wait_until='ACTIVE')
+
+        cls.server_id = server['id']
+
+    @test.attr(type=['gate', 'negative'])
+    def test_server_create_metadata_key_too_long(self):
+        # Attempt to start a server with a meta-data key that is > 255
+        # characters
+
+        # Tryset_server_metadata_item a few values
+        for sz in [256, 257, 511, 1023]:
+            key = "k" * sz
+            meta = {key: 'data1'}
+            self.assertRaises(exceptions.OverLimit,
+                              self.create_test_server,
+                              meta=meta)
+
+        # no teardown - all creates should fail
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_metadata_blank_key(self):
+        # Blank key should trigger an error.
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.create_test_server,
+                          meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_server_metadata_non_existent_server(self):
+        # GET on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.get_server_metadata_item,
+                          non_existent_server_id,
+                          'test2')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_server_metadata_non_existent_server(self):
+        # List metadata on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.list_server_metadata,
+                          non_existent_server_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_wrong_key_passed_in_body(self):
+        # Raise BadRequest if key in uri does not match
+        # the key passed in body.
+        meta = {'testkey': 'testvalue'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.set_server_metadata_item,
+                          self.server_id, 'key', meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_metadata_non_existent_server(self):
+        # Set metadata on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        meta = {'meta1': 'data1'}
+        self.assertRaises(exceptions.NotFound,
+                          self.client.set_server_metadata,
+                          non_existent_server_id,
+                          meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_metadata_non_existent_server(self):
+        # An update should not happen for a non-existent server
+        non_existent_server_id = data_utils.rand_uuid()
+        meta = {'key1': 'value1', 'key2': 'value2'}
+        self.assertRaises(exceptions.NotFound,
+                          self.client.update_server_metadata,
+                          non_existent_server_id,
+                          meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_metadata_with_blank_key(self):
+        # Blank key should trigger an error
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.update_server_metadata,
+                          self.server_id, meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_metadata_non_existent_server(self):
+        # Should not be able to delete metadata item from a non-existent server
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.delete_server_metadata_item,
+                          non_existent_server_id,
+                          'd')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_metadata_items_limit(self):
+        # Raise a 413 OverLimit exception while exceeding metadata items limit
+        # for tenant.
+        _, quota_set = self.quotas.get_quota_set(self.tenant_id)
+        quota_metadata = quota_set['metadata_items']
+        req_metadata = {}
+        for num in range(1, quota_metadata + 2):
+            req_metadata['key' + str(num)] = 'val' + str(num)
+        self.assertRaises(exceptions.OverLimit,
+                          self.client.set_server_metadata,
+                          self.server_id, req_metadata)
+
+        # Raise a 413 OverLimit exception while exceeding metadata items limit
+        # for tenant (update).
+        self.assertRaises(exceptions.OverLimit,
+                          self.client.update_server_metadata,
+                          self.server_id, req_metadata)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_server_metadata_blank_key(self):
+        # Raise a bad request error for blank key.
+        # set_server_metadata will replace all metadata with new value
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.set_server_metadata,
+                          self.server_id, meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_server_metadata_missing_metadata(self):
+        # Raise a bad request error for a missing metadata field
+        # set_server_metadata will replace all metadata with new value
+        meta = {'meta1': 'data1'}
+        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_servers.py b/tempest/api/compute/servers/test_servers.py
index 8ae43b5..203832e 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -104,6 +104,24 @@
         self.assertEqual('::babe:202:202', server['accessIPv6'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_delete_server_while_in_building_state(self):
         # Delete a server while it's VM state is Building
         resp, server = self.create_test_server(wait_until='BUILD')
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index a389c27..8f49aec 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -195,7 +195,7 @@
                           networks=networks)
 
     @test.attr(type=['negative', 'gate'])
-    def test_create_with_non_existant_keypair(self):
+    def test_create_with_non_existent_keypair(self):
         # Pass a non-existent keypair while creating a server
 
         key_name = data_utils.rand_name('key')
diff --git a/tempest/api/compute/v3/admin/test_aggregates.py b/tempest/api/compute/v3/admin/test_aggregates.py
index 7491742..956eddd 100644
--- a/tempest/api/compute/v3/admin/test_aggregates.py
+++ b/tempest/api/compute/v3/admin/test_aggregates.py
@@ -210,10 +210,3 @@
                                                wait_until='ACTIVE')
         resp, body = admin_servers_client.get_server(server['id'])
         self.assertEqual(self.host, body[self._host_key])
-
-
-class AggregatesAdminV3TestXML(AggregatesAdminV3TestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/'
-        'extended_server_attributes/api/v3}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_aggregates_negative.py b/tempest/api/compute/v3/admin/test_aggregates_negative.py
index 4eb75a5..da3568a 100644
--- a/tempest/api/compute/v3/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/v3/admin/test_aggregates_negative.py
@@ -188,7 +188,3 @@
 
         self.assertRaises(exceptions.NotFound, self.client.remove_host,
                           aggregate['id'], non_exist_host)
-
-
-class AggregatesAdminNegativeV3TestXML(AggregatesAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_availability_zone.py b/tempest/api/compute/v3/admin/test_availability_zone.py
index 2955dc8..5ced2b1 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone.py
@@ -53,7 +53,3 @@
             self.non_adm_client.get_availability_zone_list()
         self.assertEqual(200, resp.status)
         self.assertTrue(len(availability_zone) > 0)
-
-
-class AZAdminV3TestXML(AZAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_availability_zone_negative.py b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
index d69e956..60cd1d6 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
@@ -39,7 +39,3 @@
         self.assertRaises(
             exceptions.Unauthorized,
             self.non_adm_client.get_availability_zone_list_detail)
-
-
-class AZAdminNegativeV3TestXML(AZAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_flavors_access.py b/tempest/api/compute/v3/admin/test_flavors_access.py
index 532dc48..d668640 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access.py
@@ -99,7 +99,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 FlavorsAdminV3TestXML(FlavorsAccessV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_flavors_access_negative.py b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
index e9d811c..8595b2c 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
@@ -140,7 +140,3 @@
                           self.client.remove_flavor_access,
                           new_flavor['id'],
                           str(uuid.uuid4()))
-
-
-class FlavorsAdminNegativeV3TestXML(FlavorsAccessNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
index b084157..0363fcb 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
@@ -120,7 +120,3 @@
         self.assertEqual(resp.status, 200)
         self.assertEqual(body['key1'], 'value1')
         self.assertNotIn('key2', body)
-
-
-class FlavorsExtraSpecsV3TestXML(FlavorsExtraSpecsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
index a81edb1..0f300a1 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
@@ -124,7 +124,3 @@
                           "key1",
                           key1="value",
                           key2="value")
-
-
-class FlavorsExtraSpecsNegativeV3TestXML(FlavorsExtraSpecsNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_hosts.py b/tempest/api/compute/v3/admin/test_hosts.py
index a110d02..8199ee8 100644
--- a/tempest/api/compute/v3/admin/test_hosts.py
+++ b/tempest/api/compute/v3/admin/test_hosts.py
@@ -86,7 +86,3 @@
             self.assertIsNotNone(host_resource['memory_mb'])
             self.assertIsNotNone(host_resource['project'])
             self.assertEqual(hostname, host_resource['host'])
-
-
-class HostsAdminV3TestXML(HostsAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_hosts_negative.py b/tempest/api/compute/v3/admin/test_hosts_negative.py
index 9841950..aa50618 100644
--- a/tempest/api/compute/v3/admin/test_hosts_negative.py
+++ b/tempest/api/compute/v3/admin/test_hosts_negative.py
@@ -168,7 +168,3 @@
         self.assertRaises(exceptions.Unauthorized,
                           self.non_admin_client.reboot_host,
                           hostname)
-
-
-class HostsAdminNegativeV3TestXML(HostsAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_hypervisor.py b/tempest/api/compute/v3/admin/test_hypervisor.py
index 84f6b4d..8bd4abb 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor.py
@@ -97,7 +97,3 @@
             hypers[0]['hypervisor_hostname'])
         self.assertEqual(200, resp.status)
         self.assertTrue(len(hypers) > 0)
-
-
-class HypervisorAdminV3TestXML(HypervisorAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_hypervisor_negative.py b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
index 68b0af0..63e8cae 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
@@ -136,7 +136,3 @@
             exceptions.Unauthorized,
             self.non_adm_client.search_hypervisor,
             hypers[0]['hypervisor_hostname'])
-
-
-class HypervisorAdminNegativeV3TestXML(HypervisorAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
index fada98c..9651338 100644
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
@@ -57,7 +57,3 @@
         for item in expected_items:
             self.assertIn(item, body)
         self.assertEqual(body['period_ending'], "2012-12-23 23:00:00")
-
-
-class InstanceUsageAuditLogV3TestXML(InstanceUsageAuditLogV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
index 06b3711..8ed1a98 100644
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
@@ -39,8 +39,3 @@
         self.assertRaises(exceptions.BadRequest,
                           self.adm_client.list_instance_usage_audit_logs,
                           "invalid_time")
-
-
-class InstanceUsageLogNegativeV3TestXML(
-    InstanceUsageLogNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_quotas.py b/tempest/api/compute/v3/admin/test_quotas.py
index ed4561d..e116734 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -147,7 +147,3 @@
         self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
                         instances=default_instances_quota)
         self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-
-class QuotasAdminV3TestXML(QuotasAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index dec573e..a8e1a0a 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -15,6 +15,7 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
+from tempest import test
 from tempest.test import attr
 from tempest.test import skip_because
 
@@ -62,6 +63,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual([], servers)
 
+    @test.skip_because(bug='1265416')
     @attr(type='gate')
     def test_list_servers_by_admin_with_all_tenants(self):
         # Listing servers by admin user with all tenants parameter
@@ -83,6 +85,18 @@
         self.servers_client.wait_for_server_termination(server['id'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
@@ -155,7 +169,3 @@
         resp, server = self.non_admin_client.get_server(rebuilt_server['id'])
         rebuilt_image_id = server['image']['id']
         self.assertEqual(self.image_ref_alt, rebuilt_image_id)
-
-
-class ServersAdminV3TestXML(ServersAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_servers_negative.py b/tempest/api/compute/v3/admin/test_servers_negative.py
index fb4b043..a86bdfc 100644
--- a/tempest/api/compute/v3/admin/test_servers_negative.py
+++ b/tempest/api/compute/v3/admin/test_servers_negative.py
@@ -135,7 +135,3 @@
         self.assertRaises(exceptions.Conflict,
                           self.client.migrate_server,
                           server_id)
-
-
-class ServersAdminNegativeV3TestXML(ServersAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_services.py b/tempest/api/compute/v3/admin/test_services.py
index ba32739..9e55e78 100644
--- a/tempest/api/compute/v3/admin/test_services.py
+++ b/tempest/api/compute/v3/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 ServicesAdminV3TestXML(ServicesAdminV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_services_negative.py b/tempest/api/compute/v3/admin/test_services_negative.py
index 6f583fa..1382347 100644
--- a/tempest/api/compute/v3/admin/test_services_negative.py
+++ b/tempest/api/compute/v3/admin/test_services_negative.py
@@ -64,7 +64,3 @@
         resp, services = self.client.list_services(params)
         self.assertEqual(200, resp.status)
         self.assertEqual(0, len(services))
-
-
-class ServicesAdminNegativeV3TestXML(ServicesAdminNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
index 3a2d2e5..7ee835b 100644
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
@@ -83,7 +83,3 @@
 
         self.assertEqual(200, resp.status)
         self.assertEqual(len(tenant_usage), 8)
-
-
-class TenantUsagesV3TestXML(TenantUsagesV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
index 58acd07..00068dc 100644
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
@@ -71,7 +71,3 @@
                   'detailed': int(bool(True))}
         self.assertRaises(exceptions.Unauthorized,
                           self.client.list_tenant_usages, params)
-
-
-class TenantUsagesNegativeV3TestXML(TenantUsagesNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/certificates/test_certificates.py b/tempest/api/compute/v3/certificates/test_certificates.py
index 4dfa3be..b24f4d8 100644
--- a/tempest/api/compute/v3/certificates/test_certificates.py
+++ b/tempest/api/compute/v3/certificates/test_certificates.py
@@ -32,7 +32,3 @@
         self.assertEqual(200, resp.status)
         self.assertIn('data', body)
         self.assertIn('private_key', body)
-
-
-class CertificatesV3TestXML(CertificatesV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/images/test_image_metadata.py b/tempest/api/compute/v3/images/test_image_metadata.py
index 89a2f75..d0d2daf 100644
--- a/tempest/api/compute/v3/images/test_image_metadata.py
+++ b/tempest/api/compute/v3/images/test_image_metadata.py
@@ -106,7 +106,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/v3/images/test_image_metadata_negative.py b/tempest/api/compute/v3/images/test_image_metadata_negative.py
index 4878936..6e7cc8f 100644
--- a/tempest/api/compute/v3/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/v3/images/test_image_metadata_negative.py
@@ -73,7 +73,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/v3/images/test_images.py b/tempest/api/compute/v3/images/test_images.py
index ea097ad..52772e0 100644
--- a/tempest/api/compute/v3/images/test_images.py
+++ b/tempest/api/compute/v3/images/test_images.py
@@ -118,7 +118,3 @@
         self.assertRaises(exceptions.NotFound,
                           self.servers_client.create_image,
                           test_uuid, snapshot_name)
-
-
-class ImagesV3TestXML(ImagesV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/images/test_images_oneserver.py b/tempest/api/compute/v3/images/test_images_oneserver.py
index 0cb748b..fb54942 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver.py
@@ -119,10 +119,6 @@
 
     @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
         utf8_name = data_utils.rand_name(u'\xF0\x9F\x92\xA9')
@@ -130,7 +126,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/v3/images/test_images_oneserver_negative.py b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
index 3f93fbe..d9e7882 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
@@ -85,8 +85,6 @@
     @skip_because(bug="1006725")
     @attr(type=['negative', 'gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
-        if self.__class__._interface == "xml":
-            raise self.skipException("Not testable in XML")
         # invalid multibyte sequence from:
         # http://stackoverflow.com/questions/1301402/
         #     example-invalid-utf8-string
@@ -154,7 +152,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/v3/images/test_list_image_filters.py b/tempest/api/compute/v3/images/test_list_image_filters.py
index 8ace879..f654920 100644
--- a/tempest/api/compute/v3/images/test_list_image_filters.py
+++ b/tempest/api/compute/v3/images/test_list_image_filters.py
@@ -135,8 +135,6 @@
         # Verify only the expected number of results are returned
         params = {'limit': '1'}
         resp, images = self.client.list_images(params)
-        # when _interface='xml', one element for images_links in images
-        # ref: Question #224349
         self.assertEqual(1, len([x for x in images if 'id' in x]))
 
     @attr(type='gate')
@@ -220,10 +218,6 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
 
     @attr(type=['negative', 'gate'])
-    def test_get_nonexistant_image(self):
+    def test_get_nonexistent_image(self):
         # Negative test: GET on non-existent image should fail
         self.assertRaises(exceptions.NotFound, self.client.get_image, 999)
-
-
-class ListImageFiltersTestXML(ListImageFiltersTestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs.py b/tempest/api/compute/v3/keypairs/test_keypairs.py
index 3b449f7..4aef8b1 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs.py
@@ -116,7 +116,3 @@
         self.assertEqual(key_name, k_name,
                          "The created keypair name is not equal "
                          "to the requested name!")
-
-
-class KeyPairsV3TestXML(KeyPairsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
index 5180c72..87f62b7 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
@@ -41,9 +41,9 @@
                           self._create_keypair, k_name, pub_key)
 
     @test.attr(type=['negative', 'gate'])
-    def test_keypair_delete_nonexistant_key(self):
-        # Non-existant key deletion should throw a proper error
-        k_name = data_utils.rand_name("keypair-non-existant-")
+    def test_keypair_delete_nonexistent_key(self):
+        # Non-existent key deletion should throw a proper error
+        k_name = data_utils.rand_name("keypair-non-existent-")
         self.assertRaises(exceptions.NotFound, self.client.delete_keypair,
                           k_name)
 
@@ -93,7 +93,3 @@
         k_name = 'key_/.\@:'
         self.assertRaises(exceptions.BadRequest, self._create_keypair,
                           k_name)
-
-
-class KeyPairsNegativeV3TestXML(KeyPairsNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_attach_interfaces.py b/tempest/api/compute/v3/servers/test_attach_interfaces.py
index 8f69c54..aa85424 100644
--- a/tempest/api/compute/v3/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/v3/servers/test_attach_interfaces.py
@@ -119,7 +119,3 @@
 
         _ifs = self._test_delete_interface(server, ifs)
         self.assertEqual(len(ifs) - 1, len(_ifs))
-
-
-class AttachInterfacesV3TestXML(AttachInterfacesV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_attach_volume.py b/tempest/api/compute/v3/servers/test_attach_volume.py
index ff95ca4..2529af9 100644
--- a/tempest/api/compute/v3/servers/test_attach_volume.py
+++ b/tempest/api/compute/v3/servers/test_attach_volume.py
@@ -112,7 +112,3 @@
                                     server['admin_password'])
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
-
-
-class AttachVolumeV3TestXML(AttachVolumeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_create_server.py b/tempest/api/compute/v3/servers/test_create_server.py
index 7c63865..cb02894 100644
--- a/tempest/api/compute/v3/servers/test_create_server.py
+++ b/tempest/api/compute/v3/servers/test_create_server.py
@@ -222,11 +222,3 @@
             msg = "DiskConfig extension not enabled."
             raise cls.skipException(msg)
         super(ServersV3TestManualDisk, cls).setUpClass()
-
-
-class ServersV3TestXML(ServersV3TestJSON):
-    _interface = 'xml'
-
-
-class ServersWithSpecificFlavorV3TestXML(ServersWithSpecificFlavorV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_instance_actions.py b/tempest/api/compute/v3/servers/test_instance_actions.py
index 0b4b9bf..dd5dd30 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions.py
@@ -61,7 +61,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 InstanceActionsV3TestXML(InstanceActionsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_list_server_filters.py b/tempest/api/compute/v3/servers/test_list_server_filters.py
index 99cf8e1..8698d97 100644
--- a/tempest/api/compute/v3/servers/test_list_server_filters.py
+++ b/tempest/api/compute/v3/servers/test_list_server_filters.py
@@ -123,7 +123,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]))
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
@@ -250,7 +249,3 @@
         params = {'limit': 1}
         resp, servers = self.client.list_servers_with_detail(params)
         self.assertEqual(1, len(servers['servers']))
-
-
-class ListServerFiltersV3TestXML(ListServerFiltersV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_list_servers_negative.py b/tempest/api/compute/v3/servers/test_list_servers_negative.py
index 7217148..23f2bda 100644
--- a/tempest/api/compute/v3/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_list_servers_negative.py
@@ -103,7 +103,6 @@
         # List servers by specifying limits
         resp, body = self.client.list_servers({'limit': 1})
         self.assertEqual('200', resp['status'])
-        # when _interface='xml', one element for servers_links in servers
         self.assertEqual(1, len([x for x in body['servers'] if 'id' in x]))
 
     @attr(type=['negative', 'gate'])
@@ -162,7 +161,3 @@
                   if srv['id'] in deleted_ids]
         self.assertEqual('200', resp['status'])
         self.assertEqual([], actual)
-
-
-class ListServersNegativeV3TestXML(ListServersNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_multiple_create.py b/tempest/api/compute/v3/servers/test_multiple_create.py
index c7377a6..429a8ba 100644
--- a/tempest/api/compute/v3/servers/test_multiple_create.py
+++ b/tempest/api/compute/v3/servers/test_multiple_create.py
@@ -87,7 +87,3 @@
                                                    return_reservation_id=True)
         self.assertEqual(resp['status'], '202')
         self.assertIn('reservation_id', body)
-
-
-class MultipleCreateV3TestXML(MultipleCreateV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index eb7bc94..fdf23f8 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -225,7 +225,7 @@
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
-        backup1 = data_utils.rand_name('backup')
+        backup1 = data_utils.rand_name('backup-1')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
                                                     2,
@@ -242,7 +242,7 @@
         self.assertEqual(202, resp.status)
         self.images_client.wait_for_image_status(image1_id, 'active')
 
-        backup2 = data_utils.rand_name('backup')
+        backup2 = data_utils.rand_name('backup-2')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -270,7 +270,7 @@
 
         # create the third one, due to the rotation is 2,
         # the first one will be deleted
-        backup3 = data_utils.rand_name('backup')
+        backup3 = data_utils.rand_name('backup-3')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -287,7 +287,11 @@
             sort_key='created_at',
             sort_dir='asc')
         self.assertEqual(200, resp.status)
-        self.assertEqual(2, len(image_list))
+        self.assertEqual(2, len(image_list),
+                         'Unexpected number of images for '
+                         'v3:test_create_backup; was the oldest backup not '
+                         'yet deleted? Image list: %s' %
+                         [image['name'] for image in image_list])
         self.assertEqual((backup2, backup3),
                          (image_list[0]['name'], image_list[1]['name']))
 
@@ -402,7 +406,3 @@
         resp, server = self.servers_client.start(self.server_id)
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
-
-
-class ServerActionsV3TestXML(ServerActionsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index 6ecd28b..bffa7c4 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -78,7 +78,3 @@
             addr = addr[addr_type]
             for address in addresses[addr_type]:
                 self.assertTrue(any([a for a in addr if a == address]))
-
-
-class ServerAddressesV3TestXML(ServerAddressesV3Test):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_server_metadata.py b/tempest/api/compute/v3/servers/test_server_metadata.py
index 0571f38..1758b0b 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata.py
@@ -209,7 +209,3 @@
         self.assertRaises(exceptions.BadRequest,
                           self.client.set_server_metadata,
                           self.server_id, meta=meta, no_metadata_field=True)
-
-
-class ServerMetadataV3TestXML(ServerMetadataV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_server_rescue.py b/tempest/api/compute/v3/servers/test_server_rescue.py
index 870432b..99e8f68 100644
--- a/tempest/api/compute/v3/servers/test_server_rescue.py
+++ b/tempest/api/compute/v3/servers/test_server_rescue.py
@@ -167,7 +167,3 @@
                           self.servers_client.detach_volume,
                           self.server_id,
                           self.volume_to_detach['id'])
-
-
-class ServerRescueV3TestXML(ServerRescueV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index 40ca0f0..c476b78 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -105,6 +105,24 @@
                          server['os-access-ips:access_ip_v6'])
 
     @test.attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
     def test_delete_server_while_in_building_state(self):
         # Delete a server while it's VM state is Building
         resp, server = self.create_test_server(wait_until='BUILD')
@@ -126,7 +144,3 @@
         self.client.wait_for_server_status(server['id'], 'ACTIVE')
         resp, server = self.client.get_server(server['id'])
         self.assertEqual('2001:2001::3', server['os-access-ips:access_ip_v6'])
-
-
-class ServersV3TestXML(ServersV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/servers/test_servers_negative.py b/tempest/api/compute/v3/servers/test_servers_negative.py
index bb80293..aadba77 100644
--- a/tempest/api/compute/v3/servers/test_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_servers_negative.py
@@ -155,9 +155,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,
@@ -183,7 +180,7 @@
                           networks=networks)
 
     @test.attr(type=['negative', 'gate'])
-    def test_create_with_non_existant_keypair(self):
+    def test_create_with_non_existent_keypair(self):
         # Pass a non-existent keypair while creating a server
 
         key_name = data_utils.rand_name('key')
@@ -428,7 +425,3 @@
         self.assertRaises(exceptions.Conflict,
                           self.client.unshelve_server,
                           self.server_id)
-
-
-class ServersNegativeV3TestXML(ServersNegativeV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/test_extensions.py b/tempest/api/compute/v3/test_extensions.py
index 8a88fca..32f62d5 100644
--- a/tempest/api/compute/v3/test_extensions.py
+++ b/tempest/api/compute/v3/test_extensions.py
@@ -49,7 +49,3 @@
         resp, extension = self.extensions_client.get_extension('servers')
         self.assertEqual(200, resp.status)
         self.assertEqual('servers', extension['alias'])
-
-
-class ExtensionsV3TestXML(ExtensionsV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/test_live_block_migration.py b/tempest/api/compute/v3/test_live_block_migration.py
index 50a5f3c..087bffb 100644
--- a/tempest/api/compute/v3/test_live_block_migration.py
+++ b/tempest/api/compute/v3/test_live_block_migration.py
@@ -162,10 +162,3 @@
             cls.servers_client.delete_server(server_id)
 
         super(LiveBlockMigrationV3TestJSON, cls).tearDownClass()
-
-
-class LiveBlockMigrationV3TestXML(LiveBlockMigrationV3TestJSON):
-    _host_key = (
-        '{http://docs.openstack.org/compute/ext/'
-        'extended_server_attributes/api/v3}host')
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/test_quotas.py b/tempest/api/compute/v3/test_quotas.py
index df25249..1cbfa2b 100644
--- a/tempest/api/compute/v3/test_quotas.py
+++ b/tempest/api/compute/v3/test_quotas.py
@@ -63,7 +63,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 QuotasV3TestXML(QuotasV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/v3/test_version.py b/tempest/api/compute/v3/test_version.py
index 166d161..6fbe794 100644
--- a/tempest/api/compute/v3/test_version.py
+++ b/tempest/api/compute/v3/test_version.py
@@ -28,7 +28,3 @@
         self.assertEqual(200, resp.status)
         self.assertIn("id", version)
         self.assertEqual("v3.0", version["id"])
-
-
-class VersionV3TestXML(VersionV3TestJSON):
-    _interface = 'xml'
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index d8cc190..b5a4802 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -55,7 +55,7 @@
         # GET Volume
         resp, fetched_volume = self.client.get_volume(volume['id'])
         self.assertEqual(200, resp.status)
-        # Verfication of details of fetched Volume
+        # Verification of details of fetched Volume
         self.assertEqual(v_name,
                          fetched_volume['displayName'],
                          'The fetched Volume is different '
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index b653600..e01e349 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -33,18 +33,18 @@
             raise cls.skipException(skip_msg)
 
     @attr(type=['negative', 'gate'])
-    def test_volume_get_nonexistant_volume_id(self):
-        # Negative: Should not be able to get details of nonexistant volume
-        # Creating a nonexistant volume id
-        # Trying to GET a non existant volume
+    def test_volume_get_nonexistent_volume_id(self):
+        # Negative: Should not be able to get details of nonexistent volume
+        # Creating a nonexistent volume id
+        # Trying to GET a non existent volume
         self.assertRaises(exceptions.NotFound, self.client.get_volume,
                           str(uuid.uuid4()))
 
     @attr(type=['negative', 'gate'])
-    def test_volume_delete_nonexistant_volume_id(self):
-        # Negative: Should not be able to delete nonexistant Volume
-        # Creating nonexistant volume id
-        # Trying to DELETE a non existant volume
+    def test_volume_delete_nonexistent_volume_id(self):
+        # Negative: Should not be able to delete nonexistent Volume
+        # Creating nonexistent volume id
+        # Trying to DELETE a non existent volume
         self.assertRaises(exceptions.NotFound, self.client.delete_volume,
                           str(uuid.uuid4()))
 
diff --git a/tempest/services/compute/v3/xml/__init__.py b/tempest/api/data_processing/__init__.py
similarity index 100%
copy from tempest/services/compute/v3/xml/__init__.py
copy to tempest/api/data_processing/__init__.py
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
new file mode 100644
index 0000000..ab882cd
--- /dev/null
+++ b/tempest/api/data_processing/base.py
@@ -0,0 +1,91 @@
+# Copyright (c) 2013 Mirantis Inc.
+#
+# 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 import config
+import tempest.test
+
+
+CONF = config.CONF
+
+
+class BaseDataProcessingTest(tempest.test.BaseTestCase):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(BaseDataProcessingTest, cls).setUpClass()
+        os = cls.get_client_manager()
+        if not CONF.service_available.savanna:
+            raise cls.skipException("Savanna support is required")
+        cls.client = os.data_processing_client
+
+        # set some constants
+        cls.flavor_ref = CONF.compute.flavor_ref
+        cls.simple_node_group_template = {
+            'plugin_name': 'vanilla',
+            'hadoop_version': '1.2.1',
+            'node_processes': [
+                "datanode",
+                "tasktracker"
+            ],
+            'flavor_id': cls.flavor_ref,
+            'node_configs': {
+                'HDFS': {
+                    'Data Node Heap Size': 1024
+                },
+                'MapReduce': {
+                    'Task Tracker Heap Size': 1024
+                }
+            }
+        }
+
+        # add lists for watched resources
+        cls._node_group_templates = []
+
+    @classmethod
+    def tearDownClass(cls):
+        # cleanup node group templates
+        for ngt_id in cls._node_group_templates:
+            try:
+                cls.client.delete_node_group_template(ngt_id)
+            except Exception:
+                # ignore errors while auto removing created resource
+                pass
+
+        super(BaseDataProcessingTest, cls).tearDownClass()
+
+    @classmethod
+    def create_node_group_template(cls, name, plugin_name, hadoop_version,
+                                   node_processes, flavor_id,
+                                   node_configs=None, **kwargs):
+        """Creates watched node group template with specified params.
+
+        It supports passing additional params using kwargs and returns created
+        object. All resources created in this method will be automatically
+        removed in tearDownClass method.
+        """
+
+        resp, body = cls.client.create_node_group_template(name, plugin_name,
+                                                           hadoop_version,
+                                                           node_processes,
+                                                           flavor_id,
+                                                           node_configs,
+                                                           **kwargs)
+
+        # store id of created node group template
+        template_id = body['id']
+        cls._node_group_templates.append(template_id)
+
+        return resp, body, template_id
diff --git a/tempest/api/data_processing/test_node_group_templates.py b/tempest/api/data_processing/test_node_group_templates.py
new file mode 100644
index 0000000..ff4fa6a
--- /dev/null
+++ b/tempest/api/data_processing/test_node_group_templates.py
@@ -0,0 +1,83 @@
+# Copyright (c) 2013 Mirantis Inc.
+#
+# 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.api.data_processing import base as dp_base
+from tempest.common.utils import data_utils
+from tempest.test import attr
+
+
+class NodeGroupTemplateTest(dp_base.BaseDataProcessingTest):
+    def _create_simple_node_group_template(self, template_name=None):
+        """Creates simple Node Group Template with optional name specified.
+
+        It creates template and ensures response status and template name.
+        Returns id and name of created template.
+        """
+
+        if template_name is None:
+            # generate random name if it's not specified
+            template_name = data_utils.rand_name('savanna')
+
+        # create simple node group template
+        resp, body, template_id = self.create_node_group_template(
+            template_name, **self.simple_node_group_template)
+
+        # ensure that template created successfully
+        self.assertEqual(202, resp.status)
+        self.assertEqual(template_name, body['name'])
+
+        return template_id, template_name
+
+    @attr(type='smoke')
+    def test_node_group_template_create(self):
+        # just create and ensure template
+        self._create_simple_node_group_template()
+
+    @attr(type='smoke')
+    def test_node_group_template_list(self):
+        template_info = self._create_simple_node_group_template()
+
+        # check for node group template in list
+        resp, templates = self.client.list_node_group_templates()
+
+        self.assertEqual(200, resp.status)
+        templates_info = list([(template['id'], template['name'])
+                               for template in templates])
+        self.assertIn(template_info, templates_info)
+
+    @attr(type='smoke')
+    def test_node_group_template_get(self):
+        template_id, template_name = self._create_simple_node_group_template()
+
+        # check node group template fetch by id
+        resp, template = self.client.get_node_group_template(template_id)
+
+        self.assertEqual(200, resp.status)
+        self.assertEqual(template_name, template['name'])
+        self.assertEqual(self.simple_node_group_template['plugin_name'],
+                         template['plugin_name'])
+        self.assertEqual(self.simple_node_group_template['node_processes'],
+                         template['node_processes'])
+        self.assertEqual(self.simple_node_group_template['flavor_id'],
+                         template['flavor_id'])
+
+    @attr(type='smoke')
+    def test_node_group_template_delete(self):
+        template_id, template_name = self._create_simple_node_group_template()
+
+        # delete the node group template by id
+        resp = self.client.delete_node_group_template(template_id)
+
+        self.assertEqual('204', resp[0]['status'])
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index cc53b60..e316dc7 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -134,14 +134,6 @@
         self.client.clear_auth()
 
     @attr(type=['negative', 'gate'])
-    def test_assign_user_role_for_non_existent_user(self):
-        # Attempt to assign a role to a non existent user should fail
-        (user, tenant, role) = self._get_role_params()
-        non_existent_user = str(uuid.uuid4().hex)
-        self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
-                          tenant['id'], non_existent_user, role['id'])
-
-    @attr(type=['negative', 'gate'])
     def test_assign_user_role_for_non_existent_role(self):
         # Attempt to assign a non existent role to user should fail
         (user, tenant, role) = self._get_role_params()
@@ -192,37 +184,26 @@
         self.client.clear_auth()
 
     @attr(type=['negative', 'gate'])
-    def test_remove_user_role_non_existant_user(self):
-        # Attempt to remove a role from a non existent user should fail
-        (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(tenant['id'],
-                                                       user['id'],
-                                                       role['id'])
-        non_existant_user = str(uuid.uuid4().hex)
-        self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
-                          tenant['id'], non_existant_user, role['id'])
-
-    @attr(type=['negative', 'gate'])
-    def test_remove_user_role_non_existant_role(self):
+    def test_remove_user_role_non_existent_role(self):
         # Attempt to delete a non existent role from a user should fail
         (user, tenant, role) = self._get_role_params()
         resp, user_role = self.client.assign_user_role(tenant['id'],
                                                        user['id'],
                                                        role['id'])
-        non_existant_role = str(uuid.uuid4().hex)
+        non_existent_role = str(uuid.uuid4().hex)
         self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
-                          tenant['id'], user['id'], non_existant_role)
+                          tenant['id'], user['id'], non_existent_role)
 
     @attr(type=['negative', 'gate'])
-    def test_remove_user_role_non_existant_tenant(self):
+    def test_remove_user_role_non_existent_tenant(self):
         # Attempt to remove a role from a non existent tenant should fail
         (user, tenant, role) = self._get_role_params()
         resp, user_role = self.client.assign_user_role(tenant['id'],
                                                        user['id'],
                                                        role['id'])
-        non_existant_tenant = str(uuid.uuid4().hex)
+        non_existent_tenant = str(uuid.uuid4().hex)
         self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
-                          non_existant_tenant, user['id'], role['id'])
+                          non_existent_tenant, user['id'], role['id'])
 
     @attr(type=['negative', 'gate'])
     def test_list_user_roles_by_unauthorized_user(self):
@@ -247,14 +228,6 @@
         finally:
             self.client.clear_auth()
 
-    @attr(type=['negative', 'gate'])
-    def test_list_user_roles_for_non_existent_user(self):
-        # Attempt to list roles of a non existent user should fail
-        (user, tenant, role) = self._get_role_params()
-        non_existent_user = str(uuid.uuid4().hex)
-        self.assertRaises(exceptions.NotFound, self.client.list_user_roles,
-                          tenant['id'], non_existent_user)
-
 
 class RolesTestXML(RolesNegativeTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index 1170c6f..ba7af09 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -64,7 +64,7 @@
                           self.data.tenant['id'], self.data.test_email)
 
     @attr(type=['negative', 'gate'])
-    def test_create_user_for_non_existant_tenant(self):
+    def test_create_user_for_non_existent_tenant(self):
         # Attempt to create a user in a non-existent tenant should fail
         self.assertRaises(exceptions.NotFound, self.client.create_user,
                           self.alt_user, self.alt_password, '49ffgg99999',
@@ -96,7 +96,7 @@
                           self.alt_email, enabled=3)
 
     @attr(type=['negative', 'gate'])
-    def test_update_user_for_non_existant_user(self):
+    def test_update_user_for_non_existent_user(self):
         # Attempt to update a user non-existent user should fail
         user_name = data_utils.rand_name('user-')
         non_existent_id = str(uuid.uuid4())
@@ -133,7 +133,7 @@
                           self.data.user['id'])
 
     @attr(type=['negative', 'gate'])
-    def test_delete_non_existant_user(self):
+    def test_delete_non_existent_user(self):
         # Attempt to delete a non-existent user should fail
         self.assertRaises(exceptions.NotFound, self.client.delete_user,
                           'junk12345123')
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index ca8ca54..70afec7 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 IBM Corp.
 # All Rights Reserved.
 #
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index bfc2287..2a5401f 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -199,8 +199,8 @@
 
     @attr(type='gate')
     def test_list_images_param_status(self):
-        # Test to get all available images
-        params = {"status": "available"}
+        # Test to get all active images
+        params = {"status": "active"}
         self._list_by_param_value_and_assert(params)
 
     @attr(type='gate')
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index ca3bd8d..b05f275 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -32,6 +32,10 @@
         resp, body = self.admin_client.list_agents()
         self.assertEqual('200', resp['status'])
         agents = body['agents']
+        # Hearthbeats must be excluded from comparison
+        self.agent.pop('heartbeat_timestamp', None)
+        for agent in agents:
+            agent.pop('heartbeat_timestamp', None)
         self.assertIn(self.agent, agents)
 
     @attr(type=['smoke'])
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index d7df6b2..0085cd6 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -115,13 +115,13 @@
         """Wrapper utility that returns a test network."""
         network_name = network_name or data_utils.rand_name('test-network-')
 
-        resp, body = cls.client.create_network(network_name)
+        resp, body = cls.client.create_network(name=network_name)
         network = body['network']
         cls.networks.append(network)
         return network
 
     @classmethod
-    def create_subnet(cls, network):
+    def create_subnet(cls, network, ip_version=4):
         """Wrapper utility that returns a test subnet."""
         cidr = netaddr.IPNetwork(cls.network_cfg.tenant_network_cidr)
         mask_bits = cls.network_cfg.tenant_network_mask_bits
@@ -130,8 +130,10 @@
         failure = None
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
-                resp, body = cls.client.create_subnet(network['id'],
-                                                      str(subnet_cidr))
+                resp, body = cls.client.create_subnet(
+                    network_id=network['id'],
+                    cidr=str(subnet_cidr),
+                    ip_version=ip_version)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -150,7 +152,7 @@
     @classmethod
     def create_port(cls, network):
         """Wrapper utility that returns a test port."""
-        resp, body = cls.client.create_port(network['id'])
+        resp, body = cls.client.create_port(network_id=network['id'])
         port = body['port']
         cls.ports.append(port)
         return port
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index e050c17..a7c1bd2 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -112,7 +112,7 @@
         # Create a floating IP
         created_floating_ip = self.create_floating_ip(self.ext_net_id)
         # Create a port
-        resp, port = self.client.create_port(self.network['id'])
+        resp, port = self.client.create_port(network_id=self.network['id'])
         created_port = port['port']
         resp, floating_ip = self.client.update_floating_ip(
             created_floating_ip['id'], port_id=created_port['id'])
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 4269644..b1f4608 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -65,13 +65,13 @@
     def test_create_update_delete_network_subnet(self):
         # Creates a network
         name = data_utils.rand_name('network-')
-        resp, body = self.client.create_network(name)
+        resp, body = self.client.create_network(name=name)
         self.assertEqual('201', resp['status'])
         network = body['network']
         net_id = network['id']
         # Verification of network update
         new_name = "New_network"
-        resp, body = self.client.update_network(net_id, new_name)
+        resp, body = self.client.update_network(net_id, name=new_name)
         self.assertEqual('200', resp['status'])
         updated_net = body['network']
         self.assertEqual(updated_net['name'], new_name)
@@ -80,8 +80,10 @@
         mask_bits = self.network_cfg.tenant_network_mask_bits
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
-                resp, body = self.client.create_subnet(net_id,
-                                                       str(subnet_cidr))
+                resp, body = self.client.create_subnet(
+                    network_id=net_id,
+                    cidr=str(subnet_cidr),
+                    ip_version=4)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -92,7 +94,8 @@
         subnet_id = subnet['id']
         # Verification of subnet update
         new_subnet = "New_subnet"
-        resp, body = self.client.update_subnet(subnet_id, new_subnet)
+        resp, body = self.client.update_subnet(subnet_id,
+                                               name=new_subnet)
         self.assertEqual('200', resp['status'])
         updated_subnet = body['subnet']
         self.assertEqual(updated_subnet['name'], new_subnet)
@@ -179,12 +182,13 @@
     @attr(type='smoke')
     def test_create_update_delete_port(self):
         # Verify that successful port creation, update & deletion
-        resp, body = self.client.create_port(self.network['id'])
+        resp, body = self.client.create_port(
+            network_id=self.network['id'])
         self.assertEqual('201', resp['status'])
         port = body['port']
         # Verification of port update
         new_port = "New_Port"
-        resp, body = self.client.update_port(port['id'], new_port)
+        resp, body = self.client.update_port(port['id'], name=new_port)
         self.assertEqual('200', resp['status'])
         updated_port = body['port']
         self.assertEqual(updated_port['name'], new_port)
@@ -241,7 +245,7 @@
 
         bulk network creation
         bulk subnet creation
-        bulk subnet creation
+        bulk port creation
         list tenant's networks
 
     v2.0 of the Neutron API is assumed. It is also assumed that the following
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index 67306e9..89c8a9f 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -45,7 +45,7 @@
     def test_update_non_existent_network(self):
         non_exist_id = data_utils.rand_name('network')
         self.assertRaises(exceptions.NotFound, self.client.update_network,
-                          non_exist_id, "new_name")
+                          non_exist_id, name="new_name")
 
     @attr(type=['negative', 'smoke'])
     def test_delete_non_existent_network(self):
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index e746597..426273c 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -94,7 +94,8 @@
         network = self.create_network()
         self.create_subnet(network)
         router = self.create_router(data_utils.rand_name('router-'))
-        resp, port_body = self.client.create_port(network['id'])
+        resp, port_body = self.client.create_port(
+            network_id=network['id'])
         # add router interface to port created above
         resp, interface = self.client.add_router_interface_with_port_id(
             router['id'], port_body['port']['id'])
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index 6312f69..cacc66e 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -17,12 +17,9 @@
 from tempest.api.object_storage import base
 from tempest import clients
 from tempest.common.utils import data_utils
-from tempest import config
 from tempest import exceptions
 from tempest import test
 
-CONF = config.CONF
-
 
 class AccountQuotasTest(base.BaseObjectTest):
 
@@ -106,15 +103,6 @@
         self.assertEqual(resp["status"], "201")
         self.assertHeaders(resp, 'Object', 'PUT')
 
-    @test.attr(type=["negative", "smoke"])
-    @test.requires_ext(extension='account_quotas', service='object')
-    def test_upload_large_object(self):
-        object_name = data_utils.rand_name(name="TestObject")
-        data = data_utils.arbitrary_string(30)
-        self.assertRaises(exceptions.OverLimit,
-                          self.object_client.create_object,
-                          self.container_name, object_name, data)
-
     @test.attr(type=["smoke"])
     @test.requires_ext(extension='account_quotas', service='object')
     def test_admin_modify_quota(self):
@@ -138,20 +126,3 @@
 
             self.assertEqual(resp["status"], "204")
             self.assertHeaders(resp, 'Account', 'POST')
-
-    @test.attr(type=["negative", "smoke"])
-    @test.requires_ext(extension='account_quotas', service='object')
-    def test_user_modify_quota(self):
-        """Test that a user is not able to modify or remove a quota on
-        its account.
-        """
-
-        # Not able to remove quota
-        self.assertRaises(exceptions.Unauthorized,
-                          self.account_client.create_account_metadata,
-                          {"Quota-Bytes": ""})
-
-        # Not able to modify quota
-        self.assertRaises(exceptions.Unauthorized,
-                          self.account_client.create_account_metadata,
-                          {"Quota-Bytes": "100"})
diff --git a/tempest/api/object_storage/test_account_quotas_negative.py b/tempest/api/object_storage/test_account_quotas_negative.py
new file mode 100644
index 0000000..e35cd17
--- /dev/null
+++ b/tempest/api/object_storage/test_account_quotas_negative.py
@@ -0,0 +1,119 @@
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+#
+# Author: Joe H. Rahme <joe.hakim.rahme@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.
+
+from tempest.api.object_storage import base
+from tempest import clients
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class AccountQuotasNegativeTest(base.BaseObjectTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(AccountQuotasNegativeTest, cls).setUpClass()
+        cls.container_name = data_utils.rand_name(name="TestContainer")
+        cls.container_client.create_container(cls.container_name)
+
+        cls.data.setup_test_user()
+
+        cls.os_reselleradmin = clients.Manager(
+            cls.data.test_user,
+            cls.data.test_password,
+            cls.data.test_tenant)
+
+        # Retrieve the ResellerAdmin role id
+        reseller_role_id = None
+        try:
+            _, roles = cls.os_admin.identity_client.list_roles()
+            reseller_role_id = next(r['id'] for r in roles if r['name']
+                                    == 'ResellerAdmin')
+        except StopIteration:
+            msg = "No ResellerAdmin role found"
+            raise exceptions.NotFound(msg)
+
+        # Retrieve the ResellerAdmin tenant id
+        _, users = cls.os_admin.identity_client.get_users()
+        reseller_user_id = next(usr['id'] for usr in users if usr['name']
+                                == cls.data.test_user)
+
+        # Retrieve the ResellerAdmin tenant id
+        _, tenants = cls.os_admin.identity_client.list_tenants()
+        reseller_tenant_id = next(tnt['id'] for tnt in tenants if tnt['name']
+                                  == cls.data.test_tenant)
+
+        # Assign the newly created user the appropriate ResellerAdmin role
+        cls.os_admin.identity_client.assign_user_role(
+            reseller_tenant_id,
+            reseller_user_id,
+            reseller_role_id)
+
+        # Retrieve a ResellerAdmin auth token and use it to set a quota
+        # on the client's account
+        cls.reselleradmin_token = cls.token_client.get_token(
+            cls.data.test_user,
+            cls.data.test_password,
+            cls.data.test_tenant)
+
+    def setUp(self):
+        super(AccountQuotasNegativeTest, self).setUp()
+
+        # Set a quota of 20 bytes on the user's account before each test
+        headers = {"X-Auth-Token": self.reselleradmin_token,
+                   "X-Account-Meta-Quota-Bytes": "20"}
+
+        self.os.custom_account_client.request("POST", "", headers, "")
+
+    def tearDown(self):
+        # remove the quota from the container
+        headers = {"X-Auth-Token": self.reselleradmin_token,
+                   "X-Remove-Account-Meta-Quota-Bytes": "x"}
+
+        self.os.custom_account_client.request("POST", "", headers, "")
+        super(AccountQuotasNegativeTest, self).tearDown()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.delete_containers([cls.container_name])
+        cls.data.teardown_all()
+        super(AccountQuotasNegativeTest, cls).tearDownClass()
+
+    @test.attr(type=["negative", "smoke"])
+    @test.requires_ext(extension='account_quotas', service='object')
+    def test_user_modify_quota(self):
+        """Test that a user is not able to modify or remove a quota on
+        its account.
+        """
+
+        # Not able to remove quota
+        self.assertRaises(exceptions.Unauthorized,
+                          self.account_client.create_account_metadata,
+                          {"Quota-Bytes": ""})
+
+        # Not able to modify quota
+        self.assertRaises(exceptions.Unauthorized,
+                          self.account_client.create_account_metadata,
+                          {"Quota-Bytes": "100"})
+
+    @test.attr(type=["negative", "smoke"])
+    @test.requires_ext(extension='account_quotas', service='object')
+    def test_upload_large_object(self):
+        object_name = data_utils.rand_name(name="TestObject")
+        data = data_utils.arbitrary_string(30)
+        self.assertRaises(exceptions.OverLimit,
+                          self.object_client.create_object,
+                          self.container_name, object_name, data)
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index 68b9222..79fd99d 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -16,8 +16,8 @@
 import random
 
 from tempest.api.object_storage import base
+from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest import exceptions
 from tempest.test import attr
 from tempest.test import HTTP_SUCCESS
 
@@ -52,6 +52,13 @@
             self.assertIn(container_name, container_names)
 
     @attr(type='smoke')
+    def test_list_extensions(self):
+        resp, extensions = self.account_client.list_extensions()
+
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertThat(resp, custom_matchers.AreAllWellFormatted())
+
+    @attr(type='smoke')
     def test_list_containers_with_limit(self):
         # list containers one of them, half of them then all of them
         for limit in (1, self.containers_count / 2, self.containers_count):
@@ -146,26 +153,3 @@
         resp, _ = self.account_client.list_account_metadata()
         self.assertHeaders(resp, 'Account', 'HEAD')
         self.assertNotIn('x-account-meta-' + header, resp)
-
-    @attr(type=['negative', 'gate'])
-    def test_list_containers_with_non_authorized_user(self):
-        # list containers using non-authorized user
-
-        # create user
-        self.data.setup_test_user()
-        resp, body = \
-            self.token_client.auth(self.data.test_user,
-                                   self.data.test_password,
-                                   self.data.test_tenant)
-        new_token = \
-            self.token_client.get_token(self.data.test_user,
-                                        self.data.test_password,
-                                        self.data.test_tenant)
-        custom_headers = {'X-Auth-Token': new_token}
-        params = {'format': 'json'}
-        # list containers with non-authorized user token
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_account_client.list_account_containers,
-                          params=params, metadata=custom_headers)
-        # delete the user which was created
-        self.data.teardown_all()
diff --git a/tempest/api/object_storage/test_account_services_negative.py b/tempest/api/object_storage/test_account_services_negative.py
new file mode 100644
index 0000000..3b07e17
--- /dev/null
+++ b/tempest/api/object_storage/test_account_services_negative.py
@@ -0,0 +1,46 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+#
+# Author: Joe H. Rahme <joe.hakim.rahme@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.
+
+from tempest.api.object_storage import base
+from tempest import exceptions
+from tempest.test import attr
+
+
+class AccountNegativeTest(base.BaseObjectTest):
+
+    @attr(type=['negative', 'gate'])
+    def test_list_containers_with_non_authorized_user(self):
+        # list containers using non-authorized user
+
+        # create user
+        self.data.setup_test_user()
+        self.token_client.auth(self.data.test_user,
+                               self.data.test_password,
+                               self.data.test_tenant)
+        new_token = \
+            self.token_client.get_token(self.data.test_user,
+                                        self.data.test_password,
+                                        self.data.test_tenant)
+        custom_headers = {'X-Auth-Token': new_token}
+        params = {'format': 'json'}
+        # list containers with non-authorized user token
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_account_client.list_account_containers,
+                          params=params, metadata=custom_headers)
+        # delete the user which was created
+        self.data.teardown_all()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index a01b703..0733524 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -15,7 +15,6 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest import exceptions
 from tempest.test import attr
 from tempest.test import HTTP_SUCCESS
 
@@ -44,108 +43,6 @@
         self.delete_containers([self.container_name])
         super(ObjectTestACLs, self).tearDown()
 
-    @attr(type=['negative', 'gate'])
-    def test_write_object_without_using_creds(self):
-        # trying to create object with empty headers
-        # X-Auth-Token is not provided
-        object_name = data_utils.rand_name(name='Object')
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.create_object,
-                          self.container_name, object_name, 'data')
-
-    @attr(type=['negative', 'gate'])
-    def test_delete_object_without_using_creds(self):
-        # create object
-        object_name = data_utils.rand_name(name='Object')
-        resp, _ = self.object_client.create_object(self.container_name,
-                                                   object_name, 'data')
-        # trying to delete object with empty headers
-        # X-Auth-Token is not provided
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.delete_object,
-                          self.container_name, object_name)
-
-    @attr(type=['negative', 'gate'])
-    def test_write_object_with_non_authorized_user(self):
-        # attempt to upload another file using non-authorized user
-        # User provided token is forbidden. ACL are not set
-        object_name = data_utils.rand_name(name='Object')
-        # trying to create object with non-authorized user
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.create_object,
-                          self.container_name, object_name, 'data',
-                          metadata=self.custom_headers)
-
-    @attr(type=['negative', 'gate'])
-    def test_read_object_with_non_authorized_user(self):
-        # attempt to read object using non-authorized user
-        # User provided token is forbidden. ACL are not set
-        object_name = data_utils.rand_name(name='Object')
-        resp, _ = self.object_client.create_object(
-            self.container_name, object_name, 'data')
-        self.assertEqual(resp['status'], '201')
-        self.assertHeaders(resp, 'Object', 'PUT')
-        # trying to get object with non authorized user token
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.get_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
-
-    @attr(type=['negative', 'gate'])
-    def test_delete_object_with_non_authorized_user(self):
-        # attempt to delete object using non-authorized user
-        # User provided token is forbidden. ACL are not set
-        object_name = data_utils.rand_name(name='Object')
-        resp, _ = self.object_client.create_object(
-            self.container_name, object_name, 'data')
-        self.assertEqual(resp['status'], '201')
-        self.assertHeaders(resp, 'Object', 'PUT')
-        # trying to delete object with non-authorized user token
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.delete_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
-
-    @attr(type=['negative', 'smoke'])
-    def test_read_object_without_rights(self):
-        # attempt to read object using non-authorized user
-        # update X-Container-Read metadata ACL
-        cont_headers = {'X-Container-Read': 'badtenant:baduser'}
-        resp_meta, body = self.container_client.update_container_metadata(
-            self.container_name, metadata=cont_headers,
-            metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp_meta, 'Container', 'POST')
-        # create object
-        object_name = data_utils.rand_name(name='Object')
-        resp, _ = self.object_client.create_object(self.container_name,
-                                                   object_name, 'data')
-        self.assertEqual(resp['status'], '201')
-        self.assertHeaders(resp, 'Object', 'PUT')
-        # Trying to read the object without rights
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.get_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
-
-    @attr(type=['negative', 'smoke'])
-    def test_write_object_without_rights(self):
-        # attempt to write object using non-authorized user
-        # update X-Container-Write metadata ACL
-        cont_headers = {'X-Container-Write': 'badtenant:baduser'}
-        resp_meta, body = self.container_client.update_container_metadata(
-            self.container_name, metadata=cont_headers,
-            metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp_meta, 'Container', 'POST')
-        # Trying to write the object without rights
-        object_name = data_utils.rand_name(name='Object')
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.create_object,
-                          self.container_name,
-                          object_name, 'data',
-                          metadata=self.custom_headers)
-
     @attr(type='smoke')
     def test_read_object_with_rights(self):
         # attempt to read object using authorized user
@@ -189,48 +86,3 @@
             metadata=self.custom_headers)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'PUT')
-
-    @attr(type=['negative', 'smoke'])
-    def test_write_object_without_write_rights(self):
-        # attempt to write object using non-authorized user
-        # update X-Container-Read and X-Container-Write metadata ACL
-        cont_headers = {'X-Container-Read':
-                        self.data.test_tenant + ':' + self.data.test_user,
-                        'X-Container-Write': ''}
-        resp_meta, body = self.container_client.update_container_metadata(
-            self.container_name, metadata=cont_headers,
-            metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp_meta, 'Container', 'POST')
-        # Trying to write the object without write rights
-        object_name = data_utils.rand_name(name='Object')
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.create_object,
-                          self.container_name,
-                          object_name, 'data',
-                          metadata=self.custom_headers)
-
-    @attr(type=['negative', 'smoke'])
-    def test_delete_object_without_write_rights(self):
-        # attempt to delete object using non-authorized user
-        # update X-Container-Read and X-Container-Write metadata ACL
-        cont_headers = {'X-Container-Read':
-                        self.data.test_tenant + ':' + self.data.test_user,
-                        'X-Container-Write': ''}
-        resp_meta, body = self.container_client.update_container_metadata(
-            self.container_name, metadata=cont_headers,
-            metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp_meta, 'Container', 'POST')
-        # create object
-        object_name = data_utils.rand_name(name='Object')
-        resp, _ = self.object_client.create_object(self.container_name,
-                                                   object_name, 'data')
-        self.assertEqual(resp['status'], '201')
-        self.assertHeaders(resp, 'Object', 'PUT')
-        # Trying to delete the object without write rights
-        self.assertRaises(exceptions.Unauthorized,
-                          self.custom_object_client.delete_object,
-                          self.container_name,
-                          object_name,
-                          metadata=self.custom_headers)
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
new file mode 100644
index 0000000..e75f21d
--- /dev/null
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -0,0 +1,195 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+#
+# Author: Joe H. Rahme <joe.hakim.rahme@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.
+
+from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest.test import attr
+from tempest.test import HTTP_SUCCESS
+
+
+class ObjectACLsNegativeTest(base.BaseObjectTest):
+    @classmethod
+    def setUpClass(cls):
+        super(ObjectACLsNegativeTest, cls).setUpClass()
+        cls.data.setup_test_user()
+        cls.new_token = cls.token_client.get_token(cls.data.test_user,
+                                                   cls.data.test_password,
+                                                   cls.data.test_tenant)
+        cls.custom_headers = {'X-Auth-Token': cls.new_token}
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.data.teardown_all()
+        super(ObjectACLsNegativeTest, cls).tearDownClass()
+
+    def setUp(self):
+        super(ObjectACLsNegativeTest, self).setUp()
+        self.container_name = data_utils.rand_name(name='TestContainer')
+        self.container_client.create_container(self.container_name)
+
+    def tearDown(self):
+        self.delete_containers([self.container_name])
+        super(ObjectACLsNegativeTest, self).tearDown()
+
+    @attr(type=['negative', 'gate'])
+    def test_write_object_without_using_creds(self):
+        # trying to create object with empty headers
+        # X-Auth-Token is not provided
+        object_name = data_utils.rand_name(name='Object')
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.create_object,
+                          self.container_name, object_name, 'data')
+
+    @attr(type=['negative', 'gate'])
+    def test_delete_object_without_using_creds(self):
+        # create object
+        object_name = data_utils.rand_name(name='Object')
+        resp, _ = self.object_client.create_object(self.container_name,
+                                                   object_name, 'data')
+        # trying to delete object with empty headers
+        # X-Auth-Token is not provided
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.delete_object,
+                          self.container_name, object_name)
+
+    @attr(type=['negative', 'gate'])
+    def test_write_object_with_non_authorized_user(self):
+        # attempt to upload another file using non-authorized user
+        # User provided token is forbidden. ACL are not set
+        object_name = data_utils.rand_name(name='Object')
+        # trying to create object with non-authorized user
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.create_object,
+                          self.container_name, object_name, 'data',
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'gate'])
+    def test_read_object_with_non_authorized_user(self):
+        # attempt to read object using non-authorized user
+        # User provided token is forbidden. ACL are not set
+        object_name = data_utils.rand_name(name='Object')
+        resp, _ = self.object_client.create_object(
+            self.container_name, object_name, 'data')
+        self.assertEqual(resp['status'], '201')
+        self.assertHeaders(resp, 'Object', 'PUT')
+        # trying to get object with non authorized user token
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.get_object,
+                          self.container_name, object_name,
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'gate'])
+    def test_delete_object_with_non_authorized_user(self):
+        # attempt to delete object using non-authorized user
+        # User provided token is forbidden. ACL are not set
+        object_name = data_utils.rand_name(name='Object')
+        resp, _ = self.object_client.create_object(
+            self.container_name, object_name, 'data')
+        self.assertEqual(resp['status'], '201')
+        self.assertHeaders(resp, 'Object', 'PUT')
+        # trying to delete object with non-authorized user token
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.delete_object,
+                          self.container_name, object_name,
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'smoke'])
+    def test_read_object_without_rights(self):
+        # attempt to read object using non-authorized user
+        # update X-Container-Read metadata ACL
+        cont_headers = {'X-Container-Read': 'badtenant:baduser'}
+        resp_meta, body = self.container_client.update_container_metadata(
+            self.container_name, metadata=cont_headers,
+            metadata_prefix='')
+        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp_meta, 'Container', 'POST')
+        # create object
+        object_name = data_utils.rand_name(name='Object')
+        resp, _ = self.object_client.create_object(self.container_name,
+                                                   object_name, 'data')
+        self.assertEqual(resp['status'], '201')
+        self.assertHeaders(resp, 'Object', 'PUT')
+        # Trying to read the object without rights
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.get_object,
+                          self.container_name, object_name,
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'smoke'])
+    def test_write_object_without_rights(self):
+        # attempt to write object using non-authorized user
+        # update X-Container-Write metadata ACL
+        cont_headers = {'X-Container-Write': 'badtenant:baduser'}
+        resp_meta, body = self.container_client.update_container_metadata(
+            self.container_name, metadata=cont_headers,
+            metadata_prefix='')
+        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp_meta, 'Container', 'POST')
+        # Trying to write the object without rights
+        object_name = data_utils.rand_name(name='Object')
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.create_object,
+                          self.container_name,
+                          object_name, 'data',
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'smoke'])
+    def test_write_object_without_write_rights(self):
+        # attempt to write object using non-authorized user
+        # update X-Container-Read and X-Container-Write metadata ACL
+        cont_headers = {'X-Container-Read':
+                        self.data.test_tenant + ':' + self.data.test_user,
+                        'X-Container-Write': ''}
+        resp_meta, body = self.container_client.update_container_metadata(
+            self.container_name, metadata=cont_headers,
+            metadata_prefix='')
+        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp_meta, 'Container', 'POST')
+        # Trying to write the object without write rights
+        object_name = data_utils.rand_name(name='Object')
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.create_object,
+                          self.container_name,
+                          object_name, 'data',
+                          metadata=self.custom_headers)
+
+    @attr(type=['negative', 'smoke'])
+    def test_delete_object_without_write_rights(self):
+        # attempt to delete object using non-authorized user
+        # update X-Container-Read and X-Container-Write metadata ACL
+        cont_headers = {'X-Container-Read':
+                        self.data.test_tenant + ':' + self.data.test_user,
+                        'X-Container-Write': ''}
+        resp_meta, body = self.container_client.update_container_metadata(
+            self.container_name, metadata=cont_headers,
+            metadata_prefix='')
+        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp_meta, 'Container', 'POST')
+        # create object
+        object_name = data_utils.rand_name(name='Object')
+        resp, _ = self.object_client.create_object(self.container_name,
+                                                   object_name, 'data')
+        self.assertEqual(resp['status'], '201')
+        self.assertHeaders(resp, 'Object', 'PUT')
+        # Trying to delete the object without write rights
+        self.assertRaises(exceptions.Unauthorized,
+                          self.custom_object_client.delete_object,
+                          self.container_name,
+                          object_name,
+                          metadata=self.custom_headers)
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index fdac12f..78bff03 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -16,7 +16,6 @@
 
 
 from tempest.api.object_storage import base
-from tempest import clients
 from tempest.common import custom_matchers
 from tempest.test import attr
 from tempest.test import HTTP_SUCCESS
@@ -28,37 +27,17 @@
     def setUpClass(cls):
         super(HealthcheckTest, cls).setUpClass()
 
-        # creates a test user. The test user will set its base_url to the Swift
-        # endpoint and test the healthcheck feature.
-        cls.data.setup_test_user()
-
-        cls.os_test_user = clients.Manager(
-            cls.data.test_user,
-            cls.data.test_password,
-            cls.data.test_tenant)
-
-    @classmethod
-    def tearDownClass(cls):
-        cls.data.teardown_all()
-        super(HealthcheckTest, cls).tearDownClass()
-
     def setUp(self):
         super(HealthcheckTest, self).setUp()
-        client = self.os_test_user.account_client
-        client._set_auth()
-
+        self.account_client._set_auth()
         # Turning http://.../v1/foobar into http://.../
-        client.base_url = "/".join(client.base_url.split("/")[:-2])
-
-    def tearDown(self):
-        # clear the base_url for subsequent requests
-        self.os_test_user.account_client.base_url = None
-        super(HealthcheckTest, self).tearDown()
+        self.account_client.base_url = "/".join(
+            self.account_client.base_url.split("/")[:-2])
 
     @attr('gate')
     def test_get_healthcheck(self):
 
-        resp, _ = self.os_test_user.account_client.get("healthcheck", {})
+        resp, _ = self.account_client.get("healthcheck", {})
 
         # The status is expected to be 200
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 7ca0e51..3aae0a1 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -28,30 +28,34 @@
         cls.container_name = data_utils.rand_name(name='TestContainer')
         cls.container_client.create_container(cls.container_name)
 
+    def setUp(self):
+        super(ObjectExpiryTest, self).setUp()
+        # create object
+        self.object_name = data_utils.rand_name(name='TestObject')
+        resp, _ = self.object_client.create_object(self.container_name,
+                                                   self.object_name, '')
+
     @classmethod
     def tearDownClass(cls):
         cls.delete_containers([cls.container_name])
         super(ObjectExpiryTest, cls).tearDownClass()
 
     def _test_object_expiry(self, metadata):
-        # create object
-        object_name = data_utils.rand_name(name='TestObject')
-        resp, _ = self.object_client.create_object(self.container_name,
-                                                   object_name, '')
         # update object metadata
         resp, _ = \
             self.object_client.update_object_metadata(self.container_name,
-                                                      object_name, metadata,
+                                                      self.object_name,
+                                                      metadata,
                                                       metadata_prefix='')
         # verify object metadata
         resp, _ = \
             self.object_client.list_object_metadata(self.container_name,
-                                                    object_name)
+                                                    self.object_name)
         self.assertEqual(resp['status'], '200')
         self.assertHeaders(resp, 'Object', 'HEAD')
         self.assertIn('x-delete-at', resp)
         resp, body = self.object_client.get_object(self.container_name,
-                                                   object_name)
+                                                   self.object_name)
         self.assertEqual(resp['status'], '200')
         self.assertHeaders(resp, 'Object', 'GET')
         self.assertIn('x-delete-at', resp)
@@ -61,7 +65,7 @@
 
         # object should not be there anymore
         self.assertRaises(exceptions.NotFound, self.object_client.get_object,
-                          self.container_name, object_name)
+                          self.container_name, self.object_name)
 
     @attr(type='gate')
     def test_get_object_after_expiry_time(self):
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index 621a693..6f46ec9 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -116,21 +116,3 @@
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "GET")
         self.assertEqual(body, "hello world")
-
-    @attr(type=['gate', 'negative'])
-    def test_post_object_using_form_expired(self):
-        body, content_type = self.get_multipart_form(expires=1)
-        time.sleep(2)
-
-        headers = {'Content-Type': content_type,
-                   'Content-Length': str(len(body))}
-
-        url = "%s/%s/%s" % (self.container_client.base_url,
-                            self.container_name,
-                            self.object_name)
-
-        # Use a raw request, otherwise authentication headers are used
-        resp, body = self.object_client.http_obj.request(url, "POST",
-                                                         body, headers=headers)
-        self.assertEqual(int(resp['status']), 401)
-        self.assertIn('FormPost: Form Expired', body)
diff --git a/tempest/api/object_storage/test_object_formpost_negative.py b/tempest/api/object_storage/test_object_formpost_negative.py
new file mode 100644
index 0000000..a07e277
--- /dev/null
+++ b/tempest/api/object_storage/test_object_formpost_negative.py
@@ -0,0 +1,112 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+# Author: Joe H. Rahme <joe.hakim.rahme@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 hashlib
+import hmac
+import time
+import urlparse
+
+from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
+from tempest.test import attr
+
+
+class ObjectFormPostNegativeTest(base.BaseObjectTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(ObjectFormPostNegativeTest, cls).setUpClass()
+        cls.container_name = data_utils.rand_name(name='TestContainer')
+        cls.object_name = data_utils.rand_name(name='ObjectTemp')
+
+        cls.container_client.create_container(cls.container_name)
+        cls.containers = [cls.container_name]
+
+        cls.key = 'Meta'
+        cls.metadata = {'Temp-URL-Key': cls.key}
+        cls.account_client.create_account_metadata(metadata=cls.metadata)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.account_client.delete_account_metadata(metadata=cls.metadata)
+        cls.delete_containers(cls.containers)
+        cls.data.teardown_all()
+        super(ObjectFormPostNegativeTest, cls).tearDownClass()
+
+    def get_multipart_form(self, expires=600):
+        path = "%s/%s/%s" % (
+            urlparse.urlparse(self.container_client.base_url).path,
+            self.container_name,
+            self.object_name)
+
+        redirect = ''
+        max_file_size = 104857600
+        max_file_count = 10
+        expires += int(time.time())
+        hmac_body = '%s\n%s\n%s\n%s\n%s' % (path,
+                                            redirect,
+                                            max_file_size,
+                                            max_file_count,
+                                            expires)
+
+        signature = hmac.new(self.key, hmac_body, hashlib.sha1).hexdigest()
+
+        fields = {'redirect': redirect,
+                  'max_file_size': str(max_file_size),
+                  'max_file_count': str(max_file_count),
+                  'expires': str(expires),
+                  'signature': signature}
+
+        boundary = '--boundary--'
+        data = []
+        for (key, value) in fields.items():
+            data.append('--' + boundary)
+            data.append('Content-Disposition: form-data; name="%s"' % key)
+            data.append('')
+            data.append(value)
+
+        data.append('--' + boundary)
+        data.append('Content-Disposition: form-data; '
+                    'name="file1"; filename="testfile"')
+        data.append('Content-Type: application/octet-stream')
+        data.append('')
+        data.append('hello world')
+
+        data.append('--' + boundary + '--')
+        data.append('')
+
+        body = '\r\n'.join(data)
+        content_type = 'multipart/form-data; boundary=%s' % boundary
+        return body, content_type
+
+    @attr(type=['gate', 'negative'])
+    def test_post_object_using_form_expired(self):
+        body, content_type = self.get_multipart_form(expires=1)
+        time.sleep(2)
+
+        headers = {'Content-Type': content_type,
+                   'Content-Length': str(len(body))}
+
+        url = "%s/%s/%s" % (self.container_client.base_url,
+                            self.container_name,
+                            self.object_name)
+
+        # Use a raw request, otherwise authentication headers are used
+        resp, body = self.object_client.http_obj.request(url, "POST",
+                                                         body, headers=headers)
+        self.assertEqual(int(resp['status']), 401)
+        self.assertIn('FormPost: Form Expired', body)
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 256165b..13f197b 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -31,20 +31,9 @@
         cls.container_client.create_container(cls.container_name)
         cls.containers = [cls.container_name]
 
-        cls.data.setup_test_user()
-        resp, body = cls.token_client.auth(cls.data.test_user,
-                                           cls.data.test_password,
-                                           cls.data.test_tenant)
-        cls.new_token = cls.token_client.get_token(cls.data.test_user,
-                                                   cls.data.test_password,
-                                                   cls.data.test_tenant)
-        cls.custom_headers = {'X-Auth-Token': cls.new_token}
-
     @classmethod
     def tearDownClass(cls):
         cls.delete_containers(cls.containers)
-        # delete the user setup created
-        cls.data.teardown_all()
         super(ObjectTest, cls).tearDownClass()
 
     @attr(type='smoke')
diff --git a/tempest/api/object_storage/test_object_temp_url.py b/tempest/api/object_storage/test_object_temp_url.py
index 0523c68..47c270e 100644
--- a/tempest/api/object_storage/test_object_temp_url.py
+++ b/tempest/api/object_storage/test_object_temp_url.py
@@ -22,7 +22,6 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest import exceptions
 from tempest import test
 
 CONF = config.CONF
@@ -186,19 +185,3 @@
         resp, body = self.object_client.head(url)
         self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'HEAD')
-
-    @test.attr(type=['gate', 'negative'])
-    @test.requires_ext(extension='tempurl', service='object')
-    def test_get_object_after_expiration_time(self):
-
-        expires = self._get_expiry_date(1)
-        # get a temp URL for the created object
-        url = self._get_temp_url(self.container_name,
-                                 self.object_name, "GET",
-                                 expires, self.key)
-
-        # temp URL is valid for 1 seconds, let's wait 2
-        time.sleep(2)
-
-        self.assertRaises(exceptions.Unauthorized,
-                          self.object_client.get, url)
diff --git a/tempest/api/object_storage/test_object_temp_url_negative.py b/tempest/api/object_storage/test_object_temp_url_negative.py
new file mode 100644
index 0000000..cc507c5
--- /dev/null
+++ b/tempest/api/object_storage/test_object_temp_url_negative.py
@@ -0,0 +1,109 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+#
+# Author: Joe H. Rahme <joe.hakim.rahme@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 hashlib
+import hmac
+import time
+import urlparse
+
+from tempest.api.object_storage import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class ObjectTempUrlNegativeTest(base.BaseObjectTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(ObjectTempUrlNegativeTest, cls).setUpClass()
+
+        cls.container_name = data_utils.rand_name(name='TestContainer')
+        cls.container_client.create_container(cls.container_name)
+        cls.containers = [cls.container_name]
+
+        # update account metadata
+        cls.key = 'Meta'
+        cls.metadata = {'Temp-URL-Key': cls.key}
+        cls.account_client.create_account_metadata(metadata=cls.metadata)
+        cls.account_client_metadata, _ = \
+            cls.account_client.list_account_metadata()
+
+    @classmethod
+    def tearDownClass(cls):
+        resp, _ = cls.account_client.delete_account_metadata(
+            metadata=cls.metadata)
+
+        cls.delete_containers(cls.containers)
+
+        # delete the user setup created
+        cls.data.teardown_all()
+        super(ObjectTempUrlNegativeTest, cls).tearDownClass()
+
+    def setUp(self):
+        super(ObjectTempUrlNegativeTest, self).setUp()
+        # make sure the metadata has been set
+        self.assertIn('x-account-meta-temp-url-key',
+                      self.account_client_metadata)
+
+        self.assertEqual(
+            self.account_client_metadata['x-account-meta-temp-url-key'],
+            self.key)
+
+        # create object
+        self.object_name = data_utils.rand_name(name='ObjectTemp')
+        self.data = data_utils.arbitrary_string(size=len(self.object_name),
+                                                base_text=self.object_name)
+        self.object_client.create_object(self.container_name,
+                                         self.object_name, self.data)
+
+    def _get_expiry_date(self, expiration_time=1000):
+        return int(time.time() + expiration_time)
+
+    def _get_temp_url(self, container, object_name, method, expires,
+                      key):
+        """Create the temporary URL."""
+
+        path = "%s/%s/%s" % (
+            urlparse.urlparse(self.object_client.base_url).path,
+            container, object_name)
+
+        hmac_body = '%s\n%s\n%s' % (method, expires, path)
+        sig = hmac.new(key, hmac_body, hashlib.sha1).hexdigest()
+
+        url = "%s/%s?temp_url_sig=%s&temp_url_expires=%s" % (container,
+                                                             object_name,
+                                                             sig, expires)
+
+        return url
+
+    @test.attr(type=['gate', 'negative'])
+    @test.requires_ext(extension='tempurl', service='object')
+    def test_get_object_after_expiration_time(self):
+
+        expires = self._get_expiry_date(1)
+        # get a temp URL for the created object
+        url = self._get_temp_url(self.container_name,
+                                 self.object_name, "GET",
+                                 expires, self.key)
+
+        # temp URL is valid for 1 seconds, let's wait 2
+        time.sleep(2)
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.object_client.get, url)
diff --git a/tempest/api/orchestration/stacks/test_templates.py b/tempest/api/orchestration/stacks/test_templates.py
index 6cbc872..2da819d 100644
--- a/tempest/api/orchestration/stacks/test_templates.py
+++ b/tempest/api/orchestration/stacks/test_templates.py
@@ -10,17 +10,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import logging
-
 from tempest.api.orchestration import base
 from tempest.common.utils import data_utils
-from tempest import exceptions
 from tempest.test import attr
 
 
-LOG = logging.getLogger(__name__)
-
-
 class TemplateYAMLTestJSON(base.BaseOrchestrationTest):
     _interface = 'json'
 
@@ -59,14 +53,6 @@
                                                          self.parameters)
         self.assertEqual('200', resp['status'])
 
-    @attr(type=['gate', 'negative'])
-    def test_validate_template_url(self):
-        """Validating template passing url to it."""
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.validate_template_url,
-                          template_url=self.invalid_template_url,
-                          parameters=self.parameters)
-
 
 class TemplateAWSTestJSON(TemplateYAMLTestJSON):
     template = """
diff --git a/tempest/api/orchestration/stacks/test_templates_negative.py b/tempest/api/orchestration/stacks/test_templates_negative.py
new file mode 100644
index 0000000..c55f6ee
--- /dev/null
+++ b/tempest/api/orchestration/stacks/test_templates_negative.py
@@ -0,0 +1,62 @@
+# 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 tempest.api.orchestration import base
+from tempest import exceptions
+from tempest import test
+
+
+class TemplateYAMLNegativeTestJSON(base.BaseOrchestrationTest):
+    _interface = 'json'
+
+    template = """
+HeatTemplateFormatVersion: '2012-12-12'
+Description: |
+  Template which creates only a new user
+Resources:
+  CfnUser:
+    Type: AWS::IAM::User
+"""
+
+    invalid_template_url = 'http://www.example.com/template.yaml'
+
+    @classmethod
+    def setUpClass(cls):
+        super(TemplateYAMLNegativeTestJSON, cls).setUpClass()
+        cls.client = cls.orchestration_client
+        cls.parameters = {}
+
+    @test.attr(type=['gate', 'negative'])
+    def test_validate_template_url(self):
+        """Validating template passing url to it."""
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.validate_template_url,
+                          template_url=self.invalid_template_url,
+                          parameters=self.parameters)
+
+
+class TemplateAWSNegativeTestJSON(TemplateYAMLNegativeTestJSON):
+    template = """
+{
+  "AWSTemplateFormatVersion" : "2010-09-09",
+  "Description" : "Template which creates only a new user",
+  "Resources" : {
+    "CfnUser" : {
+      "Type" : "AWS::IAM::User"
+    }
+  }
+}
+"""
+
+    invalid_template_url = 'http://www.example.com/template.template'
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 0ea999a..4add2c1 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -15,27 +15,12 @@
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
-from tempest.services.volume.json.admin import volume_types_client
 from tempest.test import attr
 
 
-class VolumeTypesTest(base.BaseVolumeV1Test):
+class VolumeTypesTest(base.BaseVolumeV1AdminTest):
     _interface = "json"
 
-    @classmethod
-    def setUpClass(cls):
-        super(VolumeTypesTest, cls).setUpClass()
-        adm_user = cls.config.identity.admin_username
-        adm_pass = cls.config.identity.admin_password
-        adm_tenant = cls.config.identity.admin_tenant_name
-        auth_url = cls.config.identity.uri
-
-        cls.client = volume_types_client.VolumeTypesClientJSON(cls.config,
-                                                               adm_user,
-                                                               adm_pass,
-                                                               auth_url,
-                                                               adm_tenant)
-
     def _delete_volume(self, volume_id):
         resp, _ = self.volumes_client.delete_volume(volume_id)
         self.assertEqual(202, resp.status)
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 008fb1a..9c6eebe 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -36,10 +36,7 @@
 
         cls.os = cls.get_client_manager()
 
-        cls.volumes_client = cls.os.volumes_client
-        cls.snapshots_client = cls.os.snapshots_client
         cls.servers_client = cls.os.servers_client
-        cls.volumes_extension_client = cls.os.volumes_extension_client
         cls.image_ref = cls.config.compute.image_ref
         cls.flavor_ref = cls.config.compute.flavor_ref
         cls.build_interval = cls.config.volume.build_interval
@@ -116,12 +113,9 @@
             msg = "Volume API v1 not supported"
             raise cls.skipException(msg)
         super(BaseVolumeV1Test, cls).setUpClass()
+        cls.snapshots_client = cls.os.snapshots_client
         cls.volumes_client = cls.os.volumes_client
-        cls.volumes_client.keystone_auth(cls.os.username,
-                                         cls.os.password,
-                                         cls.os.auth_url,
-                                         cls.volumes_client.service,
-                                         cls.os.tenant_name)
+        cls.volumes_extension_client = cls.os.volumes_extension_client
 
 
 class BaseVolumeV1AdminTest(BaseVolumeV1Test):
diff --git a/tempest/api/volume/test_extensions.py b/tempest/api/volume/test_extensions.py
index d9f9037..deef8a1 100644
--- a/tempest/api/volume/test_extensions.py
+++ b/tempest/api/volume/test_extensions.py
@@ -22,7 +22,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ExtensionsTestJSON(base.BaseVolumeTest):
+class ExtensionsTestJSON(base.BaseVolumeV1Test):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index 6e46168..6d23c0a 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -13,11 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.api.volume.base import BaseVolumeTest
+from tempest.api.volume import base
 from tempest import test
 
 
-class VolumeMetadataTest(BaseVolumeTest):
+class VolumeMetadataTest(base.BaseVolumeV1Test):
     _interface = "json"
 
     @classmethod
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 8710d82..4ee7bd0 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -55,10 +55,17 @@
         cls.alt_client = cls.os_alt.volumes_client
         cls.adm_client = cls.os_adm.volumes_client
 
+    def _delete_volume(self, volume_id):
+        # Delete the specified volume using admin creds
+        resp, _ = self.adm_client.delete_volume(volume_id)
+        self.assertEqual(202, resp.status)
+        self.adm_client.wait_for_resource_deletion(volume_id)
+
     @attr(type='gate')
     def test_create_get_list_accept_volume_transfer(self):
         # Create a volume first
         volume = self.create_volume()
+        self.addCleanup(self._delete_volume, volume['id'])
 
         # Create a volume transfer
         resp, transfer = self.client.create_volume_transfer(volume['id'])
@@ -88,6 +95,7 @@
     def test_create_list_delete_volume_transfer(self):
         # Create a volume first
         volume = self.create_volume()
+        self.addCleanup(self._delete_volume, volume['id'])
 
         # Create a volume transfer
         resp, body = self.client.create_volume_transfer(volume['id'])
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index 7d9f894..284c321 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -34,14 +34,14 @@
         cls.mountpoint = "/dev/vdc"
 
     @attr(type=['negative', 'gate'])
-    def test_volume_get_nonexistant_volume_id(self):
-        # Should not be able to get a non-existant volume
+    def test_volume_get_nonexistent_volume_id(self):
+        # Should not be able to get a non-existent volume
         self.assertRaises(exceptions.NotFound, self.client.get_volume,
                           str(uuid.uuid4()))
 
     @attr(type=['negative', 'gate'])
-    def test_volume_delete_nonexistant_volume_id(self):
-        # Should not be able to delete a non-existant Volume
+    def test_volume_delete_nonexistent_volume_id(self):
+        # Should not be able to delete a non-existent Volume
         self.assertRaises(exceptions.NotFound, self.client.delete_volume,
                           str(uuid.uuid4()))
 
@@ -80,8 +80,8 @@
                           size='-1', display_name=v_name, metadata=metadata)
 
     @attr(type=['negative', 'gate'])
-    def test_create_volume_with_nonexistant_volume_type(self):
-        # Should not be able to create volume with non-existant volume type
+    def test_create_volume_with_nonexistent_volume_type(self):
+        # Should not be able to create volume with non-existent volume type
         v_name = data_utils.rand_name('Volume-')
         metadata = {'Type': 'work'}
         self.assertRaises(exceptions.NotFound, self.client.create_volume,
@@ -89,8 +89,8 @@
                           display_name=v_name, metadata=metadata)
 
     @attr(type=['negative', 'gate'])
-    def test_create_volume_with_nonexistant_snapshot_id(self):
-        # Should not be able to create volume with non-existant snapshot
+    def test_create_volume_with_nonexistent_snapshot_id(self):
+        # Should not be able to create volume with non-existent snapshot
         v_name = data_utils.rand_name('Volume-')
         metadata = {'Type': 'work'}
         self.assertRaises(exceptions.NotFound, self.client.create_volume,
@@ -98,8 +98,8 @@
                           display_name=v_name, metadata=metadata)
 
     @attr(type=['negative', 'gate'])
-    def test_create_volume_with_nonexistant_source_volid(self):
-        # Should not be able to create volume with non-existant source volume
+    def test_create_volume_with_nonexistent_source_volid(self):
+        # Should not be able to create volume with non-existent source volume
         v_name = data_utils.rand_name('Volume-')
         metadata = {'Type': 'work'}
         self.assertRaises(exceptions.NotFound, self.client.create_volume,
@@ -107,7 +107,7 @@
                           display_name=v_name, metadata=metadata)
 
     @attr(type=['negative', 'gate'])
-    def test_update_volume_with_nonexistant_volume_id(self):
+    def test_update_volume_with_nonexistent_volume_id(self):
         v_name = data_utils.rand_name('Volume-')
         metadata = {'Type': 'work'}
         self.assertRaises(exceptions.NotFound, self.client.update_volume,
diff --git a/tempest/cli/simple_read_only/heat_templates/heat_minimal_hot.yaml b/tempest/cli/simple_read_only/heat_templates/heat_minimal_hot.yaml
index 6d89b7b..4657bfc 100644
--- a/tempest/cli/simple_read_only/heat_templates/heat_minimal_hot.yaml
+++ b/tempest/cli/simple_read_only/heat_templates/heat_minimal_hot.yaml
@@ -3,10 +3,10 @@
 parameters:
   instance_image:
     description: Glance image name
-    type: String
+    type: string
   instance_type:
     description: Nova instance type
-    type: String
+    type: string
     default: m1.small
     constraints:
         - allowed_values: [m1.small, m1.medium, m1.large]
diff --git a/tempest/cli/simple_read_only/test_cinder.py b/tempest/cli/simple_read_only/test_cinder.py
index f71a2de..5dcb708 100644
--- a/tempest/cli/simple_read_only/test_cinder.py
+++ b/tempest/cli/simple_read_only/test_cinder.py
@@ -18,7 +18,10 @@
 import subprocess
 
 import tempest.cli
+from tempest import config
 
+
+CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
@@ -30,6 +33,13 @@
     their own. They only verify the structure of output if present.
     """
 
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.cinder:
+            msg = ("%s skipped as Cinder is not available" % cls.__name__)
+            raise cls.skipException(msg)
+        super(SimpleReadOnlyCinderClientTest, cls).setUpClass()
+
     def test_cinder_fake_action(self):
         self.assertRaises(subprocess.CalledProcessError,
                           self.cinder,
@@ -47,6 +57,12 @@
 
     def test_cinder_volumes_list(self):
         self.cinder('list')
+        self.cinder('list', params='--all-tenants 1')
+        self.cinder('list', params='--all-tenants 0')
+        self.assertRaises(subprocess.CalledProcessError,
+                          self.cinder,
+                          'list',
+                          params='--all-tenants bad')
 
     def test_cinder_quota_class_show(self):
         """This CLI can accept and string as param."""
diff --git a/tempest/cli/simple_read_only/test_glance.py b/tempest/cli/simple_read_only/test_glance.py
index 0e0f995..b558190 100644
--- a/tempest/cli/simple_read_only/test_glance.py
+++ b/tempest/cli/simple_read_only/test_glance.py
@@ -35,6 +35,13 @@
     their own. They only verify the structure of output if present.
     """
 
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.glance:
+            msg = ("%s skipped as Glance is not available" % cls.__name__)
+            raise cls.skipException(msg)
+        super(SimpleReadOnlyGlanceClientTest, cls).setUpClass()
+
     def test_glance_fake_action(self):
         self.assertRaises(subprocess.CalledProcessError,
                           self.glance,
diff --git a/tempest/cli/simple_read_only/test_nova.py b/tempest/cli/simple_read_only/test_nova.py
index 822e531..f8ba971 100644
--- a/tempest/cli/simple_read_only/test_nova.py
+++ b/tempest/cli/simple_read_only/test_nova.py
@@ -42,6 +42,13 @@
 
     """
 
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.nova:
+            msg = ("%s skipped as Nova is not available" % cls.__name__)
+            raise cls.skipException(msg)
+        super(SimpleReadOnlyNovaClientTest, cls).setUpClass()
+
     def test_admin_fake_action(self):
         self.assertRaises(subprocess.CalledProcessError,
                           self.nova,
diff --git a/tempest/cli/simple_read_only/test_nova_manage.py b/tempest/cli/simple_read_only/test_nova_manage.py
index a92e8da..13a1589 100644
--- a/tempest/cli/simple_read_only/test_nova_manage.py
+++ b/tempest/cli/simple_read_only/test_nova_manage.py
@@ -16,9 +16,11 @@
 import subprocess
 
 import tempest.cli
+from tempest import config
 from tempest.openstack.common import log as logging
 
 
+CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
@@ -34,6 +36,13 @@
 
     """
 
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.nova:
+            msg = ("%s skipped as Nova is not available" % cls.__name__)
+            raise cls.skipException(msg)
+        super(SimpleReadOnlyNovaManageTest, cls).setUpClass()
+
     def test_admin_fake_action(self):
         self.assertRaises(subprocess.CalledProcessError,
                           self.nova_manage,
diff --git a/tempest/clients.py b/tempest/clients.py
index e44da84..4c40ce0 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -78,31 +78,6 @@
     TenantUsagesV3ClientJSON
 from tempest.services.compute.v3.json.version_client import \
     VersionV3ClientJSON
-from tempest.services.compute.v3.xml.aggregates_client import \
-    AggregatesV3ClientXML
-from tempest.services.compute.v3.xml.availability_zone_client import \
-    AvailabilityZoneV3ClientXML
-from tempest.services.compute.v3.xml.certificates_client import \
-    CertificatesV3ClientXML
-from tempest.services.compute.v3.xml.extensions_client import \
-    ExtensionsV3ClientXML
-from tempest.services.compute.v3.xml.flavors_client import FlavorsV3ClientXML
-from tempest.services.compute.v3.xml.hosts_client import HostsV3ClientXML
-from tempest.services.compute.v3.xml.hypervisor_client import \
-    HypervisorV3ClientXML
-from tempest.services.compute.v3.xml.instance_usage_audit_log_client import \
-    InstanceUsagesAuditLogV3ClientXML
-from tempest.services.compute.v3.xml.interfaces_client import \
-    InterfacesV3ClientXML
-from tempest.services.compute.v3.xml.keypairs_client import KeyPairsV3ClientXML
-from tempest.services.compute.v3.xml.quotas_client import \
-    QuotasV3ClientXML
-from tempest.services.compute.v3.xml.servers_client import ServersV3ClientXML
-from tempest.services.compute.v3.xml.services_client import \
-    ServicesV3ClientXML
-from tempest.services.compute.v3.xml.tenant_usages_client import \
-    TenantUsagesV3ClientXML
-from tempest.services.compute.v3.xml.version_client import VersionV3ClientXML
 from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
 from tempest.services.compute.xml.availability_zone_client import \
     AvailabilityZoneClientXML
@@ -168,6 +143,10 @@
     ObjectClientCustomizedHeader
 from tempest.services.orchestration.json.orchestration_client import \
     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_types_client import \
@@ -238,20 +217,13 @@
 
         if interface == 'xml':
             self.certificates_client = CertificatesClientXML(*client_args)
-            self.certificates_v3_client = CertificatesV3ClientXML(*client_args)
             self.baremetal_client = BaremetalClientXML(*client_args)
             self.servers_client = ServersClientXML(*client_args)
-            self.servers_v3_client = ServersV3ClientXML(*client_args)
             self.limits_client = LimitsClientXML(*client_args)
             self.images_client = ImagesClientXML(*client_args)
-            self.keypairs_v3_client = KeyPairsV3ClientXML(*client_args)
             self.keypairs_client = KeyPairsClientXML(*client_args)
-            self.keypairs_v3_client = KeyPairsV3ClientXML(*client_args)
             self.quotas_client = QuotasClientXML(*client_args)
-            self.quotas_v3_client = QuotasV3ClientXML(*client_args)
             self.flavors_client = FlavorsClientXML(*client_args)
-            self.flavors_v3_client = FlavorsV3ClientXML(*client_args)
-            self.extensions_v3_client = ExtensionsV3ClientXML(*client_args)
             self.extensions_client = ExtensionsClientXML(*client_args)
             self.volumes_extensions_client = VolumesExtensionsClientXML(
                 *client_args)
@@ -264,42 +236,32 @@
             self.token_client = TokenClientXML(CONF)
             self.security_groups_client = SecurityGroupsClientXML(
                 *client_args)
-            self.interfaces_v3_client = InterfacesV3ClientXML(*client_args)
             self.interfaces_client = InterfacesClientXML(*client_args)
             self.endpoints_client = EndPointClientXML(*client_args)
             self.fixed_ips_client = FixedIPsClientXML(*client_args)
-            self.availability_zone_v3_client = AvailabilityZoneV3ClientXML(
-                *client_args)
             self.availability_zone_client = AvailabilityZoneClientXML(
                 *client_args)
-            self.services_v3_client = ServicesV3ClientXML(*client_args)
             self.service_client = ServiceClientXML(*client_args)
-            self.aggregates_v3_client = AggregatesV3ClientXML(*client_args)
             self.aggregates_client = AggregatesClientXML(*client_args)
             self.services_client = ServicesClientXML(*client_args)
-            self.tenant_usages_v3_client = TenantUsagesV3ClientXML(
-                *client_args)
             self.tenant_usages_client = TenantUsagesClientXML(*client_args)
-            self.version_v3_client = VersionV3ClientXML(*client_args)
             self.policy_client = PolicyClientXML(*client_args)
             self.hosts_client = HostsClientXML(*client_args)
-            self.hypervisor_v3_client = HypervisorV3ClientXML(*client_args)
             self.hypervisor_client = HypervisorClientXML(*client_args)
             self.token_v3_client = V3TokenClientXML(*client_args)
             self.network_client = NetworkClientXML(*client_args)
             self.credentials_client = CredentialsClientXML(*client_args)
             self.instance_usages_audit_log_client = \
                 InstanceUsagesAuditLogClientXML(*client_args)
-            self.instance_usages_audit_log_v3_client = \
-                InstanceUsagesAuditLogV3ClientXML(*client_args)
             self.volume_hosts_client = VolumeHostsClientXML(*client_args)
             self.volumes_extension_client = VolumeExtensionClientXML(
                 *client_args)
-            self.hosts_v3_client = HostsV3ClientXML(*client_args)
 
             if client_args_v3_auth:
                 self.servers_client_v3_auth = ServersClientXML(
                     *client_args_v3_auth)
+            if CONF.service_available.ceilometer:
+                self.telemetry_client = TelemetryClientXML(*client_args)
 
         elif interface == 'json':
             self.certificates_client = CertificatesClientJSON(*client_args)
@@ -362,6 +324,8 @@
             self.volumes_extension_client = VolumeExtensionClientJSON(
                 *client_args)
             self.hosts_v3_client = HostsV3ClientJSON(*client_args)
+            if CONF.service_available.ceilometer:
+                self.telemetry_client = TelemetryClientJSON(*client_args)
 
             if client_args_v3_auth:
                 self.servers_client_v3_auth = ServersClientJSON(
diff --git a/tempest/common/glance_http.py b/tempest/common/glance_http.py
index e72cd9e..2ce05ee 100644
--- a/tempest/common/glance_http.py
+++ b/tempest/common/glance_http.py
@@ -218,6 +218,8 @@
         return getattr(self.connection, name)
 
     def makefile(self, *args, **kwargs):
+        # Ensure the socket is closed when this file is closed
+        kwargs['close'] = True
         return socket._fileobject(self.connection, *args, **kwargs)
 
 
@@ -345,6 +347,15 @@
         self.sock = OpenSSLConnectionDelegator(self.context, sock)
         self.sock.connect((self.host, self.port))
 
+    def close(self):
+        if self.sock:
+            # Remove the reference to the socket but don't close it yet.
+            # Response close will close both socket and associated
+            # file. Closing socket too soon will cause response
+            # reads to fail with socket IO error 'Bad file descriptor'.
+            self.sock = None
+        super(VerifiedHTTPSConnection, self).close()
+
 
 class ResponseBodyIterator(object):
     """A class that acts as an iterator over an HTTP response."""
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 95d12c1..f2df061 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -146,18 +146,28 @@
         else:
             self.identity_admin_client.tenants.delete(tenant)
 
-    def _create_creds(self, suffix=None, admin=False):
-        data_utils.rand_name_root = data_utils.rand_name(self.name)
-        if suffix:
-            data_utils.rand_name_root += suffix
-        tenant_name = data_utils.rand_name_root + "-tenant"
+    def _create_creds(self, suffix="", admin=False):
+        """Create random credentials under the following schema.
+
+        If the name contains a '.' is the full class path of something, and
+        we don't really care. If it isn't, it's probably a meaningful name,
+        so use it.
+
+        For logging purposes, -user and -tenant are long and redundant,
+        don't use them. The user# will be sufficient to figure it out.
+        """
+        if '.' in self.name:
+            root = ""
+        else:
+            root = self.name
+
+        tenant_name = data_utils.rand_name(root) + suffix
         tenant_desc = tenant_name + "-desc"
         tenant = self._create_tenant(name=tenant_name,
                                      description=tenant_desc)
-        if suffix:
-            data_utils.rand_name_root += suffix
-        username = data_utils.rand_name_root + "-user"
-        email = data_utils.rand_name_root + "@example.com"
+
+        username = data_utils.rand_name(root) + suffix
+        email = data_utils.rand_name(root) + suffix + "@example.com"
         user = self._create_user(username, self.password,
                                  tenant, email)
         if admin:
@@ -237,7 +247,7 @@
     def _create_network(self, name, tenant_id):
         if self.tempest_client:
             resp, resp_body = self.network_admin_client.create_network(
-                name, tenant_id=tenant_id)
+                name=name, tenant_id=tenant_id)
         else:
             body = {'network': {'tenant_id': tenant_id, 'name': name}}
             resp_body = self.network_admin_client.create_network(body)
@@ -257,15 +267,18 @@
                     if self.network_resources:
                         resp, resp_body = self.network_admin_client.\
                             create_subnet(
-                                network_id, str(subnet_cidr),
+                                network_id=network_id, cidr=str(subnet_cidr),
                                 name=subnet_name,
                                 tenant_id=tenant_id,
-                                enable_dhcp=self.network_resources['dhcp'])
+                                enable_dhcp=self.network_resources['dhcp'],
+                                ip_version=4)
                     else:
                         resp, resp_body = self.network_admin_client.\
-                            create_subnet(network_id, str(subnet_cidr),
+                            create_subnet(network_id=network_id,
+                                          cidr=str(subnet_cidr),
                                           name=subnet_name,
-                                          tenant_id=tenant_id)
+                                          tenant_id=tenant_id,
+                                          ip_version=4)
                 else:
                     body['subnet']['cidr'] = str(subnet_cidr)
                     resp_body = self.network_admin_client.create_subnet(body)
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 966c277..b1fef99 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -265,7 +265,8 @@
                            " (auth URL is '%s'), the response status is %s" %
                            (req_url, resp.status))
             raise exceptions.AuthenticationFailure(user=user,
-                                                   password=password)
+                                                   password=password,
+                                                   tenant=project_name)
 
     def expected_success(self, expected_code, read_code):
         assert_msg = ("This function only allowed to use for HTTP status"
@@ -441,18 +442,17 @@
         if resp.status < 400:
             return
 
-        JSON_ENC = ['application/json; charset=UTF-8', 'application/json',
-                    'application/json; charset=utf-8']
+        JSON_ENC = ['application/json', 'application/json; charset=utf-8']
         # NOTE(mtreinish): This is for compatibility with Glance and swift
         # APIs. These are the return content types that Glance api v1
         # (and occasionally swift) are using.
-        TXT_ENC = ['text/plain', 'text/plain; charset=UTF-8',
-                   'text/html; charset=UTF-8', 'text/plain; charset=utf-8']
-        XML_ENC = ['application/xml', 'application/xml; charset=UTF-8']
+        TXT_ENC = ['text/plain', 'text/html', 'text/html; charset=utf-8',
+                   'text/plain; charset=utf-8']
+        XML_ENC = ['application/xml', 'application/xml; charset=utf-8']
 
-        if ctype in JSON_ENC or ctype in XML_ENC:
+        if ctype.lower() in JSON_ENC or ctype.lower() in XML_ENC:
             parse_resp = True
-        elif ctype in TXT_ENC:
+        elif ctype.lower() in TXT_ENC:
             parse_resp = False
         else:
             raise exceptions.RestClientException(str(resp.status))
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index 5eb7336..0ed9b82 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -93,20 +93,6 @@
     def _is_timed_out(self, start_time):
         return (time.time() - self.timeout) > start_time
 
-    def connect_until_closed(self):
-        """Connect to the server and wait until connection is lost."""
-        try:
-            ssh = self._get_ssh_connection()
-            _transport = ssh.get_transport()
-            _start_time = time.time()
-            _timed_out = self._is_timed_out(_start_time)
-            while _transport.is_active() and not _timed_out:
-                time.sleep(5)
-                _timed_out = self._is_timed_out(_start_time)
-            ssh.close()
-        except (EOFError, paramiko.AuthenticationException, socket.error):
-            return
-
     def exec_command(self, cmd):
         """
         Execute the specified command on the server.
@@ -138,7 +124,7 @@
                 raise exceptions.TimeoutException(
                     "Command: '{0}' executed on host '{1}'.".format(
                         cmd, self.host))
-            if not ready[0]:        # If there is nothing to read.
+            if not ready[0]:  # If there is nothing to read.
                 continue
             out_chunk = err_chunk = None
             if channel.recv_ready():
diff --git a/tempest/common/utils/data_utils.py b/tempest/common/utils/data_utils.py
index 2b2963c..cd32720 100644
--- a/tempest/common/utils/data_utils.py
+++ b/tempest/common/utils/data_utils.py
@@ -30,8 +30,12 @@
     return uuid.uuid4().hex
 
 
-def rand_name(name='test'):
-    return name + "-tempest-" + str(random.randint(1, 0x7fffffff))
+def rand_name(name=''):
+    randbits = str(random.randint(1, 0x7fffffff))
+    if name:
+        return name + '-' + randbits
+    else:
+        return randbits
 
 
 def rand_int_id(start=0, end=0x7fffffff):
diff --git a/tempest/config.py b/tempest/config.py
index d529965..5a9199d 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -147,7 +147,7 @@
                default='root',
                help="User name used to authenticate to an instance."),
     cfg.IntOpt('ping_timeout',
-               default=60,
+               default=120,
                help="Timeout in seconds to wait for ping to "
                     "succeed."),
     cfg.IntOpt('ssh_timeout',
diff --git a/tempest/openstack/common/fixture/mockpatch.py b/tempest/openstack/common/fixture/mockpatch.py
index 858e77c..d7dcc11 100644
--- a/tempest/openstack/common/fixture/mockpatch.py
+++ b/tempest/openstack/common/fixture/mockpatch.py
@@ -22,14 +22,15 @@
 class PatchObject(fixtures.Fixture):
     """Deal with code around mock."""
 
-    def __init__(self, obj, attr, **kwargs):
+    def __init__(self, obj, attr, new=mock.DEFAULT, **kwargs):
         self.obj = obj
         self.attr = attr
         self.kwargs = kwargs
+        self.new = new
 
     def setUp(self):
         super(PatchObject, self).setUp()
-        _p = mock.patch.object(self.obj, self.attr, **self.kwargs)
+        _p = mock.patch.object(self.obj, self.attr, self.new, **self.kwargs)
         self.mock = _p.start()
         self.addCleanup(_p.stop)
 
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 04882f3..ca3a2db 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -233,7 +233,7 @@
     def setUpClass(cls):
         super(OfficialClientTest, cls).setUpClass()
         cls.isolated_creds = isolated_creds.IsolatedCreds(
-            __name__, tempest_client=False,
+            cls.__name__, tempest_client=False,
             network_resources=cls.network_resources)
 
         username, password, tenant_name = cls.credentials()
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 3ae9567..7afa863 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 IBM Corp.
 # All Rights Reserved.
 #
diff --git a/tempest/scenario/test_cross_tenant_connectivity.py b/tempest/scenario/test_cross_tenant_connectivity.py
index cb64314..6fd10be 100644
--- a/tempest/scenario/test_cross_tenant_connectivity.py
+++ b/tempest/scenario/test_cross_tenant_connectivity.py
@@ -369,7 +369,6 @@
                             msg)
         except Exception:
             debug.log_ip_ns()
-            self._log_console_output(servers=self.servers)
             raise
 
     def _test_in_tenant_block(self, tenant):
@@ -472,17 +471,21 @@
     @attr(type='smoke')
     @services('compute', 'network')
     def test_cross_tenant_traffic(self):
-        for tenant_id in self.tenants.keys():
-            self._deploy_tenant(tenant_id)
-            self._verify_network_details(self.tenants[tenant_id])
-            self._verify_mac_addr(self.tenants[tenant_id])
+        try:
+            for tenant_id in self.tenants.keys():
+                self._deploy_tenant(tenant_id)
+                self._verify_network_details(self.tenants[tenant_id])
+                self._verify_mac_addr(self.tenants[tenant_id])
 
-        # in-tenant check
-        self._test_in_tenant_block(self.demo_tenant)
-        self._test_in_tenant_allow(self.demo_tenant)
+            # in-tenant check
+            self._test_in_tenant_block(self.demo_tenant)
+            self._test_in_tenant_allow(self.demo_tenant)
 
-        # cross tenant check
-        source_tenant = self.demo_tenant
-        dest_tenant = self.alt_tenant
-        self._test_cross_tenant_block(source_tenant, dest_tenant)
-        self._test_cross_tenant_allow(source_tenant, dest_tenant)
+            # cross tenant check
+            source_tenant = self.demo_tenant
+            dest_tenant = self.alt_tenant
+            self._test_cross_tenant_block(source_tenant, dest_tenant)
+            self._test_cross_tenant_allow(source_tenant, dest_tenant)
+        except Exception:
+            self._log_console_output(servers=self.servers)
+            raise
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index c2c5e27..26a4dc0 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -159,6 +159,7 @@
         self.cinder_list()
         self.cinder_show()
         self.nova_volume_attach()
+        self.addCleanup(self.nova_volume_detach)
         self.cinder_show()
         self.nova_reboot()
 
@@ -167,5 +168,3 @@
         self._create_loginable_secgroup_rule_nova()
         self.ssh_to_server()
         self.check_partitions()
-
-        self.nova_volume_detach()
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index eaca1fd..aea5874 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -186,8 +186,7 @@
                                                     key.private_key)
         except Exception:
             LOG.exception('Tenant connectivity check failed')
-            self._log_console_output(
-                servers=[server for server, _key in self.servers])
+            self._log_console_output(servers=self.servers.keys())
             debug.log_ip_ns()
             raise
 
@@ -214,8 +213,7 @@
                                             should_connect=should_connect)
         except Exception:
             LOG.exception('Public network connectivity check failed')
-            self._log_console_output(
-                servers=[server for server, _key in self.servers])
+            self._log_console_output(servers=self.servers.keys())
             debug.log_ip_ns()
             raise
 
diff --git a/tempest/services/compute/v3/xml/aggregates_client.py b/tempest/services/compute/v3/xml/aggregates_client.py
deleted file mode 100644
index d619aa7..0000000
--- a/tempest/services/compute/v3/xml/aggregates_client.py
+++ /dev/null
@@ -1,128 +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.rest_client import RestClientXML
-from tempest import exceptions
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import Text
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class AggregatesV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(AggregatesV3ClientXML, self).__init__(config, username, password,
-                                                    auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _format_aggregate(self, g):
-        agg = 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", self.headers)
-        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),
-                              self.headers)
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def create_aggregate(self, name, availability_zone=None):
-        """Creates a new aggregate."""
-        post_body = Element("aggregate",
-                            name=name,
-                            availability_zone=availability_zone)
-        resp, body = self.post('os-aggregates',
-                               str(Document(post_body)),
-                               self.headers)
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
-
-    def update_aggregate(self, aggregate_id, name, availability_zone=None):
-        """Update a aggregate."""
-        put_body = Element("aggregate",
-                           name=name,
-                           availability_zone=availability_zone)
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              str(Document(put_body)),
-                              self.headers)
-        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),
-                           self.headers)
-
-    def is_resource_deleted(self, id):
-        try:
-            self.get_aggregate(id)
-        except exceptions.NotFound:
-            return True
-        return False
-
-    def add_host(self, aggregate_id, host):
-        """Adds a host to the given aggregate."""
-        post_body = Element("add_host", host=host)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
-        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 = Element("remove_host", host=host)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
-        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 = Element("set_metadata")
-        metadata = Element("metadata")
-        post_body.append(metadata)
-        for k, v in meta.items():
-            meta = Element(k)
-            meta.append(Text(v))
-            metadata.append(meta)
-        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
-        aggregate = self._format_aggregate(etree.fromstring(body))
-        return resp, aggregate
diff --git a/tempest/services/compute/v3/xml/availability_zone_client.py b/tempest/services/compute/v3/xml/availability_zone_client.py
deleted file mode 100644
index 5278eab..0000000
--- a/tempest/services/compute/v3/xml/availability_zone_client.py
+++ /dev/null
@@ -1,41 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class AvailabilityZoneV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(AvailabilityZoneV3ClientXML, self).__init__(config, username,
-                                                          password, auth_url,
-                                                          tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _parse_array(self, node):
-        return [xml_to_json(x) for x in node]
-
-    def get_availability_zone_list(self):
-        resp, body = self.get('os-availability-zone', self.headers)
-        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', self.headers)
-        availability_zone = self._parse_array(etree.fromstring(body))
-        return resp, availability_zone
diff --git a/tempest/services/compute/v3/xml/certificates_client.py b/tempest/services/compute/v3/xml/certificates_client.py
deleted file mode 100644
index 0ff4de4..0000000
--- a/tempest/services/compute/v3/xml/certificates_client.py
+++ /dev/null
@@ -1,39 +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.rest_client import RestClientXML
-
-
-class CertificatesV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(CertificatesV3ClientXML, self).__init__(config, username,
-                                                      password,
-                                                      auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def get_certificate(self, id):
-        url = "os-certificates/%s" % (id)
-        resp, body = self.get(url, self.headers)
-        body = self._parse_resp(body)
-        return resp, body
-
-    def create_certificate(self):
-        """create certificates."""
-        url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
-        body = self._parse_resp(body)
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/extensions_client.py b/tempest/services/compute/v3/xml/extensions_client.py
deleted file mode 100644
index 8145e20..0000000
--- a/tempest/services/compute/v3/xml/extensions_client.py
+++ /dev/null
@@ -1,48 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class ExtensionsV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(ExtensionsV3ClientXML, self).__init__(config, username, password,
-                                                    auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node:
-            array.append(xml_to_json(child))
-        return array
-
-    def list_extensions(self):
-        url = 'extensions'
-        resp, body = self.get(url, self.headers)
-        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, self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/flavors_client.py b/tempest/services/compute/v3/xml/flavors_client.py
deleted file mode 100644
index f568488..0000000
--- a/tempest/services/compute/v3/xml/flavors_client.py
+++ /dev/null
@@ -1,210 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import Text
-from tempest.services.compute.xml.common import xml_to_json
-from tempest.services.compute.xml.common import XMLNS_V3
-
-XMLNS_OS_FLV_ACCESS = \
-    "http://docs.openstack.org/compute/core/flavor-access/api/v3"
-
-
-class FlavorsV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(FlavorsV3ClientXML, self).__init__(config, username, password,
-                                                 auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_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}is_public' % XMLNS_OS_FLV_ACCESS:
-                k = 'flavor-access:is_public'
-                v = True if v == 'True' else False
-
-            if k == 'extra_specs':
-                k = 'flavor-extra-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_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, self.headers)
-        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), self.headers)
-        body = 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 = Element("flavor",
-                         xmlns=XMLNS_V3,
-                         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('ephemeral', kwargs.get('ephemeral'))
-        if kwargs.get('is_public'):
-            flavor.add_attr('flavor-access:is_public',
-                            kwargs.get('is_public'))
-        flavor.add_attr('xmlns:flavor-access', XMLNS_OS_FLV_ACCESS)
-        resp, body = self.post('flavors', str(Document(flavor)), self.headers)
-        body = 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), self.headers)
-
-    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
-
-    def set_flavor_extra_spec(self, flavor_id, specs):
-        """Sets extra Specs to the mentioned flavor."""
-        extra_specs = Element("extra_specs")
-        for key in specs.keys():
-            extra_specs.add_attr(key, specs[key])
-        resp, body = self.post('flavors/%s/flavor-extra-specs' % flavor_id,
-                               str(Document(extra_specs)), self.headers)
-        body = 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/flavor-extra-specs' % flavor_id,
-                              self.headers)
-        body = 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/flavor-extra-specs/%s' %
-                                  (str(flavor_id), key), self.headers)
-        body = {}
-        element = etree.fromstring(xml_body)
-        key = element.get('key')
-        body[key] = 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 = Document()
-        for (k, v) in kwargs.items():
-            element = Element(k)
-            doc.append(element)
-            value = Text(v)
-            element.append(value)
-
-        resp, body = self.put('flavors/%s/flavor-extra-specs/%s' %
-                              (flavor_id, key),
-                              str(doc), self.headers)
-        body = 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/flavor-extra-specs/%s' %
-                           (str(flavor_id), key))
-
-    def _parse_array_access(self, node):
-        return [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/flavor-access' % str(flavor_id),
-                              self.headers)
-        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 = Document()
-        server = Element("add_tenant_access")
-        doc.append(server)
-        server.add_attr("tenant_id", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
-        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 = Document()
-        server = Element("remove_tenant_access")
-        doc.append(server)
-        server.add_attr("tenant_id", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
-        body = self._parse_array_access(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/hosts_client.py b/tempest/services/compute/v3/xml/hosts_client.py
deleted file mode 100644
index 2951928..0000000
--- a/tempest/services/compute/v3/xml/hosts_client.py
+++ /dev/null
@@ -1,90 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class HostsV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(HostsV3ClientXML, self).__init__(config, username, password,
-                                               auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_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, self.headers)
-        node = etree.fromstring(body)
-        body = [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), self.headers)
-        node = etree.fromstring(body)
-        body = [xml_to_json(node)]
-        return resp, body
-
-    def update_host(self, hostname, **kwargs):
-        """Update a host."""
-
-        request_body = Element("host")
-        if kwargs:
-            for k, v in kwargs.iteritems():
-                request_body.append(Element(k, v))
-        resp, body = self.put("os-hosts/%s" % str(hostname),
-                              str(Document(request_body)),
-                              self.headers)
-        node = etree.fromstring(body)
-        body = [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),
-                              self.headers)
-        node = etree.fromstring(body)
-        body = [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),
-                              self.headers)
-        node = etree.fromstring(body)
-        body = [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),
-                              self.headers)
-        node = etree.fromstring(body)
-        body = [xml_to_json(x) for x in node.getchildren()]
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/hypervisor_client.py b/tempest/services/compute/v3/xml/hypervisor_client.py
deleted file mode 100644
index 2f232ab..0000000
--- a/tempest/services/compute/v3/xml/hypervisor_client.py
+++ /dev/null
@@ -1,77 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class HypervisorV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(HypervisorV3ClientXML, self).__init__(config, username,
-                                                    password, auth_url,
-                                                    tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _parse_array(self, node):
-        return [xml_to_json(x) for x in node]
-
-    def get_hypervisor_list(self):
-        """List hypervisors information."""
-        resp, body = self.get('os-hypervisors', self.headers)
-        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', self.headers)
-        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,
-                              self.headers)
-        hypervisor = 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,
-                              self.headers)
-        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', self.headers)
-        stats = 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,
-                              self.headers)
-        uptime = xml_to_json(etree.fromstring(body))
-        return resp, uptime
-
-    def search_hypervisor(self, hyper_name):
-        """Search specified hypervisor."""
-        resp, body = self.get('os-hypervisors/search?query=%s' % hyper_name,
-                              self.headers)
-        hypervisors = self._parse_array(etree.fromstring(body))
-        return resp, hypervisors
diff --git a/tempest/services/compute/v3/xml/instance_usage_audit_log_client.py b/tempest/services/compute/v3/xml/instance_usage_audit_log_client.py
deleted file mode 100644
index ed6f36e..0000000
--- a/tempest/services/compute/v3/xml/instance_usage_audit_log_client.py
+++ /dev/null
@@ -1,36 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class InstanceUsagesAuditLogV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(InstanceUsagesAuditLogV3ClientXML, self).__init__(
-            config, username, password, auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def list_instance_usage_audit_logs(self, time_before=None):
-        if time_before:
-            url = 'os-instance-usage-audit-log?before=%s' % time_before
-        else:
-            url = 'os-instance-usage-audit-log'
-        resp, body = self.get(url, self.headers)
-        instance_usage_audit_logs = xml_to_json(etree.fromstring(body))
-        return resp, instance_usage_audit_logs
diff --git a/tempest/services/compute/v3/xml/interfaces_client.py b/tempest/services/compute/v3/xml/interfaces_client.py
deleted file mode 100644
index 870c130..0000000
--- a/tempest/services/compute/v3/xml/interfaces_client.py
+++ /dev/null
@@ -1,108 +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.rest_client import RestClientXML
-from tempest import exceptions
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import Text
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class InterfacesV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(InterfacesV3ClientXML, self).__init__(config, username, password,
-                                                    auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _process_xml_interface(self, node):
-        iface = xml_to_json(node)
-        # NOTE(danms): if multiple addresses per interface is ever required,
-        # 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-attach-interfaces' % server,
-                              self.headers)
-        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 = Document()
-        iface = Element('interface_attachment')
-        if port_id:
-            _port_id = Element('port_id')
-            _port_id.append(Text(port_id))
-            iface.append(_port_id)
-        if network_id:
-            _network_id = Element('net_id')
-            _network_id.append(Text(network_id))
-            iface.append(_network_id)
-        if fixed_ip:
-            _fixed_ips = Element('fixed_ips')
-            _fixed_ip = Element('fixed_ip')
-            _ip_address = Element('ip_address')
-            _ip_address.append(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-attach-interfaces' % server,
-                               headers=self.headers,
-                               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-attach-interfaces/%s' % (server, port_id),
-                     self.headers)
-        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-attach-interfaces/%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
diff --git a/tempest/services/compute/v3/xml/keypairs_client.py b/tempest/services/compute/v3/xml/keypairs_client.py
deleted file mode 100644
index 6efb7fe..0000000
--- a/tempest/services/compute/v3/xml/keypairs_client.py
+++ /dev/null
@@ -1,67 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import Text
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class KeyPairsV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(KeyPairsV3ClientXML, self).__init__(config, username, password,
-                                                  auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def list_keypairs(self):
-        resp, body = self.get("keypairs", self.headers)
-        node = etree.fromstring(body)
-        body = [{'keypair': xml_to_json(x)} for x in node.getchildren()]
-        return resp, body
-
-    def get_keypair(self, key_name):
-        resp, body = self.get("keypairs/%s" % str(key_name), self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def create_keypair(self, name, pub_key=None):
-        doc = Document()
-
-        keypair_element = Element("keypair")
-
-        if pub_key:
-            public_key_element = Element("public_key")
-            public_key_text = Text(pub_key)
-            public_key_element.append(public_key_text)
-            keypair_element.append(public_key_element)
-
-        name_element = Element("name")
-        name_text = Text(name)
-        name_element.append(name_text)
-        keypair_element.append(name_element)
-
-        doc.append(keypair_element)
-
-        resp, body = self.post("keypairs",
-                               headers=self.headers, body=str(doc))
-        body = xml_to_json(etree.fromstring(body))
-        return resp, body
-
-    def delete_keypair(self, key_name):
-        return self.delete("keypairs/%s" % str(key_name))
diff --git a/tempest/services/compute/v3/xml/quotas_client.py b/tempest/services/compute/v3/xml/quotas_client.py
deleted file mode 100644
index 145c6e8..0000000
--- a/tempest/services/compute/v3/xml/quotas_client.py
+++ /dev/null
@@ -1,111 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import xml_to_json
-from tempest.services.compute.xml.common import XMLNS_V3
-
-
-class QuotasV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(QuotasV3ClientXML, self).__init__(config, username, password,
-                                                auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _format_quota(self, q):
-        quota = {}
-        for k, v in q.items():
-            try:
-                v = int(v)
-            except ValueError:
-                pass
-
-            quota[k] = v
-
-        return quota
-
-    def _parse_array(self, node):
-        return [self._format_quota(xml_to_json(x)) for x in node]
-
-    def get_quota_set(self, tenant_id):
-        """List the quota set for a tenant."""
-
-        url = 'os-quota-sets/%s' % str(tenant_id)
-        resp, body = self.get(url, self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        body = self._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, self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        body = self._format_quota(body)
-        return resp, body
-
-    def update_quota_set(self, tenant_id, force=None,
-                         metadata_items=None, ram=None, floating_ips=None,
-                         fixed_ips=None, key_pairs=None, instances=None,
-                         security_group_rules=None, cores=None,
-                         security_groups=None):
-        """
-        Updates the tenant's quota limits for one or more resources
-        """
-        post_body = Element("quota_set",
-                            xmlns=XMLNS_V3)
-
-        if force is not None:
-            post_body.add_attr('force', force)
-
-        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 cores is not None:
-            post_body.add_attr('cores', cores)
-
-        if security_groups is not None:
-            post_body.add_attr('security_groups', security_groups)
-
-        resp, body = self.put('os-quota-sets/%s' % str(tenant_id),
-                              str(Document(post_body)),
-                              self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        body = self._format_quota(body)
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/servers_client.py b/tempest/services/compute/v3/xml/servers_client.py
deleted file mode 100644
index 240c962..0000000
--- a/tempest/services/compute/v3/xml/servers_client.py
+++ /dev/null
@@ -1,663 +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.rest_client import RestClientXML
-from tempest.common import waiters
-from tempest import exceptions
-from tempest.openstack.common import log as logging
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import Text
-from tempest.services.compute.xml.common import xml_to_json
-from tempest.services.compute.xml.common import XMLNS_V3
-
-
-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)
-    if ip.get('type'):
-        ip['type'] = ip.get('type')
-    if ip.get('mac_addr'):
-        ip['mac_addr'] = ip.get('mac_addr')
-    return ip
-
-
-def _translate_network_xml_to_json(network):
-    return [_translate_ip_xml_json(ip.attrib)
-            for ip in network.findall('{%s}ip' % XMLNS_V3)]
-
-
-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' % XMLNS_V3))
-
-
-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/v3">
-        <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': XMLNS_V3}
-    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_to_json(xml_dom)
-        json['addresses'] = json_addresses
-    else:
-        json = xml_to_json(xml_dom)
-    disk_config = ('{http://docs.openstack.org'
-                   '/compute/ext/disk_config/api/v3}disk_config')
-    terminated_at = ('{http://docs.openstack.org/'
-                     'compute/ext/os-server-usage/api/v3}terminated_at')
-    launched_at = ('{http://docs.openstack.org'
-                   '/compute/ext/os-server-usage/api/v3}launched_at')
-    power_state = ('{http://docs.openstack.org'
-                   '/compute/ext/extended_status/api/v3}power_state')
-    availability_zone = ('{http://docs.openstack.org'
-                         '/compute/ext/extended_availability_zone/api/v3}'
-                         'availability_zone')
-    vm_state = ('{http://docs.openstack.org'
-                '/compute/ext/extended_status/api/v3}vm_state')
-    task_state = ('{http://docs.openstack.org'
-                  '/compute/ext/extended_status/api/v3}task_state')
-    access_ip_v4 = ('{http://docs.openstack.org/compute/ext/'
-                    'os-access-ips/api/v3}access_ip_v4')
-    access_ip_v6 = ('{http://docs.openstack.org/compute/ext/'
-                    'os-access-ips/api/v3}access_ip_v6')
-    if disk_config in json:
-        json['os-disk-config:disk_config'] = json.pop(disk_config)
-    if terminated_at in json:
-        json['os-server-usage:terminated_at'] = json.pop(terminated_at)
-    if launched_at in json:
-        json['os-server-usage:launched_at'] = json.pop(launched_at)
-    if power_state in json:
-        json['os-extended-status:power_state'] = json.pop(power_state)
-    if availability_zone in json:
-        json['os-extended-availability-zone:availability_zone'] = json.pop(
-            availability_zone)
-    if vm_state in json:
-        json['os-extended-status:vm_state'] = json.pop(vm_state)
-    if task_state in json:
-        json['os-extended-status:task_state'] = json.pop(task_state)
-    if access_ip_v4 in json:
-        json['os-access-ips:access_ip_v4'] = json.pop(access_ip_v4)
-    if access_ip_v6 in json:
-        json['os-access-ips:access_ip_v6'] = json.pop(access_ip_v6)
-    return json
-
-
-class ServersV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url,
-                 tenant_name=None, auth_version='v2'):
-        super(ServersV3ClientXML, self).__init__(config, username, password,
-                                                 auth_url, tenant_name,
-                                                 auth_version=auth_version)
-        self.service = self.config.compute.catalog_v3_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_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' % XMLNS_V3)
-            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), self.headers)
-        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 reset_state(self, server_id, state='error'):
-        """Resets the state of a server to active/error."""
-        return self.action(server_id, 'reset_state', None, state=state)
-
-    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 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_to_json(child))
-        return array
-
-    def list_servers(self, params=None):
-        url = 'servers'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url, self.headers)
-        servers = self._parse_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, self.headers)
-        servers = self._parse_array(etree.fromstring(body))
-        return resp, {"servers": servers}
-
-    def update_server(self, server_id, name=None, meta=None, access_ip_v4=None,
-                      access_ip_v6=None, disk_config=None):
-        doc = Document()
-        server = Element("server")
-        doc.append(server)
-
-        if name is not None:
-            server.add_attr("name", name)
-        if access_ip_v4 or access_ip_v6:
-            server.add_attr('xmlns:os-access-ips',
-                            "http://docs.openstack.org/compute/ext/"
-                            "os-access-ips/api/v3")
-        if access_ip_v4 is not None:
-            server.add_attr("os-access-ips:access_ip_v4", access_ip_v4)
-        if access_ip_v6 is not None:
-            server.add_attr("os-access-ips:access_ip_v6", access_ip_v6)
-        if disk_config is not None:
-            server.add_attr('xmlns:os-disk-config', "http://docs.openstack.org"
-                            "/compute/ext/disk_config/api/v3")
-            server.add_attr("os-disk-config:disk_config", disk_config)
-        if meta is not None:
-            metadata = Element("metadata")
-            server.append(metadata)
-            for k, v in meta:
-                meta = Element("meta", key=k)
-                meta.append(Text(v))
-                metadata.append(meta)
-
-        resp, body = self.put('servers/%s' % str(server_id),
-                              str(doc), self.headers)
-        return resp, 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:
-        admin_password: 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.
-        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.
-        access_ip_v4: The IPv4 access address for the server.
-        access_ip_v6: 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.
-        return_reservation_id: Enable/Disable the return of reservation id.
-        """
-        server = Element("server",
-                         xmlns=XMLNS_V3,
-                         flavor_ref=flavor_ref,
-                         image_ref=image_ref,
-                         name=name)
-        attrs = ["admin_password", "key_name",
-                 ('os-access-ips:access_ip_v4',
-                  'access_ip_v4',
-                  'xmlns:os-access-ips',
-                  "http://docs.openstack.org/compute/ext/"
-                  "os-access-ips/api/v3"),
-                 ('os-access-ips:access_ip_v6',
-                  'access_ip_v6',
-                  'xmlns:os-access-ips',
-                  "http://docs.openstack.org/compute/ext/"
-                  "os-access-ips/api/v3"),
-                 ("os-user-data:user_data",
-                  'user_data',
-                  'xmlns:os-user-data',
-                  "http://docs.openstack.org/compute/ext/userdata/api/v3"),
-                 ("os-availability-zone:availability_zone",
-                  'availability_zone',
-                  'xmlns:os-availability-zone',
-                  "http://docs.openstack.org/compute/ext/"
-                  "availabilityzone/api/v3"),
-                 ("os-multiple-create:min_count",
-                  'min_count',
-                  'xmlns:os-multiple-create',
-                  "http://docs.openstack.org/compute/ext/"
-                  "multiplecreate/api/v3"),
-                 ("os-multiple-create:max_count",
-                  'max_count',
-                  'xmlns:os-multiple-create',
-                  "http://docs.openstack.org/compute/ext/"
-                  "multiplecreate/api/v3"),
-                 ("os-multiple-create:return_reservation_id",
-                  "return_reservation_id",
-                  'xmlns:os-multiple-create',
-                  "http://docs.openstack.org/compute/ext/"
-                  "multiplecreate/api/v3"),
-                 ("os-disk-config:disk_config",
-                  "disk_config",
-                  "xmlns:os-disk-config",
-                  "http://docs.openstack.org/"
-                  "compute/ext/disk_config/api/v3")]
-
-        for attr in attrs:
-            if isinstance(attr, tuple):
-                post_param = attr[0]
-                key = attr[1]
-                value = kwargs.get(key)
-                if value is not None:
-                    server.add_attr(attr[2], attr[3])
-                    server.add_attr(post_param, value)
-            else:
-                post_param = attr
-                key = attr
-                value = kwargs.get(key)
-                if value is not None:
-                    server.add_attr(post_param, value)
-
-        if 'security_groups' in kwargs:
-            server.add_attr("xmlns:os-security-groups",
-                            "http://docs.openstack.org/compute/ext/"
-                            "securitygroups/api/v3")
-            secgroups = Element("os-security-groups:security_groups")
-            server.append(secgroups)
-            for secgroup in kwargs['security_groups']:
-                s = Element("security_group", name=secgroup['name'])
-                secgroups.append(s)
-
-        if 'networks' in kwargs:
-            networks = Element("networks")
-            server.append(networks)
-            for network in kwargs['networks']:
-                s = Element("network", uuid=network['uuid'],
-                            fixed_ip=network['fixed_ip'])
-                networks.append(s)
-
-        if 'meta' in kwargs:
-            metadata = Element("metadata")
-            server.append(metadata)
-            for k, v in kwargs['meta'].items():
-                meta = Element("meta", key=k)
-                meta.append(Text(v))
-                metadata.append(meta)
-
-        resp, body = self.post('servers', str(Document(server)), self.headers)
-        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
-
-            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), self.headers)
-
-        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),
-                              self.headers)
-        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'] = XMLNS_V3
-        doc = Document((Element(action_name, **kwargs)))
-        resp, body = self.post("servers/%s/action" % server_id,
-                               str(doc), self.headers)
-        if response_key is not None:
-            body = 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, "create_backup", None,
-                           backup_type=backup_type,
-                           rotation=rotation,
-                           name=name)
-
-    def change_password(self, server_id, password):
-        return self.action(server_id, "change_password", None,
-                           admin_password=password)
-
-    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['image_ref'] = image_ref
-        if 'disk_config' in kwargs:
-            kwargs['os-disk-config:disk_config'] = kwargs['disk_config']
-            del kwargs['disk_config']
-            kwargs['xmlns:os-disk-config'] = "http://docs.openstack.org/"\
-                                             "compute/ext/disk_config/api/v3"
-            kwargs['xmlns:atom'] = "http://www.w3.org/2005/Atom"
-        if 'xmlns' not in kwargs:
-            kwargs['xmlns'] = XMLNS_V3
-
-        attrs = kwargs.copy()
-        if 'metadata' in attrs:
-            del attrs['metadata']
-        rebuild = Element("rebuild",
-                          **attrs)
-
-        if 'metadata' in kwargs:
-            metadata = Element("metadata")
-            rebuild.append(metadata)
-            for k, v in kwargs['metadata'].items():
-                meta = Element("meta", key=k)
-                meta.append(Text(v))
-                metadata.append(meta)
-
-        resp, body = self.post('servers/%s/action' % server_id,
-                               str(Document(rebuild)), self.headers)
-        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-disk-config:disk_config'] = kwargs['disk_config']
-            del kwargs['disk_config']
-            kwargs['xmlns:os-disk-config'] = "http://docs.openstack.org/"\
-                                             "compute/ext/disk_config/api/v3"
-            kwargs['xmlns:atom'] = "http://www.w3.org/2005/Atom"
-        kwargs['flavor_ref'] = flavor_ref
-        return self.action(server_id, 'resize', None, **kwargs)
-
-    def confirm_resize(self, server_id, **kwargs):
-        return self.action(server_id, 'confirm_resize', None, **kwargs)
-
-    def revert_resize(self, server_id, **kwargs):
-        return self.action(server_id, 'revert_resize', None, **kwargs)
-
-    def stop(self, server_id, **kwargs):
-        return self.action(server_id, 'stop', None, **kwargs)
-
-    def start(self, server_id, **kwargs):
-        return self.action(server_id, 'start', None, **kwargs)
-
-    def create_image(self, server_id, name, meta=None):
-        """Creates an image of the original server."""
-        post_body = Element('create_image', name=name)
-
-        if meta:
-            metadata = Element('metadata')
-            post_body.append(metadata)
-            for k, v in meta.items():
-                data = Element('meta', key=k)
-                data.append(Text(v))
-                metadata.append(data)
-        resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(Document(post_body)), self.headers)
-        return resp, body
-
-    def live_migrate_server(self, server_id, dest_host, use_block_migration):
-        """This should be called with administrator privileges ."""
-
-        req_body = Element("migrate_live",
-                           xmlns=XMLNS_V3,
-                           disk_over_commit=False,
-                           block_migration=use_block_migration,
-                           host=dest_host)
-
-        resp, body = self.post("servers/%s/action" % str(server_id),
-                               str(Document(req_body)), self.headers)
-        return resp, body
-
-    def list_server_metadata(self, server_id):
-        resp, body = self.get("servers/%s/metadata" % str(server_id),
-                              self.headers)
-        body = self._parse_key_value(etree.fromstring(body))
-        return resp, body
-
-    def set_server_metadata(self, server_id, meta, no_metadata_field=False):
-        doc = Document()
-        if not no_metadata_field:
-            metadata = Element("metadata")
-            doc.append(metadata)
-            for k, v in meta.items():
-                meta_element = Element("meta", key=k)
-                meta_element.append(Text(v))
-                metadata.append(meta_element)
-        resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              str(doc), self.headers)
-        return resp, xml_to_json(etree.fromstring(body))
-
-    def update_server_metadata(self, server_id, meta):
-        doc = Document()
-        metadata = Element("metadata")
-        doc.append(metadata)
-        for k, v in meta.items():
-            meta_element = Element("meta", key=k)
-            meta_element.append(Text(v))
-            metadata.append(meta_element)
-        resp, body = self.post("/servers/%s/metadata" % str(server_id),
-                               str(doc), headers=self.headers)
-        body = 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),
-                              headers=self.headers)
-        return resp, dict([(etree.fromstring(body).attrib['key'],
-                            xml_to_json(etree.fromstring(body)))])
-
-    def set_server_metadata_item(self, server_id, key, meta):
-        doc = Document()
-        for k, v in meta.items():
-            meta_element = Element("metadata", key=k)
-            meta_element.append(Text(v))
-            doc.append(meta_element)
-        resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              str(doc), self.headers)
-        return resp, 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):
-        return self.action(server_id, 'get_console_output', 'output',
-                           length=length)
-
-    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'):
-        return self.action(server_id, "attach", None, volume_id=volume_id,
-                           device=device)
-
-    def detach_volume(self, server_id, volume_id):
-        return self.action(server_id, "detach", None, volume_id=volume_id)
-
-    def get_server_diagnostics(self, server_id):
-        """Get the usage data for a server."""
-        resp, body = self.get("servers/%s/os-server-diagnostics" % server_id,
-                              self.headers)
-        body = 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,
-                              self.headers)
-        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), self.headers)
-        body = 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, 'force_delete', None, **kwargs)
-
-    def restore_soft_deleted_server(self, server_id, **kwargs):
-        """Restore a soft-deleted server."""
-        return self.action(server_id, 'restore', None, **kwargs)
diff --git a/tempest/services/compute/v3/xml/services_client.py b/tempest/services/compute/v3/xml/services_client.py
deleted file mode 100644
index 749a812..0000000
--- a/tempest/services/compute/v3/xml/services_client.py
+++ /dev/null
@@ -1,71 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class ServicesV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(ServicesV3ClientXML, self).__init__(config, username, password,
-                                                  auth_url, tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def list_services(self, params=None):
-        url = 'os-services'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url, self.headers)
-        node = etree.fromstring(body)
-        body = [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 = Element("service")
-        post_body.add_attr('binary', binary)
-        post_body.add_attr('host', host_name)
-
-        resp, body = self.put('os-services/enable', str(Document(post_body)),
-                              self.headers)
-        body = 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 = Element("service")
-        post_body.add_attr('binary', binary)
-        post_body.add_attr('host', host_name)
-
-        resp, body = self.put('os-services/disable', str(Document(post_body)),
-                              self.headers)
-        body = xml_to_json(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/compute/v3/xml/tenant_usages_client.py b/tempest/services/compute/v3/xml/tenant_usages_client.py
deleted file mode 100644
index 12b7655..0000000
--- a/tempest/services/compute/v3/xml/tenant_usages_client.py
+++ /dev/null
@@ -1,52 +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.rest_client import RestClientXML
-from tempest.services.compute.xml.common import xml_to_json
-
-
-class TenantUsagesV3ClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(TenantUsagesV3ClientXML, self).__init__(config, username,
-                                                      password, auth_url,
-                                                      tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _parse_array(self, node):
-        json = 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, self.headers)
-        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, self.headers)
-        tenant_usage = self._parse_array(etree.fromstring(body))
-        return resp, tenant_usage
diff --git a/tempest/services/compute/v3/xml/version_client.py b/tempest/services/compute/v3/xml/version_client.py
deleted file mode 100644
index 7ecb31f..0000000
--- a/tempest/services/compute/v3/xml/version_client.py
+++ /dev/null
@@ -1,37 +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.services.compute.xml import common
-
-
-class VersionV3ClientXML(rest_client.RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(VersionV3ClientXML, self).__init__(config, username,
-                                                 password, auth_url,
-                                                 tenant_name)
-        self.service = self.config.compute.catalog_v3_type
-
-    def _parse_array(self, node):
-        json = common.xml_to_json(node)
-        return json
-
-    def get_version(self):
-        resp, body = self.get('', self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 8cb74a9..47c20d2 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -47,50 +47,8 @@
     def serialize(self, data):
         return json.dumps(data)
 
-    def create_network(self, name, **kwargs):
-        post_body = {'network': kwargs}
-        post_body['network']['name'] = name
-        body = json.dumps(post_body)
-        uri = '%s/networks' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_bulk_network(self, count, names):
-        network_list = list()
-        for i in range(count):
-            network_list.append({'name': names[i]})
-        post_body = {'networks': network_list}
-        body = json.dumps(post_body)
-        uri = '%s/networks' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_subnet(self, net_uuid, cidr, ip_version=4, **kwargs):
-        post_body = {'subnet': kwargs}
-        post_body['subnet']['ip_version'] = ip_version
-        post_body['subnet']['network_id'] = net_uuid
-        post_body['subnet']['cidr'] = cidr
-        body = json.dumps(post_body)
-        uri = '%s/subnets' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_port(self, network_id, **kwargs):
-        post_body = {
-            'port': {
-                'network_id': network_id,
-            }
-        }
-        for key, val in kwargs.items():
-            post_body['port'][key] = val
-        body = json.dumps(post_body)
-        uri = '%s/ports' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
+    def serialize_list(self, data, root=None, item=None):
+        return self.serialize(data)
 
     def update_quotas(self, tenant_id, **kwargs):
         put_body = {'quota': kwargs}
@@ -105,42 +63,6 @@
         resp, body = self.delete(uri)
         return resp, body
 
-    def update_subnet(self, subnet_id, new_name):
-        put_body = {
-            'subnet': {
-                'name': new_name,
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/subnets/%s' % (self.uri_prefix, subnet_id)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_port(self, port_id, new_name):
-        put_body = {
-            'port': {
-                'name': new_name,
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/ports/%s' % (self.uri_prefix, port_id)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_network(self, network_id, new_name):
-        put_body = {
-            "network": {
-                "name": new_name,
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/networks/%s' % (self.uri_prefix, network_id)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def create_router(self, name, admin_state_up=True, **kwargs):
         post_body = {'router': kwargs}
         post_body['router']['name'] = name
@@ -272,22 +194,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_bulk_subnet(self, subnet_list):
-        post_body = {'subnets': subnet_list}
-        body = json.dumps(post_body)
-        uri = '%s/subnets' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_bulk_port(self, port_list):
-        post_body = {'ports': port_list}
-        body = json.dumps(post_body)
-        uri = '%s/ports' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
         post_body = {
             "vip": {
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index 57b0ebb..f4a012f 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -156,3 +156,31 @@
             if name[:prefix_len] == prefix:
                 return method_functors[index](name[prefix_len:])
         raise AttributeError(name)
+
+    # Common methods that are hard to automate
+    def create_bulk_network(self, count, names):
+        network_list = list()
+        for i in range(count):
+            network_list.append({'name': names[i]})
+        post_data = {'networks': network_list}
+        body = self.serialize_list(post_data, "networks", "network")
+        uri = self.get_uri("networks")
+        resp, body = self.post(uri, body)
+        body = {'networks': self.deserialize_list(body)}
+        return resp, body
+
+    def create_bulk_subnet(self, subnet_list):
+        post_data = {'subnets': subnet_list}
+        body = self.serialize_list(post_data, 'subnets', 'subnet')
+        uri = self.get_uri('subnets')
+        resp, body = self.post(uri, body)
+        body = {'subnets': self.deserialize_list(body)}
+        return resp, body
+
+    def create_bulk_port(self, port_list):
+        post_data = {'ports': port_list}
+        body = self.serialize_list(post_data, 'ports', 'port')
+        uri = self.get_uri('ports')
+        resp, body = self.post(uri, body)
+        body = {'ports': self.deserialize_list(body)}
+        return resp, body
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
index ebb2d00..b8e39ad 100644
--- a/tempest/services/network/xml/network_client.py
+++ b/tempest/services/network/xml/network_client.py
@@ -33,6 +33,12 @@
         return RestClientXML(config, username, password,
                              auth_url, tenant_name)
 
+    def _parse_array(self, node):
+        array = []
+        for child in node.getchildren():
+            array.append(xml_to_json(child))
+        return array
+
     def deserialize_list(self, body):
         return parse_array(etree.fromstring(body), self.PLURALS)
 
@@ -44,84 +50,34 @@
         # expecting the dict with single key
         root = body.keys()[0]
         post_body = Element(root)
+        post_body.add_attr('xmlns:xsi',
+                           'http://www.w3.org/2001/XMLSchema-instance')
         for name, attr in body[root].items():
-            elt = Element(name, attr)
+            elt = self._get_element(name, attr)
             post_body.append(elt)
         return str(Document(post_body))
 
-    def create_network(self, name):
-        uri = '%s/networks' % (self.uri_prefix)
-        post_body = Element("network")
-        p2 = Element("name", name)
-        post_body.append(p2)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
+    def serialize_list(self, body, root_name=None, item_name=None):
+        # expecting dict in form
+        # body = {'resources': [res_dict1, res_dict2, ...]
+        post_body = Element(root_name)
+        post_body.add_attr('xmlns:xsi',
+                           'http://www.w3.org/2001/XMLSchema-instance')
+        for item in body[body.keys()[0]]:
+            elt = 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(Document(post_body))
 
-    def create_bulk_network(self, count, names):
-        uri = '%s/networks' % (self.uri_prefix)
-        post_body = Element("networks")
-        for i in range(count):
-                p1 = Element("network")
-                p2 = Element("name", names[i])
-                p1.append(p2)
-                post_body.append(p1)
-        resp, body = self.post(uri, str(Document(post_body)))
-        networks = parse_array(etree.fromstring(body))
-        networks = {"networks": networks}
-        return resp, networks
-
-    def create_subnet(self, net_uuid, cidr):
-        uri = '%s/subnets' % (self.uri_prefix)
-        subnet = Element("subnet")
-        p2 = Element("network_id", net_uuid)
-        p3 = Element("cidr", cidr)
-        p4 = Element("ip_version", 4)
-        subnet.append(p2)
-        subnet.append(p3)
-        subnet.append(p4)
-        resp, body = self.post(uri, str(Document(subnet)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_port(self, net_uuid, **kwargs):
-        uri = '%s/ports' % (self.uri_prefix)
-        port = Element("port")
-        p1 = Element('network_id', net_uuid)
-        port.append(p1)
-        for key, val in kwargs.items():
-            key = Element(key, val)
-            port.append(key)
-        resp, body = self.post(uri, str(Document(port)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_port(self, port_id, name):
-        uri = '%s/ports/%s' % (self.uri_prefix, str(port_id))
-        port = Element("port")
-        p2 = Element("name", name)
-        port.append(p2)
-        resp, body = self.put(uri, str(Document(port)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_subnet(self, subnet_id, name):
-        uri = '%s/subnets/%s' % (self.uri_prefix, str(subnet_id))
-        subnet = Element("subnet")
-        p2 = Element("name", name)
-        subnet.append(p2)
-        resp, body = self.put(uri, str(Document(subnet)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_network(self, net_id, name):
-        uri = '%s/networks/%s' % (self.uri_prefix, str(net_id))
-        network = Element("network")
-        p2 = Element("name", name)
-        network.append(p2)
-        resp, body = self.put(uri, str(Document(network)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
+    def _get_element(self, name, value):
+        if value is None:
+            xml_elem = Element(name)
+            xml_elem.add_attr("xsi:nil", "true")
+            return xml_elem
+        else:
+            return Element(name, value)
 
     def create_security_group(self, name):
         uri = '%s/security-groups' % (self.uri_prefix)
@@ -147,36 +103,6 @@
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
-    def create_bulk_subnet(self, subnet_list):
-        uri = '%s/subnets' % (self.uri_prefix)
-        post_body = Element("subnets")
-        for i in range(len(subnet_list)):
-            v = subnet_list[i]
-            p1 = Element("subnet")
-            for k, kv in v.iteritems():
-                p2 = Element(k, kv)
-                p1.append(p2)
-            post_body.append(p1)
-        resp, body = self.post(uri, str(Document(post_body)))
-        subnets = parse_array(etree.fromstring(body))
-        subnets = {"subnets": subnets}
-        return resp, subnets
-
-    def create_bulk_port(self, port_list):
-        uri = '%s/ports' % (self.uri_prefix)
-        post_body = Element("ports")
-        for i in range(len(port_list)):
-            v = port_list[i]
-            p1 = Element("port")
-            for k, kv in v.iteritems():
-                p2 = Element(k, kv)
-                p1.append(p2)
-            post_body.append(p1)
-        resp, body = self.post(uri, str(Document(post_body)))
-        ports = parse_array(etree.fromstring(body))
-        ports = {"ports": ports}
-        return resp, ports
-
     def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
         uri = '%s/lb/vips' % (self.uri_prefix)
         post_body = Element("vip")
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index e796f9b..a6f47b7 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -33,9 +33,7 @@
         HEAD on the storage URL
         Returns all account metadata headers
         """
-
-        headers = {"X-Storage-Token": self.token}
-        resp, body = self.head('', headers=headers)
+        resp, body = self.head('')
         return resp, body
 
     def create_account_metadata(self, metadata,
@@ -54,7 +52,7 @@
         Deletes an account metadata entry.
         """
 
-        headers = {"X-Storage-Token": self.token}
+        headers = {}
         for item in metadata:
             headers[metadata_prefix + item] = 'x'
         resp, body = self.post('', headers=headers, body=None)
@@ -63,8 +61,8 @@
     def list_account_containers(self, params=None):
         """
         GET on the (base) storage URL
-        Given the X-Storage-URL and a valid X-Auth-Token, returns
-        a list of all containers for the account.
+        Given valid X-Auth-Token, returns a list of all containers for the
+        account.
 
         Optional Arguments:
         limit=[integer value N]
@@ -93,6 +91,14 @@
         body = json.loads(body)
         return resp, body
 
+    def list_extensions(self):
+        _base_url = self.base_url
+        self.base_url = "/".join(self.base_url.split("/")[:-2])
+        resp, body = self.get('info')
+        self.base_url = _base_url
+        body = json.loads(body)
+        return resp, body
+
 
 class AccountClientCustomizedHeader(RestClient):
 
@@ -127,8 +133,8 @@
     def list_account_containers(self, params=None, metadata=None):
         """
         GET on the (base) storage URL
-        Given the X-Storage-URL and a valid X-Auth-Token, returns
-        a list of all containers for the account.
+        Given a valid X-Auth-Token, returns a list of all containers for the
+        account.
 
         Optional Arguments:
         limit=[integer value N]
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index 15185bc..cbd07bf 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -82,8 +82,7 @@
         Retrieves container metadata headers
         """
         url = str(container_name)
-        headers = {"X-Storage-Token": self.token}
-        resp, body = self.head(url, headers=headers)
+        resp, body = self.head(url)
         return resp, body
 
     def list_all_container_objects(self, container, params=None):
diff --git a/tempest/services/compute/v3/xml/__init__.py b/tempest/services/telemetry/__init__.py
similarity index 100%
copy from tempest/services/compute/v3/xml/__init__.py
copy to tempest/services/telemetry/__init__.py
diff --git a/tempest/services/compute/v3/xml/__init__.py b/tempest/services/telemetry/json/__init__.py
similarity index 100%
copy from tempest/services/compute/v3/xml/__init__.py
copy to tempest/services/telemetry/json/__init__.py
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
new file mode 100644
index 0000000..8d46bf3
--- /dev/null
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -0,0 +1,52 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# 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 tempest.common.rest_client import RestClient
+from tempest.openstack.common import jsonutils as json
+import tempest.services.telemetry.telemetry_client_base as client
+
+
+class TelemetryClientJSON(client.TelemetryClientBase):
+
+    def get_rest_client(self, config, username,
+                        password, auth_url, tenant_name=None):
+        return RestClient(config, username, password, auth_url, tenant_name)
+
+    def deserialize(self, body):
+        return json.loads(body.replace("\n", ""))
+
+    def serialize(self, body):
+        return json.dumps(body)
+
+    def create_alarm(self, **kwargs):
+        uri = "%s/alarms" % self.uri_prefix
+        return self.post(uri, kwargs)
+
+    def add_sample(self, sample_list, meter_name, meter_unit, volume,
+                   sample_type, resource_id, **kwargs):
+        sample = {"counter_name": meter_name, "counter_unit": meter_unit,
+                  "counter_volume": volume, "counter_type": sample_type,
+                  "resource_id": resource_id}
+        for key in kwargs:
+            sample[key] = kwargs[key]
+
+        sample_list.append(self.serialize(sample))
+        return sample_list
+
+    def create_sample(self, meter_name, sample_list):
+        uri = "%s/meters/%s" % (self.uri_prefix, meter_name)
+        return self.post(uri, str(sample_list))
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
new file mode 100644
index 0000000..59127b9
--- /dev/null
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -0,0 +1,133 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# 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 abc
+import six
+import urllib
+
+
+@six.add_metaclass(abc.ABCMeta)
+class TelemetryClientBase(object):
+
+    """
+    Tempest REST client for Ceilometer V2 API.
+    Implements the following basic Ceilometer abstractions:
+    resources
+    meters
+    alarms
+    queries
+    statistics
+    """
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        self.rest_client = self.get_rest_client(config, username, password,
+                                                auth_url, tenant_name)
+        self.rest_client.service = \
+            self.rest_client.config.telemetry.catalog_type
+        self.headers = self.rest_client.headers
+        self.version = '2'
+        self.uri_prefix = "v%s" % self.version
+
+    @abc.abstractmethod
+    def get_rest_client(self, config, username, password,
+                        auth_url, tenant_name):
+        """
+        :param config:
+        :param username:
+        :param password:
+        :param auth_url:
+        :param tenant_name:
+        :return: RestClient
+        """
+
+    @abc.abstractmethod
+    def deserialize(self, body):
+        """
+        :param body:
+        :return: Deserialize body
+        """
+
+    @abc.abstractmethod
+    def serialize(self, body):
+        """
+        :param body:
+        :return: Serialize body
+        """
+
+    def post(self, uri, body):
+        body = self.serialize(body)
+        resp, body = self.rest_client.post(uri, body, self.headers)
+        body = self.deserialize(body)
+        return resp, body
+
+    def put(self, uri, body):
+        return self.rest_client.put(uri, body, self.headers)
+
+    def get(self, uri):
+        resp, body = self.rest_client.get(uri)
+        body = self.deserialize(body)
+        return resp, body
+
+    def delete(self, uri):
+        resp, body = self.rest_client.delete(uri)
+        if body:
+            body = self.deserialize(body)
+        return resp, body
+
+    def helper_list(self, uri, query=None, period=None):
+        uri_dict = {}
+        if query:
+            uri_dict = {'q.field': query[0],
+                        'q.op': query[1],
+                        'q.value': query[2]}
+        if period:
+            uri_dict['period'] = period
+        if uri_dict:
+            uri += "?%s" % urllib.urlencode(uri_dict)
+        return self.get(uri)
+
+    def list_resources(self):
+        uri = '%s/resources' % self.uri_prefix
+        return self.get(uri)
+
+    def list_meters(self):
+        uri = '%s/meters' % self.uri_prefix
+        return self.get(uri)
+
+    def list_alarms(self):
+        uri = '%s/alarms' % self.uri_prefix
+        return self.get(uri)
+
+    def list_statistics(self, meter, period=None, query=None):
+        uri = "%s/meters/%s/statistics" % (self.uri_prefix, meter)
+        return self.helper_list(uri, query, period)
+
+    def list_samples(self, meter_id, query=None):
+        uri = '%s/meters/%s' % (self.uri_prefix, meter_id)
+        return self.helper_list(uri, query)
+
+    def get_resource(self, resource_id):
+        uri = '%s/resources/%s' % (self.uri_prefix, resource_id)
+        return self.get(uri)
+
+    def get_alarm(self, alarm_id):
+        uri = '%s/meter/%s' % (self.uri_prefix, alarm_id)
+        return self.get(uri)
+
+    def delete_alarm(self, alarm_id):
+        uri = "%s/alarms/%s" % (self.uri_prefix, alarm_id)
+        return self.delete(uri)
diff --git a/tempest/services/compute/v3/xml/__init__.py b/tempest/services/telemetry/xml/__init__.py
similarity index 100%
rename from tempest/services/compute/v3/xml/__init__.py
rename to tempest/services/telemetry/xml/__init__.py
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
new file mode 100644
index 0000000..245ccb5
--- /dev/null
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -0,0 +1,42 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# 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.rest_client import RestClientXML
+from tempest.services.compute.xml.common import Document
+from tempest.services.compute.xml.common import xml_to_json
+import tempest.services.telemetry.telemetry_client_base as client
+
+
+class TelemetryClientXML(client.TelemetryClientBase):
+
+    def get_rest_client(self, config, username,
+                        password, auth_url, tenant_name=None):
+        return RestClientXML(config, username, password, auth_url, tenant_name)
+
+    def _parse_array(self, body):
+        array = []
+        for child in body.getchildren():
+            array.append(xml_to_json(child))
+        return array
+
+    def serialize(self, body):
+        return str(Document(body))
+
+    def deserialize(self, body):
+        return self._parse_array(etree.fromstring(body))
diff --git a/tempest/stress/run_stress.py b/tempest/stress/run_stress.py
index 61fb58f..76320d0 100755
--- a/tempest/stress/run_stress.py
+++ b/tempest/stress/run_stress.py
@@ -19,7 +19,11 @@
 import json
 import sys
 from testtools.testsuite import iterate_tests
-from unittest import loader
+try:
+    from unittest import loader
+except ImportError:
+    # unittest in python 2.6 does not contain loader, so uses unittest2
+    from unittest2 import loader
 
 from tempest.openstack.common import log as logging
 from tempest.stress import driver
diff --git a/tempest/test_discover/test_discover.py b/tempest/test_discover/test_discover.py
index 87fdbdc..3fbb8e1 100644
--- a/tempest/test_discover/test_discover.py
+++ b/tempest/test_discover/test_discover.py
@@ -13,7 +13,12 @@
 #    under the License.
 
 import os
-import unittest
+import sys
+
+if sys.version_info >= (2, 7):
+    import unittest
+else:
+    import unittest2 as unittest
 
 
 def load_tests(loader, tests, pattern):
diff --git a/tempest/tests/base.py b/tempest/tests/base.py
index 3654f64..15e4311 100644
--- a/tempest/tests/base.py
+++ b/tempest/tests/base.py
@@ -15,6 +15,7 @@
 import os
 
 import fixtures
+import mock
 import testtools
 
 from tempest.openstack.common.fixture import moxstubout
@@ -36,3 +37,22 @@
         mox_fixture = self.useFixture(moxstubout.MoxStubout())
         self.mox = mox_fixture.mox
         self.stubs = mox_fixture.stubs
+
+    def patch(self, target, **kwargs):
+        """
+        Returns a started `mock.patch` object for the supplied target.
+
+        The caller may then call the returned patcher to create a mock object.
+
+        The caller does not need to call stop() on the returned
+        patcher object, as this method automatically adds a cleanup
+        to the test class to stop the patcher.
+
+        :param target: String module.class or module.object expression to patch
+        :param **kwargs: Passed as-is to `mock.patch`. See mock documentation
+                         for details.
+        """
+        p = mock.patch(target, **kwargs)
+        m = p.start()
+        self.addCleanup(p.stop)
+        return m
diff --git a/tempest/tests/test_ssh.py b/tempest/tests/test_ssh.py
new file mode 100644
index 0000000..09bb588
--- /dev/null
+++ b/tempest/tests/test_ssh.py
@@ -0,0 +1,200 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2014 OpenStack Foundation
+#
+#    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 contextlib
+import socket
+
+import mock
+import testtools
+
+from tempest.common import ssh
+from tempest import exceptions
+from tempest.tests import base
+
+
+class TestSshClient(base.TestCase):
+
+    def test_pkey_calls_paramiko_RSAKey(self):
+        with contextlib.nested(
+            mock.patch('paramiko.RSAKey.from_private_key'),
+            mock.patch('cStringIO.StringIO')) as (rsa_mock, cs_mock):
+            cs_mock.return_value = mock.sentinel.csio
+            pkey = 'mykey'
+            ssh.Client('localhost', 'root', pkey=pkey)
+            rsa_mock.assert_called_once_with(mock.sentinel.csio)
+            cs_mock.assert_called_once_with('mykey')
+            rsa_mock.reset_mock()
+            cs_mock.rest_mock()
+            pkey = mock.sentinel.pkey
+            # Shouldn't call out to load a file from RSAKey, since
+            # a sentinel isn't a basestring...
+            ssh.Client('localhost', 'root', pkey=pkey)
+            rsa_mock.assert_not_called()
+            cs_mock.assert_not_called()
+
+    def test_get_ssh_connection(self):
+        c_mock = self.patch('paramiko.SSHClient')
+        aa_mock = self.patch('paramiko.AutoAddPolicy')
+        s_mock = self.patch('time.sleep')
+        t_mock = self.patch('time.time')
+
+        aa_mock.return_value = mock.sentinel.aa
+
+        def reset_mocks():
+            aa_mock.reset_mock()
+            c_mock.reset_mock()
+            s_mock.reset_mock()
+            t_mock.reset_mock()
+
+        # Test normal case for successful connection on first try
+        client_mock = mock.MagicMock()
+        c_mock.return_value = client_mock
+        client_mock.connect.return_value = True
+
+        client = ssh.Client('localhost', 'root', timeout=2)
+        client._get_ssh_connection(sleep=1)
+
+        aa_mock.assert_called_once_with()
+        client_mock.set_missing_host_key_policy.assert_called_once_with(
+            mock.sentinel.aa)
+        expected_connect = [mock.call(
+            'localhost',
+            username='root',
+            pkey=None,
+            key_filename=None,
+            look_for_keys=False,
+            timeout=10.0,
+            password=None
+        )]
+        self.assertEqual(expected_connect, client_mock.connect.mock_calls)
+        s_mock.assert_not_called()
+        t_mock.assert_called_once_with()
+
+        reset_mocks()
+
+        # Test case when connection fails on first two tries and
+        # succeeds on third try (this validates retry logic)
+        client_mock.connect.side_effect = [socket.error, socket.error, True]
+        t_mock.side_effect = [
+            1000,  # Start time
+            1001,  # Sleep loop 1
+            1002   # Sleep loop 2
+        ]
+
+        client._get_ssh_connection(sleep=1)
+
+        expected_sleeps = [
+            mock.call(1),
+            mock.call(1.01)
+        ]
+        self.assertEqual(expected_sleeps, s_mock.mock_calls)
+
+        reset_mocks()
+
+        # Test case when connection fails on first three tries and
+        # exceeds the timeout, so expect to raise a Timeout exception
+        client_mock.connect.side_effect = [
+            socket.error,
+            socket.error,
+            socket.error
+        ]
+        t_mock.side_effect = [
+            1000,  # Start time
+            1001,  # Sleep loop 1
+            1002,  # Sleep loop 2
+            1003,  # Sleep loop 3
+            1004  # LOG.error() calls time.time()
+        ]
+
+        with testtools.ExpectedException(exceptions.SSHTimeout):
+            client._get_ssh_connection()
+
+    def test_exec_command(self):
+        gsc_mock = self.patch('tempest.common.ssh.Client._get_ssh_connection')
+        ito_mock = self.patch('tempest.common.ssh.Client._is_timed_out')
+        select_mock = self.patch('select.poll')
+
+        client_mock = mock.MagicMock()
+        tran_mock = mock.MagicMock()
+        chan_mock = mock.MagicMock()
+        poll_mock = mock.MagicMock()
+
+        def reset_mocks():
+            gsc_mock.reset_mock()
+            ito_mock.reset_mock()
+            select_mock.reset_mock()
+            poll_mock.reset_mock()
+            client_mock.reset_mock()
+            tran_mock.reset_mock()
+            chan_mock.reset_mock()
+
+        select_mock.return_value = poll_mock
+        gsc_mock.return_value = client_mock
+        ito_mock.return_value = True
+        client_mock.get_transport.return_value = tran_mock
+        tran_mock.open_session.return_value = chan_mock
+        poll_mock.poll.side_effect = [
+            [0, 0, 0]
+        ]
+
+        # Test for a timeout condition immediately raised
+        client = ssh.Client('localhost', 'root', timeout=2)
+        with testtools.ExpectedException(exceptions.TimeoutException):
+            client.exec_command("test")
+
+        chan_mock.fileno.assert_called_once_with()
+        chan_mock.exec_command.assert_called_once_with("test")
+        chan_mock.shutdown_write.assert_called_once_with()
+
+        SELECT_POLLIN = 1
+        poll_mock.register.assert_called_once_with(chan_mock, SELECT_POLLIN)
+        poll_mock.poll.assert_called_once_with(10)
+
+        # Test for proper reading of STDOUT and STDERROR and closing
+        # of all file descriptors.
+
+        reset_mocks()
+
+        select_mock.return_value = poll_mock
+        gsc_mock.return_value = client_mock
+        ito_mock.return_value = False
+        client_mock.get_transport.return_value = tran_mock
+        tran_mock.open_session.return_value = chan_mock
+        poll_mock.poll.side_effect = [
+            [1, 0, 0]
+        ]
+        closed_prop = mock.PropertyMock(return_value=True)
+        type(chan_mock).closed = closed_prop
+        chan_mock.recv_exit_status.return_value = 0
+        chan_mock.recv.return_value = ''
+        chan_mock.recv_stderr.return_value = ''
+
+        client = ssh.Client('localhost', 'root', timeout=2)
+        client.exec_command("test")
+
+        chan_mock.fileno.assert_called_once_with()
+        chan_mock.exec_command.assert_called_once_with("test")
+        chan_mock.shutdown_write.assert_called_once_with()
+
+        SELECT_POLLIN = 1
+        poll_mock.register.assert_called_once_with(chan_mock, SELECT_POLLIN)
+        poll_mock.poll.assert_called_once_with(10)
+        chan_mock.recv_ready.assert_called_once_with()
+        chan_mock.recv.assert_called_once_with(1024)
+        chan_mock.recv_stderr_ready.assert_called_once_with()
+        chan_mock.recv_stderr.assert_called_once_with(1024)
+        chan_mock.recv_exit_status.assert_called_once_with()
+        closed_prop.assert_called_once_with()
diff --git a/tools/install_venv.py b/tools/install_venv.py
index a7fb5ee..e41ca43 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -1,7 +1,7 @@
 # Copyright 2010 United States Government as represented by the
 # Administrator of the National Aeronautics and Space Administration.
 # All Rights Reserved.
-# flake8: noqa
+#
 # Copyright 2010 OpenStack Foundation
 # Copyright 2013 IBM Corp.
 #
@@ -17,66 +17,55 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-"""Installation script for Tempest's development virtualenv."""
-
 import os
 import sys
 
-import install_venv_common as install_venv
+import install_venv_common as install_venv  # noqa
 
 
-class CentOS(install_venv.Fedora):
-    """This covers CentOS."""
-
-    def post_process(self):
-        if not self.check_pkg('openssl-devel'):
-            self.yum.install('openssl-devel', check_exit_code=False)
-
-
-def print_help():
-    """This prints Help."""
-
+def print_help(venv, root):
     help = """
-    Tempest development environment setup is complete.
+    Openstack development environment setup is complete.
 
-    Tempest development uses virtualenv to track and manage Python dependencies
-    while in development and testing.
+    Openstack development uses virtualenv to track and manage Python
+    dependencies while in development and testing.
 
-    To activate the Tempest virtualenv for the extent of your current shell
+    To activate the Openstack virtualenv for the extent of your current shell
     session you can run:
 
-    $ source .venv/bin/activate
+    $ source %s/bin/activate
 
     Or, if you prefer, you can run commands in the virtualenv on a case by case
     basis by running:
 
-    $ tools/with_venv.sh <your command>
+    $ %s/tools/with_venv.sh <your command>
 
     Also, make test will automatically use the virtualenv.
     """
-    print(help)
+    print(help % (venv, root))
 
 
 def main(argv):
     root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+
+    if os.environ.get('tools_path'):
+        root = os.environ['tools_path']
     venv = os.path.join(root, '.venv')
+    if os.environ.get('venv'):
+        venv = os.environ['venv']
+
     pip_requires = os.path.join(root, 'requirements.txt')
     test_requires = os.path.join(root, 'test-requirements.txt')
     py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
     project = 'Tempest'
     install = install_venv.InstallVenv(root, venv, pip_requires, test_requires,
                                        py_version, project)
-    if os.path.exists('/etc/redhat-release'):
-        with open('/etc/redhat-release') as rh_release:
-            if 'CentOS' in rh_release.read():
-                install_venv.Fedora = CentOS
     options = install.parse_args(argv)
     install.check_python_version()
     install.check_dependencies()
     install.create_virtualenv(no_site_packages=options.no_site_packages)
     install.install_dependencies()
-    install.post_process()
-    print_help()
+    print_help(venv, root)
 
 if __name__ == '__main__':
     main(sys.argv)
diff --git a/tools/verify_tempest_config.py b/tools/verify_tempest_config.py
index f56b475..b393402 100755
--- a/tools/verify_tempest_config.py
+++ b/tools/verify_tempest_config.py
@@ -14,20 +14,17 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import json
 import sys
 
+import httplib2
+
 from tempest import clients
 from tempest import config
 
 
 CONF = config.CONF
-
-#Dicts matching extension names to config options
-NOVA_EXTENSIONS = {
-    'disk_config': 'DiskConfig',
-    'change_password': 'ServerPassword',
-    'flavor_extra': 'FlavorExtraSpecs'
-}
+RAW_HTTP = httplib2.Http()
 
 
 def verify_glance_api_versions(os):
@@ -42,33 +39,102 @@
             not CONF.image_feature_enabled.api_v2))
 
 
-def verify_extensions(os):
-    results = {}
-    extensions_client = os.extensions_client
+def verify_nova_api_versions(os):
+    # Check nova api versions
+    os.servers_client._set_auth()
+    v2_endpoint = os.servers_client.base_url
+    endpoint = 'http://' + v2_endpoint.split('/')[2]
+    __, body = RAW_HTTP.request(endpoint, 'GET')
+    body = json.loads(body)
+    versions = map(lambda x: x['id'], body['versions'])
+    if CONF.compute_feature_enabled.api_v3 != ('v3.0' in versions):
+        print('Config option compute api_v3 should be change to: %s' % (
+              not CONF.compute_feature_enabled.api_v3))
+
+
+def get_extension_client(os, service):
+    extensions_client = {
+        'nova': os.extensions_client,
+        'nova_v3': os.extensions_v3_client,
+        'cinder': os.volumes_extension_client,
+        'neutron': os.network_client,
+    }
+    if service not in extensions_client:
+        print('No tempest extensions client for %s' % service)
+        exit(1)
+    return extensions_client[service]
+
+
+def get_enabled_extensions(service):
+    extensions_options = {
+        'nova': CONF.compute_feature_enabled.api_extensions,
+        'nova_v3': CONF.compute_feature_enabled.api_v3_extensions,
+        'cinder': CONF.volume_feature_enabled.api_extensions,
+        'neutron': CONF.network_feature_enabled.api_extensions,
+    }
+    if service not in extensions_options:
+        print('No supported extensions list option for %s' % service)
+        exit(1)
+    return extensions_options[service]
+
+
+def verify_extensions(os, service, results):
+    extensions_client = get_extension_client(os, service)
     __, resp = extensions_client.list_extensions()
-    resp = resp['extensions']
-    extensions = map(lambda x: x['name'], resp)
-    results['nova_features'] = {}
-    for extension in NOVA_EXTENSIONS.keys():
-        if NOVA_EXTENSIONS[extension] in extensions:
-            results['nova_features'][extension] = True
+    if isinstance(resp, dict):
+        # Neutron's extension 'name' field has is not a single word (it has
+        # spaces in the string) Since that can't be used for list option the
+        # api_extension option in the network-feature-enabled group uses alias
+        # instead of name.
+        if service == 'neutron':
+            extensions = map(lambda x: x['alias'], resp['extensions'])
         else:
-            results['nova_features'][extension] = False
+            extensions = map(lambda x: x['name'], resp['extensions'])
+
+    else:
+        extensions = map(lambda x: x['name'], resp)
+    if not results.get(service):
+        results[service] = {}
+    extensions_opt = get_enabled_extensions(service)
+    if extensions_opt[0] == 'all':
+        results[service]['extensions'] = 'all'
+        return results
+    # Verify that all configured extensions are actually enabled
+    for extension in extensions_opt:
+        results[service][extension] = extension in extensions
+    # Verify that there aren't additional extensions enabled that aren't
+    # specified in the config list
+    for extension in extensions:
+        if extension not in extensions_opt:
+            results[service][extension] = False
     return results
 
 
 def display_results(results):
-    for option in NOVA_EXTENSIONS.keys():
-        config_value = getattr(CONF.compute_feature_enabled, option)
-        if config_value != results['nova_features'][option]:
-            print("Config option: %s should be changed to: %s" % (
-                option, not config_value))
+    for service in results:
+        # If all extensions are specified as being enabled there is no way to
+        # verify this so we just assume this to be true
+        if results[service].get('extensions'):
+            continue
+        extension_list = get_enabled_extensions(service)
+        for extension in results[service]:
+            if not results[service][extension]:
+                if extension in extension_list:
+                    print("%s extension: %s should not be included in the list"
+                          " of enabled extensions" % (service, extension))
+                else:
+                    print("%s extension: %s should be included in the list of "
+                          "enabled extensions" % (service, extension))
 
 
 def main(argv):
+    print('Running config verification...')
     os = clients.ComputeAdminManager(interface='json')
-    results = verify_extensions(os)
+    results = {}
+    for service in ['nova', 'nova_v3', 'cinder', 'neutron']:
+        results = verify_extensions(os, service, results)
     verify_glance_api_versions(os)
+    verify_nova_api_versions(os)
     display_results(results)
 
 
