diff --git a/HACKING.rst b/HACKING.rst
index 1566b2f..c0df0fb 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -11,6 +11,7 @@
 - [T102] Cannot import OpenStack python clients in tempest/api tests
 - [T104] Scenario tests require a services decorator
 - [T105] Unit tests cannot use setUpClass
+- [T106] vim configuration should not be kept in source files.
 
 Test Data/Configuration
 -----------------------
diff --git a/README.rst b/README.rst
index bff2bf8..9daf873 100644
--- a/README.rst
+++ b/README.rst
@@ -118,3 +118,15 @@
 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.
+
+Python 2.6
+----------
+
+Tempest can be run with Python 2.6 however the unit tests and the gate
+currently only run with Python 2.7, so there are no guarantees about the state
+of tempest when running with Python 2.6. Additionally, to enable testr to work
+with tempest using python 2.6 the discover module from the unittest-ext
+project has to be patched to switch the unittest.TestSuite to use
+unittest2.TestSuite instead. See::
+
+https://code.google.com/p/unittest-ext/issues/detail?id=79
diff --git a/doc/source/conf.py b/doc/source/conf.py
index e5444ae..bd4e553 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -30,7 +30,7 @@
               'sphinx.ext.intersphinx',
               'sphinx.ext.todo',
               'sphinx.ext.viewcode',
-              'oslo.sphinx'
+              'oslosphinx'
              ]
 
 todo_include_todos = True
diff --git a/etc/schemas/compute/flavors/flavor_details.json b/etc/schemas/compute/flavors/flavor_details.json
index d1c1077..c16075c 100644
--- a/etc/schemas/compute/flavors/flavor_details.json
+++ b/etc/schemas/compute/flavors/flavor_details.json
@@ -2,5 +2,7 @@
     "name": "get-flavor-details",
     "http-method": "GET",
     "url": "flavors/%s",
-    "resources": ["flavor"]
+    "resources": [
+        {"name": "flavor", "expected_result": 404}
+    ]
 }
diff --git a/etc/schemas/compute/flavors/flavor_details_v3.json b/etc/schemas/compute/flavors/flavor_details_v3.json
new file mode 100644
index 0000000..d1c1077
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavor_details_v3.json
@@ -0,0 +1,6 @@
+{
+    "name": "get-flavor-details",
+    "http-method": "GET",
+    "url": "flavors/%s",
+    "resources": ["flavor"]
+}
diff --git a/etc/schemas/compute/flavors/flavors_list_v3.json b/etc/schemas/compute/flavors/flavors_list_v3.json
new file mode 100644
index 0000000..d5388b3
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavors_list_v3.json
@@ -0,0 +1,24 @@
+{
+    "name": "list-flavors-with-detail",
+    "http-method": "GET",
+    "url": "flavors/detail",
+    "json-schema": {
+        "type": "object",
+        "properties": {
+            "min_ram": {
+                "type": "integer",
+                "results": {
+                    "gen_none": 400,
+                    "gen_string": 400
+                }
+            },
+            "min_disk": {
+                "type": "integer",
+                "results": {
+                    "gen_none": 400,
+                    "gen_string": 400
+                }
+            }
+        }
+    }
+}
diff --git a/etc/schemas/compute/servers/get_console_output.json b/etc/schemas/compute/servers/get_console_output.json
index 7c3860f..8d974ba 100644
--- a/etc/schemas/compute/servers/get_console_output.json
+++ b/etc/schemas/compute/servers/get_console_output.json
@@ -2,7 +2,9 @@
     "name": "get-console-output",
     "http-method": "POST",
     "url": "servers/%s/action",
-    "resources": ["server"],
+    "resources": [
+        {"name":"server", "expected_result": 404}
+    ],
     "json-schema": {
         "type": "object",
         "properties": {
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index fe4959b..0f18f5e 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -261,6 +261,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the compute service. (string
+# value)
+#endpoint_type=publicURL
+
 # Catalog type of the Compute v3 service. (string value)
 #catalog_v3_type=computev3
 
@@ -316,6 +320,10 @@
 # If false, skip disk config tests (boolean value)
 #disk_config=true
 
+# A list of enabled compute extensions with a special entry
+# all which indicates every extension is enabled (list value)
+#api_extensions=all
+
 # A list of enabled v3 extensions with a special entry all
 # which indicates every extension is enabled (list value)
 #api_v3_extensions=all
@@ -407,6 +415,10 @@
 # one is used. (string value)
 #region=RegionOne
 
+# The endpoint type to use for the identity service. (string
+# value)
+#endpoint_type=publicURL
+
 # Username to use for Nova API requests. (string value)
 #username=demo
 
@@ -453,6 +465,12 @@
 # enabled (boolean value)
 #trust=true
 
+# Is the v2 identity API enabled (boolean value)
+#api_v2=true
+
+# Is the v3 identity API enabled (boolean value)
+#api_v3=true
+
 
 [image]
 
@@ -469,6 +487,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the image service. (string
+# value)
+#endpoint_type=publicURL
+
 # http accessible image (string value)
 #http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz
 
@@ -524,13 +546,27 @@
 # value)
 #region=
 
-# The cidr block to allocate tenant networks from (string
+# The endpoint type to use for the network service. (string
+# value)
+#endpoint_type=publicURL
+
+# The cidr block to allocate tenant ipv4 subnets from (string
 # value)
 #tenant_network_cidr=10.100.0.0/16
 
-# The mask bits for tenant networks (integer value)
+# The mask bits for tenant ipv4 subnets (integer value)
 #tenant_network_mask_bits=28
 
+# Allow the execution of IPv6 tests (boolean value)
+#ipv6_enabled=true
+
+# The cidr block to allocate tenant ipv6 subnets from (string
+# value)
+#tenant_network_v6_cidr=2003::/64
+
+# The mask bits for tenant ipv6 subnets (integer value)
+#tenant_network_v6_mask_bits=96
+
 # Whether tenant network connectivity should be evaluated
 # directly (boolean value)
 #tenant_networks_reachable=false
@@ -550,16 +586,8 @@
 # Options defined in tempest.config
 #
 
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
-#api_extensions=all
-
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
-#api_extensions=all
-
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
+# A list of enabled network extensions with a special entry
+# all which indicates every extension is enabled (list value)
 #api_extensions=all
 
 
@@ -578,6 +606,10 @@
 # (string value)
 #region=
 
+# The endpoint type to use for the object-store service.
+# (string value)
+#endpoint_type=publicURL
+
 # Number of seconds to time on waiting for a container to
 # container synchronization complete. (integer value)
 #container_sync_timeout=120
@@ -618,6 +650,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the orchestration service.
+# (string value)
+#endpoint_type=publicURL
+
 # Time in seconds between build status checks. (integer value)
 #build_interval=1
 
@@ -651,6 +687,9 @@
 # Directory containing image files (string value)
 #img_dir=/opt/stack/new/devstack/files/images/cirros-0.3.1-x86_64-uec
 
+# QCOW2 image file name (string value)
+#qcow2_img_file=cirros-0.3.1-x86_64-disk.img
+
 # AMI image file name (string value)
 #ami_img_file=cirros-0.3.1-x86_64-blank.img
 
@@ -757,6 +796,11 @@
 # value)
 #leave_dirty_stack=false
 
+# Allows a full cleaning process after a stress test. Caution
+# : this cleanup will remove every objects of every tenant.
+# (boolean value)
+#full_clean_stack=false
+
 
 [telemetry]
 
@@ -791,6 +835,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the volume service. (string
+# value)
+#endpoint_type=publicURL
+
 # Name of the backend1 (must be declared in cinder.conf)
 # (string value)
 #backend1_name=BACKEND_1
@@ -822,7 +870,17 @@
 # (boolean value)
 #multi_backend=false
 
+# Runs Cinder volumes backup test (boolean value)
+#backup=true
+
+# A list of enabled volume extensions with a special entry all
+# which indicates every extension is enabled (list value)
+#api_extensions=all
+
 # Is the v1 volume API enabled (boolean value)
 #api_v1=true
 
+# Is the v2 volume API enabled (boolean value)
+#api_v2=true
+
 
diff --git a/requirements.txt b/requirements.txt
index 8c0f872..8573a2e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,6 +14,7 @@
 python-neutronclient>=2.3.3,<3
 python-cinderclient>=1.0.6
 python-heatclient>=0.2.3
+python-savannaclient>=0.4.1
 python-swiftclient>=1.5
 testresources>=0.2.4
 keyring>=1.6.1,<2.0,>=2.1
diff --git a/run_tests.sh b/run_tests.sh
index eaa7fd7..cb6a5df 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -98,6 +98,8 @@
       echo "Running flake8 without virtual env may miss OpenStack HACKING detection" >&2
   fi
   ${wrapper} flake8
+  export MODULEPATH=tempest.common.generate_sample_tempest
+  ${wrapper} tools/config/check_uptodate.sh
 }
 
 if [ $never_venv -eq 0 ]
diff --git a/setup.cfg b/setup.cfg
index 23a97ff..79f538f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -21,3 +21,6 @@
 all_files = 1
 build-dir = doc/build
 source-dir = doc/source
+
+[wheel]
+universal = 1
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 18e4452..283a45a 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -29,7 +29,6 @@
     def setUpClass(cls):
         super(AZAdminTestJSON, cls).setUpClass()
         cls.client = cls.os_adm.availability_zone_client
-        cls.non_adm_client = cls.availability_zone_client
 
     @attr(type='gate')
     def test_get_availability_zone_list(self):
@@ -46,14 +45,6 @@
         self.assertEqual(200, resp.status)
         self.assertTrue(len(availability_zone) > 0)
 
-    @attr(type='gate')
-    def test_get_availability_zone_list_with_non_admin_user(self):
-        # List of availability zone with non-administrator user
-        resp, availability_zone = \
-            self.non_adm_client.get_availability_zone_list()
-        self.assertEqual(200, resp.status)
-        self.assertTrue(len(availability_zone) > 0)
-
 
 class AZAdminTestXML(AZAdminTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 252f4be..3e13bf8 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -172,7 +172,6 @@
                 flag = True
         self.assertTrue(flag)
 
-    @test.skip_because(bug="1209101")
     @test.attr(type='gate')
     def test_list_non_public_flavor(self):
         # Create a flavor with os-flavor-access:is_public false should
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index d4a32e6..81b0328 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -25,7 +25,6 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminTestJSON, cls).setUpClass()
-        cls.client = cls.os.quotas_client
         cls.adm_client = cls.os_adm.quotas_client
 
         # NOTE(afazekas): these test cases should always create and use a new
@@ -45,7 +44,7 @@
     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'])
-        resp, quota_set = self.client.get_default_quota_set(
+        resp, quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(sorted(expected_quota_set),
@@ -55,7 +54,7 @@
     @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(
+        resp, default_quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         new_quota_set = {'injected_file_content_bytes': 20480,
                          'metadata_items': 256, 'injected_files': 10,
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index d3696a1..4c4acd4 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -49,7 +49,7 @@
     @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)
+        resp, quota_set = self.adm_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
 
@@ -64,7 +64,7 @@
     @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)
+        resp, quota_set = self.adm_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
 
@@ -79,7 +79,7 @@
     @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)
+        resp, quota_set = self.adm_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
 
@@ -96,7 +96,7 @@
     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)
+        resp, quota_set = self.adm_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
 
@@ -121,7 +121,7 @@
         # 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)
+        resp, quota_set = self.adm_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
 
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 2cee78a..03b041c 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -15,8 +15,7 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 
 class ServersAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -25,6 +24,7 @@
     Tests Servers API using admin privileges
     """
 
+    _host_key = 'OS-EXT-SRV-ATTR:host'
     _interface = 'json'
 
     @classmethod
@@ -54,7 +54,7 @@
             flavor_id = data_utils.rand_int_id(start=1000)
         return flavor_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin(self):
         # Listing servers by admin user returns empty list by default
         resp, body = self.client.list_servers_with_detail()
@@ -62,7 +62,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual([], servers)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_error_status(self):
         # Filter the list of servers by server error status
         params = {'status': 'error'}
@@ -78,7 +78,7 @@
         self.assertIn(self.s1_id, map(lambda x: x['id'], servers))
         self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin_with_all_tenants(self):
         # Listing servers by admin user with all tenants parameter
         # Here should be listed all servers
@@ -90,15 +90,42 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
+    def test_list_servers_filter_by_exist_host(self):
+        # Filter the list of servers by existent host
+        name = data_utils.rand_name('server')
+        flavor = self.flavor_ref
+        image_id = self.image_ref
+        resp, test_server = self.client.create_server(
+            name, image_id, flavor)
+        self.assertEqual('202', resp['status'])
+        self.addCleanup(self.client.delete_server, test_server['id'])
+        self.client.wait_for_server_status(test_server['id'], 'ACTIVE')
+        resp, server = self.client.get_server(test_server['id'])
+        self.assertEqual(server['status'], 'ACTIVE')
+        hostname = server[self._host_key]
+        params = {'host': hostname}
+        resp, body = self.client.list_servers(params)
+        self.assertEqual('200', resp['status'])
+        servers = body['servers']
+        nonexistent_params = {'host': 'nonexistent_host'}
+        resp, nonexistent_body = self.client.list_servers(
+            nonexistent_params)
+        self.assertEqual('200', resp['status'])
+        nonexistent_servers = nonexistent_body['servers']
+        self.assertIn(test_server['id'], map(lambda x: x['id'], servers))
+        self.assertNotIn(test_server['id'],
+                         map(lambda x: x['id'], nonexistent_servers))
+
+    @test.attr(type='gate')
     def test_admin_delete_servers_of_others(self):
         # Administrator can delete servers of others
-        _, server = self.create_test_server()
+        _, server = self.create_test_server(wait_until='ACTIVE')
         resp, _ = self.client.delete_server(server['id'])
         self.assertEqual('204', resp['status'])
         self.servers_client.wait_for_server_termination(server['id'])
 
-    @attr(type='gate')
+    @test.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')
@@ -110,7 +137,7 @@
         resp, _ = self.client.delete_server(server['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
@@ -128,8 +155,8 @@
         resp, server = self.client.get_server(self.s1_id)
         self.assertEqual(server['status'], 'ACTIVE')
 
-    @attr(type='gate')
-    @skip_because(bug="1240043")
+    @test.attr(type='gate')
+    @test.skip_because(bug="1240043")
     def test_get_server_diagnostics_by_admin(self):
         # Retrieve server diagnostics by admin user
         resp, diagnostic = self.client.get_server_diagnostics(self.s1_id)
@@ -140,12 +167,12 @@
         for key in basic_attrs:
             self.assertIn(key, str(diagnostic.keys()))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_error_state(self):
         # The server in error state should be rebuilt using the provided
         # image and changed to ACTIVE state
 
-        # resetting vm state require admin priviledge
+        # resetting vm state require admin privilege
         resp, server = self.client.reset_state(self.s1_id, state='error')
         self.assertEqual(202, resp.status)
         resp, rebuilt_server = self.non_admin_client.rebuild(
@@ -170,4 +197,6 @@
 
 
 class ServersAdminTestXML(ServersAdminTestJSON):
+    _host_key = (
+        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 16dcfcc..ac800fb 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -30,7 +30,6 @@
     def setUpClass(cls):
         super(ServicesAdminTestJSON, cls).setUpClass()
         cls.client = cls.os_adm.services_client
-        cls.non_admin_client = cls.services_client
 
     @attr(type='gate')
     def test_list_services(self):
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index fd069e7..72bb723 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -51,6 +51,7 @@
         cls.servers = []
         cls.images = []
         cls.multi_user = cls.get_multi_user()
+        cls.security_groups = []
 
     @classmethod
     def get_multi_user(cls):
@@ -102,9 +103,25 @@
                 pass
 
     @classmethod
+    def clear_security_groups(cls):
+        for sg in cls.security_groups:
+            try:
+                resp, body =\
+                    cls.security_groups_client.delete_security_group(sg['id'])
+            except exceptions.NotFound:
+                # The security group may have already been deleted which is OK.
+                pass
+            except Exception as exc:
+                LOG.info('Exception raised deleting security group %s',
+                         sg['id'])
+                LOG.exception(exc)
+                pass
+
+    @classmethod
     def tearDownClass(cls):
         cls.clear_images()
         cls.clear_servers()
+        cls.clear_security_groups()
         cls.clear_isolated_creds()
         super(BaseComputeTest, cls).tearDownClass()
 
@@ -146,6 +163,19 @@
 
         return resp, body
 
+    @classmethod
+    def create_security_group(cls, name=None, description=None):
+        if name is None:
+            name = data_utils.rand_name(cls.__name__ + "-securitygroup")
+        if description is None:
+            description = data_utils.rand_name('description-')
+        resp, body = \
+            cls.security_groups_client.create_security_group(name,
+                                                             description)
+        cls.security_groups.append(body)
+
+        return resp, body
+
     def wait_for(self, condition):
         """Repeatedly calls condition() until a timeout."""
         start_time = int(time.time())
@@ -296,11 +326,8 @@
         cls.extensions_client = cls.os.extensions_v3_client
         cls.availability_zone_client = cls.os.availability_zone_v3_client
         cls.interfaces_client = cls.os.interfaces_v3_client
-        cls.instance_usages_audit_log_client = \
-            cls.os.instance_usages_audit_log_v3_client
         cls.hypervisor_client = cls.os.hypervisor_v3_client
         cls.keypairs_client = cls.os.keypairs_v3_client
-        cls.tenant_usages_client = cls.os.tenant_usages_v3_client
         cls.volumes_client = cls.os.volumes_client
         cls.certificates_client = cls.os.certificates_v3_client
         cls.keypairs_client = cls.os.keypairs_v3_client
@@ -372,13 +399,10 @@
 
         cls.os_adm = os_adm
         cls.servers_admin_client = cls.os_adm.servers_v3_client
-        cls.instance_usages_audit_log_admin_client = \
-            cls.os_adm.instance_usages_audit_log_v3_client
         cls.services_admin_client = cls.os_adm.services_v3_client
         cls.availability_zone_admin_client = \
             cls.os_adm.availability_zone_v3_client
         cls.hypervisor_admin_client = cls.os_adm.hypervisor_v3_client
-        cls.tenant_usages_admin_client = cls.os_adm.tenant_usages_v3_client
         cls.flavors_admin_client = cls.os_adm.flavors_v3_client
         cls.aggregates_admin_client = cls.os_adm.aggregates_v3_client
         cls.hosts_admin_client = cls.os_adm.hosts_v3_client
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 56bd291..ea785b3 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -14,9 +14,9 @@
 #    under the License.
 
 from tempest.api.compute.floating_ips import base
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
@@ -44,7 +44,7 @@
         resp, body = cls.client.delete_floating_ip(cls.floating_ip_id)
         super(FloatingIPsTestJSON, cls).tearDownClass()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_allocate_floating_ip(self):
         # Positive test:Allocation of a new floating IP to a project
         # should be successful
@@ -59,7 +59,7 @@
         resp, body = self.client.list_floating_ips()
         self.assertIn(floating_ip_details, body)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_floating_ip(self):
         # Positive test:Deletion of valid floating IP from project
         # should be successful
@@ -74,7 +74,7 @@
         # Check it was really deleted.
         self.client.wait_for_resource_deletion(floating_ip_body['id'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_disassociate_floating_ip(self):
         # Positive test:Associate and disassociate the provided floating IP
         # to a specific server should be successful
@@ -90,12 +90,12 @@
             self.server_id)
         self.assertEqual(202, resp.status)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_already_associated_floating_ip(self):
         # positive test:Association of an already associated floating IP
         # to specific server should change the association of the Floating IP
         # Create server so as to use for Multiple association
-        new_name = rand_name('floating_server')
+        new_name = data_utils.rand_name('floating_server')
         resp, body = self.create_test_server(name=new_name)
         self.servers_client.wait_for_server_status(body['id'], 'ACTIVE')
         self.new_server_id = body['id']
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 4cc36c9..8964dcf 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -13,11 +13,10 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -36,18 +35,6 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def tearDown(self):
         """Terminate test instances created after a test is executed."""
         for image_id in self.image_ids:
@@ -62,7 +49,7 @@
         self.image_ids.append(image_id)
         return resp, body
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_deleted_server(self):
         # An image should not be created if the server instance is removed
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -77,7 +64,7 @@
                           self.__create_image__,
                           server['id'], name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_invalid_server(self):
         # An image should not be created with invalid server id
         # Create a new image with invalid server id
@@ -88,7 +75,7 @@
         self.assertRaises(exceptions.NotFound, self.__create_image__,
                           '!@#$%^&*()', name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_stopped_server(self):
         resp, server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.stop(server['id'])
@@ -103,7 +90,7 @@
         self.addCleanup(self.client.delete_image, image['id'])
         self.assertEqual(snapshot_name, image['name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_saving_image(self):
         snapshot_name = data_utils.rand_name('test-snap-')
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -114,7 +101,7 @@
         resp, body = self.client.delete_image(image['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_35_characters_or_less(self):
         # Return an error if Image ID passed is 35 characters or less
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -122,7 +109,7 @@
         self.assertRaises(exceptions.NotFound, self.client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_37_characters_or_more(self):
         # Return an error if Image ID passed is 37 characters or more
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -130,13 +117,13 @@
         self.assertRaises(exceptions.NotFound, self.client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_with_invalid_image_id(self):
         # An image should not be deleted with invalid image id
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           '!@$%^&*()')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_non_existent_image(self):
         # Return an error while trying to delete a non-existent image
 
@@ -144,24 +131,24 @@
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           non_existent_image_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_blank_id(self):
         # Return an error while trying to delete an image with blank Id
         self.assertRaises(exceptions.NotFound, self.client.delete_image, '')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_non_hex_string_id(self):
         # Return an error while trying to delete an image with non hex id
         image_id = '11a22b9-120q-5555-cc11-00ab112223gj'
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           image_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_negative_image_id(self):
         # Return an error while trying to delete an image with negative id
         self.assertRaises(exceptions.NotFound, self.client.delete_image, -1)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_id_is_over_35_character_limit(self):
         # Return an error while trying to delete image with id over limit
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 8d60623..7d5593d 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -16,11 +16,10 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -29,13 +28,6 @@
 class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
-    def tearDown(self):
-        """Terminate test instances created after a test is executed."""
-        for image_id in self.image_ids:
-            self.client.delete_image(image_id)
-            self.image_ids.remove(image_id)
-        super(ImagesOneServerTestJSON, self).tearDown()
-
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
@@ -66,27 +58,13 @@
             cls.tearDownClass()
             raise
 
-        cls.image_ids = []
-
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def _get_default_flavor_disk_size(self, flavor_id):
         resp, flavor = self.flavors_client.get_flavor_details(flavor_id)
         return flavor['disk']
 
     @testtools.skipUnless(CONF.compute_feature_enabled.create_image,
                           'Environment unable to create images.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_delete_image(self):
 
         # Create a new image
@@ -117,7 +95,7 @@
         self.assertEqual('204', resp['status'])
         self.client.wait_for_resource_deletion(image_id)
 
-    @attr(type=['gate'])
+    @test.attr(type=['gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         if self.__class__._interface == "xml":
             # NOTE(sdague): not entirely accurage, but we'd need a ton of work
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index c96c4a4..82955d8 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -15,13 +15,11 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -73,20 +71,8 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
-    @skip_because(bug="1006725")
-    @attr(type=['negative', 'gate'])
+    @test.skip_because(bug="1006725")
+    @test.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")
@@ -98,7 +84,7 @@
                           self.client.create_image, self.server_id,
                           invalid_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_invalid_metadata(self):
         # Return an error when creating image with invalid metadata
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -106,7 +92,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_metadata_over_limits(self):
         # Return an error when creating image with meta data over 256 chars
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -114,7 +100,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_second_image_when_first_image_is_being_saved(self):
         # Disallow creating another image when first image is being saved
 
@@ -132,7 +118,7 @@
         self.assertRaises(exceptions.Conflict, self.client.create_image,
                           self.server_id, alt_snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_name_over_256_chars(self):
         # Return an error if snapshot name over 256 characters is passed
 
@@ -140,7 +126,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_that_is_not_yet_active(self):
         # Return an error while trying to delete an image what is creating
 
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index f82143e..9cff3a8 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -15,9 +15,8 @@
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -34,7 +33,6 @@
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
         cls.client = cls.images_client
-        cls.image_ids = []
 
         try:
             resp, cls.server1 = cls.create_test_server()
@@ -64,13 +62,7 @@
             cls.tearDownClass()
             raise
 
-    @attr(type=['negative', 'gate'])
-    def test_get_image_not_existing(self):
-        # Check raises a NotFound
-        self.assertRaises(exceptions.NotFound, self.client.get_image,
-                          "nonexistingimageid")
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_status(self):
         # The list of images should contain only images with the
         # provided status
@@ -81,7 +73,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_name(self):
         # List of all images should contain the expected images filtered
         # by name
@@ -92,7 +84,7 @@
         self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_server_id(self):
         # The images should contain images filtered by server id
         params = {'server': self.server1['id']}
@@ -104,7 +96,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_server_ref(self):
         # The list of servers should be filtered by server ref
         server_links = self.server2['links']
@@ -121,7 +113,7 @@
             self.assertTrue(any([i for i in images
                                  if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_type(self):
         # The list of servers should be filtered by image type
         params = {'type': 'snapshot'}
@@ -132,7 +124,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_limit_results(self):
         # Verify only the expected number of results are returned
         params = {'limit': '1'}
@@ -141,7 +133,7 @@
         # ref: Question #224349
         self.assertEqual(1, len([x for x in images if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_changes_since(self):
         # Verify only updated images are returned in the detailed list
 
@@ -152,7 +144,7 @@
         found = any([i for i in images if i['id'] == self.image3_id])
         self.assertTrue(found)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_status(self):
         # Detailed list of all images should only contain images
         # with the provided status
@@ -163,7 +155,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_name(self):
         # Detailed list of all images should contain the expected
         # images filtered by name
@@ -174,7 +166,7 @@
         self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_limit_results(self):
         # Verify only the expected number of results (with full details)
         # are returned
@@ -182,7 +174,7 @@
         resp, images = self.client.list_images_with_detail(params)
         self.assertEqual(1, len(images))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_server_ref(self):
         # Detailed list of servers should be filtered by server ref
         server_links = self.server2['links']
@@ -199,7 +191,7 @@
             self.assertTrue(any([i for i in images
                                  if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_type(self):
         # The detailed list of servers should be filtered by image type
         params = {'type': 'snapshot'}
@@ -211,7 +203,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_changes_since(self):
         # Verify an update image is returned
 
@@ -221,11 +213,6 @@
         resp, images = self.client.list_images_with_detail(params)
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
 
-    @attr(type=['negative', 'gate'])
-    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/images/test_list_image_filters_negative.py b/tempest/api/compute/images/test_list_image_filters_negative.py
new file mode 100644
index 0000000..3b19d3c
--- /dev/null
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -0,0 +1,44 @@
+# 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 ListImageFiltersNegativeTestJSON(base.BaseV2ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(ListImageFiltersNegativeTestJSON, cls).setUpClass()
+        if not CONF.service_available.glance:
+            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
+            raise cls.skipException(skip_msg)
+        cls.client = cls.images_client
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_nonexistent_image(self):
+        # Check raises a NotFound
+        nonexistent_image = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound, self.client.get_image,
+                          nonexistent_image)
+
+
+class ListImageFiltersNegativeTestXML(ListImageFiltersNegativeTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index 375105e..17bb489 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -14,9 +14,8 @@
 #    under the License.
 
 from tempest.api.compute.security_groups import base
-from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -30,17 +29,13 @@
         cls.client = cls.security_groups_client
         cls.neutron_available = CONF.service_available.neutron
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_create(self):
         # Positive test: Creation of Security Group rule
         # should be successful
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        securitygroup_id = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, securitygroup_id)
+        resp, security_group = self.create_security_group()
+        securitygroup_id = security_group['id']
         # Adding rules to the created Security Group
         ip_protocol = 'tcp'
         from_port = 22
@@ -53,7 +48,7 @@
         self.addCleanup(self.client.delete_security_group_rule, rule['id'])
         self.assertEqual(200, resp.status)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_create_with_optional_arguments(self):
         # Positive test: Creation of Security Group rule
         # with optional arguments
@@ -62,19 +57,11 @@
         secgroup1 = None
         secgroup2 = None
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        secgroup1 = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, secgroup1)
+        resp, security_group = self.create_security_group()
+        secgroup1 = security_group['id']
         # Creating a Security Group so as to assign group_id to the rule
-        s_name2 = data_utils.rand_name('securitygroup-')
-        s_description2 = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name2, s_description2)
-        secgroup2 = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, secgroup2)
+        resp, security_group = self.create_security_group()
+        secgroup2 = security_group['id']
         # Adding rules to the created Security Group with optional arguments
         parent_group_id = secgroup1
         ip_protocol = 'tcp'
@@ -92,18 +79,13 @@
         self.addCleanup(self.client.delete_security_group_rule, rule['id'])
         self.assertEqual(200, resp.status)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_list(self):
         # Positive test: Created Security Group rules should be
         # in the list of all rules
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        securitygroup_id = securitygroup['id']
-        # Delete the Security Group at the end of this method
-        self.addCleanup(self.client.delete_security_group, securitygroup_id)
+        resp, security_group = self.create_security_group()
+        securitygroup_id = security_group['id']
 
         # Add a first rule to the created Security Group
         ip_protocol1 = 'tcp'
@@ -135,29 +117,21 @@
         self.assertTrue(any([i for i in rules if i['id'] == rule1_id]))
         self.assertTrue(any([i for i in rules if i['id'] == rule2_id]))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_delete_when_peer_group_deleted(self):
         # Positive test:rule will delete when peer group deleting
         # Creating a Security Group to add rules to it
-        s1_name = data_utils.rand_name('securitygroup1-')
-        s1_description = data_utils.rand_name('description1-')
-        resp, sg1 = \
-            self.client.create_security_group(s1_name, s1_description)
-        self.addCleanup(self.client.delete_security_group, sg1['id'])
-        self.assertEqual(200, resp.status)
+        resp, security_group = self.create_security_group()
+        sg1_id = security_group['id']
         # Creating other Security Group to access to group1
-        s2_name = data_utils.rand_name('securitygroup2-')
-        s2_description = data_utils.rand_name('description2-')
-        resp, sg2 = \
-            self.client.create_security_group(s2_name, s2_description)
-        self.assertEqual(200, resp.status)
-        sg2_id = sg2['id']
+        resp, security_group = self.create_security_group()
+        sg2_id = security_group['id']
         # Adding rules to the Group1
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 22
         resp, rule = \
-            self.client.create_security_group_rule(sg1['id'],
+            self.client.create_security_group_rule(sg1_id,
                                                    ip_protocol,
                                                    from_port,
                                                    to_port,
@@ -169,7 +143,7 @@
         self.assertEqual(202, resp.status)
         # Get rules of the Group1
         resp, rules = \
-            self.client.list_security_group_rules(sg1['id'])
+            self.client.list_security_group_rules(sg1_id)
         # The group1 has no rules because group2 has deleted
         self.assertEqual(0, len(rules))
 
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index 4831939..680bc2f 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -19,8 +19,7 @@
 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
+from tempest import test
 
 CONF = config.CONF
 
@@ -33,9 +32,9 @@
         super(SecurityGroupRulesNegativeTestJSON, cls).setUpClass()
         cls.client = cls.security_groups_client
 
-    @skip_because(bug="1182384",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'smoke'])
+    @test.skip_because(bug="1182384",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_non_existent_id(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with non existent Parent group id
@@ -50,7 +49,7 @@
 
     @testtools.skipIf(CONF.service_available.neutron,
                       "Neutron not check the security_group_id")
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_id(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with Parent group id which is not integer
@@ -63,21 +62,17 @@
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_duplicate(self):
         # Negative test: Create Security Group rule duplicate should fail
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, sg = self.client.create_security_group(s_name, s_description)
-        self.assertEqual(200, resp.status)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
         parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 22
 
-        self.addCleanup(self.client.delete_security_group, sg['id'])
         resp, rule = \
             self.client.create_security_group_rule(parent_group_id,
                                                    ip_protocol,
@@ -90,86 +85,70 @@
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_ip_protocol(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid ip_protocol
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = data_utils.rand_name('999')
         from_port = 22
         to_port = 22
 
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_from_port(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid from_port
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = data_utils.rand_int_id(start=65536)
         to_port = 22
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_to_port(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid to_port
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = data_utils.rand_int_id(start=65536)
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_port_range(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid port range.
         # Creating a Security Group to add rule to it.
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding a rule to the created Security Group
-        secgroup_id = securitygroup['id']
+        secgroup_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 21
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           secgroup_id, ip_protocol, from_port, to_port)
 
-    @skip_because(bug="1182384",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'smoke'])
+    @test.skip_because(bug="1182384",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type=['negative', 'smoke'])
     def test_delete_security_group_rule_with_non_existent_id(self):
         # Negative test: Deletion of Security Group rule should be FAIL
         # with non existent id
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 2c67581..b376edc 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -27,68 +27,43 @@
         super(SecurityGroupsTestJSON, cls).setUpClass()
         cls.client = cls.security_groups_client
 
-    def _delete_security_group(self, securitygroup_id):
-        resp, _ = self.client.delete_security_group(securitygroup_id)
-        self.assertEqual(202, resp.status)
-
     @test.attr(type='gate')
     def test_security_groups_create_list_delete(self):
         # Positive test:Should return the list of Security Groups
         # Create 3 Security Groups
-        security_group_list = list()
         for i in range(3):
-            s_name = data_utils.rand_name('securitygroup-')
-            s_description = data_utils.rand_name('description-')
-            resp, securitygroup = \
-                self.client.create_security_group(s_name, s_description)
+            resp, securitygroup = self.create_security_group()
             self.assertEqual(200, resp.status)
-            self.addCleanup(self._delete_security_group,
-                            securitygroup['id'])
-            security_group_list.append(securitygroup)
         # Fetch all Security Groups and verify the list
         # has all created Security Groups
         resp, fetched_list = self.client.list_security_groups()
         self.assertEqual(200, resp.status)
         # Now check if all the created Security Groups are in fetched list
         missing_sgs = \
-            [sg for sg in security_group_list if sg not in fetched_list]
+            [sg for sg in self.security_groups if sg not in fetched_list]
         self.assertFalse(missing_sgs,
                          "Failed to find Security Group %s in fetched "
                          "list" % ', '.join(m_group['name']
                                             for m_group in missing_sgs))
-
-    # TODO(afazekas): scheduled for delete,
-    # test_security_group_create_get_delete covers it
-    @test.attr(type='gate')
-    def test_security_group_create_delete(self):
-        # Security Group should be created, verified and deleted
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        self.assertIn('id', securitygroup)
-        securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
-        self.assertEqual(200, resp.status)
-        self.assertFalse(securitygroup_id is None)
-        self.assertIn('name', securitygroup)
-        securitygroup_name = securitygroup['name']
-        self.assertEqual(securitygroup_name, s_name,
-                         "The created Security Group name is "
-                         "not equal to the requested name")
+        # Delete all security groups
+        for sg in self.security_groups:
+            resp, _ = self.client.delete_security_group(sg['id'])
+            self.assertEqual(202, resp.status)
+            self.client.wait_for_resource_deletion(sg['id'])
+        # Now check if all the created Security Groups are deleted
+        resp, fetched_list = self.client.list_security_groups()
+        deleted_sgs = \
+            [sg for sg in self.security_groups if sg in fetched_list]
+        self.assertFalse(deleted_sgs,
+                         "Failed to delete Security Group %s "
+                         "list" % ', '.join(m_group['name']
+                                            for m_group in deleted_sgs))
 
     @test.attr(type='gate')
     def test_security_group_create_get_delete(self):
         # Security Group should be created, fetched and deleted
         s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        self.addCleanup(self._delete_security_group,
-                        securitygroup['id'])
-
-        self.assertEqual(200, resp.status)
+        resp, securitygroup = self.create_security_group(name=s_name)
         self.assertIn('name', securitygroup)
         securitygroup_name = securitygroup['name']
         self.assertEqual(securitygroup_name, s_name,
@@ -108,15 +83,8 @@
         # and not deleted if the server is active.
         # Create a couple security groups that we will use
         # for the server resource this test creates
-        sg_name = data_utils.rand_name('sg')
-        sg_desc = data_utils.rand_name('sg-desc')
-        resp, sg = self.client.create_security_group(sg_name, sg_desc)
-        sg_id = sg['id']
-
-        sg2_name = data_utils.rand_name('sg')
-        sg2_desc = data_utils.rand_name('sg-desc')
-        resp, sg2 = self.client.create_security_group(sg2_name, sg2_desc)
-        sg2_id = sg2['id']
+        resp, sg = self.create_security_group()
+        resp, sg2 = self.create_security_group()
 
         # Create server and add the security group created
         # above to the server we just created
@@ -125,50 +93,44 @@
         server_id = server['id']
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         resp, body = self.servers_client.add_security_group(server_id,
-                                                            sg_name)
+                                                            sg['name'])
 
         # Check that we are not able to delete the security
         # group since it is in use by an active server
         self.assertRaises(exceptions.BadRequest,
                           self.client.delete_security_group,
-                          sg_id)
+                          sg['id'])
 
         # Reboot and add the other security group
         resp, body = self.servers_client.reboot(server_id, 'HARD')
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         resp, body = self.servers_client.add_security_group(server_id,
-                                                            sg2_name)
+                                                            sg2['name'])
 
         # Check that we are not able to delete the other security
         # group since it is in use by an active server
         self.assertRaises(exceptions.BadRequest,
                           self.client.delete_security_group,
-                          sg2_id)
+                          sg2['id'])
 
         # Shutdown the server and then verify we can destroy the
         # security groups, since no active server instance is using them
         self.servers_client.delete_server(server_id)
         self.servers_client.wait_for_server_termination(server_id)
 
-        self.client.delete_security_group(sg_id)
+        self.client.delete_security_group(sg['id'])
         self.assertEqual(202, resp.status)
-
-        self.client.delete_security_group(sg2_id)
+        self.client.delete_security_group(sg2['id'])
         self.assertEqual(202, resp.status)
 
     @test.attr(type='gate')
     def test_update_security_groups(self):
         # Update security group name and description
         # Create a security group
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update the name and description
         s_new_name = data_utils.rand_name('sg-hth-')
         s_new_des = data_utils.rand_name('description-hth-')
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index ce1eada..edf38e9 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -33,10 +33,6 @@
         cls.client = cls.security_groups_client
         cls.neutron_available = CONF.service_available.neutron
 
-    def _delete_security_group(self, securitygroup_id):
-        resp, _ = self.client.delete_security_group(securitygroup_id)
-        self.assertEqual(202, resp.status)
-
     def _generate_a_non_existent_security_group_id(self):
         security_group_id = []
         resp, body = self.client.list_security_groups()
@@ -107,11 +103,8 @@
         s_name = data_utils.rand_name('securitygroup-')
         s_description = data_utils.rand_name('description-')
         resp, security_group =\
-            self.client.create_security_group(s_name, s_description)
+            self.create_security_group(s_name, s_description)
         self.assertEqual(200, resp.status)
-
-        self.addCleanup(self.client.delete_security_group,
-                        security_group['id'])
         # Now try the Security Group with the same 'Name'
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group, s_name,
@@ -163,15 +156,10 @@
     @test.attr(type=['negative', 'gate'])
     def test_update_security_group_with_invalid_sg_name(self):
         # Update security_group with invalid sg_name should fail
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update Security Group with group name longer than 255 chars
         s_new_name = 'securitygroup-'.ljust(260, '0')
         self.assertRaises(exceptions.BadRequest,
@@ -183,15 +171,10 @@
     @test.attr(type=['negative', 'gate'])
     def test_update_security_group_with_invalid_sg_des(self):
         # Update security_group with invalid sg_des should fail
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update Security Group with group description longer than 255 chars
         s_new_des = 'des-'.ljust(260, '0')
         self.assertRaises(exceptions.BadRequest,
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
new file mode 100644
index 0000000..748ba41
--- /dev/null
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -0,0 +1,42 @@
+# 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 import test
+
+
+class AZTestJSON(base.BaseV2ComputeTest):
+
+    """
+    Tests Availability Zone API List
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(AZTestJSON, cls).setUpClass()
+        cls.client = cls.availability_zone_client
+
+    @test.attr(type='gate')
+    def test_get_availability_zone_list_with_non_admin_user(self):
+        # List of availability zone with non-administrator user
+        resp, availability_zone = self.client.get_availability_zone_list()
+        self.assertEqual(200, resp.status)
+        self.assertTrue(len(availability_zone) > 0)
+
+
+class AZTestXML(AZTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 887608f..f705308 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -20,9 +20,9 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -54,14 +54,14 @@
         cls.client.wait_for_server_status(cls.server_initial['id'], 'ACTIVE')
         resp, cls.server = cls.client.get_server(cls.server_initial['id'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_server_response(self):
         # Check that the required fields are returned with values
         self.assertEqual(202, self.resp.status)
         self.assertTrue(self.server_initial['id'] is not None)
         self.assertTrue(self.server_initial['adminPass'] is not None)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_verify_server_details(self):
         # Verify the specified server attributes are set correctly
         self.assertEqual(self.accessIPv4, self.server['accessIPv4'])
@@ -74,7 +74,7 @@
         self.assertEqual(self.flavor_ref, self.server['flavor']['id'])
         self.assertEqual(self.meta, self.server['metadata'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_servers(self):
         # The created server should be in the list of all servers
         resp, body = self.client.list_servers()
@@ -82,7 +82,7 @@
         found = any([i for i in servers if i['id'] == self.server['id']])
         self.assertTrue(found)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_servers_with_detail(self):
         # The created server should be in the detailed list of all servers
         resp, body = self.client.list_servers_with_detail()
@@ -91,19 +91,21 @@
         self.assertTrue(found)
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_verify_created_server_vcpus(self):
         # Verify that the number of vcpus reported by the instance matches
         # the amount stated by the flavor
         resp, flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
+                                                  self.password)
         self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_host_name_is_same_as_server_name(self):
         # Verify the instance host name is the same as the server name
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
+                                                  self.password)
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
 
@@ -136,7 +138,7 @@
         resp, cls.server = cls.client.get_server(cls.server_initial['id'])
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_verify_created_server_ephemeral_disk(self):
         # Verify that the ephemeral disk is created when creating server
 
@@ -196,12 +198,12 @@
                                       adminPass=admin_pass,
                                       flavor=flavor_with_eph_disk_id))
         # Get partition number of server without extra specs.
-        linux_client = RemoteClient(server_no_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_no_eph_disk,
+                                                  self.ssh_user, self.password)
         partition_num = len(linux_client.get_partitions())
 
-        linux_client = RemoteClient(server_with_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_with_eph_disk,
+                                                  self.ssh_user, self.password)
         self.assertEqual(partition_num + 1, linux_client.get_partitions())
 
 
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
new file mode 100644
index 0000000..6a9b996
--- /dev/null
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -0,0 +1,85 @@
+# 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 import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class DeleteServersTestJSON(base.BaseV2ComputeTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances"
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersTestJSON, cls).setUpClass()
+        cls.client = cls.servers_client
+
+    @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')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_delete_active_server(self):
+        # Delete a server while it's VM state is Active
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @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_shelved_state(self):
+        # Delete a server while it's VM state is Shelved
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.shelve_server(server['id'])
+        self.assertEqual(202, resp.status)
+
+        offload_time = CONF.compute.shelved_offload_time
+        if offload_time >= 0:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED_OFFLOADED',
+                                               extra_timeout=offload_time)
+        else:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+
+class DeleteServersTestXML(DeleteServersTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 15b7b9e..fc0bb9f 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -18,8 +18,7 @@
 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
+from tempest import test
 
 CONF = config.CONF
 
@@ -74,7 +73,7 @@
         cls.fixed_network_name = CONF.compute.fixed_network_name
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_image(self):
         # Filter the list of servers by image
         params = {'image': self.image_ref}
@@ -85,7 +84,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_flavor(self):
         # Filter the list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -96,7 +95,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_name(self):
         # Filter the list of servers by server name
         params = {'name': self.s1_name}
@@ -107,7 +106,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_status(self):
         # Filter the list of servers by server status
         params = {'status': 'active'}
@@ -118,7 +117,7 @@
         self.assertIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_shutoff_status(self):
         # Filter the list of servers by server shutoff status
         params = {'status': 'shutoff'}
@@ -135,7 +134,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertNotIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 1}
@@ -143,14 +142,14 @@
         # when _interface='xml', one element for servers_links in servers
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_zero_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 0}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(0, len(servers['servers']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_exceed_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 100000}
@@ -160,7 +159,7 @@
                          len([x for x in servers['servers'] if 'id' in x]))
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
         # Filter the detailed list of servers by image
         params = {'image': self.image_ref}
@@ -171,7 +170,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_flavor(self):
         # Filter the detailed list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -182,7 +181,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_name(self):
         # Filter the detailed list of servers by server name
         params = {'name': self.s1_name}
@@ -193,7 +192,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_status(self):
         # Filter the detailed list of servers by server status
         params = {'status': 'active'}
@@ -205,7 +204,7 @@
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
         self.assertEqual(['ACTIVE'] * 3, [x['status'] for x in servers])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_name_wildcard(self):
         # List all servers that contains '-instance' in name
         params = {'name': '-instance'}
@@ -227,8 +226,8 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1170718")
-    @attr(type='gate')
+    @test.skip_because(bug="1170718")
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip(self):
         # Filter servers by ip
         # Here should be listed 1 server
@@ -242,9 +241,9 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1182883",
-                  condition=CONF.service_available.neutron)
-    @attr(type='gate')
+    @test.skip_because(bug="1182883",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip_regex(self):
         # Filter servers by regex ip
         # List all servers filtered by part of ip address.
@@ -259,7 +258,7 @@
         self.assertIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_limit_results(self):
         # Verify only the expected number of detailed results are returned
         params = {'limit': 1}
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index f113047..adf522b 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -20,11 +20,10 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -53,7 +52,7 @@
 
     @testtools.skipUnless(CONF.compute_feature_enabled.change_password,
                           'Change password not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_change_server_password(self):
         # The server's password should be set to the provided password
         new_password = 'Newpass1234'
@@ -64,16 +63,18 @@
         if self.run_ssh:
             # Verify that the user can authenticate with the new password
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, new_password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      new_password)
             linux_client.validate_authentication()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_reboot_server_hard(self):
         # The server should be power cycled
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -82,19 +83,21 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertTrue(new_boot_time > boot_time,
                             '%s > %s' % (new_boot_time, boot_time))
 
-    @skip_because(bug="1014647")
-    @attr(type='smoke')
+    @test.skip_because(bug="1014647")
+    @test.attr(type='smoke')
     def test_reboot_server_soft(self):
         # The server should be signaled to reboot gracefully
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'SOFT')
@@ -103,12 +106,13 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertTrue(new_boot_time > boot_time,
                             '%s > %s' % (new_boot_time, boot_time))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_rebuild_server(self):
         # The server should be rebuilt using the provided image and data
         meta = {'rebuild': 'server'}
@@ -140,10 +144,11 @@
 
         if self.run_ssh:
             # Verify that the user can authenticate with the provided password
-            linux_client = RemoteClient(server, self.ssh_user, password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      password)
             linux_client.validate_authentication()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_stop_state(self):
         # The server in stop state  should be rebuilt using the provided
         # image and remain in SHUTOFF state
@@ -181,7 +186,7 @@
         return current_flavor, new_flavor_ref
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_resize_server_confirm(self):
         # The server's RAM and disk space should be modified to that of
         # the provided flavor
@@ -200,7 +205,7 @@
         self.assertEqual(new_flavor_ref, server['flavor']['id'])
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_resize_server_revert(self):
         # The server's RAM and disk space should return to its original
         # values after a resize is reverted
@@ -228,7 +233,7 @@
                 required time (%s s).' % (self.server_id, self.build_timeout)
                 raise exceptions.TimeoutException(message)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
@@ -313,7 +318,7 @@
         lines = len(output.split('\n'))
         self.assertEqual(lines, 10)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id and number of lines
@@ -329,7 +334,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output_server_id_in_shutoff_status(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id in SHUTOFF status
@@ -346,7 +351,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_pause_unpause_server(self):
         resp, server = self.client.pause_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -355,7 +360,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_suspend_resume_server(self):
         resp, server = self.client.suspend_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -364,7 +369,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_shelve_unshelve_server(self):
         resp, server = self.client.shelve_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -389,7 +394,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_stop_start_server(self):
         resp, server = self.servers_client.stop(self.server_id)
         self.assertEqual(202, resp.status)
@@ -398,7 +403,7 @@
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_lock_unlock_server(self):
         # Lock the server,try server stop(exceptions throw),unlock it and retry
         resp, server = self.servers_client.lock_server(self.server_id)
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index 8e432c4..d5528c4 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -14,8 +14,11 @@
 #    under the License.
 
 from tempest.api.compute import base
+from tempest import config
 from tempest import test
 
+CONF = config.CONF
+
 
 class ServerAddressesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
@@ -29,6 +32,8 @@
 
         resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
 
+    @test.skip_because(bug="1210483",
+                       condition=CONF.service_available.neutron)
     @test.attr(type='smoke')
     def test_list_server_addresses(self):
         # All public and private addresses for
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 203832e..7167a8b 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -104,38 +104,6 @@
         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')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
-    def test_delete_active_server(self):
-        # Delete a server while it's VM state is Active
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
     def test_create_server_with_ipv6_addr_only(self):
         # Create a server without an IPv4 address(only IPv6 address).
         resp, server = self.create_test_server(accessIPv6='2001:2001::3')
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index fcd055b..1df4159 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -13,14 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import random
-import string
 
 import testtools
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -65,14 +62,6 @@
             if host != target_host:
                 return target_host
 
-    def _get_non_existing_host_name(self):
-        random_name = ''.join(
-            random.choice(string.ascii_uppercase) for x in range(20))
-
-        self.assertNotIn(random_name, self._get_compute_hostnames())
-
-        return random_name
-
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
@@ -110,18 +99,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @testtools.skipIf(not CONF.compute_feature_enabled.live_migration,
-                      'Live migration not available')
-    @attr(type='gate')
-    def test_invalid_host_for_migration(self):
-        # Migrating to an invalid host should not change the status
-        server_id = self._get_an_active_server()
-        target_host = self._get_non_existing_host_name()
-
-        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
-                          server_id, target_host)
-        self.assertEqual('ACTIVE', self._get_server_status(server_id))
-
     @testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
                       CONF.compute_feature_enabled.
                       block_migration_for_live_migration,
@@ -155,13 +132,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @classmethod
-    def tearDownClass(cls):
-        for server_id in cls.created_server_ids:
-            cls.servers_client.delete_server(server_id)
-
-        super(LiveBlockMigrationTestJSON, cls).tearDownClass()
-
 
 class LiveBlockMigrationTestXML(LiveBlockMigrationTestJSON):
     _host_key = (
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
new file mode 100644
index 0000000..da0e4c4
--- /dev/null
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -0,0 +1,60 @@
+# 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 config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
+    _host_key = 'OS-EXT-SRV-ATTR:host'
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(LiveBlockMigrationNegativeTestJSON, cls).setUpClass()
+        if not CONF.compute_feature_enabled.live_migration:
+            raise cls.skipException("Live migration is not enabled")
+        cls.admin_hosts_client = cls.os_adm.hosts_client
+        cls.admin_servers_client = cls.os_adm.servers_client
+
+    def _migrate_server_to(self, server_id, dest_host):
+        _resp, body = self.admin_servers_client.live_migrate_server(
+            server_id, dest_host,
+            self.config.compute_feature_enabled.
+            block_migration_for_live_migration)
+        return body
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_host_for_migration(self):
+        # Migrating to an invalid host should not change the status
+        target_host = data_utils.rand_name('host-')
+        _, server = self.create_test_server(wait_until="ACTIVE")
+        server_id = server['id']
+
+        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
+                          server_id, target_host)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
+
+
+class LiveBlockMigrationNegativeTestXML(LiveBlockMigrationNegativeTestJSON):
+    _host_key = (
+        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
+    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_aggregates.py b/tempest/api/compute/v3/admin/test_aggregates.py
index b8b478d..20093e4 100644
--- a/tempest/api/compute/v3/admin/test_aggregates.py
+++ b/tempest/api/compute/v3/admin/test_aggregates.py
@@ -32,7 +32,6 @@
     def setUpClass(cls):
         super(AggregatesAdminV3Test, cls).setUpClass()
         cls.client = cls.aggregates_admin_client
-        cls.user_client = cls.aggregates_client
         cls.aggregate_name_prefix = 'test_aggregate_'
         cls.az_name_prefix = 'test_az_'
 
diff --git a/tempest/api/compute/v3/admin/test_availability_zone.py b/tempest/api/compute/v3/admin/test_availability_zone.py
index 57ac869..176751f 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone.py
@@ -29,7 +29,6 @@
     def setUpClass(cls):
         super(AZAdminV3Test, cls).setUpClass()
         cls.client = cls.availability_zone_admin_client
-        cls.non_adm_client = cls.availability_zone_client
 
     @attr(type='gate')
     def test_get_availability_zone_list(self):
@@ -45,11 +44,3 @@
             self.client.get_availability_zone_list_detail()
         self.assertEqual(200, resp.status)
         self.assertTrue(len(availability_zone) > 0)
-
-    @attr(type='gate')
-    def test_get_availability_zone_list_with_non_admin_user(self):
-        # List of availability zone with non-administrator user
-        resp, availability_zone = \
-            self.non_adm_client.get_availability_zone_list()
-        self.assertEqual(200, resp.status)
-        self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/compute/v3/admin/test_flavors.py b/tempest/api/compute/v3/admin/test_flavors.py
new file mode 100644
index 0000000..597c99b
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_flavors.py
@@ -0,0 +1,311 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import uuid
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class FlavorsAdminV3Test(base.BaseV3ComputeAdminTest):
+
+    """
+    Tests Flavors API Create and Delete that require admin privileges
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsAdminV3Test, cls).setUpClass()
+
+        cls.client = cls.flavors_admin_client
+        cls.user_client = cls.flavors_client
+        cls.flavor_name_prefix = 'test_flavor_'
+        cls.ram = 512
+        cls.vcpus = 1
+        cls.disk = 10
+        cls.ephemeral = 10
+        cls.swap = 1024
+        cls.rxtx = 2
+
+    def flavor_clean_up(self, flavor_id):
+        resp, body = self.client.delete_flavor(flavor_id)
+        self.assertEqual(resp.status, 204)
+        self.client.wait_for_resource_deletion(flavor_id)
+
+    def _create_flavor(self, flavor_id):
+        # Create a flavor and ensure it is listed
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(flavor['ram'], self.ram)
+        self.assertEqual(flavor['swap'], self.swap)
+        if test.is_extension_enabled("os-flavor-rxtx", "compute_v3"):
+            self.assertEqual(flavor['os-flavor-rxtx:rxtx_factor'], self.rxtx)
+        self.assertEqual(flavor['ephemeral'],
+                         self.ephemeral)
+        self.assertEqual(flavor['flavor-access:is_public'], True)
+
+        # Verify flavor is retrieved
+        resp, flavor = self.client.get_flavor_details(flavor['id'])
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+
+        return flavor['id']
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_int_id(self):
+        flavor_id = data_utils.rand_int_id(start=1000)
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, str(flavor_id))
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_uuid_id(self):
+        flavor_id = str(uuid.uuid4())
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, flavor_id)
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_none_id(self):
+        # If nova receives a request with None as flavor_id,
+        # nova generates flavor_id of uuid.
+        flavor_id = None
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, str(uuid.UUID(new_flavor_id)))
+
+    @test.attr(type='gate')
+    def test_create_flavor_verify_entry_in_list_details(self):
+        # Create a flavor and ensure it's details are listed
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        flag = False
+        # Verify flavor is retrieved
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+    @test.attr(type='gate')
+    def test_create_list_flavor_without_extra_data(self):
+        # Create a flavor and ensure it is listed
+        # This operation requires the user to have 'admin' role
+
+        def verify_flavor_response_extension(flavor):
+            # check some extensions for the flavor create/show/detail response
+            self.assertEqual(flavor['swap'], 0)
+            if test.is_extension_enabled("os-flavor-rxtx", "compute_v3"):
+                self.assertEqual(int(flavor['os-flavor-rxtx:rxtx_factor']), 1)
+            self.assertEqual(int(flavor['ephemeral']), 0)
+            self.assertEqual(flavor['flavor-access:is_public'], True)
+
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['ram'], self.ram)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(int(flavor['id']), new_flavor_id)
+        verify_flavor_response_extension(flavor)
+
+        # Verify flavor is retrieved
+        resp, flavor = self.client.get_flavor_details(new_flavor_id)
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+        verify_flavor_response_extension(flavor)
+
+        # Check if flavor is present in list
+        resp, flavors = self.user_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                verify_flavor_response_extension(flavor)
+                flag = True
+        self.assertTrue(flag)
+
+    @test.skip_because(bug="1209101")
+    @test.attr(type='gate')
+    def test_list_non_public_flavor(self):
+        # Create a flavor with os-flavor-access:is_public false should
+        # be present in list_details.
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        # Verify flavor is retrieved
+        flag = False
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+        # Verify flavor is not retrieved with other user
+        flag = False
+        resp, flavors = self.user_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertFalse(flag)
+
+    @test.attr(type='gate')
+    def test_create_server_with_non_public_flavor(self):
+        # Create a flavor with os-flavor-access:is_public false
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+
+        # Verify flavor is not used by other user
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_server,
+                          'test', self.image_ref, flavor['id'])
+
+    @test.attr(type='gate')
+    def test_list_public_flavor_with_other_user(self):
+        # Create a Flavor with public access.
+        # Try to List/Get flavor with another user
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+            # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="True")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        flag = False
+        self.new_client = self.flavors_client
+        # Verify flavor is retrieved with new user
+        resp, flavors = self.new_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+    @test.attr(type='gate')
+    def test_is_public_string_variations(self):
+        flavor_id_not_public = data_utils.rand_int_id(start=1000)
+        flavor_name_not_public = data_utils.rand_name(self.flavor_name_prefix)
+        flavor_id_public = data_utils.rand_int_id(start=1000)
+        flavor_name_public = data_utils.rand_name(self.flavor_name_prefix)
+
+        # Create a non public flavor
+        resp, flavor = self.client.create_flavor(flavor_name_not_public,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id_not_public,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        # Create a public flavor
+        resp, flavor = self.client.create_flavor(flavor_name_public,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id_public,
+                                                 is_public="True")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        def _flavor_lookup(flavors, flavor_name):
+            for flavor in flavors:
+                if flavor['name'] == flavor_name:
+                    return flavor
+            return None
+
+        def _test_string_variations(variations, flavor_name):
+            for string in variations:
+                params = {'is_public': string}
+                r, flavors = self.client.list_flavors_with_detail(params)
+                self.assertEqual(r.status, 200)
+                flavor = _flavor_lookup(flavors, flavor_name)
+                self.assertIsNotNone(flavor)
+
+        _test_string_variations(['f', 'false', 'no', '0'],
+                                flavor_name_not_public)
+
+        _test_string_variations(['t', 'true', 'yes', '1'],
+                                flavor_name_public)
+
+    @test.attr(type='gate')
+    def test_create_flavor_using_string_ram(self):
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        ram = " 1024 "
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(flavor['ram'], int(ram))
+        self.assertEqual(int(flavor['id']), new_flavor_id)
diff --git a/tempest/api/compute/v3/admin/test_flavors_negative.py b/tempest/api/compute/v3/admin/test_flavors_negative.py
new file mode 100644
index 0000000..f54de79
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_flavors_negative.py
@@ -0,0 +1,335 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import uuid
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class FlavorsAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
+
+    """
+    Tests Flavors API Create and Delete that require admin privileges
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsAdminNegativeV3Test, cls).setUpClass()
+
+        cls.client = cls.flavors_admin_client
+        cls.user_client = cls.flavors_client
+        cls.flavor_name_prefix = 'test_flavor_'
+        cls.ram = 512
+        cls.vcpus = 1
+        cls.disk = 10
+        cls.ephemeral = 10
+        cls.swap = 1024
+        cls.rxtx = 2
+
+    def flavor_clean_up(self, flavor_id):
+        resp, body = self.client.delete_flavor(flavor_id)
+        self.assertEqual(resp.status, 204)
+        self.client.wait_for_resource_deletion(flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_flavor_details_for_deleted_flavor(self):
+        # Delete a flavor and ensure it is not listed
+        # Create a test flavor
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+
+        # no need to specify flavor_id, we can get the flavor_id from a
+        # response of create_flavor() call.
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram,
+                                                 self.vcpus, self.disk,
+                                                 '',
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        # Delete the flavor
+        new_flavor_id = flavor['id']
+        resp_delete, body = self.client.delete_flavor(new_flavor_id)
+        self.assertEqual(201, resp.status)
+        self.assertEqual(204, resp_delete.status)
+
+        # Deleted flavors can be seen via detailed GET
+        resp, flavor = self.client.get_flavor_details(new_flavor_id)
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+
+        # Deleted flavors should not show up in a list however
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        flag = True
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = False
+        self.assertTrue(flag)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_is_public_string(self):
+        # the 'is_public' parameter can be 'none/true/false' if it exists
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.list_flavors_with_detail,
+                          {'is_public': 'invalid'})
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_as_user(self):
+        # only admin user can create a flavor
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.create_flavor,
+                          flavor_name, self.ram, self.vcpus, self.disk,
+                          new_flavor_id, ephemeral=self.ephemeral,
+                          swap=self.swap, rxtx=self.rxtx)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_flavor_as_user(self):
+        # only admin user can delete a flavor
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.delete_flavor,
+                          self.flavor_ref_alt)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_using_invalid_ram(self):
+        # the 'ram' attribute must be positive integer
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          flavor_name, -1, self.vcpus,
+                          self.disk, new_flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_using_invalid_vcpus(self):
+        # the 'vcpu' attribute must be positive integer
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          flavor_name, self.ram, -1,
+                          self.disk, new_flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_name_length_less_than_1(self):
+        # ensure name length >= 1
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          '',
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_name_length_exceeds_255(self):
+        # ensure name do not exceed 255 characters
+        new_flavor_name = 'a' * 256
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_name(self):
+        # the regex of flavor_name is '^[\w\.\- ]*$'
+        invalid_flavor_name = data_utils.rand_name('invalid-!@#$%-')
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          invalid_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_flavor_id(self):
+        # the regex of flavor_id is '^[\w\.\- ]*$', and it cannot contain
+        # leading and/or trailing whitespace
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        invalid_flavor_id = '!@#$%'
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          invalid_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_id_length_exceeds_255(self):
+        # the length of flavor_id should not exceed 255 characters
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        invalid_flavor_id = 'a' * 256
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          invalid_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_root_gb(self):
+        # root_gb attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          -1,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_ephemeral_gb(self):
+        # ephemeral_gb attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=-1,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_swap(self):
+        # swap attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=-1,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_rxtx_factor(self):
+        # rxtx_factor attribute should be a positive float
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=-1.5,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_is_public(self):
+        # is_public attribute should be boolean
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='Invalid')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_already_exists(self):
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.assertEqual(201, resp.status)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        self.assertRaises(exceptions.Conflict,
+                          self.client.create_flavor,
+                          flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_nonexistent_flavor(self):
+        nonexistent_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.NotFound,
+                          self.client.delete_flavor,
+                          nonexistent_flavor_id)
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
deleted file mode 100644
index a86b7f5..0000000
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
+++ /dev/null
@@ -1,59 +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.
-
-import datetime
-import urllib
-
-from tempest.api.compute import base
-from tempest import test
-
-
-class InstanceUsageAuditLogV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(InstanceUsageAuditLogV3Test, cls).setUpClass()
-        cls.adm_client = cls.instance_usages_audit_log_admin_client
-
-    @test.attr(type='gate')
-    def test_list_instance_usage_audit_logs(self):
-        # list instance usage audit logs
-        resp, body = self.adm_client.list_instance_usage_audit_logs()
-        self.assertEqual(200, resp.status)
-        expected_items = ['total_errors', 'total_instances', 'log',
-                          'num_hosts_running', 'num_hosts_done',
-                          'num_hosts', 'hosts_not_run', 'overall_status',
-                          'period_ending', 'period_beginning',
-                          'num_hosts_not_run']
-        for item in expected_items:
-            self.assertIn(item, body)
-
-    @test.attr(type='gate')
-    def test_list_instance_usage_audit_logs_with_filter_before(self):
-        # Get instance usage audit log before specified time
-        ending_time = datetime.datetime(2012, 12, 24)
-        resp, body = self.adm_client.list_instance_usage_audit_logs(
-            urllib.quote(ending_time.strftime("%Y-%m-%d %H:%M:%S")))
-
-        self.assertEqual(200, resp.status)
-        expected_items = ['total_errors', 'total_instances', 'log',
-                          'num_hosts_running', 'num_hosts_done', 'num_hosts',
-                          'hosts_not_run', 'overall_status', 'period_ending',
-                          'period_beginning', 'num_hosts_not_run']
-        for item in expected_items:
-            self.assertIn(item, body)
-        self.assertEqual(body['period_ending'], "2012-12-23 23:00:00")
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
deleted file mode 100644
index 0438825..0000000
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
+++ /dev/null
@@ -1,41 +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 tempest.api.compute import base
-from tempest import exceptions
-from tempest import test
-
-
-class InstanceUsageLogNegativeV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(InstanceUsageLogNegativeV3Test, cls).setUpClass()
-        cls.adm_client = cls.instance_usages_audit_log_admin_client
-
-    @test.attr(type=['negative', 'gate'])
-    def test_instance_usage_audit_logs_with_nonadmin_user(self):
-        # the instance_usage_audit_logs API just can be accessed by admin user
-        self.assertRaises(exceptions.Unauthorized,
-                          self.instance_usages_audit_log_client.
-                          list_instance_usage_audit_logs)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_get_instance_usage_audit_logs_with_invalid_time(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.adm_client.list_instance_usage_audit_logs,
-                          "invalid_time")
diff --git a/tempest/api/compute/v3/admin/test_quotas.py b/tempest/api/compute/v3/admin/test_quotas.py
index ccb9d8e..3ebbdeb 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -29,10 +29,8 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminV3Test, cls).setUpClass()
-        cls.auth_url = CONF.identity.uri
         cls.client = cls.quotas_client
         cls.adm_client = cls.quotas_admin_client
-        cls.identity_admin_client = cls._get_identity_admin_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 +47,7 @@
     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'])
-        resp, quota_set = self.client.get_default_quota_set(
+        resp, quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(sorted(expected_quota_set),
@@ -59,7 +57,7 @@
     @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(
+        resp, default_quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         new_quota_set = {'metadata_items': 256,
                          'ram': 10240, 'floating_ips': 20, 'fixed_ips': 10,
@@ -103,7 +101,7 @@
     @test.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)
+        resp, quota_set = self.adm_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
 
@@ -118,7 +116,7 @@
     @test.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)
+        resp, quota_set = self.adm_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
 
@@ -140,7 +138,7 @@
     @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)
+        resp, quota_set = self.adm_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
 
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index ef9eedc..653e498 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -16,8 +16,6 @@
 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
 
 
 class ServersAdminV3Test(base.BaseV3ComputeAdminTest):
@@ -26,6 +24,7 @@
     Tests Servers API using admin privileges
     """
 
+    _host_key = 'os-extended-server-attributes:host'
     _interface = 'json'
 
     @classmethod
@@ -55,7 +54,7 @@
             flavor_id = data_utils.rand_int_id(start=1000)
         return flavor_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin(self):
         # Listing servers by admin user returns empty list by default
         resp, body = self.client.list_servers_with_detail()
@@ -64,7 +63,7 @@
         self.assertEqual([], servers)
 
     @test.skip_because(bug='1265416')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin_with_all_tenants(self):
         # Listing servers by admin user with all tenants parameter
         # Here should be listed all servers
@@ -76,15 +75,42 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
+    def test_list_servers_filter_by_existent_host(self):
+        # Filter the list of servers by existent host
+        name = data_utils.rand_name('server')
+        flavor = self.flavor_ref
+        image_id = self.image_ref
+        resp, test_server = self.client.create_server(
+            name, image_id, flavor)
+        self.assertEqual('202', resp['status'])
+        self.addCleanup(self.client.delete_server, test_server['id'])
+        self.client.wait_for_server_status(test_server['id'], 'ACTIVE')
+        resp, server = self.client.get_server(test_server['id'])
+        self.assertEqual(server['status'], 'ACTIVE')
+        hostname = server[self._host_key]
+        params = {'host': hostname}
+        resp, body = self.client.list_servers(params)
+        self.assertEqual('200', resp['status'])
+        servers = body['servers']
+        nonexistent_params = {'host': 'nonexistent_host'}
+        resp, nonexistent_body = self.client.list_servers(
+            nonexistent_params)
+        self.assertEqual('200', resp['status'])
+        nonexistent_servers = nonexistent_body['servers']
+        self.assertIn(test_server['id'], map(lambda x: x['id'], servers))
+        self.assertNotIn(test_server['id'],
+                         map(lambda x: x['id'], nonexistent_servers))
+
+    @test.attr(type='gate')
     def test_admin_delete_servers_of_others(self):
         # Administrator can delete servers of others
-        _, server = self.create_test_server()
+        _, server = self.create_test_server(wait_until='ACTIVE')
         resp, _ = self.client.delete_server(server['id'])
         self.assertEqual('204', resp['status'])
         self.servers_client.wait_for_server_termination(server['id'])
 
-    @attr(type='gate')
+    @test.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')
@@ -96,7 +122,7 @@
         resp, _ = self.client.delete_server(server['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
@@ -114,8 +140,8 @@
         resp, server = self.client.get_server(self.s1_id)
         self.assertEqual(server['status'], 'ACTIVE')
 
-    @attr(type='gate')
-    @skip_because(bug="1240043")
+    @test.attr(type='gate')
+    @test.skip_because(bug="1240043")
     def test_get_server_diagnostics_by_admin(self):
         # Retrieve server diagnostics by admin user
         resp, diagnostic = self.client.get_server_diagnostics(self.s1_id)
@@ -126,7 +152,7 @@
         for key in basic_attrs:
             self.assertIn(key, str(diagnostic.keys()))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_error_status(self):
         # Filter the list of servers by server error status
         params = {'status': 'error'}
@@ -142,12 +168,12 @@
         self.assertIn(self.s1_id, map(lambda x: x['id'], servers))
         self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_error_state(self):
         # The server in error state should be rebuilt using the provided
         # image and changed to ACTIVE state
 
-        # resetting vm state require admin priviledge
+        # resetting vm state require admin privilege
         resp, server = self.client.reset_state(self.s1_id, state='error')
         self.assertEqual(202, resp.status)
         resp, rebuilt_server = self.non_admin_client.rebuild(
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
deleted file mode 100644
index e16332f..0000000
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
+++ /dev/null
@@ -1,85 +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 datetime
-
-from tempest.api.compute import base
-from tempest import test
-from tempest.test import attr
-import time
-
-
-class TenantUsagesV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(TenantUsagesV3Test, cls).setUpClass()
-        cls.adm_client = cls.tenant_usages_admin_client
-        cls.client = cls.tenant_usages_client
-        cls.identity_client = cls._get_identity_admin_client()
-
-        resp, tenants = cls.identity_client.list_tenants()
-        cls.tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
-                         cls.client.tenant_name][0]
-
-        # Create a server in the demo tenant
-        resp, server = cls.create_test_server(wait_until='ACTIVE')
-        time.sleep(2)
-
-        now = datetime.datetime.now()
-        cls.start = cls._parse_strtime(now - datetime.timedelta(days=1))
-        cls.end = cls._parse_strtime(now + datetime.timedelta(days=1))
-
-    @classmethod
-    def _parse_strtime(cls, at):
-        # Returns formatted datetime
-        return at.strftime('%Y-%m-%dT%H:%M:%S.%f')
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_list_usage_all_tenants(self):
-        # Get usage for all tenants
-        params = {'start': self.start,
-                  'end': self.end,
-                  'detailed': int(bool(True))}
-        resp, tenant_usage = self.adm_client.list_tenant_usages(params)
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_get_usage_tenant(self):
-        # Get usage for a specific tenant
-        params = {'start': self.start,
-                  'end': self.end}
-        resp, tenant_usage = self.adm_client.get_tenant_usage(
-            self.tenant_id, params)
-
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_get_usage_tenant_with_non_admin_user(self):
-        # Get usage for a specific tenant with non admin user
-        params = {'start': self.start,
-                  'end': self.end}
-        resp, tenant_usage = self.client.get_tenant_usage(
-            self.tenant_id, params)
-
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
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
deleted file mode 100644
index 17849c5..0000000
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
+++ /dev/null
@@ -1,73 +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 datetime
-
-from tempest.api.compute import base
-from tempest import exceptions
-from tempest import test
-from tempest.test import attr
-
-
-class TenantUsagesNegativeV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(TenantUsagesNegativeV3Test, cls).setUpClass()
-        cls.adm_client = cls.os_adm.tenant_usages_client
-        cls.client = cls.os.tenant_usages_client
-        cls.identity_client = cls._get_identity_admin_client()
-        now = datetime.datetime.now()
-        cls.start = cls._parse_strtime(now - datetime.timedelta(days=1))
-        cls.end = cls._parse_strtime(now + datetime.timedelta(days=1))
-
-    @classmethod
-    def _parse_strtime(cls, at):
-        # Returns formatted datetime
-        return at.strftime('%Y-%m-%dT%H:%M:%S.%f')
-
-    @attr(type=['negative', 'gate'])
-    def test_get_usage_tenant_with_empty_tenant_id(self):
-        # Get usage for a specific tenant empty
-        params = {'start': self.start,
-                  'end': self.end}
-        self.assertRaises(exceptions.NotFound,
-                          self.adm_client.get_tenant_usage,
-                          '', params)
-
-    @test.skip_because(bug='1265416')
-    @attr(type=['negative', 'gate'])
-    def test_get_usage_tenant_with_invalid_date(self):
-        # Get usage for tenant with invalid date
-        params = {'start': self.end,
-                  'end': self.start}
-        resp, tenants = self.identity_client.list_tenants()
-        tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
-                     self.client.tenant_name][0]
-        self.assertRaises(exceptions.BadRequest,
-                          self.adm_client.get_tenant_usage,
-                          tenant_id, params)
-
-    @test.skip_because(bug='1265416')
-    @attr(type=['negative', 'gate'])
-    def test_list_usage_all_tenants_with_non_admin_user(self):
-        # Get usage for all tenants with non admin user
-        params = {'start': self.start,
-                  'end': self.end,
-                  'detailed': int(bool(True))}
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.list_tenant_usages, params)
diff --git a/tempest/api/compute/v3/flavors/__init__.py b/tempest/api/compute/v3/flavors/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/__init__.py
diff --git a/tempest/api/compute/v3/flavors/test_flavors.py b/tempest/api/compute/v3/flavors/test_flavors.py
new file mode 100644
index 0000000..812358f
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/test_flavors.py
@@ -0,0 +1,128 @@
+# 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 import test
+
+
+class FlavorsV3Test(base.BaseV3ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsV3Test, cls).setUpClass()
+        cls.client = cls.flavors_client
+
+    @test.attr(type='smoke')
+    def test_list_flavors(self):
+        # List of all flavors should contain the expected flavor
+        resp, flavors = self.client.list_flavors()
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
+                             'name': flavor['name']}
+        self.assertIn(flavor_min_detail, flavors)
+
+    @test.attr(type='smoke')
+    def test_list_flavors_with_detail(self):
+        # Detailed list of all flavors should contain the expected flavor
+        resp, flavors = self.client.list_flavors_with_detail()
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        self.assertIn(flavor, flavors)
+
+    @test.attr(type='smoke')
+    def test_get_flavor(self):
+        # The expected flavor details should be returned
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        self.assertEqual(self.flavor_ref, flavor['id'])
+
+    @test.attr(type='gate')
+    def test_list_flavors_limit_results(self):
+        # Only the expected number of flavors should be returned
+        params = {'limit': 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertEqual(1, len(flavors))
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_limit_results(self):
+        # Only the expected number of flavors (detailed) should be returned
+        params = {'limit': 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertEqual(1, len(flavors))
+
+    @test.attr(type='gate')
+    def test_list_flavors_using_marker(self):
+        # The list of flavors should start from the provided marker
+        resp, flavors = self.client.list_flavors()
+        flavor_id = flavors[0]['id']
+
+        params = {'marker': flavor_id}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
+                         'The list of flavors did not start after the marker.')
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_using_marker(self):
+        # The list of flavors should start from the provided marker
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavor_id = flavors[0]['id']
+
+        params = {'marker': flavor_id}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
+                         'The list of flavors did not start after the marker.')
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_filter_by_min_disk(self):
+        # The detailed list of flavors should be filtered by disk space
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['disk'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_disk': flavors[0]['disk'] + 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_filter_by_min_ram(self):
+        # The detailed list of flavors should be filtered by RAM
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['ram'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_ram': flavors[0]['ram'] + 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_filter_by_min_disk(self):
+        # The list of flavors should be filtered by disk space
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['disk'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_disk': flavors[0]['disk'] + 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_filter_by_min_ram(self):
+        # The list of flavors should be filtered by RAM
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['ram'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_ram': flavors[0]['ram'] + 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/api/compute/v3/flavors/test_flavors_negative.py b/tempest/api/compute/v3/flavors/test_flavors_negative.py
new file mode 100644
index 0000000..3d4100a
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/test_flavors_negative.py
@@ -0,0 +1,54 @@
+# 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 testscenarios
+
+from tempest.api.compute import base
+from tempest import test
+
+
+load_tests = testscenarios.load_tests_apply_scenarios
+
+
+class FlavorsListNegativeV3Test(base.BaseV3ComputeTest,
+                                test.NegativeAutoTest):
+    _interface = 'json'
+    _service = 'computev3'
+    _schema_file = 'compute/flavors/flavors_list_v3.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_flavors_with_detail(self):
+        self.execute(self._schema_file)
+
+
+class FlavorDetailsNegativeV3Test(base.BaseV3ComputeTest,
+                                  test.NegativeAutoTest):
+    _interface = 'json'
+    _service = 'computev3'
+    _schema_file = 'compute/flavors/flavor_details_v3.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorDetailsNegativeV3Test, cls).setUpClass()
+        cls.set_resource("flavor", cls.flavor_ref)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_flavor_details(self):
+        # flavor details are not returned for non-existent flavors
+        self.execute(self._schema_file)
diff --git a/tempest/api/compute/v3/images/test_image_metadata.py b/tempest/api/compute/v3/images/test_image_metadata.py
deleted file mode 100644
index cd4e5e7..0000000
--- a/tempest/api/compute/v3/images/test_image_metadata.py
+++ /dev/null
@@ -1,111 +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 tempest.api.compute import base
-from tempest.common.utils import data_utils
-from tempest import config
-from tempest.test import attr
-
-CONF = config.CONF
-
-
-class ImagesMetadataTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ImagesMetadataTest, cls).setUpClass()
-        if not CONF.service_available.glance:
-            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-
-        cls.servers_client = cls.servers_client
-        cls.client = cls.images_client
-
-        resp, server = cls.create_test_server(wait_until='ACTIVE')
-        cls.server_id = server['id']
-
-        # Snapshot the server once to save time
-        name = data_utils.rand_name('image')
-        resp, _ = cls.client.create_image(cls.server_id, name, {})
-        cls.image_id = resp['location'].rsplit('/', 1)[1]
-
-        cls.client.wait_for_image_status(cls.image_id, 'ACTIVE')
-
-    @classmethod
-    def tearDownClass(cls):
-        cls.client.delete_image(cls.image_id)
-        super(ImagesMetadataTest, cls).tearDownClass()
-
-    def setUp(self):
-        super(ImagesMetadataTest, self).setUp()
-        meta = {'key1': 'value1', 'key2': 'value2'}
-        resp, _ = self.client.set_image_metadata(self.image_id, meta)
-        self.assertEqual(resp.status, 200)
-
-    @attr(type='gate')
-    def test_list_image_metadata(self):
-        # All metadata key/value pairs for an image should be returned
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'value1', 'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_set_image_metadata(self):
-        # The metadata for the image should match the new values
-        req_metadata = {'meta2': 'value2', 'meta3': 'value3'}
-        resp, body = self.client.set_image_metadata(self.image_id,
-                                                    req_metadata)
-
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        self.assertEqual(req_metadata, resp_metadata)
-
-    @attr(type='gate')
-    def test_update_image_metadata(self):
-        # The metadata for the image should match the updated values
-        req_metadata = {'key1': 'alt1', 'key3': 'value3'}
-        resp, metadata = self.client.update_image_metadata(self.image_id,
-                                                           req_metadata)
-
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_get_image_metadata_item(self):
-        # The value for a specific metadata key should be returned
-        resp, meta = self.client.get_image_metadata_item(self.image_id,
-                                                         'key2')
-        self.assertEqual('value2', meta['key2'])
-
-    @attr(type='gate')
-    def test_set_image_metadata_item(self):
-        # The value provided for the given meta item should be set for
-        # the image
-        meta = {'key1': 'alt'}
-        resp, body = self.client.set_image_metadata_item(self.image_id,
-                                                         'key1', meta)
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt', 'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_delete_image_metadata_item(self):
-        # The metadata value/key pair should be deleted from the image
-        resp, body = self.client.delete_image_metadata_item(self.image_id,
-                                                            'key1')
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
diff --git a/tempest/api/compute/v3/images/test_image_metadata_negative.py b/tempest/api/compute/v3/images/test_image_metadata_negative.py
deleted file mode 100644
index e76af2c..0000000
--- a/tempest/api/compute/v3/images/test_image_metadata_negative.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.api.compute import base
-from tempest.common.utils import data_utils
-from tempest import exceptions
-from tempest.test import attr
-
-
-class ImagesMetadataTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ImagesMetadataTest, cls).setUpClass()
-        cls.client = cls.images_client
-
-    @attr(type=['negative', 'gate'])
-    def test_list_nonexistent_image_metadata(self):
-        # Negative test: List on nonexistent image
-        # metadata should not happen
-        self.assertRaises(exceptions.NotFound, self.client.list_image_metadata,
-                          data_utils.rand_uuid())
-
-    @attr(type=['negative', 'gate'])
-    def test_update_nonexistent_image_metadata(self):
-        # Negative test:An update should not happen for a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.update_image_metadata,
-                          data_utils.rand_uuid(), meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_get_nonexistent_image_metadata_item(self):
-        # Negative test: Get on non-existent image should not happen
-        self.assertRaises(exceptions.NotFound,
-                          self.client.get_image_metadata_item,
-                          data_utils.rand_uuid(), 'key2')
-
-    @attr(type=['negative', 'gate'])
-    def test_set_nonexistent_image_metadata(self):
-        # Negative test: Metadata should not be set to a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
-        self.assertRaises(exceptions.NotFound, self.client.set_image_metadata,
-                          data_utils.rand_uuid(), meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_set_nonexistent_image_metadata_item(self):
-        # Negative test: Metadata item should not be set to a
-        # nonexistent image
-        meta = {'key1': 'alt'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.set_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1',
-                          meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_delete_nonexistent_image_metadata_item(self):
-        # Negative test: Shouldn't be able to delete metadata
-        # item from non-existent image
-        self.assertRaises(exceptions.NotFound,
-                          self.client.delete_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1')
diff --git a/tempest/api/compute/v3/images/test_images.py b/tempest/api/compute/v3/images/test_images.py
index bbb84fb..b045630 100644
--- a/tempest/api/compute/v3/images/test_images.py
+++ b/tempest/api/compute/v3/images/test_images.py
@@ -13,11 +13,10 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -34,18 +33,6 @@
         cls.client = cls.images_client
         cls.servers_client = cls.servers_client
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def __create_image__(self, server_id, name, meta=None):
         resp, body = self.servers_client.create_image(server_id, name, meta)
         image_id = data_utils.parse_image_id(resp['location'])
@@ -53,7 +40,7 @@
         self.client.wait_for_image_status(image_id, 'ACTIVE')
         return resp, body
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_deleted_server(self):
         # An image should not be created if the server instance is removed
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -68,7 +55,7 @@
                           self.__create_image__,
                           server['id'], name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_invalid_server(self):
         # An image should not be created with invalid server id
         # Create a new image with invalid server id
@@ -79,7 +66,7 @@
         self.assertRaises(exceptions.NotFound, self.__create_image__,
                           '!@#$%^&*()', name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_stopped_server(self):
         resp, server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.stop(server['id'])
@@ -93,7 +80,7 @@
         self.addCleanup(self.client.delete_image, image['id'])
         self.assertEqual(snapshot_name, image['name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_queued_image(self):
         snapshot_name = data_utils.rand_name('test-snap-')
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -104,7 +91,7 @@
         resp, body = self.client.delete_image(image['id'])
         self.assertEqual('200', resp['status'])
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_35_characters_or_less(self):
         # Return an error if Image ID passed is 35 characters or less
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -113,7 +100,7 @@
                           self.servers_client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_37_characters_or_more(self):
         # Return an error if Image ID passed is 37 characters or more
         snapshot_name = data_utils.rand_name('test-snap-')
diff --git a/tempest/api/compute/v3/images/test_images_oneserver.py b/tempest/api/compute/v3/images/test_images_oneserver.py
index 18772df..1ded4e4 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver.py
@@ -16,30 +16,22 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerTest(base.BaseV2ComputeTest):
+class ImagesOneServerV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
-    def tearDown(self):
-        """Terminate test instances created after a test is executed."""
-        for image_id in self.image_ids:
-            self.client.delete_image(image_id)
-            self.image_ids.remove(image_id)
-        super(ImagesOneServerTest, self).tearDown()
-
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
-        super(ImagesOneServerTest, self).setUp()
+        super(ImagesOneServerV3Test, self).setUp()
         # Check if the server is in a clean state after test
         try:
             self.servers_client.wait_for_server_status(self.server_id,
@@ -53,7 +45,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerTest, cls).setUpClass()
+        super(ImagesOneServerV3Test, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
@@ -66,33 +58,20 @@
             cls.tearDownClass()
             raise
 
-        cls.image_ids = []
-
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def _get_default_flavor_disk_size(self, flavor_id):
         resp, flavor = self.flavors_client.get_flavor_details(flavor_id)
         return flavor['disk']
 
     @testtools.skipUnless(CONF.compute_feature_enabled.create_image,
                           'Environment unable to create images.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_delete_image(self):
 
         # Create a new image
         name = data_utils.rand_name('image')
         meta = {'image_type': 'test'}
-        resp, body = self.client.create_image(self.server_id, name, meta)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      name, meta)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.client.wait_for_image_status(image_id, 'ACTIVE')
@@ -117,12 +96,13 @@
         self.assertEqual('204', resp['status'])
         self.client.wait_for_resource_deletion(image_id)
 
-    @attr(type=['gate'])
+    @test.attr(type=['gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         # prefix character is:
         # http://www.fileformat.info/info/unicode/char/1F4A9/index.htm
         utf8_name = data_utils.rand_name(u'\xF0\x9F\x92\xA9')
-        resp, body = self.client.create_image(self.server_id, utf8_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      utf8_name)
         image_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(self.client.delete_image, image_id)
         self.assertEqual('202', resp['status'])
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 bc276d1..8d2517e 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
@@ -15,20 +15,18 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerNegativeTest(base.BaseV2ComputeTest):
+class ImagesOneServerNegativeV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     def tearDown(self):
@@ -36,12 +34,12 @@
         for image_id in self.image_ids:
             self.client.delete_image(image_id)
             self.image_ids.remove(image_id)
-        super(ImagesOneServerNegativeTest, self).tearDown()
+        super(ImagesOneServerNegativeV3Test, self).tearDown()
 
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
-        super(ImagesOneServerNegativeTest, self).setUp()
+        super(ImagesOneServerNegativeV3Test, self).setUp()
         # Check if the server is in a clean state after test
         try:
             self.servers_client.wait_for_server_status(self.server_id,
@@ -58,7 +56,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerNegativeTest, cls).setUpClass()
+        super(ImagesOneServerNegativeV3Test, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
@@ -73,53 +71,44 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
-    @skip_because(bug="1006725")
-    @attr(type=['negative', 'gate'])
+    @test.skip_because(bug="1006725")
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         # invalid multibyte sequence from:
         # http://stackoverflow.com/questions/1301402/
         #     example-invalid-utf8-string
         invalid_name = data_utils.rand_name(u'\xc3\x28')
         self.assertRaises(exceptions.BadRequest,
-                          self.client.create_image, self.server_id,
+                          self.servers_client.create_image,
+                          self.server_id,
                           invalid_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_invalid_metadata(self):
         # Return an error when creating image with invalid metadata
         snapshot_name = data_utils.rand_name('test-snap-')
         meta = {'': ''}
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_metadata_over_limits(self):
         # Return an error when creating image with meta data over 256 chars
         snapshot_name = data_utils.rand_name('test-snap-')
         meta = {'a' * 260: 'b' * 260}
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_second_image_when_first_image_is_being_saved(self):
         # Disallow creating another image when first image is being saved
 
         # Create first snapshot
         snapshot_name = data_utils.rand_name('test-snap-')
-        resp, body = self.client.create_image(self.server_id,
-                                              snapshot_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      snapshot_name)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.image_ids.append(image_id)
@@ -127,23 +116,26 @@
 
         # Create second snapshot
         alt_snapshot_name = data_utils.rand_name('test-snap-')
-        self.assertRaises(exceptions.Conflict, self.client.create_image,
+        self.assertRaises(exceptions.Conflict,
+                          self.servers_client.create_image,
                           self.server_id, alt_snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_name_over_256_chars(self):
         # Return an error if snapshot name over 256 characters is passed
 
         snapshot_name = data_utils.rand_name('a' * 260)
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_that_is_not_yet_active(self):
         # Return an error while trying to delete an image what is creating
 
         snapshot_name = data_utils.rand_name('test-snap-')
-        resp, body = self.client.create_image(self.server_id, snapshot_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      snapshot_name)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.image_ids.append(image_id)
@@ -151,7 +143,7 @@
 
         # Do not wait, attempt to delete the image, ensure it's successful
         resp, body = self.client.delete_image(image_id)
-        self.assertEqual('204', resp['status'])
+        self.assertEqual('200', resp['status'])
         self.image_ids.remove(image_id)
 
         self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
diff --git a/tempest/api/compute/v3/images/test_list_image_filters.py b/tempest/api/compute/v3/images/test_list_image_filters.py
deleted file mode 100644
index 457ca53..0000000
--- a/tempest/api/compute/v3/images/test_list_image_filters.py
+++ /dev/null
@@ -1,225 +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 tempest.api.compute import base
-from tempest import config
-from tempest import exceptions
-from tempest.openstack.common import log as logging
-from tempest.test import attr
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class ListImageFiltersTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ListImageFiltersTest, cls).setUpClass()
-        if not CONF.service_available.glance:
-            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-        cls.client = cls.images_client
-        cls.image_ids = []
-
-        try:
-            resp, cls.server1 = cls.create_test_server()
-            resp, cls.server2 = cls.create_test_server(wait_until='ACTIVE')
-            # NOTE(sdague) this is faster than doing the sync wait_util on both
-            cls.servers_client.wait_for_server_status(cls.server1['id'],
-                                                      'ACTIVE')
-
-            # Create images to be used in the filter tests
-            resp, cls.image1 = cls.create_image_from_server(
-                cls.server1['id'], wait_until='ACTIVE')
-            cls.image1_id = cls.image1['id']
-
-            # Servers have a hidden property for when they are being imaged
-            # Performing back-to-back create image calls on a single
-            # server will sometimes cause failures
-            resp, cls.image3 = cls.create_image_from_server(
-                cls.server2['id'], wait_until='ACTIVE')
-            cls.image3_id = cls.image3['id']
-
-            # Wait for the server to be active after the image upload
-            resp, cls.image2 = cls.create_image_from_server(
-                cls.server1['id'], wait_until='ACTIVE')
-            cls.image2_id = cls.image2['id']
-        except Exception:
-            LOG.exception('setUpClass failed')
-            cls.tearDownClass()
-            raise
-
-    @attr(type=['negative', 'gate'])
-    def test_get_image_not_existing(self):
-        # Check raises a NotFound
-        self.assertRaises(exceptions.NotFound, self.client.get_image,
-                          "nonexistingimageid")
-
-    @attr(type='gate')
-    def test_list_images_filter_by_status(self):
-        # The list of images should contain only images with the
-        # provided status
-        params = {'status': 'ACTIVE'}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_name(self):
-        # List of all images should contain the expected images filtered
-        # by name
-        params = {'name': self.image1['name']}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_server_id(self):
-        # The images should contain images filtered by server id
-        params = {'server': self.server1['id']}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]),
-                        "Failed to find image %s in images. Got images %s" %
-                        (self.image1_id, images))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_server_ref(self):
-        # The list of servers should be filtered by server ref
-        server_links = self.server2['links']
-
-        # Try all server link types
-        for link in server_links:
-            params = {'server': link['href']}
-            resp, images = self.client.list_images(params)
-
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image1_id]))
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image2_id]))
-            self.assertTrue(any([i for i in images
-                                 if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_type(self):
-        # The list of servers should be filtered by image type
-        params = {'type': 'snapshot'}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
-
-    @attr(type='gate')
-    def test_list_images_limit_results(self):
-        # Verify only the expected number of results are returned
-        params = {'limit': '1'}
-        resp, images = self.client.list_images(params)
-        self.assertEqual(1, len([x for x in images if 'id' in x]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_changes_since(self):
-        # Verify only updated images are returned in the detailed list
-
-        # Becoming ACTIVE will modify the updated time
-        # Filter by the image's created time
-        params = {'changes-since': self.image3['created']}
-        resp, images = self.client.list_images(params)
-        found = any([i for i in images if i['id'] == self.image3_id])
-        self.assertTrue(found)
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_status(self):
-        # Detailed list of all images should only contain images
-        # with the provided status
-        params = {'status': 'ACTIVE'}
-        resp, images = self.client.list_images_with_detail(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_name(self):
-        # Detailed list of all images should contain the expected
-        # images filtered by name
-        params = {'name': self.image1['name']}
-        resp, images = self.client.list_images_with_detail(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_limit_results(self):
-        # Verify only the expected number of results (with full details)
-        # are returned
-        params = {'limit': '1'}
-        resp, images = self.client.list_images_with_detail(params)
-        self.assertEqual(1, len(images))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_server_ref(self):
-        # Detailed list of servers should be filtered by server ref
-        server_links = self.server2['links']
-
-        # Try all server link types
-        for link in server_links:
-            params = {'server': link['href']}
-            resp, images = self.client.list_images_with_detail(params)
-
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image1_id]))
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image2_id]))
-            self.assertTrue(any([i for i in images
-                                 if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_type(self):
-        # The detailed list of servers should be filtered by image type
-        params = {'type': 'snapshot'}
-        resp, images = self.client.list_images_with_detail(params)
-        resp, image4 = self.client.get_image(self.image_ref)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_changes_since(self):
-        # Verify an update image is returned
-
-        # Becoming ACTIVE will modify the updated time
-        # Filter by the image's created time
-        params = {'changes-since': self.image1['created']}
-        resp, images = self.client.list_images_with_detail(params)
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-
-    @attr(type=['negative', 'gate'])
-    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/v3/servers/test_attach_volume.py b/tempest/api/compute/v3/servers/test_attach_volume.py
index d693be5..2edf934 100644
--- a/tempest/api/compute/v3/servers/test_attach_volume.py
+++ b/tempest/api/compute/v3/servers/test_attach_volume.py
@@ -16,9 +16,9 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -78,7 +78,7 @@
         self.addCleanup(self._detach, server['id'], volume['id'])
 
     @testtools.skipIf(not run_ssh, 'SSH required for this test')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_attach_detach_volume(self):
         # Stop and Start a server with an attached volume, ensuring that
         # the volume remains attached.
@@ -92,9 +92,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user,
-                                    server['admin_password'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['admin_password'])
         partitions = linux_client.get_partitions()
         self.assertIn(self.device, partitions)
 
@@ -107,8 +106,7 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user,
-                                    server['admin_password'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['admin_password'])
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
diff --git a/tempest/api/compute/v3/servers/test_availability_zone.py b/tempest/api/compute/v3/servers/test_availability_zone.py
new file mode 100644
index 0000000..feac9a1
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_availability_zone.py
@@ -0,0 +1,38 @@
+# 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 import test
+
+
+class AZV3Test(base.BaseV3ComputeTest):
+
+    """
+    Tests Availability Zone API List
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(AZV3Test, cls).setUpClass()
+        cls.client = cls.availability_zone_client
+
+    @test.attr(type='gate')
+    def test_get_availability_zone_list_with_non_admin_user(self):
+        # List of availability zone with non-administrator user
+        resp, availability_zone = self.client.get_availability_zone_list()
+        self.assertEqual(200, resp.status)
+        self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/compute/v3/servers/test_create_server.py b/tempest/api/compute/v3/servers/test_create_server.py
index 7a4c877..0825381 100644
--- a/tempest/api/compute/v3/servers/test_create_server.py
+++ b/tempest/api/compute/v3/servers/test_create_server.py
@@ -20,7 +20,7 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import test
 
@@ -95,7 +95,8 @@
     @test.attr(type='gate')
     def test_can_log_into_created_server(self):
         # Check that the user can authenticate with the generated password
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertTrue(linux_client.can_authenticate())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
@@ -104,14 +105,16 @@
         # Verify that the number of vcpus reported by the instance matches
         # the amount stated by the flavor
         resp, flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
     @test.attr(type='gate')
     def test_host_name_is_same_as_server_name(self):
         # Verify the instance host name is the same as the server name
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
 
@@ -204,12 +207,12 @@
                                       adminPass=admin_pass,
                                       flavor=flavor_with_eph_disk_id))
         # Get partition number of server without extra specs.
-        linux_client = RemoteClient(server_no_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_no_eph_disk,
+                                                  self.ssh_user, self.password)
         partition_num = len(linux_client.get_partitions())
 
-        linux_client = RemoteClient(server_with_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_with_eph_disk,
+                                                  self.ssh_user, self.password)
         self.assertEqual(partition_num + 1, linux_client.get_partitions())
 
 
diff --git a/tempest/api/compute/v3/servers/test_delete_server.py b/tempest/api/compute/v3/servers/test_delete_server.py
new file mode 100644
index 0000000..e98e1b7
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_delete_server.py
@@ -0,0 +1,81 @@
+# Copyright 2012 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.
+
+from tempest.api.compute import base
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class DeleteServersV3Test(base.BaseV3ComputeTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+
+    @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')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_delete_active_server(self):
+        # Delete a server while it's VM state is Active
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @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_shelved_state(self):
+        # Delete a server while it's VM state is Shelved
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.shelve_server(server['id'])
+        self.assertEqual(202, resp.status)
+
+        offload_time = CONF.compute.shelved_offload_time
+        if offload_time >= 0:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED_OFFLOADED',
+                                               extra_timeout=offload_time)
+        else:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED')
+
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
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 9082eda..e08125b 100644
--- a/tempest/api/compute/v3/servers/test_list_server_filters.py
+++ b/tempest/api/compute/v3/servers/test_list_server_filters.py
@@ -18,8 +18,7 @@
 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
+from tempest import test
 
 CONF = config.CONF
 
@@ -74,7 +73,7 @@
         cls.fixed_network_name = CONF.compute.fixed_network_name
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_image(self):
         # Filter the list of servers by image
         params = {'image': self.image_ref}
@@ -85,7 +84,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_flavor(self):
         # Filter the list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -96,7 +95,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_name(self):
         # Filter the list of servers by server name
         params = {'name': self.s1_name}
@@ -107,7 +106,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_status(self):
         # Filter the list of servers by server status
         params = {'status': 'active'}
@@ -118,21 +117,21 @@
         self.assertIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 1}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_zero_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 0}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(0, len(servers['servers']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_exceed_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 100000}
@@ -142,7 +141,7 @@
                          len([x for x in servers['servers'] if 'id' in x]))
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
         # Filter the detailed list of servers by image
         params = {'image': self.image_ref}
@@ -153,7 +152,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_flavor(self):
         # Filter the detailed list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -164,7 +163,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_name(self):
         # Filter the detailed list of servers by server name
         params = {'name': self.s1_name}
@@ -175,7 +174,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_status(self):
         # Filter the detailed list of servers by server status
         params = {'status': 'active'}
@@ -188,7 +187,7 @@
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
         self.assertEqual(['ACTIVE'] * 3, [x['status'] for x in servers])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_shutoff_status(self):
         # Filter the list of servers by server shutoff status
         params = {'status': 'shutoff'}
@@ -205,7 +204,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertNotIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_name_wildcard(self):
         # List all servers that contains '-instance' in name
         params = {'name': '-instance'}
@@ -227,8 +226,8 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1170718")
-    @attr(type='gate')
+    @test.skip_because(bug="1170718")
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip(self):
         # Filter servers by ip
         # Here should be listed 1 server
@@ -242,9 +241,9 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1182883",
-                  condition=CONF.service_available.neutron)
-    @attr(type='gate')
+    @test.skip_because(bug="1182883",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip_regex(self):
         # Filter servers by regex ip
         # List all servers filtered by part of ip address.
@@ -259,7 +258,7 @@
         self.assertIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_limit_results(self):
         # Verify only the expected number of detailed results are returned
         params = {'limit': 1}
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index 0dae796..6584b93 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -19,11 +19,10 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -52,7 +51,7 @@
 
     @testtools.skipUnless(CONF.compute_feature_enabled.change_password,
                           'Change password not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_change_server_password(self):
         # The server's password should be set to the provided password
         new_password = 'Newpass1234'
@@ -63,16 +62,18 @@
         if self.run_ssh:
             # Verify that the user can authenticate with the new password
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, new_password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      new_password)
             linux_client.validate_authentication()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_reboot_server_hard(self):
         # The server should be power cycled
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -81,18 +82,20 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertGreater(new_boot_time, boot_time)
 
-    @skip_because(bug="1014647")
-    @attr(type='smoke')
+    @test.skip_because(bug="1014647")
+    @test.attr(type='smoke')
     def test_reboot_server_soft(self):
         # The server should be signaled to reboot gracefully
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'SOFT')
@@ -101,11 +104,12 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertGreater(new_boot_time, boot_time)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_rebuild_server(self):
         # The server should be rebuilt using the provided image and data
         meta = {'rebuild': 'server'}
@@ -133,10 +137,11 @@
 
         if self.run_ssh:
             # Verify that the user can authenticate with the provided password
-            linux_client = RemoteClient(server, self.ssh_user, password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      password)
             linux_client.validate_authentication()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_stop_state(self):
         # The server in stop state  should be rebuilt using the provided
         # image and remain in SHUTOFF state
@@ -174,7 +179,7 @@
         return current_flavor, new_flavor_ref
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_resize_server_confirm(self):
         # The server's RAM and disk space should be modified to that of
         # the provided flavor
@@ -193,7 +198,7 @@
         self.assertEqual(new_flavor_ref, server['flavor']['id'])
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_resize_server_revert(self):
         # The server's RAM and disk space should return to its original
         # values after a resize is reverted
@@ -221,7 +226,7 @@
                 required time (%s s).' % (self.server_id, self.build_timeout)
                 raise exceptions.TimeoutException(message)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
@@ -303,7 +308,7 @@
         lines = len(output.split('\n'))
         self.assertEqual(lines, 10)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id and number of lines
@@ -319,7 +324,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output_server_id_in_shutoff_status(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id in SHUTOFF status
@@ -336,7 +341,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_pause_unpause_server(self):
         resp, server = self.client.pause_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -345,7 +350,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_suspend_resume_server(self):
         resp, server = self.client.suspend_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -354,7 +359,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_shelve_unshelve_server(self):
         resp, server = self.client.shelve_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -378,7 +383,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_stop_start_server(self):
         resp, server = self.servers_client.stop(self.server_id)
         self.assertEqual(202, resp.status)
@@ -387,7 +392,7 @@
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_lock_unlock_server(self):
         # Lock the server,try server stop(exceptions throw),unlock it and retry
         resp, server = self.servers_client.lock_server(self.server_id)
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index bffa7c4..038e254 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -14,8 +14,11 @@
 #    under the License.
 
 from tempest.api.compute import base
+from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
+
+CONF = config.CONF
 
 
 class ServerAddressesV3Test(base.BaseV3ComputeTest):
@@ -30,20 +33,22 @@
 
         resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_list_server_addresses_invalid_server_id(self):
         # List addresses request should fail if server id not in system
         self.assertRaises(exceptions.NotFound, self.client.list_addresses,
                           '999')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_list_server_addresses_by_network_neg(self):
         # List addresses by network should fail if network name not valid
         self.assertRaises(exceptions.NotFound,
                           self.client.list_addresses_by_network,
                           self.server['id'], 'invalid')
 
-    @attr(type='smoke')
+    @test.skip_because(bug="1210483",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='smoke')
     def test_list_server_addresses(self):
         # All public and private addresses for
         # a server should be returned
@@ -60,7 +65,7 @@
                 self.assertTrue(address['addr'])
                 self.assertTrue(address['version'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_server_addresses_by_network(self):
         # Providing a network type should filter
         # the addresses return by that type
diff --git a/tempest/api/compute/v3/servers/test_server_password.py b/tempest/api/compute/v3/servers/test_server_password.py
new file mode 100644
index 0000000..579a8a5
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_server_password.py
@@ -0,0 +1,38 @@
+# 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 tempest.api.compute import base
+from tempest import test
+
+
+class ServerPasswordV3Test(base.BaseV3ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(ServerPasswordV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+        resp, cls.server = cls.create_test_server(wait_until="ACTIVE")
+
+    @test.attr(type='gate')
+    def test_get_server_password(self):
+        resp, body = self.client.get_password(self.server['id'])
+        self.assertEqual(200, resp.status)
+
+    @test.attr(type='gate')
+    def test_delete_server_password(self):
+        resp, body = self.client.delete_password(self.server['id'])
+        self.assertEqual(204, resp.status)
diff --git a/tempest/api/compute/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index dc64c40..5480e31 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -105,38 +105,6 @@
                          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')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
-    def test_delete_active_server(self):
-        # Delete a server while it's VM state is Active
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
     def test_create_server_with_ipv6_addr_only(self):
         # Create a server without an IPv4 address(only IPv6 address).
         resp, server = self.create_test_server(access_ip_v6='2001:2001::3')
diff --git a/tempest/api/compute/v3/test_live_block_migration.py b/tempest/api/compute/v3/test_live_block_migration.py
index 144cadb..43b4e2b 100644
--- a/tempest/api/compute/v3/test_live_block_migration.py
+++ b/tempest/api/compute/v3/test_live_block_migration.py
@@ -13,14 +13,10 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import random
-import string
-
 import testtools
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -66,14 +62,6 @@
             if host != target_host:
                 return target_host
 
-    def _get_non_existing_host_name(self):
-        random_name = ''.join(
-            random.choice(string.ascii_uppercase) for x in range(20))
-
-        self.assertNotIn(random_name, self._get_compute_hostnames())
-
-        return random_name
-
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
@@ -111,18 +99,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @testtools.skipIf(not CONF.compute_feature_enabled.live_migration,
-                      'Live migration not available')
-    @attr(type='gate')
-    def test_invalid_host_for_migration(self):
-        # Migrating to an invalid host should not change the status
-        server_id = self._get_an_active_server()
-        target_host = self._get_non_existing_host_name()
-
-        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
-                          server_id, target_host)
-        self.assertEqual('ACTIVE', self._get_server_status(server_id))
-
     @testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
                       CONF.compute_feature_enabled.
                       block_migration_for_live_migration,
@@ -155,10 +131,3 @@
         self._migrate_server_to(server_id, target_host)
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
-
-    @classmethod
-    def tearDownClass(cls):
-        for server_id in cls.created_server_ids:
-            cls.servers_client.delete_server(server_id)
-
-        super(LiveBlockMigrationV3Test, cls).tearDownClass()
diff --git a/tempest/api/compute/v3/test_live_block_migration_negative.py b/tempest/api/compute/v3/test_live_block_migration_negative.py
new file mode 100644
index 0000000..4d820d8
--- /dev/null
+++ b/tempest/api/compute/v3/test_live_block_migration_negative.py
@@ -0,0 +1,54 @@
+# 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 config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class LiveBlockMigrationV3NegativeTest(base.BaseV3ComputeAdminTest):
+    _host_key = 'os-extended-server-attributes:host'
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(LiveBlockMigrationV3NegativeTest, cls).setUpClass()
+        if not CONF.compute_feature_enabled.live_migration:
+            raise cls.skipException("Live migration is not enabled")
+
+        cls.admin_hosts_client = cls.hosts_admin_client
+        cls.admin_servers_client = cls.servers_admin_client
+
+    def _migrate_server_to(self, server_id, dest_host):
+        _resp, body = self.admin_servers_client.live_migrate_server(
+            server_id, dest_host,
+            self.config.compute_feature_enabled.
+            block_migration_for_live_migration)
+        return body
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_host_for_migration(self):
+        # Migrating to an invalid host should not change the status
+        target_host = data_utils.rand_name('host-')
+        _, server = self.create_test_server(wait_until="ACTIVE")
+        server_id = server['id']
+        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
+                          server_id, target_host)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 8d8e3ec..7a60196 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -16,9 +16,9 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -78,7 +78,7 @@
         self.addCleanup(self._detach, server['id'], volume['id'])
 
     @testtools.skipIf(not run_ssh, 'SSH required for this test')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_attach_detach_volume(self):
         # Stop and Start a server with an attached volume, ensuring that
         # the volume remains attached.
@@ -92,8 +92,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user, server['adminPass'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['adminPass'])
         partitions = linux_client.get_partitions()
         self.assertIn(self.device, partitions)
 
@@ -106,8 +106,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user, server['adminPass'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['adminPass'])
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
 
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index bcab891..73e3b3a 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -16,8 +16,8 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from testtools.matchers import ContainsAll
+from tempest import test
+from testtools import matchers
 
 CONF = config.CONF
 
@@ -34,7 +34,7 @@
             skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_create_get_delete(self):
         # CREATE, GET, DELETE Volume
         volume = None
@@ -68,7 +68,7 @@
                          'The fetched Volume is different '
                          'from the created Volume')
         self.assertThat(fetched_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
 
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
index ab882cd..5b272ef 100644
--- a/tempest/api/data_processing/base.py
+++ b/tempest/api/data_processing/base.py
@@ -63,7 +63,7 @@
             except Exception:
                 # ignore errors while auto removing created resource
                 pass
-
+        cls.clear_isolated_creds()
         super(BaseDataProcessingTest, cls).tearDownClass()
 
     @classmethod
diff --git a/tempest/api/identity/admin/test_roles.py b/tempest/api/identity/admin/test_roles.py
index f1124e4..aa64969 100644
--- a/tempest/api/identity/admin/test_roles.py
+++ b/tempest/api/identity/admin/test_roles.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class RolesTestJSON(base.BaseIdentityAdminTest):
+class RolesTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index e5c04de..7a0bdea 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class RolesNegativeTestJSON(base.BaseIdentityAdminTest):
+class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     def _get_role_params(self):
diff --git a/tempest/api/identity/admin/test_services.py b/tempest/api/identity/admin/test_services.py
index 8ba333f..cbf6b58 100644
--- a/tempest/api/identity/admin/test_services.py
+++ b/tempest/api/identity/admin/test_services.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServicesTestJSON(base.BaseIdentityAdminTest):
+class ServicesTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     def _del_service(self, service_id):
diff --git a/tempest/api/identity/admin/test_tenant_negative.py b/tempest/api/identity/admin/test_tenant_negative.py
index e9eddc8..44b54b8 100644
--- a/tempest/api/identity/admin/test_tenant_negative.py
+++ b/tempest/api/identity/admin/test_tenant_negative.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class TenantsNegativeTestJSON(base.BaseIdentityAdminTest):
+class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type=['negative', 'gate'])
diff --git a/tempest/api/identity/admin/test_tenants.py b/tempest/api/identity/admin/test_tenants.py
index 46fa7a9..c7cacb4 100644
--- a/tempest/api/identity/admin/test_tenants.py
+++ b/tempest/api/identity/admin/test_tenants.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class TenantsTestJSON(base.BaseIdentityAdminTest):
+class TenantsTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/identity/admin/test_tokens.py b/tempest/api/identity/admin/test_tokens.py
index 620e293..239433b 100644
--- a/tempest/api/identity/admin/test_tokens.py
+++ b/tempest/api/identity/admin/test_tokens.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class TokensTestJSON(base.BaseIdentityAdminTest):
+class TokensTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index 39ef947..a4e6c17 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -13,14 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import Contains
+from testtools import matchers
 
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
-class UsersTestJSON(base.BaseIdentityAdminTest):
+class UsersTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -30,7 +30,7 @@
         cls.alt_password = data_utils.rand_name('pass_')
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_user(self):
         # Create a user
         self.data.setup_test_tenant()
@@ -41,7 +41,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual(self.alt_user, user['name'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_user_with_enabled(self):
         # Create a user with enabled : False
         self.data.setup_test_tenant()
@@ -55,7 +55,7 @@
         self.assertEqual('false', str(user['enabled']).lower())
         self.assertEqual(self.alt_email, user['email'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_user(self):
         # Test case to check if updating of user attributes is successful.
         test_user = data_utils.rand_name('test_user_')
@@ -83,7 +83,7 @@
         self.assertEqual(u_email2, updated_user['email'])
         self.assertEqual('false', str(updated_user['enabled']).lower())
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_user(self):
         # Delete a user
         test_user = data_utils.rand_name('test_user_')
@@ -95,7 +95,7 @@
         resp, body = self.client.delete_user(user['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_user_authentication(self):
         # Valid user's token is authenticated
         self.data.setup_test_user()
@@ -108,7 +108,7 @@
                                             self.data.test_tenant)
         self.assertEqual('200', resp['status'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_authentication_request_without_token(self):
         # Request for token authentication with a valid token in header
         self.data.setup_test_user()
@@ -125,16 +125,16 @@
         self.assertEqual('200', resp['status'])
         self.client.auth_provider.clear_auth()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_users(self):
         # Get a list of users and find the test user
         self.data.setup_test_user()
         resp, users = self.client.get_users()
         self.assertThat([u['name'] for u in users],
-                        Contains(self.data.test_user),
+                        matchers.Contains(self.data.test_user),
                         "Could not find %s" % self.data.test_user)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_users_for_tenant(self):
         # Return a list of all users for a tenant
         self.data.setup_test_tenant()
@@ -167,7 +167,7 @@
                          "Failed to find user %s in fetched list" %
                          ', '.join(m_user for m_user in missing_users))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_users_with_roles_for_tenant(self):
         # Return list of users on tenant when roles are assigned to users
         self.data.setup_test_user()
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index 060f24a..1188325 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -20,7 +20,7 @@
 import uuid
 
 
-class UsersNegativeTestJSON(base.BaseIdentityAdminTest):
+class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 753eaa6..5f22d43 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class CredentialsTestJSON(base.BaseIdentityAdminTest):
+class CredentialsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -32,23 +32,23 @@
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
         for i in range(2):
-            resp, cls.project = cls.v3_client.create_project(
+            resp, cls.project = cls.client.create_project(
                 data_utils.rand_name('project-'),
                 description=data_utils.rand_name('project-desc-'))
             assert resp['status'] == '201', "Expected %s" % resp['status']
             cls.projects.append(cls.project['id'])
 
-        resp, cls.user_body = cls.v3_client.create_user(
+        resp, cls.user_body = cls.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=cls.projects[0])
         assert resp['status'] == '201', "Expected: %s" % resp['status']
 
     @classmethod
     def tearDownClass(cls):
-        resp, _ = cls.v3_client.delete_user(cls.user_body['id'])
+        resp, _ = cls.client.delete_user(cls.user_body['id'])
         assert resp['status'] == '204', "Expected: %s" % resp['status']
         for p in cls.projects:
-            resp, _ = cls.v3_client.delete_project(p)
+            resp, _ = cls.client.delete_project(p)
             assert resp['status'] == '204', "Expected: %s" % resp['status']
         super(CredentialsTestJSON, cls).tearDownClass()
 
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 4017b62..086d235 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -19,14 +19,14 @@
 from tempest.test import attr
 
 
-class DomainsTestJSON(base.BaseIdentityAdminTest):
+class DomainsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_domain(self, domain_id):
         # It is necessary to disable the domain before deleting,
         # or else it would result in unauthorized error
-        _, body = self.v3_client.update_domain(domain_id, enabled=False)
-        resp, _ = self.v3_client.delete_domain(domain_id)
+        _, body = self.client.update_domain(domain_id, enabled=False)
+        resp, _ = self.client.delete_domain(domain_id)
         self.assertEqual(204, resp.status)
 
     @attr(type='smoke')
@@ -35,14 +35,14 @@
         domain_ids = list()
         fetched_ids = list()
         for _ in range(3):
-            _, domain = self.v3_client.create_domain(
+            _, domain = self.client.create_domain(
                 data_utils.rand_name('domain-'),
                 description=data_utils.rand_name('domain-desc-'))
             # Delete the domain at the end of this method
             self.addCleanup(self._delete_domain, domain['id'])
             domain_ids.append(domain['id'])
         # List and Verify Domains
-        resp, body = self.v3_client.list_domains()
+        resp, body = self.client.list_domains()
         self.assertEqual(resp['status'], '200')
         for d in body:
             fetched_ids.append(d['id'])
@@ -53,7 +53,7 @@
     def test_create_update_delete_domain(self):
         d_name = data_utils.rand_name('domain-')
         d_desc = data_utils.rand_name('domain-desc-')
-        resp_1, domain = self.v3_client.create_domain(
+        resp_1, domain = self.client.create_domain(
             d_name, description=d_desc)
         self.assertEqual(resp_1['status'], '201')
         self.addCleanup(self._delete_domain, domain['id'])
@@ -72,7 +72,7 @@
         new_desc = data_utils.rand_name('new-desc-')
         new_name = data_utils.rand_name('new-name-')
 
-        resp_2, updated_domain = self.v3_client.update_domain(
+        resp_2, updated_domain = self.client.update_domain(
             domain['id'], name=new_name, description=new_desc)
         self.assertEqual(resp_2['status'], '200')
         self.assertIn('id', updated_domain)
@@ -85,7 +85,7 @@
         self.assertEqual(new_desc, updated_domain['description'])
         self.assertEqual('true', str(updated_domain['enabled']).lower())
 
-        resp_3, fetched_domain = self.v3_client.get_domain(domain['id'])
+        resp_3, fetched_domain = self.client.get_domain(domain['id'])
         self.assertEqual(resp_3['status'], '200')
         self.assertEqual(new_name, fetched_domain['name'])
         self.assertEqual(new_desc, fetched_domain['description'])
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 4ae7884..78ecf93 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class EndPointsTestJSON(base.BaseIdentityAdminTest):
+class EndPointsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -31,8 +31,8 @@
         s_type = data_utils.rand_name('type--')
         s_description = data_utils.rand_name('description-')
         resp, cls.service_data =\
-            cls.identity_client.create_service(s_name, s_type,
-                                               description=s_description)
+            cls.service_client.create_service(s_name, s_type,
+                                              description=s_description)
         cls.service_id = cls.service_data['id']
         cls.service_ids.append(cls.service_id)
         # Create endpoints so as to use for LIST and GET test cases
@@ -50,7 +50,7 @@
         for e in cls.setup_endpoints:
             cls.client.delete_endpoint(e['id'])
         for s in cls.service_ids:
-            cls.identity_client.delete_service(s)
+            cls.service_client.delete_service(s)
         super(EndPointsTestJSON, cls).tearDownClass()
 
     @attr(type='gate')
@@ -107,8 +107,8 @@
         s_type = data_utils.rand_name('type--')
         s_description = data_utils.rand_name('description-')
         resp, self.service2 =\
-            self.identity_client.create_service(s_name, s_type,
-                                                description=s_description)
+            self.service_client.create_service(s_name, s_type,
+                                               description=s_description)
         self.service_ids.append(self.service2['id'])
         # Updating endpoint with new values
         region2 = data_utils.rand_name('region')
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 70afec7..6e898b2 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class GroupsV3TestJSON(base.BaseIdentityAdminTest):
+class GroupsV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -29,23 +29,23 @@
     def test_group_create_update_get(self):
         name = data_utils.rand_name('Group')
         description = data_utils.rand_name('Description')
-        resp, group = self.v3_client.create_group(name,
-                                                  description=description)
-        self.addCleanup(self.v3_client.delete_group, group['id'])
+        resp, group = self.client.create_group(name,
+                                               description=description)
+        self.addCleanup(self.client.delete_group, group['id'])
         self.assertEqual(resp['status'], '201')
         self.assertEqual(group['name'], name)
         self.assertEqual(group['description'], description)
 
         new_name = data_utils.rand_name('UpdateGroup')
         new_desc = data_utils.rand_name('UpdateDescription')
-        resp, updated_group = self.v3_client.update_group(group['id'],
-                                                          name=new_name,
-                                                          description=new_desc)
+        resp, updated_group = self.client.update_group(group['id'],
+                                                       name=new_name,
+                                                       description=new_desc)
         self.assertEqual(resp['status'], '200')
         self.assertEqual(updated_group['name'], new_name)
         self.assertEqual(updated_group['description'], new_desc)
 
-        resp, new_group = self.v3_client.get_group(group['id'])
+        resp, new_group = self.client.get_group(group['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(group['id'], new_group['id'])
         self.assertEqual(new_name, new_group['name'])
@@ -54,27 +54,27 @@
     @test.attr(type='smoke')
     def test_group_users_add_list_delete(self):
         name = data_utils.rand_name('Group')
-        resp, group = self.v3_client.create_group(name)
-        self.addCleanup(self.v3_client.delete_group, group['id'])
+        resp, group = self.client.create_group(name)
+        self.addCleanup(self.client.delete_group, group['id'])
         # add user into group
         users = []
         for i in range(3):
             name = data_utils.rand_name('User')
-            resp, user = self.v3_client.create_user(name)
+            resp, user = self.client.create_user(name)
             users.append(user)
-            self.addCleanup(self.v3_client.delete_user, user['id'])
-            self.v3_client.add_group_user(group['id'], user['id'])
+            self.addCleanup(self.client.delete_user, user['id'])
+            self.client.add_group_user(group['id'], user['id'])
 
         # list users in group
-        resp, group_users = self.v3_client.list_group_users(group['id'])
+        resp, group_users = self.client.list_group_users(group['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(users.sort(), group_users.sort())
         # delete user in group
         for user in users:
-            resp, body = self.v3_client.delete_group_user(group['id'],
-                                                          user['id'])
+            resp, body = self.client.delete_group_user(group['id'],
+                                                       user['id'])
             self.assertEqual(resp['status'], '204')
-        resp, group_users = self.v3_client.list_group_users(group['id'])
+        resp, group_users = self.client.list_group_users(group['id'])
         self.assertEqual(len(group_users), 0)
 
 
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 0e8e4c3..3e04b5f 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class PoliciesTestJSON(base.BaseIdentityAdminTest):
+class PoliciesTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_policy(self, policy_id):
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 1fc5a6a..f309897 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -19,27 +19,27 @@
 from tempest.test import attr
 
 
-class ProjectsTestJSON(base.BaseIdentityAdminTest):
+class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_project(self, project_id):
-        resp, _ = self.v3_client.delete_project(project_id)
+        resp, _ = self.client.delete_project(project_id)
         self.assertEqual(resp['status'], '204')
         self.assertRaises(
-            exceptions.NotFound, self.v3_client.get_project, project_id)
+            exceptions.NotFound, self.client.get_project, project_id)
 
     @attr(type='gate')
     def test_project_list_delete(self):
         # Create several projects and delete them
         for _ in xrange(3):
-            resp, project = self.v3_client.create_project(
+            resp, project = self.client.create_project(
                 data_utils.rand_name('project-new'))
             self.addCleanup(self._delete_project, project['id'])
 
-        resp, list_projects = self.v3_client.list_projects()
+        resp, list_projects = self.client.list_projects()
         self.assertEqual(resp['status'], '200')
 
-        resp, get_project = self.v3_client.get_project(project['id'])
+        resp, get_project = self.client.get_project(project['id'])
         self.assertIn(get_project, list_projects)
 
     @attr(type='gate')
@@ -47,16 +47,16 @@
         # Create project with a description
         project_name = data_utils.rand_name('project-')
         project_desc = data_utils.rand_name('desc-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, description=project_desc)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         st1 = resp['status']
         project_id = project['id']
         desc1 = project['description']
         self.assertEqual(st1, '201')
         self.assertEqual(desc1, project_desc, 'Description should have '
                          'been sent in response for create')
-        resp, body = self.v3_client.get_project(project_id)
+        resp, body = self.client.get_project(project_id)
         desc2 = body['description']
         self.assertEqual(desc2, project_desc, 'Description does not appear'
                          'to be set')
@@ -65,15 +65,15 @@
     def test_project_create_enabled(self):
         # Create a project that is enabled
         project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, enabled=True)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         project_id = project['id']
         st1 = resp['status']
         en1 = project['enabled']
         self.assertEqual(st1, '201')
         self.assertTrue(en1, 'Enable should be True in response')
-        resp, body = self.v3_client.get_project(project_id)
+        resp, body = self.client.get_project(project_id)
         en2 = body['enabled']
         self.assertTrue(en2, 'Enable should be True in lookup')
 
@@ -81,15 +81,15 @@
     def test_project_create_not_enabled(self):
         # Create a project that is not enabled
         project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, enabled=False)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         st1 = resp['status']
         en1 = project['enabled']
         self.assertEqual(st1, '201')
         self.assertEqual('false', str(en1).lower(),
                          'Enable should be False in response')
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         en2 = body['enabled']
         self.assertEqual('false', str(en2).lower(),
                          'Enable should be False in lookup')
@@ -98,19 +98,19 @@
     def test_project_update_name(self):
         # Update name attribute of a project
         p_name1 = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(p_name1)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name1)
+        self.data.projects.append(project)
 
         resp1_name = project['name']
 
         p_name2 = data_utils.rand_name('project2-')
-        resp, body = self.v3_client.update_project(project['id'], name=p_name2)
+        resp, body = self.client.update_project(project['id'], name=p_name2)
         st2 = resp['status']
         resp2_name = body['name']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_name, resp2_name)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_name = body['name']
 
         self.assertNotEqual(resp1_name, resp3_name)
@@ -122,20 +122,20 @@
         # Update description attribute of a project
         p_name = data_utils.rand_name('project-')
         p_desc = data_utils.rand_name('desc-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             p_name, description=p_desc)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         resp1_desc = project['description']
 
         p_desc2 = data_utils.rand_name('desc2-')
-        resp, body = self.v3_client.update_project(
+        resp, body = self.client.update_project(
             project['id'], description=p_desc2)
         st2 = resp['status']
         resp2_desc = body['description']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_desc, resp2_desc)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_desc = body['description']
 
         self.assertNotEqual(resp1_desc, resp3_desc)
@@ -147,20 +147,20 @@
         # Update the enabled attribute of a project
         p_name = data_utils.rand_name('project-')
         p_en = False
-        resp, project = self.v3_client.create_project(p_name, enabled=p_en)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name, enabled=p_en)
+        self.data.projects.append(project)
 
         resp1_en = project['enabled']
 
         p_en2 = True
-        resp, body = self.v3_client.update_project(
+        resp, body = self.client.update_project(
             project['id'], enabled=p_en2)
         st2 = resp['status']
         resp2_en = body['enabled']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_en, resp2_en)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_en = body['enabled']
 
         self.assertNotEqual(resp1_en, resp3_en)
@@ -172,23 +172,23 @@
         #Associate a user to a project
         #Create a Project
         p_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(p_name)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name)
+        self.data.projects.append(project)
 
         #Create a User
         u_name = data_utils.rand_name('user-')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=project['id'])
         self.assertEqual(resp['status'], '201')
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
 
         # Get User To validate the user details
-        resp, new_user_get = self.v3_client.get_user(user['id'])
+        resp, new_user_get = self.client.get_user(user['id'])
         #Assert response body of GET
         self.assertEqual(u_name, new_user_get['name'])
         self.assertEqual(u_desc, new_user_get['description'])
@@ -200,53 +200,53 @@
     def test_list_projects_by_unauthorized_user(self):
         # Non-admin user should not be able to list projects
         self.assertRaises(exceptions.Unauthorized,
-                          self.v3_non_admin_client.list_projects)
+                          self.non_admin_client.list_projects)
 
     @attr(type=['negative', 'gate'])
     def test_project_create_duplicate(self):
         # Project names should be unique
         project_name = data_utils.rand_name('project-dup-')
-        resp, project = self.v3_client.create_project(project_name)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(project_name)
+        self.data.projects.append(project)
 
         self.assertRaises(
-            exceptions.Conflict, self.v3_client.create_project, project_name)
+            exceptions.Conflict, self.client.create_project, project_name)
 
     @attr(type=['negative', 'gate'])
     def test_create_project_by_unauthorized_user(self):
         # Non-admin user should not be authorized to create a project
         project_name = data_utils.rand_name('project-')
         self.assertRaises(
-            exceptions.Unauthorized, self.v3_non_admin_client.create_project,
+            exceptions.Unauthorized, self.non_admin_client.create_project,
             project_name)
 
     @attr(type=['negative', 'gate'])
     def test_create_project_with_empty_name(self):
         # Project name should not be empty
-        self.assertRaises(exceptions.BadRequest, self.v3_client.create_project,
+        self.assertRaises(exceptions.BadRequest, self.client.create_project,
                           name='')
 
     @attr(type=['negative', 'gate'])
     def test_create_projects_name_length_over_64(self):
         # Project name length should not be greater than 64 characters
         project_name = 'a' * 65
-        self.assertRaises(exceptions.BadRequest, self.v3_client.create_project,
+        self.assertRaises(exceptions.BadRequest, self.client.create_project,
                           project_name)
 
     @attr(type=['negative', 'gate'])
     def test_project_delete_by_unauthorized_user(self):
         # Non-admin user should not be able to delete a project
         project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(project_name)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(project_name)
+        self.data.projects.append(project)
         self.assertRaises(
-            exceptions.Unauthorized, self.v3_non_admin_client.delete_project,
+            exceptions.Unauthorized, self.non_admin_client.delete_project,
             project['id'])
 
     @attr(type=['negative', 'gate'])
     def test_delete_non_existent_project(self):
         # Attempt to delete a non existent project should fail
-        self.assertRaises(exceptions.NotFound, self.v3_client.delete_project,
+        self.assertRaises(exceptions.NotFound, self.client.delete_project,
                           'junk_Project_123456abc')
 
 
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index efaed39..467d28b 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class RolesV3TestJSON(base.BaseIdentityAdminTest):
+class RolesV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -30,20 +30,20 @@
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
         resp = [None] * 5
-        resp[0], cls.project = cls.v3_client.create_project(
+        resp[0], cls.project = cls.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
-        resp[1], cls.domain = cls.v3_client.create_domain(
+        resp[1], cls.domain = cls.client.create_domain(
             data_utils.rand_name('domain-'),
             description=data_utils.rand_name('domain-desc-'))
-        resp[2], cls.group_body = cls.v3_client.create_group(
+        resp[2], cls.group_body = cls.client.create_group(
             data_utils.rand_name('Group-'), project_id=cls.project['id'],
             domain_id=cls.domain['id'])
-        resp[3], cls.user_body = cls.v3_client.create_user(
+        resp[3], cls.user_body = cls.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=cls.project['id'],
             domain_id=cls.domain['id'])
-        resp[4], cls.role = cls.v3_client.create_role(
+        resp[4], cls.role = cls.client.create_role(
             data_utils.rand_name('Role-'))
         for r in resp:
             assert r['status'] == '201', "Expected: %s" % r['status']
@@ -51,14 +51,14 @@
     @classmethod
     def tearDownClass(cls):
         resp = [None] * 5
-        resp[0], _ = cls.v3_client.delete_role(cls.role['id'])
-        resp[1], _ = cls.v3_client.delete_group(cls.group_body['id'])
-        resp[2], _ = cls.v3_client.delete_user(cls.user_body['id'])
-        resp[3], _ = cls.v3_client.delete_project(cls.project['id'])
+        resp[0], _ = cls.client.delete_role(cls.role['id'])
+        resp[1], _ = cls.client.delete_group(cls.group_body['id'])
+        resp[2], _ = cls.client.delete_user(cls.user_body['id'])
+        resp[3], _ = cls.client.delete_project(cls.project['id'])
         # NOTE(harika-vakadi): It is necessary to disable the domain
         # before deleting,or else it would result in unauthorized error
-        cls.v3_client.update_domain(cls.domain['id'], enabled=False)
-        resp[4], _ = cls.v3_client.delete_domain(cls.domain['id'])
+        cls.client.update_domain(cls.domain['id'], enabled=False)
+        resp[4], _ = cls.client.delete_domain(cls.domain['id'])
         for r in resp:
             assert r['status'] == '204', "Expected: %s" % r['status']
         super(RolesV3TestJSON, cls).tearDownClass()
@@ -71,32 +71,32 @@
     @attr(type='smoke')
     def test_role_create_update_get(self):
         r_name = data_utils.rand_name('Role-')
-        resp, role = self.v3_client.create_role(r_name)
-        self.addCleanup(self.v3_client.delete_role, role['id'])
+        resp, role = self.client.create_role(r_name)
+        self.addCleanup(self.client.delete_role, role['id'])
         self.assertEqual(resp['status'], '201')
         self.assertIn('name', role)
         self.assertEqual(role['name'], r_name)
 
         new_name = data_utils.rand_name('NewRole-')
-        resp, updated_role = self.v3_client.update_role(new_name, role['id'])
+        resp, updated_role = self.client.update_role(new_name, role['id'])
         self.assertEqual(resp['status'], '200')
         self.assertIn('name', updated_role)
         self.assertIn('id', updated_role)
         self.assertIn('links', updated_role)
         self.assertNotEqual(r_name, updated_role['name'])
 
-        resp, new_role = self.v3_client.get_role(role['id'])
+        resp, new_role = self.client.get_role(role['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(new_name, new_role['name'])
         self.assertEqual(updated_role['id'], new_role['id'])
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_user_on_project(self):
-        resp, _ = self.v3_client.assign_user_role_on_project(
+        resp, _ = self.client.assign_user_role_on_project(
             self.project['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_user_roles_on_project(
+        resp, roles = self.client.list_user_roles_on_project(
             self.project['id'], self.user_body['id'])
 
         for i in roles:
@@ -105,17 +105,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_user_on_project(
+        resp, _ = self.client.revoke_role_from_user_on_project(
             self.project['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_user_on_domain(self):
-        resp, _ = self.v3_client.assign_user_role_on_domain(
+        resp, _ = self.client.assign_user_role_on_domain(
             self.domain['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_user_roles_on_domain(
+        resp, roles = self.client.list_user_roles_on_domain(
             self.domain['id'], self.user_body['id'])
 
         for i in roles:
@@ -124,17 +124,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_user_on_domain(
+        resp, _ = self.client.revoke_role_from_user_on_domain(
             self.domain['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_group_on_project(self):
-        resp, _ = self.v3_client.assign_group_role_on_project(
+        resp, _ = self.client.assign_group_role_on_project(
             self.project['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_group_roles_on_project(
+        resp, roles = self.client.list_group_roles_on_project(
             self.project['id'], self.group_body['id'])
 
         for i in roles:
@@ -143,17 +143,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_group_on_project(
+        resp, _ = self.client.revoke_role_from_group_on_project(
             self.project['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_group_on_domain(self):
-        resp, _ = self.v3_client.assign_group_role_on_domain(
+        resp, _ = self.client.assign_group_role_on_domain(
             self.domain['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_group_roles_on_domain(
+        resp, roles = self.client.list_group_roles_on_domain(
             self.domain['id'], self.group_body['id'])
 
         for i in roles:
@@ -162,7 +162,7 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_group_on_domain(
+        resp, _ = self.client.revoke_role_from_group_on_domain(
             self.domain['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index 4d6c22f..c5d4ddf 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -19,20 +19,20 @@
 from tempest.test import attr
 
 
-class ServicesTestJSON(base.BaseIdentityAdminTest):
+class ServicesTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
     def test_update_service(self):
         # Update description attribute of service
         name = data_utils.rand_name('service-')
-        type = data_utils.rand_name('type--')
-        description = data_utils.rand_name('description-')
-        resp, body = self.client.create_service(
-            name, type, description=description)
-        self.assertEqual('200', resp['status'])
+        serv_type = data_utils.rand_name('type--')
+        desc = data_utils.rand_name('description-')
+        resp, body = self.service_client.create_service(name, serv_type,
+                                                        description=desc)
+        self.assertEqual('201', resp['status'])
         # Deleting the service created in this method
-        self.addCleanup(self.client.delete_service, body['id'])
+        self.addCleanup(self.service_client.delete_service, body['id'])
 
         s_id = body['id']
         resp1_desc = body['description']
@@ -45,7 +45,7 @@
         self.assertNotEqual(resp1_desc, resp2_desc)
 
         # Get service
-        resp, body = self.client.get_service(s_id)
+        resp, body = self.service_client.get_service(s_id)
         resp3_desc = body['description']
 
         self.assertNotEqual(resp1_desc, resp3_desc)
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index d17dc4a..9629213 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class UsersTestJSON(base.BaseIdentityAdminTest):
+class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='smoke')
@@ -30,26 +30,26 @@
         u_desc = '%s-description' % u_name
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email)
         self.assertTrue(resp['status'].startswith('2'))
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
         # Perform Authentication
-        resp, body = self.v3_token.auth(user['id'], u_password)
+        resp, body = self.token.auth(user['id'], u_password)
         self.assertEqual(resp['status'], '201')
         subject_token = resp['x-subject-token']
         # Perform GET Token
-        resp, token_details = self.v3_client.get_token(subject_token)
+        resp, token_details = self.client.get_token(subject_token)
         self.assertEqual(resp['status'], '200')
         self.assertEqual(resp['x-subject-token'], subject_token)
         self.assertEqual(token_details['user']['id'], user['id'])
         self.assertEqual(token_details['user']['name'], u_name)
         # Perform Delete Token
-        resp, _ = self.v3_client.delete_token(subject_token)
-        self.assertRaises(exceptions.NotFound, self.v3_client.get_token,
+        resp, _ = self.client.delete_token(subject_token)
+        self.assertRaises(exceptions.NotFound, self.client.get_token,
                           subject_token)
 
 
-class UsersTestXML(UsersTestJSON):
+class TokensV3TestXML(TokensV3TestJSON):
     _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 1bebad4..cae20ad 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -14,16 +14,16 @@
 import re
 from tempest.api.identity import base
 from tempest import clients
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import timeutils
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
 
-class BaseTrustsV3Test(base.BaseIdentityAdminTest):
+class BaseTrustsV3Test(base.BaseIdentityV3AdminTest):
 
     def setUp(self):
         super(BaseTrustsV3Test, self).setUp()
@@ -43,17 +43,17 @@
 
     def create_trustor_and_roles(self):
         # Get trustor project ID, use the admin project
-        self.trustor_project_name = self.v3_client.tenant_name
+        self.trustor_project_name = self.client.tenant_name
         self.trustor_project_id = self.get_tenant_by_name(
             self.trustor_project_name)['id']
         self.assertIsNotNone(self.trustor_project_id)
 
         # Create a trustor User
-        self.trustor_username = rand_name('user-')
+        self.trustor_username = data_utils.rand_name('user-')
         u_desc = self.trustor_username + 'description'
         u_email = self.trustor_username + '@testmail.xx'
-        self.trustor_password = rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        self.trustor_password = data_utils.rand_name('pass-')
+        resp, user = self.client.create_user(
             self.trustor_username,
             description=u_desc,
             password=self.trustor_password,
@@ -63,27 +63,27 @@
         self.trustor_user_id = user['id']
 
         # And two roles, one we'll delegate and one we won't
-        self.delegated_role = rand_name('DelegatedRole-')
-        self.not_delegated_role = rand_name('NotDelegatedRole-')
+        self.delegated_role = data_utils.rand_name('DelegatedRole-')
+        self.not_delegated_role = data_utils.rand_name('NotDelegatedRole-')
 
-        resp, role = self.v3_client.create_role(self.delegated_role)
+        resp, role = self.client.create_role(self.delegated_role)
         self.assertEqual(resp['status'], '201')
         self.delegated_role_id = role['id']
 
-        resp, role = self.v3_client.create_role(self.not_delegated_role)
+        resp, role = self.client.create_role(self.not_delegated_role)
         self.assertEqual(resp['status'], '201')
         self.not_delegated_role_id = role['id']
 
         # Assign roles to trustor
-        self.v3_client.assign_user_role(self.trustor_project_id,
-                                        self.trustor_user_id,
-                                        self.delegated_role_id)
-        self.v3_client.assign_user_role(self.trustor_project_id,
-                                        self.trustor_user_id,
-                                        self.not_delegated_role_id)
+        self.client.assign_user_role(self.trustor_project_id,
+                                     self.trustor_user_id,
+                                     self.delegated_role_id)
+        self.client.assign_user_role(self.trustor_project_id,
+                                     self.trustor_user_id,
+                                     self.not_delegated_role_id)
 
         # Get trustee user ID, use the demo user
-        trustee_username = self.v3_non_admin_client.user
+        trustee_username = self.non_admin_client.user
         self.trustee_user_id = self.get_user_by_name(trustee_username)['id']
         self.assertIsNotNone(self.trustee_user_id)
 
@@ -92,19 +92,19 @@
                              password=self.trustor_password,
                              tenant_name=self.trustor_project_name,
                              interface=self._interface)
-        self.trustor_v3_client = os.identity_v3_client
+        self.trustor_client = os.identity_v3_client
 
     def cleanup_user_and_roles(self):
         if self.trustor_user_id:
-            self.v3_client.delete_user(self.trustor_user_id)
+            self.client.delete_user(self.trustor_user_id)
         if self.delegated_role_id:
-            self.v3_client.delete_role(self.delegated_role_id)
+            self.client.delete_role(self.delegated_role_id)
         if self.not_delegated_role_id:
-            self.v3_client.delete_role(self.not_delegated_role_id)
+            self.client.delete_role(self.not_delegated_role_id)
 
     def create_trust(self, impersonate=True, expires=None):
 
-        resp, trust_create = self.trustor_v3_client.create_trust(
+        resp, trust_create = self.trustor_client.create_trust(
             trustor_user_id=self.trustor_user_id,
             trustee_user_id=self.trustee_user_id,
             project_id=self.trustor_project_id,
@@ -137,7 +137,7 @@
             self.assertEqual(1, len(trust['roles']))
 
     def get_trust(self):
-        resp, trust_get = self.trustor_v3_client.get_trust(self.trust_id)
+        resp, trust_get = self.trustor_client.get_trust(self.trust_id)
         self.assertEqual('200', resp['status'])
         return trust_get
 
@@ -153,37 +153,37 @@
 
     def check_trust_roles(self):
         # Check we find the delegated role
-        resp, roles_get = self.trustor_v3_client.get_trust_roles(
+        resp, roles_get = self.trustor_client.get_trust_roles(
             self.trust_id)
         self.assertEqual('200', resp['status'])
         self.assertEqual(1, len(roles_get))
         self.validate_role(roles_get[0])
 
-        resp, role_get = self.trustor_v3_client.get_trust_role(
+        resp, role_get = self.trustor_client.get_trust_role(
             self.trust_id, self.delegated_role_id)
         self.assertEqual('200', resp['status'])
         self.validate_role(role_get)
 
-        resp, role_get = self.trustor_v3_client.check_trust_role(
+        resp, role_get = self.trustor_client.check_trust_role(
             self.trust_id, self.delegated_role_id)
         self.assertEqual('204', resp['status'])
 
         # And that we don't find not_delegated_role
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.get_trust_role,
+                          self.trustor_client.get_trust_role,
                           self.trust_id,
                           self.not_delegated_role_id)
 
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.check_trust_role,
+                          self.trustor_client.check_trust_role,
                           self.trust_id,
                           self.not_delegated_role_id)
 
     def delete_trust(self):
-        resp, trust_delete = self.trustor_v3_client.delete_trust(self.trust_id)
+        resp, trust_delete = self.trustor_client.delete_trust(self.trust_id)
         self.assertEqual('204', resp['status'])
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.get_trust,
+                          self.trustor_client.get_trust,
                           self.trust_id)
         self.trust_id = None
 
@@ -196,7 +196,7 @@
         self.create_trustor_and_roles()
         self.addCleanup(self.cleanup_user_and_roles)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_impersonate(self):
         # Test case to check we can create, get and delete a trust
         # updates are not supported for trusts
@@ -208,7 +208,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_noimpersonate(self):
         # Test case to check we can create, get and delete a trust
         # with impersonation=False
@@ -220,7 +220,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_expire(self):
         # Test case to check we can create, get and delete a trust
         # with an expiry specified
@@ -236,7 +236,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_expire_invalid(self):
         # Test case to check we can check an invlaid expiry time
         # is rejected with the correct error
@@ -246,19 +246,19 @@
                           self.create_trust,
                           expires=expires_str)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_trusts_query(self):
         self.create_trust()
-        resp, trusts_get = self.trustor_v3_client.get_trusts(
+        resp, trusts_get = self.trustor_client.get_trusts(
             trustor_user_id=self.trustor_user_id)
         self.assertEqual('200', resp['status'])
         self.assertEqual(1, len(trusts_get))
         self.validate_trust(trusts_get[0], summary=True)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_trusts_all(self):
         self.create_trust()
-        resp, trusts_get = self.v3_client.get_trusts()
+        resp, trusts_get = self.client.get_trusts()
         self.assertEqual('200', resp['status'])
         trusts = [t for t in trusts_get
                   if t['id'] == self.trust_id]
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 7cae856..a78d542 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class UsersV3TestJSON(base.BaseIdentityAdminTest):
+class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
@@ -29,22 +29,22 @@
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False)
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
         # Creating second project for updation
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
         # Delete the Project at the end of this method
-        self.addCleanup(self.v3_client.delete_project, project['id'])
+        self.addCleanup(self.client.delete_project, project['id'])
         # Updating user details with new values
         u_name2 = data_utils.rand_name('user2-')
         u_email2 = u_name2 + '@testmail.tm'
         u_description2 = u_name2 + ' description'
-        resp, update_user = self.v3_client.update_user(
+        resp, update_user = self.client.update_user(
             user['id'], name=u_name2, description=u_description2,
             project_id=project['id'],
             email=u_email2, enabled=False)
@@ -57,7 +57,7 @@
         self.assertEqual(u_email2, update_user['email'])
         self.assertEqual('false', str(update_user['enabled']).lower())
         # GET by id after updation
-        resp, new_user_get = self.v3_client.get_user(user['id'])
+        resp, new_user_get = self.client.get_user(user['id'])
         # Assert response body of GET after updation
         self.assertEqual(u_name2, new_user_get['name'])
         self.assertEqual(u_description2, new_user_get['description'])
@@ -71,43 +71,43 @@
         # List the projects that a user has access upon
         assigned_project_ids = list()
         fetched_project_ids = list()
-        _, u_project = self.v3_client.create_project(
+        _, u_project = self.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
         # Delete the Project at the end of this method
-        self.addCleanup(self.v3_client.delete_project, u_project['id'])
+        self.addCleanup(self.client.delete_project, u_project['id'])
         # Create a user.
         u_name = data_utils.rand_name('user-')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        _, user_body = self.v3_client.create_user(
+        _, user_body = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False, project_id=u_project['id'])
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user_body['id'])
+        self.addCleanup(self.client.delete_user, user_body['id'])
         # Creating Role
-        _, role_body = self.v3_client.create_role(
+        _, role_body = self.client.create_role(
             data_utils.rand_name('role-'))
         # Delete the Role at the end of this method
-        self.addCleanup(self.v3_client.delete_role, role_body['id'])
+        self.addCleanup(self.client.delete_role, role_body['id'])
 
-        _, user = self.v3_client.get_user(user_body['id'])
-        _, role = self.v3_client.get_role(role_body['id'])
+        _, user = self.client.get_user(user_body['id'])
+        _, role = self.client.get_role(role_body['id'])
         for i in range(2):
             # Creating project so as to assign role
-            _, project_body = self.v3_client.create_project(
+            _, project_body = self.client.create_project(
                 data_utils.rand_name('project-'),
                 description=data_utils.rand_name('project-desc-'))
-            _, project = self.v3_client.get_project(project_body['id'])
+            _, project = self.client.get_project(project_body['id'])
             # Delete the Project at the end of this method
-            self.addCleanup(self.v3_client.delete_project, project_body['id'])
+            self.addCleanup(self.client.delete_project, project_body['id'])
             # Assigning roles to user on project
-            self.v3_client.assign_user_role(project['id'],
-                                            user['id'],
-                                            role['id'])
+            self.client.assign_user_role(project['id'],
+                                         user['id'],
+                                         role['id'])
             assigned_project_ids.append(project['id'])
-        resp, body = self.v3_client.list_user_projects(user['id'])
+        resp, body = self.client.list_user_projects(user['id'])
         self.assertEqual(200, resp.status)
         for i in body:
             fetched_project_ids.append(i['id'])
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index a3fc65a..10f5217 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -16,67 +16,98 @@
 
 from tempest import clients
 from tempest.common.utils import data_utils
+from tempest import config
 import tempest.test
 
+CONF = config.CONF
+
 
 class BaseIdentityAdminTest(tempest.test.BaseTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(BaseIdentityAdminTest, cls).setUpClass()
-        os = clients.AdminManager(interface=cls._interface)
-        cls.client = os.identity_client
-        cls.token_client = os.token_client
-        cls.endpoints_client = os.endpoints_client
-        cls.v3_client = os.identity_v3_client
-        cls.service_client = os.service_client
-        cls.policy_client = os.policy_client
-        cls.v3_token = os.token_v3_client
-        cls.creds_client = os.credentials_client
-
-        if not cls.client.has_admin_extensions():
-            raise cls.skipException("Admin extensions disabled")
-
-        cls.data = DataGenerator(cls.client)
-        cls.v3data = DataGenerator(cls.v3_client)
-
-        os = clients.Manager(interface=cls._interface)
-        cls.non_admin_client = os.identity_client
-        cls.v3_non_admin_client = os.identity_v3_client
+        cls.os_adm = clients.AdminManager(interface=cls._interface)
+        cls.os = clients.Manager(interface=cls._interface)
 
     @classmethod
-    def tearDownClass(cls):
-        cls.data.teardown_all()
-        cls.v3data.teardown_all()
-        super(BaseIdentityAdminTest, cls).tearDownClass()
+    def disable_user(cls, user_name):
+        user = cls.get_user_by_name(user_name)
+        cls.client.enable_disable_user(user['id'], False)
 
-    def disable_user(self, user_name):
-        user = self.get_user_by_name(user_name)
-        self.client.enable_disable_user(user['id'], False)
+    @classmethod
+    def disable_tenant(cls, tenant_name):
+        tenant = cls.get_tenant_by_name(tenant_name)
+        cls.client.update_tenant(tenant['id'], enabled=False)
 
-    def disable_tenant(self, tenant_name):
-        tenant = self.get_tenant_by_name(tenant_name)
-        self.client.update_tenant(tenant['id'], enabled=False)
-
-    def get_user_by_name(self, name):
-        _, users = self.client.get_users()
+    @classmethod
+    def get_user_by_name(cls, name):
+        _, users = cls.client.get_users()
         user = [u for u in users if u['name'] == name]
         if len(user) > 0:
             return user[0]
 
-    def get_tenant_by_name(self, name):
-        _, tenants = self.client.list_tenants()
+    @classmethod
+    def get_tenant_by_name(cls, name):
+        try:
+            _, tenants = cls.client.list_tenants()
+        except AttributeError:
+            _, tenants = cls.client.list_projects()
         tenant = [t for t in tenants if t['name'] == name]
         if len(tenant) > 0:
             return tenant[0]
 
-    def get_role_by_name(self, name):
-        _, roles = self.client.list_roles()
+    @classmethod
+    def get_role_by_name(cls, name):
+        _, roles = cls.client.list_roles()
         role = [r for r in roles if r['name'] == name]
         if len(role) > 0:
             return role[0]
 
 
+class BaseIdentityV2AdminTest(BaseIdentityAdminTest):
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.identity_feature_enabled.api_v2:
+            raise cls.skipException("Identity api v2 is not enabled")
+        super(BaseIdentityV2AdminTest, cls).setUpClass()
+        cls.client = cls.os_adm.identity_client
+        cls.token_client = cls.os_adm.token_client
+        if not cls.client.has_admin_extensions():
+            raise cls.skipException("Admin extensions disabled")
+        cls.data = DataGenerator(cls.client)
+        cls.non_admin_client = cls.os.identity_client
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.data.teardown_all()
+        super(BaseIdentityV2AdminTest, cls).tearDownClass()
+
+
+class BaseIdentityV3AdminTest(BaseIdentityAdminTest):
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.identity_feature_enabled.api_v3:
+            raise cls.skipException("Identity api v3 is not enabled")
+        super(BaseIdentityV3AdminTest, cls).setUpClass()
+        cls.client = cls.os_adm.identity_v3_client
+        cls.token = cls.os_adm.token_v3_client
+        cls.endpoints_client = cls.os_adm.endpoints_client
+        cls.data = DataGenerator(cls.client)
+        cls.non_admin_client = cls.os.identity_v3_client
+        cls.service_client = cls.os_adm.service_client
+        cls.policy_client = cls.os_adm.policy_client
+        cls.creds_client = cls.os_adm.credentials_client
+        cls.non_admin_client = cls.os.identity_v3_client
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.data.teardown_all()
+        super(BaseIdentityV3AdminTest, cls).tearDownClass()
+
+
 class DataGenerator(object):
 
         def __init__(self, client):
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index d8b79ca..517123d 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -16,8 +16,9 @@
 import cStringIO as StringIO
 
 from tempest.api.image import base
+from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -25,7 +26,7 @@
 class CreateRegisterImagesTest(base.BaseV1ImageTest):
     """Here we test the registration and creation of images."""
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_then_upload(self):
         # Register, then upload an image
         properties = {'prop1': 'val1'}
@@ -48,7 +49,7 @@
         self.assertIn('size', body)
         self.assertEqual(1024, body.get('size'))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_remote_image(self):
         # Register a new remote image
         resp, body = self.create_image(name='New Remote Image',
@@ -66,7 +67,7 @@
         self.assertEqual(properties['key1'], 'value1')
         self.assertEqual(properties['key2'], 'value2')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_http_image(self):
         resp, body = self.create_image(name='New Http Image',
                                        container_format='bare',
@@ -80,7 +81,7 @@
         resp, body = self.client.get_image(image_id)
         self.assertEqual(resp['status'], '200')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_image_with_min_ram(self):
         # Register an image with min ram
         properties = {'prop1': 'val1'}
@@ -110,7 +111,6 @@
     @classmethod
     def setUpClass(cls):
         super(ListImagesTest, cls).setUpClass()
-
         # We add a few images here to test the listing functionality of
         # the images API
         img1 = cls._create_remote_image('one', 'bare', 'raw')
@@ -131,7 +131,7 @@
         # 1x with size 42
         cls.size42_set = set((img5,))
         # 3x with size 142
-        cls.size142_set = set((img6, img7, img8))
+        cls.size142_set = set((img6, img7, img8,))
         # dup named
         cls.dup_set = set((img3, img4))
 
@@ -168,7 +168,7 @@
         image_id = image['id']
         return image_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_no_params(self):
         # Simple test to see all fixture images returned
         resp, images_list = self.client.image_list()
@@ -177,7 +177,7 @@
         for image_id in self.created_images:
             self.assertIn(image_id, image_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_disk_format(self):
         resp, images_list = self.client.image_list(disk_format='ami')
         self.assertEqual(resp['status'], '200')
@@ -187,7 +187,7 @@
         self.assertTrue(self.ami_set <= result_set)
         self.assertFalse(self.created_set - self.ami_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_container_format(self):
         resp, images_list = self.client.image_list(container_format='bare')
         self.assertEqual(resp['status'], '200')
@@ -197,7 +197,7 @@
         self.assertTrue(self.bare_set <= result_set)
         self.assertFalse(self.created_set - self.bare_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_max_size(self):
         resp, images_list = self.client.image_list(size_max=42)
         self.assertEqual(resp['status'], '200')
@@ -207,7 +207,7 @@
         self.assertTrue(self.size42_set <= result_set)
         self.assertFalse(self.created_set - self.size42_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_min_size(self):
         resp, images_list = self.client.image_list(size_min=142)
         self.assertEqual(resp['status'], '200')
@@ -217,7 +217,7 @@
         self.assertTrue(self.size142_set <= result_set)
         self.assertFalse(self.size42_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_status_active_detail(self):
         resp, images_list = self.client.image_list_detail(status='active',
                                                           sort_key='size',
@@ -230,7 +230,7 @@
             top_size = size
             self.assertEqual(image['status'], 'active')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_name(self):
         resp, images_list = self.client.image_list_detail(
             name='New Remote Image dup')
@@ -240,3 +240,139 @@
             self.assertEqual(image['name'], 'New Remote Image dup')
         self.assertTrue(self.dup_set <= result_set)
         self.assertFalse(self.created_set - self.dup_set <= result_set)
+
+
+class ListSnapshotImagesTest(base.BaseV1ImageTest):
+    @classmethod
+    def setUpClass(cls):
+        super(ListSnapshotImagesTest, cls).setUpClass()
+        if not CONF.compute_feature_enabled.api_v3:
+            cls.servers_client = cls.os.servers_client
+        else:
+            cls.servers_client = cls.os.servers_v3_client
+        cls.servers = []
+        # We add a few images here to test the listing functionality of
+        # the images API
+        cls.snapshot = cls._create_snapshot(
+            'snapshot', CONF.compute.image_ref,
+            CONF.compute.flavor_ref)
+        cls.snapshot_set = set((cls.snapshot,))
+
+        image_file = StringIO.StringIO('*' * 42)
+        resp, image = cls.create_image(name="Standard Image",
+                                       container_format='ami',
+                                       disk_format='ami',
+                                       is_public=True, data=image_file)
+        cls.image_id = image['id']
+        cls.client.wait_for_image_status(image['id'], 'active')
+
+    @classmethod
+    def tearDownClass(cls):
+        for server in cls.servers:
+            cls.servers_client.delete_server(server['id'])
+        super(ListSnapshotImagesTest, cls).tearDownClass()
+
+    @classmethod
+    def _create_snapshot(cls, name, image_id, flavor, **kwargs):
+        resp, server = cls.servers_client.create_server(
+            name, image_id, flavor, **kwargs)
+        cls.servers.append(server)
+        cls.servers_client.wait_for_server_status(
+            server['id'], 'ACTIVE')
+        resp, image = cls.servers_client.create_image(
+            server['id'], name)
+        image_id = data_utils.parse_image_id(resp['location'])
+        cls.created_images.append(image_id)
+        cls.client.wait_for_image_status(image_id,
+                                         'active')
+        return image_id
+
+    @test.attr(type='gate')
+    def test_index_server_id(self):
+        # The images should contain images filtered by server id
+        resp, images = self.client.image_list_detail(
+            {'instance_uuid': self.servers[0]['id']})
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertEqual(self.snapshot_set, result_set)
+
+    @test.attr(type='gate')
+    def test_index_type(self):
+        # The list of servers should be filtered by image type
+        params = {'image_type': 'snapshot'}
+        resp, images = self.client.image_list_detail(params)
+
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertIn(self.snapshot, result_set)
+
+    @test.attr(type='gate')
+    def test_index_limit(self):
+        # Verify only the expected number of results are returned
+        resp, images = self.client.image_list_detail(limit=1)
+
+        self.assertEqual(200, resp.status)
+        self.assertEqual(1, len(images))
+
+    @test.attr(type='gate')
+    def test_index_by_change_since(self):
+        # Verify an update image is returned
+        # Becoming ACTIVE will modify the updated time
+        # Filter by the image's created time
+        resp, image = self.client.get_image_meta(self.snapshot)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(self.snapshot, image['id'])
+        resp, images = self.client.image_list_detail(
+            changes_since=image['updated_at'])
+
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertIn(self.image_id, result_set)
+        self.assertNotIn(self.snapshot, result_set)
+
+
+class UpdateImageMetaTest(base.BaseV1ImageTest):
+    @classmethod
+    def setUpClass(cls):
+        super(UpdateImageMetaTest, cls).setUpClass()
+        cls.image_id = cls._create_standard_image('1', 'ami', 'ami', 42)
+
+    @classmethod
+    def _create_standard_image(cls, name, container_format,
+                               disk_format, size):
+        """
+        Create a new standard image and return the ID of the newly-registered
+        image. Note that the size of the new image is a random number between
+        1024 and 4096
+        """
+        image_file = StringIO.StringIO('*' * size)
+        name = 'New Standard Image %s' % name
+        resp, image = cls.create_image(name=name,
+                                       container_format=container_format,
+                                       disk_format=disk_format,
+                                       is_public=True, data=image_file,
+                                       properties={'key1': 'value1'})
+        image_id = image['id']
+        return image_id
+
+    @test.attr(type='gate')
+    def test_list_image_metadata(self):
+        # All metadata key/value pairs for an image should be returned
+        resp, resp_metadata = self.client.get_image_meta(self.image_id)
+        expected = {'key1': 'value1'}
+        self.assertEqual(expected, resp_metadata['properties'])
+
+    @test.attr(type='gate')
+    def test_update_image_metadata(self):
+        # The metadata for the image should match the updated values
+        req_metadata = {'key1': 'alt1', 'key2': 'value2'}
+        resp, metadata = self.client.get_image_meta(self.image_id)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(metadata['properties'], {'key1': 'value1'})
+        metadata['properties'].update(req_metadata)
+        resp, metadata = self.client.update_image(
+            self.image_id, properties=metadata['properties'])
+
+        resp, resp_metadata = self.client.get_image_meta(self.image_id)
+        expected = {'key1': 'alt1', 'key2': 'value2'}
+        self.assertEqual(expected, resp_metadata['properties'])
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index b05f275..342bc6a 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -14,7 +14,7 @@
 
 from tempest.api.network import base
 from tempest.common import tempest_fixtures as fixtures
-from tempest.test import attr
+from tempest import test
 
 
 class AgentManagementTestJSON(base.BaseAdminNetworkTest):
@@ -23,11 +23,14 @@
     @classmethod
     def setUpClass(cls):
         super(AgentManagementTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('agent', 'network'):
+            msg = "agent extension not enabled."
+            raise cls.skipException(msg)
         resp, body = cls.admin_client.list_agents()
         agents = body['agents']
         cls.agent = agents[0]
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_agent(self):
         resp, body = self.admin_client.list_agents()
         self.assertEqual('200', resp['status'])
@@ -38,20 +41,20 @@
             agent.pop('heartbeat_timestamp', None)
         self.assertIn(self.agent, agents)
 
-    @attr(type=['smoke'])
+    @test.attr(type=['smoke'])
     def test_list_agents_non_admin(self):
         resp, body = self.client.list_agents()
         self.assertEqual('200', resp['status'])
         self.assertEqual(len(body["agents"]), 0)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_show_agent(self):
         resp, body = self.admin_client.show_agent(self.agent['id'])
         agent = body['agent']
         self.assertEqual('200', resp['status'])
         self.assertEqual(agent['id'], self.agent['id'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_agent_status(self):
         origin_status = self.agent['admin_state_up']
         # Try to update the 'admin_state_up' to the original
@@ -63,7 +66,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual(origin_status, updated_status)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_agent_description(self):
         self.useFixture(fixtures.LockFixture('agent_description'))
         description = 'description for update agent.'
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index 13309cd..ecd992a 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -13,7 +13,7 @@
 #    under the License.
 
 from tempest.api.network import base
-from tempest.test import attr
+from tempest import test
 
 
 class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest):
@@ -22,6 +22,9 @@
     @classmethod
     def setUpClass(cls):
         super(DHCPAgentSchedulersTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('dhcp_agent_scheduler', 'network'):
+            msg = "dhcp_agent_scheduler extension not enabled."
+            raise cls.skipException(msg)
         # Create a network and make sure it will be hosted by a
         # dhcp agent.
         cls.network = cls.create_network()
@@ -29,13 +32,13 @@
         cls.cidr = cls.subnet['cidr']
         cls.port = cls.create_port(cls.network)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_dhcp_agent_hosting_network(self):
         resp, body = self.admin_client.list_dhcp_agent_hosting_network(
             self.network['id'])
         self.assertEqual(resp['status'], '200')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_networks_hosted_by_one_dhcp(self):
         resp, body = self.admin_client.list_dhcp_agent_hosting_network(
             self.network['id'])
@@ -55,7 +58,7 @@
             network_ids.append(network['id'])
         return network_id in network_ids
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_remove_network_from_dhcp_agent(self):
         resp, body = self.admin_client.list_dhcp_agent_hosting_network(
             self.network['id'])
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
new file mode 100644
index 0000000..a5ba90f
--- /dev/null
+++ b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
@@ -0,0 +1,78 @@
+# Copyright 2013 IBM Corp.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations in the Neutron API using the REST client for
+    Neutron:
+
+        List pools the given LBaaS agent is hosting.
+        Show a LBaaS agent hosting the given pool.
+
+    v2.0 of the Neutron API is assumed. It is also assumed that the following
+    options are defined in the [networki-feature-enabled] section of
+    etc/tempest.conf:
+
+        api_extensions
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(LBaaSAgentSchedulerTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
+            msg = "LBaaS Agent Scheduler Extension not enabled."
+            raise cls.skipException(msg)
+        cls.network = cls.create_network()
+        cls.subnet = cls.create_subnet(cls.network)
+        pool_name = data_utils.rand_name('pool-')
+        cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
+                                   "HTTP", cls.subnet)
+
+    @test.attr(type='smoke')
+    def test_list_pools_on_lbaas_agent(self):
+        found = False
+        resp, body = self.admin_client.list_agents(
+            agent_type="Loadbalancer agent")
+        self.assertEqual('200', resp['status'])
+        agents = body['agents']
+        for a in agents:
+            msg = 'Load Balancer agent expected'
+            self.assertEqual(a['agent_type'], 'Loadbalancer agent', msg)
+            resp, body = (
+                self.admin_client.list_pools_hosted_by_one_lbaas_agent(
+                    a['id']))
+            self.assertEqual('200', resp['status'])
+            pools = body['pools']
+            if self.pool['id'] in [p['id'] for p in pools]:
+                found = True
+        msg = 'Unable to find Load Balancer agent hosting pool'
+        self.assertTrue(found, msg)
+
+    @test.attr(type='smoke')
+    def test_show_lbaas_agent_hosting_pool(self):
+        resp, body = self.admin_client.show_lbaas_agent_hosting_pool(
+            self.pool['id'])
+        self.assertEqual('200', resp['status'])
+        self.assertEqual('Loadbalancer agent', body['agent']['agent_type'])
+
+
+class LBaaSAgentSchedulerTestXML(LBaaSAgentSchedulerTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index b129786..dd888a6 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -51,6 +51,11 @@
 
     force_tenant_isolation = False
 
+    # Default to ipv4.
+    _ip_version = 4
+    _tenant_network_cidr = CONF.network.tenant_network_cidr
+    _tenant_network_mask_bits = CONF.network.tenant_network_mask_bits
+
     @classmethod
     def setUpClass(cls):
         # Create no network resources for these test.
@@ -75,6 +80,8 @@
         cls.vpnservices = []
         cls.ikepolicies = []
         cls.floating_ips = []
+        cls.metering_labels = []
+        cls.metering_label_rules = []
 
     @classmethod
     def tearDownClass(cls):
@@ -107,6 +114,13 @@
         # Clean up pools
         for pool in cls.pools:
             cls.client.delete_pool(pool['id'])
+        # Clean up metering label rules
+        for metering_label_rule in cls.metering_label_rules:
+            cls.admin_client.delete_metering_label_rule(
+                metering_label_rule['id'])
+        # Clean up metering labels
+        for metering_label in cls.metering_labels:
+            cls.admin_client.delete_metering_label(metering_label['id'])
         # Clean up ports
         for port in cls.ports:
             cls.client.delete_port(port['id'])
@@ -130,10 +144,11 @@
         return network
 
     @classmethod
-    def create_subnet(cls, network, ip_version=4):
+    def create_subnet(cls, network):
         """Wrapper utility that returns a test subnet."""
-        cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
-        mask_bits = CONF.network.tenant_network_mask_bits
+        # The cidr and mask_bits depend on the ip version.
+        cidr = netaddr.IPNetwork(cls._tenant_network_cidr)
+        mask_bits = cls._tenant_network_mask_bits
         # Find a cidr that is not in use yet and create a subnet with it
         body = None
         failure = None
@@ -142,7 +157,7 @@
                 resp, body = cls.client.create_subnet(
                     network_id=network['id'],
                     cidr=str(subnet_cidr),
-                    ip_version=ip_version)
+                    ip_version=cls._ip_version)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -213,13 +228,22 @@
     @classmethod
     def create_vip(cls, name, protocol, protocol_port, subnet, pool):
         """Wrapper utility that returns a test vip."""
-        resp, body = cls.client.create_vip(name, protocol, protocol_port,
-                                           subnet['id'], pool['id'])
+        resp, body = cls.client.create_vip(name=name,
+                                           protocol=protocol,
+                                           protocol_port=protocol_port,
+                                           subnet_id=subnet['id'],
+                                           pool_id=pool['id'])
         vip = body['vip']
         cls.vips.append(vip)
         return vip
 
     @classmethod
+    def update_vip(cls, name):
+        resp, body = cls.client.update_vip(name=name)
+        vip = body['vip']
+        return vip
+
+    @classmethod
     def create_member(cls, protocol_port, pool):
         """Wrapper utility that returns a test member."""
         resp, body = cls.client.create_member("10.0.9.46",
@@ -232,14 +256,21 @@
     @classmethod
     def create_health_monitor(cls, delay, max_retries, Type, timeout):
         """Wrapper utility that returns a test health monitor."""
-        resp, body = cls.client.create_health_monitor(delay,
-                                                      max_retries,
-                                                      Type, timeout)
+        resp, body = cls.client.create_health_monitor(delay=delay,
+                                                      max_retries=max_retries,
+                                                      type=Type,
+                                                      timeout=timeout)
         health_monitor = body['health_monitor']
         cls.health_monitors.append(health_monitor)
         return health_monitor
 
     @classmethod
+    def update_health_monitor(cls, admin_state_up):
+        resp, body = cls.client.update_vip(admin_state_up=admin_state_up)
+        health_monitor = body['health_monitor']
+        return health_monitor
+
+    @classmethod
     def create_router_interface(cls, router_id, subnet_id):
         """Wrapper utility that returns a router interface."""
         resp, interface = cls.client.add_router_interface_with_subnet_id(
@@ -287,3 +318,24 @@
         else:
             cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
         cls.admin_client = cls.os_adm.network_client
+
+    @classmethod
+    def create_metering_label(cls, name, description):
+        """Wrapper utility that returns a test metering label."""
+        resp, body = cls.admin_client.create_metering_label(
+            description=description,
+            name=data_utils.rand_name("metering-label"))
+        metering_label = body['metering_label']
+        cls.metering_labels.append(metering_label)
+        return metering_label
+
+    @classmethod
+    def create_metering_label_rule(cls, remote_ip_prefix, direction,
+                                   metering_label_id):
+        """Wrapper utility that returns a test metering label rule."""
+        resp, body = cls.admin_client.create_metering_label_rule(
+            remote_ip_prefix=remote_ip_prefix, direction=direction,
+            metering_label_id=metering_label_id)
+        metering_label_rule = body['metering_label_rule']
+        cls.metering_label_rules.append(metering_label_rule)
+        return metering_label_rule
diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py
index a177d65..529f8e9 100644
--- a/tempest/api/network/test_extensions.py
+++ b/tempest/api/network/test_extensions.py
@@ -44,6 +44,8 @@
                           'agent', 'dhcp_agent_scheduler', 'provider',
                           'router', 'extraroute', 'external-net',
                           'allowed-address-pairs', 'extra_dhcp_opt']
+        expected_alias = [ext for ext in expected_alias if
+                          test.is_extension_enabled(ext, 'network')]
         actual_alias = list()
         resp, extensions = self.client.list_extensions()
         self.assertEqual('200', resp['status'])
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
new file mode 100644
index 0000000..ed86d75
--- /dev/null
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -0,0 +1,99 @@
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations with the Extra DHCP Options Neutron API
+    extension:
+
+        port create
+        port list
+        port show
+        port update
+
+    v2.0 of the Neutron API is assumed. It is also assumed that the Extra
+    DHCP Options extension is enabled in the [network-feature-enabled]
+    section of etc/tempest.conf
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(ExtraDHCPOptionsTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('extra_dhcp_opt', 'network'):
+            msg = "Extra DHCP Options extension not enabled."
+            raise cls.skipException(msg)
+        cls.network = cls.create_network()
+        cls.subnet = cls.create_subnet(cls.network)
+        cls.port = cls.create_port(cls.network)
+
+    @test.attr(type='smoke')
+    def test_create_list_port_with_extra_dhcp_options(self):
+        # Create a port with Extra DHCP Options
+        extra_dhcp_opts = [
+            {'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
+            {'opt_value': '123.123.123.123', 'opt_name': 'tftp-server'},
+            {'opt_value': '123.123.123.45', 'opt_name': 'server-ip-address'}
+        ]
+        resp, body = self.client.create_port(
+            network_id=self.network['id'],
+            extra_dhcp_opts=extra_dhcp_opts)
+        self.assertEqual('201', resp['status'])
+        port_id = body['port']['id']
+        self.addCleanup(self.client.delete_port, port_id)
+
+        # Confirm port created has Extra DHCP Options
+        resp, body = self.client.list_ports()
+        self.assertEqual('200', resp['status'])
+        ports = body['ports']
+        port = [p for p in ports if p['id'] == port_id]
+        self.assertTrue(port)
+        self._confirm_extra_dhcp_options(port[0], extra_dhcp_opts)
+
+    @test.attr(type='smoke')
+    def test_update_show_port_with_extra_dhcp_options(self):
+        # Update port with extra dhcp options
+        extra_dhcp_opts = [
+            {'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
+            {'opt_value': '123.123.123.123', 'opt_name': 'tftp-server'},
+            {'opt_value': '123.123.123.45', 'opt_name': 'server-ip-address'}
+        ]
+        name = data_utils.rand_name('new-port-name')
+        resp, body = self.client.update_port(
+            self.port['id'], name=name, extra_dhcp_opts=extra_dhcp_opts)
+        self.assertEqual('200', resp['status'])
+
+        # Confirm extra dhcp options were added to the port
+        resp, body = self.client.show_port(self.port['id'])
+        self.assertEqual('200', resp['status'])
+        self._confirm_extra_dhcp_options(body['port'], extra_dhcp_opts)
+
+    def _confirm_extra_dhcp_options(self, port, extra_dhcp_opts):
+        retrieved = port['extra_dhcp_opts']
+        self.assertEqual(len(retrieved), len(extra_dhcp_opts))
+        for retrieved_option in retrieved:
+            for option in extra_dhcp_opts:
+                if (retrieved_option['opt_value'] == option['opt_value'] and
+                    retrieved_option['opt_name'] == option['opt_name']):
+                    break
+            else:
+                self.fail('Extra DHCP option not found in port %s' %
+                          str(retrieved_option))
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 69367ab..b31c090 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -16,7 +16,7 @@
 from tempest.api.network import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -46,6 +46,9 @@
     @classmethod
     def setUpClass(cls):
         super(FloatingIPTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('router', 'network'):
+            msg = "router extension not enabled."
+            raise cls.skipException(msg)
         cls.ext_net_id = CONF.network.public_network_id
 
         # Create network, subnet, router and add interface
@@ -59,7 +62,7 @@
         for i in range(2):
             cls.create_port(cls.network)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_list_show_update_delete_floating_ip(self):
         # Creates a floating IP
         created_floating_ip = self.create_floating_ip(
@@ -110,7 +113,7 @@
         self.assertIsNone(updated_floating_ip['fixed_ip_address'])
         self.assertIsNone(updated_floating_ip['router_id'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_floating_ip_delete_port(self):
         # Create a floating IP
         created_floating_ip = self.create_floating_ip(self.ext_net_id)
@@ -133,7 +136,7 @@
         self.assertIsNone(shown_floating_ip['fixed_ip_address'])
         self.assertIsNone(shown_floating_ip['router_id'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_floating_ip_update_different_router(self):
         # Associate a floating IP to a port on a router
         created_floating_ip = self.create_floating_ip(
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index d5f2b5b..03e095d 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -50,9 +50,16 @@
         vip_name = data_utils.rand_name('vip-')
         cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
                                    "HTTP", cls.subnet)
-        cls.vip = cls.create_vip(vip_name, "HTTP", 80, cls.subnet, cls.pool)
+        cls.vip = cls.create_vip(name=vip_name,
+                                 protocol="HTTP",
+                                 protocol_port=80,
+                                 subnet=cls.subnet,
+                                 pool=cls.pool)
         cls.member = cls.create_member(80, cls.pool)
-        cls.health_monitor = cls.create_health_monitor(4, 3, "TCP", 1)
+        cls.health_monitor = cls.create_health_monitor(delay=4,
+                                                       max_retries=3,
+                                                       Type="TCP",
+                                                       timeout=1)
 
     @test.attr(type='smoke')
     def test_list_vips(self):
@@ -76,14 +83,17 @@
             protocol='HTTP',
             subnet_id=self.subnet['id'])
         pool = body['pool']
-        resp, body = self.client.create_vip(name, "HTTP", 80,
-                                            self.subnet['id'], pool['id'])
+        resp, body = self.client.create_vip(name=name,
+                                            protocol="HTTP",
+                                            protocol_port=80,
+                                            subnet_id=self.subnet['id'],
+                                            pool_id=pool['id'])
         self.assertEqual('201', resp['status'])
         vip = body['vip']
         vip_id = vip['id']
         # Verification of vip update
         new_name = "New_vip"
-        resp, body = self.client.update_vip(vip_id, new_name)
+        resp, body = self.client.update_vip(vip_id, name=new_name)
         self.assertEqual('200', resp['status'])
         updated_vip = body['vip']
         self.assertEqual(updated_vip['name'], new_name)
@@ -143,11 +153,10 @@
         self.assertEqual('201', resp['status'])
         member = body['member']
         # Verification of member update
-        admin_state = [False, 'False']
-        resp, body = self.client.update_member(admin_state[0], member['id'])
+        resp, body = self.client.update_member(False, member['id'])
         self.assertEqual('200', resp['status'])
         updated_member = body['member']
-        self.assertIn(updated_member['admin_state_up'], admin_state)
+        self.assertFalse(updated_member['admin_state_up'])
         # Verification of member delete
         resp, body = self.client.delete_member(member['id'])
         self.assertEqual('204', resp['status'])
@@ -174,16 +183,19 @@
     @test.attr(type='smoke')
     def test_create_update_delete_health_monitor(self):
         # Creates a health_monitor
-        resp, body = self.client.create_health_monitor(4, 3, "TCP", 1)
+        resp, body = self.client.create_health_monitor(delay=4,
+                                                       max_retries=3,
+                                                       type="TCP",
+                                                       timeout=1)
         self.assertEqual('201', resp['status'])
         health_monitor = body['health_monitor']
         # Verification of health_monitor update
-        admin_state = [False, 'False']
-        resp, body = self.client.update_health_monitor(admin_state[0],
-                                                       health_monitor['id'])
+        resp, body = (self.client.update_health_monitor
+                     (health_monitor['id'],
+                      admin_state_up=False))
         self.assertEqual('200', resp['status'])
         updated_health_monitor = body['health_monitor']
-        self.assertIn(updated_health_monitor['admin_state_up'], admin_state)
+        self.assertFalse(updated_health_monitor['admin_state_up'])
         # Verification of health_monitor delete
         resp, body = self.client.delete_health_monitor(health_monitor['id'])
         self.assertEqual('204', resp['status'])
@@ -209,6 +221,17 @@
                      (self.health_monitor['id'], self.pool['id']))
         self.assertEqual('204', resp['status'])
 
+    @test.attr(type='smoke')
+    def test_get_lb_pool_stats(self):
+        # Verify the details of pool stats
+        resp, body = self.client.list_lb_pool_stats(self.pool['id'])
+        self.assertEqual('200', resp['status'])
+        stats = body['stats']
+        self.assertIn("bytes_in", stats)
+        self.assertIn("total_connections", stats)
+        self.assertIn("active_connections", stats)
+        self.assertIn("bytes_out", stats)
+
 
 class LoadBalancerTestXML(LoadBalancerTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
new file mode 100644
index 0000000..08ccbfe
--- /dev/null
+++ b/tempest/api/network/test_metering_extensions.py
@@ -0,0 +1,159 @@
+# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
+#
+# Author: Emilien Macchi <emilien.macchi@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.network import base
+from tempest.common.utils import data_utils
+from tempest.openstack.common import log as logging
+from tempest import test
+
+
+LOG = logging.getLogger(__name__)
+
+
+class MeteringJSON(base.BaseAdminNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations in the Neutron API using the REST client for
+    Neutron:
+
+        List, Show, Create, Delete Metering labels
+        List, Show, Create, Delete Metering labels rules
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(MeteringJSON, cls).setUpClass()
+        if not test.is_extension_enabled('metering', 'network'):
+            msg = "metering extension not enabled."
+            raise cls.skipException(msg)
+        description = "metering label created by tempest"
+        name = data_utils.rand_name("metering-label")
+        try:
+            cls.metering_label = cls.create_metering_label(name, description)
+            remote_ip_prefix = "10.0.0.0/24"
+            direction = "ingress"
+            cls.metering_label_rule = cls.create_metering_label_rule(
+                remote_ip_prefix, direction,
+                metering_label_id=cls.metering_label['id'])
+        except Exception:
+            LOG.exception('setUpClass failed')
+            cls.tearDownClass()
+            raise
+
+    def _delete_metering_label(self, metering_label_id):
+        # Deletes a label and verifies if it is deleted or not
+        resp, body = self.admin_client.delete_metering_label(metering_label_id)
+        self.assertEqual(204, resp.status)
+        # Asserting that the label is not found in list after deletion
+        resp, labels = (self.admin_client.list_metering_labels(
+                        id=metering_label_id))
+        self.assertEqual(len(labels['metering_labels']), 0)
+
+    def _delete_metering_label_rule(self, metering_label_rule_id):
+        # Deletes a rule and verifies if it is deleted or not
+        resp, body = (self.admin_client.delete_metering_label_rule(
+                      metering_label_rule_id))
+        self.assertEqual(204, resp.status)
+        # Asserting that the rule is not found in list after deletion
+        resp, rules = (self.admin_client.list_metering_label_rules(
+                       id=metering_label_rule_id))
+        self.assertEqual(len(rules['metering_label_rules']), 0)
+
+    @test.attr(type='smoke')
+    def test_list_metering_labels(self):
+        # Verify label filtering
+        resp, body = self.admin_client.list_metering_labels(id=33)
+        self.assertEqual('200', resp['status'])
+        metering_labels = body['metering_labels']
+        self.assertEqual(0, len(metering_labels))
+
+    @test.attr(type='smoke')
+    def test_create_delete_metering_label_with_filters(self):
+        # Creates a label
+        name = data_utils.rand_name('metering-label-')
+        description = "label created by tempest"
+        resp, body = (self.admin_client.create_metering_label(name=name,
+                      description=description))
+        self.assertEqual('201', resp['status'])
+        metering_label = body['metering_label']
+        self.addCleanup(self._delete_metering_label,
+                        metering_label['id'])
+        # Assert whether created labels are found in labels list or fail
+        # if created labels are not found in labels list
+        resp, labels = (self.admin_client.list_metering_labels(
+                        id=metering_label['id']))
+        self.assertEqual(len(labels['metering_labels']), 1)
+
+    @test.attr(type='smoke')
+    def test_show_metering_label(self):
+        # Verifies the details of a label
+        resp, body = (self.admin_client.show_metering_label(
+                      self.metering_label['id']))
+        self.assertEqual('200', resp['status'])
+        metering_label = body['metering_label']
+        self.assertEqual(self.metering_label['id'], metering_label['id'])
+        self.assertEqual(self.metering_label['tenant_id'],
+                         metering_label['tenant_id'])
+        self.assertEqual(self.metering_label['name'], metering_label['name'])
+        self.assertEqual(self.metering_label['description'],
+                         metering_label['description'])
+
+    @test.attr(type='smoke')
+    def test_list_metering_label_rules(self):
+        # Verify rule filtering
+        resp, body = self.admin_client.list_metering_label_rules(id=33)
+        self.assertEqual('200', resp['status'])
+        metering_label_rules = body['metering_label_rules']
+        self.assertEqual(0, len(metering_label_rules))
+
+    @test.attr(type='smoke')
+    def test_create_delete_metering_label_rule_with_filters(self):
+        # Creates a rule
+        resp, body = (self.admin_client.create_metering_label_rule(
+                      remote_ip_prefix="10.0.1.0/24",
+                      direction="ingress",
+                      metering_label_id=self.metering_label['id']))
+        self.assertEqual('201', resp['status'])
+        metering_label_rule = body['metering_label_rule']
+        self.addCleanup(self._delete_metering_label_rule,
+                        metering_label_rule['id'])
+        # Assert whether created rules are found in rules list or fail
+        # if created rules are not found in rules list
+        resp, rules = (self.admin_client.list_metering_label_rules(
+                       id=metering_label_rule['id']))
+        self.assertEqual(len(rules['metering_label_rules']), 1)
+
+    @test.attr(type='smoke')
+    def test_show_metering_label_rule(self):
+        # Verifies the details of a rule
+        resp, body = (self.admin_client.show_metering_label_rule(
+                      self.metering_label_rule['id']))
+        self.assertEqual('200', resp['status'])
+        metering_label_rule = body['metering_label_rule']
+        self.assertEqual(self.metering_label_rule['id'],
+                         metering_label_rule['id'])
+        self.assertEqual(self.metering_label_rule['remote_ip_prefix'],
+                         metering_label_rule['remote_ip_prefix'])
+        self.assertEqual(self.metering_label_rule['direction'],
+                         metering_label_rule['direction'])
+        self.assertEqual(self.metering_label_rule['metering_label_id'],
+                         metering_label_rule['metering_label_id'])
+        self.assertFalse(metering_label_rule['excluded'])
+
+
+class MeteringXML(MeteringJSON):
+    interface = 'xml'
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index aee2a44..aba2c8e 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -45,14 +45,20 @@
         network update
         subnet update
 
+        All subnet tests are run once with ipv4 and once with ipv6.
+
     v2.0 of the Neutron API is assumed. It is also assumed that the following
     options are defined in the [network] section of etc/tempest.conf:
 
         tenant_network_cidr with a block of cidr's from which smaller blocks
-        can be allocated for tenant networks
+        can be allocated for tenant ipv4 subnets
+
+        tenant_network_v6_cidr is the equivalent for ipv6 subnets
 
         tenant_network_mask_bits with the mask bits to be used to partition the
-        block defined by tenant-network_cidr
+        block defined by tenant_network_cidr
+
+        tenant_network_v6_mask_bits is the equivalent for ipv6 subnets
     """
 
     @classmethod
@@ -79,14 +85,14 @@
         updated_net = body['network']
         self.assertEqual(updated_net['name'], new_name)
         # Find a cidr that is not in use yet and create a subnet with it
-        cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
-        mask_bits = CONF.network.tenant_network_mask_bits
+        cidr = netaddr.IPNetwork(self._tenant_network_cidr)
+        mask_bits = self._tenant_network_mask_bits
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
                 resp, body = self.client.create_subnet(
                     network_id=net_id,
                     cidr=str(subnet_cidr),
-                    ip_version=4)
+                    ip_version=self._ip_version)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -118,6 +124,18 @@
         self.assertEqual(self.name, network['name'])
 
     @attr(type='smoke')
+    def test_show_network_fields(self):
+        # Verifies showing some fields of a network works
+        field_list = [('fields', 'id'), ('fields', 'name'), ]
+        resp, body = self.client.show_network(self.network['id'],
+                                              field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        network = body['network']
+        self.assertEqual(len(network), 2)
+        self.assertEqual(self.network['id'], network['id'])
+        self.assertEqual(self.name, network['name'])
+
+    @attr(type='smoke')
     def test_list_networks(self):
         # Verify the network exists in the list of all networks
         resp, body = self.client.list_networks()
@@ -155,6 +173,18 @@
         self.assertEqual(self.cidr, subnet['cidr'])
 
     @attr(type='smoke')
+    def test_show_subnet_fields(self):
+        # Verifies showing some fields of a subnet works
+        field_list = [('fields', 'id'), ('fields', 'cidr'), ]
+        resp, body = self.client.show_subnet(self.subnet['id'],
+                                             field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        subnet = body['subnet']
+        self.assertEqual(len(subnet), 2)
+        self.assertEqual(self.subnet['id'], subnet['id'])
+        self.assertEqual(self.cidr, subnet['cidr'])
+
+    @attr(type='smoke')
     def test_list_subnets(self):
         # Verify the subnet exists in the list of all subnets
         resp, body = self.client.list_subnets()
@@ -189,12 +219,17 @@
             network_id=self.network['id'])
         self.assertEqual('201', resp['status'])
         port = body['port']
+        self.assertTrue(port['admin_state_up'])
         # Verification of port update
         new_port = "New_Port"
-        resp, body = self.client.update_port(port['id'], name=new_port)
+        resp, body = self.client.update_port(
+            port['id'],
+            name=new_port,
+            admin_state_up=False)
         self.assertEqual('200', resp['status'])
         updated_port = body['port']
         self.assertEqual(updated_port['name'], new_port)
+        self.assertFalse(updated_port['admin_state_up'])
         # Verification of port delete
         resp, body = self.client.delete_port(port['id'])
         self.assertEqual('204', resp['status'])
@@ -208,6 +243,17 @@
         self.assertEqual(self.port['id'], port['id'])
 
     @attr(type='smoke')
+    def test_show_port_fields(self):
+        # Verifies showing fields of a port works
+        field_list = [('fields', 'id'), ]
+        resp, body = self.client.show_port(self.port['id'],
+                                           field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        port = body['port']
+        self.assertEqual(len(port), 1)
+        self.assertEqual(self.port['id'], port['id'])
+
+    @attr(type='smoke')
     def test_list_ports(self):
         # Verify the port exists in the list of all ports
         resp, body = self.client.list_ports()
@@ -220,6 +266,28 @@
         self.assertIsNotNone(found, "Port list doesn't contain created port")
 
     @attr(type='smoke')
+    def test_port_list_filter_by_router_id(self):
+        # Create a router
+        network = self.create_network()
+        self.create_subnet(network)
+        router = self.create_router(data_utils.rand_name('router-'))
+        resp, port = 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['port']['id'])
+        self.addCleanup(self.client.remove_router_interface_with_port_id,
+                        router['id'], port['port']['id'])
+        # list ports filtered by router_id
+        resp, port_list = self.client.list_ports(
+            device_id=router['id'])
+        self.assertEqual('200', resp['status'])
+        # Verify if only corresponding port is listed and assert router_id
+        self.assertEqual(len(port_list['ports']), 1)
+        self.assertEqual(port['port']['id'], port_list['ports'][0]['id'])
+        self.assertEqual(router['id'], port_list['ports'][0]['device_id'])
+
+    @attr(type='smoke')
     def test_list_ports_fields(self):
         # Verify listing some fields of the ports
         resp, body = self.client.list_ports(fields='id')
@@ -392,3 +460,21 @@
 
 class BulkNetworkOpsTestXML(BulkNetworkOpsTestJSON):
     _interface = 'xml'
+
+
+class NetworksIpV6TestJSON(NetworksTestJSON):
+    _ip_version = 6
+    _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
+    _tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
+
+    @classmethod
+    def setUpClass(cls):
+        super(NetworksIpV6TestJSON, cls).setUpClass()
+        if not CONF.network.ipv6_enabled:
+            cls.tearDownClass()
+            skip_msg = "IPv6 Tests are disabled."
+            raise cls.skipException(skip_msg)
+
+
+class NetworksIpV6TestXML(NetworksIpV6TestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/network/test_quotas.py b/tempest/api/network/test_quotas.py
index a5be395..38784d8 100644
--- a/tempest/api/network/test_quotas.py
+++ b/tempest/api/network/test_quotas.py
@@ -17,7 +17,7 @@
 from tempest.api.network import base
 from tempest import clients
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class QuotasTest(base.BaseNetworkTest):
@@ -46,11 +46,14 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasTest, cls).setUpClass()
+        if not test.is_extension_enabled('quotas', 'network'):
+            msg = "quotas extension not enabled."
+            raise cls.skipException(msg)
         admin_manager = clients.AdminManager()
         cls.admin_client = admin_manager.network_client
         cls.identity_admin_client = admin_manager.identity_client
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_quotas(self):
         # Add a tenant to conduct the test
         test_tenant = data_utils.rand_name('test_tenant_')
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index f3fac93..d552c70 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -29,6 +29,9 @@
     @classmethod
     def setUpClass(cls):
         super(RoutersTest, cls).setUpClass()
+        if not test.is_extension_enabled('router', 'network'):
+            msg = "router extension not enabled."
+            raise cls.skipException(msg)
 
     @test.attr(type='smoke')
     def test_create_show_list_update_delete_router(self):
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index 0d65b64..e6ad4de 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -16,7 +16,7 @@
 from tempest.api.network import base_routers as base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class RoutersNegativeTest(base.BaseRouterTest):
@@ -25,11 +25,14 @@
     @classmethod
     def setUpClass(cls):
         super(RoutersNegativeTest, cls).setUpClass()
+        if not test.is_extension_enabled('router', 'network'):
+            msg = "router extension not enabled."
+            raise cls.skipException(msg)
         cls.router = cls.create_router(data_utils.rand_name('router-'))
         cls.network = cls.create_network()
         cls.subnet = cls.create_subnet(cls.network)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_router_add_gateway_invalid_network_returns_404(self):
         self.assertRaises(exceptions.NotFound,
                           self.client.update_router,
@@ -37,7 +40,7 @@
                           external_gateway_info={
                               'network_id': self.router['id']})
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_router_add_gateway_net_not_external_returns_400(self):
         self.create_subnet(self.network)
         self.assertRaises(exceptions.BadRequest,
@@ -46,7 +49,7 @@
                           external_gateway_info={
                               'network_id': self.network['id']})
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_router_remove_interface_in_use_returns_409(self):
         self.client.add_router_interface_with_subnet_id(
             self.router['id'], self.subnet['id'])
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index b95182d..6eebf5b 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -14,13 +14,20 @@
 #    under the License.
 
 from tempest.api.network import base_security_groups as base
-from tempest.test import attr
+from tempest import test
 
 
 class SecGroupTest(base.BaseSecGroupTest):
     _interface = 'json'
 
-    @attr(type='smoke')
+    @classmethod
+    def setUpClass(cls):
+        super(SecGroupTest, cls).setUpClass()
+        if not test.is_extension_enabled('security-group', 'network'):
+            msg = "security-group extension not enabled."
+            raise cls.skipException(msg)
+
+    @test.attr(type='smoke')
     def test_list_security_groups(self):
         # Verify the that security group belonging to tenant exist in list
         resp, body = self.client.list_security_groups()
@@ -33,7 +40,7 @@
         msg = "Security-group list doesn't contain default security-group"
         self.assertIsNotNone(found, msg)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_show_delete_security_group(self):
         group_create_body, name = self._create_security_group()
 
@@ -51,7 +58,7 @@
             secgroup_list.append(secgroup['id'])
         self.assertIn(group_create_body['security_group']['id'], secgroup_list)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_show_delete_security_group_rule(self):
         group_create_body, _ = self._create_security_group()
 
@@ -80,7 +87,7 @@
                      for rule in rule_list_body['security_group_rules']]
         self.assertIn(rule_create_body['security_group_rule']['id'], rule_list)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_security_group_rule_with_additional_args(self):
         # Verify creating security group rule with the following
         # arguments works: "protocol": "tcp", "port_range_max": 77,
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index 98e109e..e1f4055 100644
--- a/tempest/api/network/test_security_groups_negative.py
+++ b/tempest/api/network/test_security_groups_negative.py
@@ -17,26 +17,33 @@
 
 from tempest.api.network import base_security_groups as base
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class NegativeSecGroupTest(base.BaseSecGroupTest):
     _interface = 'json'
 
-    @attr(type=['negative', 'gate'])
+    @classmethod
+    def setUpClass(cls):
+        super(NegativeSecGroupTest, cls).setUpClass()
+        if not test.is_extension_enabled('security-group', 'network'):
+            msg = "security-group extension not enabled."
+            raise cls.skipException(msg)
+
+    @test.attr(type=['negative', 'gate'])
     def test_show_non_existent_security_group(self):
         non_exist_id = str(uuid.uuid4())
         self.assertRaises(exceptions.NotFound, self.client.show_security_group,
                           non_exist_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_show_non_existent_security_group_rule(self):
         non_exist_id = str(uuid.uuid4())
         self.assertRaises(exceptions.NotFound,
                           self.client.show_security_group_rule,
                           non_exist_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_non_existent_security_group(self):
         non_exist_id = str(uuid.uuid4())
         self.assertRaises(exceptions.NotFound,
@@ -44,7 +51,7 @@
                           non_exist_id
                           )
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_security_group_rule_with_bad_protocol(self):
         group_create_body, _ = self._create_security_group()
 
@@ -55,7 +62,7 @@
                           group_create_body['security_group']['id'],
                           protocol=pname)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_security_group_rule_with_invalid_ports(self):
         group_create_body, _ = self._create_security_group()
 
@@ -73,7 +80,7 @@
                                    port_range_max=pmax)
             self.assertIn(msg, str(ex))
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_additional_default_security_group_fails(self):
         # Create security group named 'default', it should be failed.
         name = 'default'
@@ -81,7 +88,7 @@
                           self.client.create_security_group,
                           name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_non_existent_security_group(self):
         # Create security group rules with not existing security group.
         non_existent_sg = str(uuid.uuid4())
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index ef36c3d..d08dc34 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 
-from tempest.api.identity.base import DataGenerator
+from tempest.api.identity import base
 from tempest import clients
 from tempest.common import custom_matchers
 from tempest.common import isolated_creds
@@ -83,7 +83,7 @@
         cls.object_client_alt.auth_provider.clear_auth()
         cls.container_client_alt.auth_provider.clear_auth()
 
-        cls.data = DataGenerator(cls.identity_admin_client)
+        cls.data = base.DataGenerator(cls.identity_admin_client)
 
     @classmethod
     def tearDownClass(cls):
diff --git a/tempest/api/object_storage/test_account_bulk.py b/tempest/api/object_storage/test_account_bulk.py
index 5fde76a..a94c883 100644
--- a/tempest/api/object_storage/test_account_bulk.py
+++ b/tempest/api/object_storage/test_account_bulk.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 NTT Corporation
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index 79fd99d..5456768 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class AccountTest(base.BaseObjectTest):
@@ -38,7 +37,7 @@
         cls.delete_containers(cls.containers)
         super(AccountTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers(self):
         # list of all containers should not be empty
         params = {'format': 'json'}
@@ -51,14 +50,14 @@
         for container_name in self.containers:
             self.assertIn(container_name, container_names)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_extensions(self):
         resp, extensions = self.account_client.list_extensions()
 
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertThat(resp, custom_matchers.AreAllWellFormatted())
 
-    @attr(type='smoke')
+    @test.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):
@@ -69,7 +68,7 @@
 
             self.assertEqual(len(container_list), limit)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_marker(self):
         # list containers using marker param
         # first expect to get 0 container as we specified last
@@ -89,7 +88,7 @@
 
         self.assertEqual(len(container_list), self.containers_count / 2 - 1)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_end_marker(self):
         # list containers using end_marker param
         # first expect to get 0 container as we specified first container as
@@ -107,7 +106,7 @@
         self.assertHeaders(resp, 'Account', 'GET')
         self.assertEqual(len(container_list), self.containers_count / 2)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_limit_and_marker(self):
         # list containers combining marker and limit param
         # result are always limitated by the limit whatever the marker
@@ -121,21 +120,21 @@
 
             self.assertTrue(len(container_list) <= limit, str(container_list))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_account_metadata(self):
         # list all account metadata
         resp, metadata = self.account_client.list_account_metadata()
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'HEAD')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_and_delete_account_metadata(self):
         header = 'test-account-meta'
         data = 'Meta!'
         # add metadata to account
         resp, _ = self.account_client.create_account_metadata(
             metadata={header: data})
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
@@ -147,7 +146,7 @@
         # delete metadata from account
         resp, _ = \
             self.account_client.delete_account_metadata(metadata=[header])
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index aae6b4d..085ef51 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -16,8 +16,7 @@
 from tempest.api.object_storage import base
 from tempest import clients
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTestACLs(base.BaseObjectTest):
@@ -44,7 +43,7 @@
         self.delete_containers([self.container_name])
         super(ObjectTestACLs, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_read_object_with_rights(self):
         # attempt to read object using authorized user
         # update X-Container-Read metadata ACL
@@ -53,7 +52,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -68,10 +67,10 @@
         )
         resp, _ = self.custom_object_client.get_object(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_write_object_with_rights(self):
         # attempt to write object using authorized user
         # update X-Container-Write metadata ACL
@@ -80,7 +79,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object with rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -91,5 +90,5 @@
         resp, _ = self.custom_object_client.create_object(
             self.container_name,
             object_name, 'data')
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index 1dc9bb5..a5a0950 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -18,8 +18,7 @@
 from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectACLsNegativeTest(base.BaseObjectTest):
@@ -46,7 +45,7 @@
         self.delete_containers([self.container_name])
         super(ObjectACLsNegativeTest, self).tearDown()
 
-    @attr(type=['negative', 'gate'])
+    @test.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
@@ -59,7 +58,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_object_without_using_creds(self):
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -75,7 +74,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.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
@@ -89,7 +88,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.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
@@ -107,7 +106,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.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
@@ -125,7 +124,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.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
@@ -133,7 +132,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -150,7 +149,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.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
@@ -158,7 +157,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -171,7 +170,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.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
@@ -181,7 +180,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without write rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -194,7 +193,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.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
@@ -204,7 +203,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 84cc91e..8689d10 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -15,8 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -47,7 +46,7 @@
 
         return object_name
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container(self):
         container_name = data_utils.rand_name(name='TestContainer')
         resp, body = self.container_client.create_container(container_name)
@@ -55,7 +54,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_overwrite(self):
         # overwrite container with the same name
         container_name = data_utils.rand_name(name='TestContainer')
@@ -66,7 +65,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_key(self):
         # create container with the blank value of metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -84,7 +83,7 @@
         # in the server
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_value(self):
         # create container with metadata value
         container_name = data_utils.rand_name(name='TestContainer')
@@ -103,7 +102,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta'],
                          metadata['test-container-meta'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_key(self):
         # create container with the blank value of remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -124,7 +123,7 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_value(self):
         # create container with remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -143,18 +142,18 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_container(self):
         # create a container
         container_name = self._create_container()
         # delete container
         resp, _ = self.container_client.delete_container(container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'DELETE')
 
         self.containers.remove(container_name)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents(self):
         # get container contents list
         container_name = self._create_container()
@@ -162,22 +161,22 @@
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_no_object(self):
         # get empty container contents list
         container_name = self._create_container()
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual('', object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_delimiter(self):
         # get container contents list using delimiter param
         container_name = self._create_container()
@@ -188,11 +187,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name.split('/')[0], object_list.strip('/\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_end_marker(self):
         # get container contents list using end_marker param
         container_name = self._create_container()
@@ -202,11 +201,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_json(self):
         # get container contents list using format_json param
         container_name = self._create_container()
@@ -216,7 +215,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -226,7 +225,7 @@
         self.assertTrue([c['content_type'] for c in object_list])
         self.assertTrue([c['last_modified'] for c in object_list])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_xml(self):
         # get container contents list using format_xml param
         container_name = self._create_container()
@@ -236,7 +235,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -251,7 +250,7 @@
         self.assertEqual(object_list.find(".//last_modified").tag,
                          'last_modified')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_limit(self):
         # get container contents list using limit param
         container_name = self._create_container()
@@ -261,11 +260,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_marker(self):
         # get container contents list using marker param
         container_name = self._create_container()
@@ -275,11 +274,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_path(self):
         # get container contents list using path param
         container_name = self._create_container()
@@ -290,11 +289,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_prefix(self):
         # get container contents list using prefix param
         container_name = self._create_container()
@@ -305,11 +304,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_metadata(self):
         # List container metadata
         container_name = self._create_container()
@@ -321,23 +320,23 @@
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertIn('x-container-meta-name', resp)
         self.assertEqual(resp['x-container-meta-name'], metadata['name'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_no_container_metadata(self):
         # HEAD container without metadata
         container_name = self._create_container()
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertNotIn('x-container-meta-', str(resp))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_and_delete_matadata(self):
         # Send one request of adding and deleting metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -351,7 +350,7 @@
             container_name,
             metadata=metadata_2,
             remove_metadata=metadata_1)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -361,7 +360,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta2'],
                          metadata_2['test-container-meta2'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_metadata(self):
         # update container metadata using add metadata
         container_name = self._create_container()
@@ -370,7 +369,7 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -379,7 +378,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta1'],
                          metadata['test-container-meta1'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata(self):
         # update container metadata using delete metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -391,14 +390,14 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_matadata_key(self):
         # update container metadata with a blenk value of metadata
         container_name = self._create_container()
@@ -407,14 +406,14 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata_key(self):
         # update container metadata with a blank value of matadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -427,7 +426,7 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(container_name)
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 197e7fa..6c71340 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -49,6 +49,7 @@
         cls.data.teardown_all()
         super(StaticWebTest, cls).tearDownClass()
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_index(self):
         headers = {'web-index': self.object_name}
@@ -79,6 +80,7 @@
             self.container_name)
         self.assertNotIn('x-container-meta-web-index', body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_listing(self):
         headers = {'web-listings': 'true'}
@@ -110,6 +112,7 @@
             self.container_name)
         self.assertNotIn('x-container-meta-web-listings', body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_listing_css(self):
         headers = {'web-listings': 'true',
@@ -133,6 +136,7 @@
         css = '<link rel="stylesheet" type="text/css" href="listings.css" />'
         self.assertIn(css, body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_error(self):
         headers = {'web-listings': 'true',
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index 207fced..9bd986f 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -19,8 +19,7 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 CONF = config.CONF
 
@@ -66,7 +65,7 @@
             cls.delete_containers(cls.containers, client[0], client[1])
         super(ContainerSyncTest, cls).tearDownClass()
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     def test_container_synchronization(self):
         # container to container synchronization
         # to allow/accept sync requests to/from other accounts
@@ -86,12 +85,12 @@
                        (client_base_url, str(cont[1]))}
             resp, body = \
                 cont_client[0].put(str(cont[0]), body=None, headers=headers)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             # create object in container
             object_name = data_utils.rand_name(name='TestSyncObject')
             data = object_name[::-1]  # data_utils.arbitrary_string()
             resp, _ = obj_client[0].create_object(cont[0], object_name, data)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             self.objects.append(object_name)
 
         # wait until container contents list is not empty
@@ -104,7 +103,7 @@
                     cont_client[client_index].\
                     list_container_contents(self.containers[client_index],
                                             params=params)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 object_lists.append(dict(
                     (obj['name'], obj) for obj in object_list))
             # check that containers are not empty and have equal keys()
@@ -124,5 +123,5 @@
         for obj_client, cont in obj_clients:
             for obj_name in object_lists[0]:
                 resp, object_content = obj_client.get_object(cont, obj_name)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 self.assertEqual(object_content, obj_name[::-1])
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index 35aee2a..e27c7ef 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -17,8 +17,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class HealthcheckTest(base.BaseObjectTest):
@@ -32,13 +31,13 @@
         # Turning http://.../v1/foobar into http://.../
         self.account_client.skip_path()
 
-    @attr('gate')
+    @test.attr('gate')
     def test_get_healthcheck(self):
 
         resp, _ = self.account_client.get("healthcheck", {})
 
         # The status is expected to be 200
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
 
         # The target of the request is not any Swift resource. Therefore, the
         # existence of response header is checked without a custom matcher.
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 3aae0a1..53ca20d 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -18,7 +18,7 @@
 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 import test
 
 
 class ObjectExpiryTest(base.BaseObjectTest):
@@ -67,12 +67,12 @@
         self.assertRaises(exceptions.NotFound, self.object_client.get_object,
                           self.container_name, self.object_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_after_expiry_time(self):
         metadata = {'X-Delete-After': '3'}
         self._test_object_expiry(metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_at_expiry_time(self):
         metadata = {'X-Delete-At': str(int(time.time()) + 3)}
         self._test_object_expiry(metadata)
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index 6f46ec9..e0d15ac 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -21,8 +21,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectFormPostTest(base.BaseObjectTest):
@@ -93,7 +92,8 @@
         content_type = 'multipart/form-data; boundary=%s' % boundary
         return body, content_type
 
-    @attr(type='gate')
+    @test.requires_ext(extension='formpost', service='object')
+    @test.attr(type='gate')
     def test_post_object_using_form(self):
         body, content_type = self.get_multipart_form()
 
@@ -107,12 +107,12 @@
         # Use a raw request, otherwise authentication headers are used
         resp, body = self.object_client.http_obj.request(url, "POST",
                                                          body, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "POST")
 
         # Ensure object is available
         resp, body = self.object_client.get("%s/%s%s" % (
             self.container_name, self.object_name, "testfile"))
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "GET")
         self.assertEqual(body, "hello world")
diff --git a/tempest/api/object_storage/test_object_formpost_negative.py b/tempest/api/object_storage/test_object_formpost_negative.py
index e02a058..a52c248 100644
--- a/tempest/api/object_storage/test_object_formpost_negative.py
+++ b/tempest/api/object_storage/test_object_formpost_negative.py
@@ -20,7 +20,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class ObjectFormPostNegativeTest(base.BaseObjectTest):
@@ -91,7 +91,8 @@
         content_type = 'multipart/form-data; boundary=%s' % boundary
         return body, content_type
 
-    @attr(type=['gate', 'negative'])
+    @test.requires_ext(extension='formpost', service='object')
+    @test.attr(type=['gate', 'negative'])
     def test_post_object_using_form_expired(self):
         body, content_type = self.get_multipart_form(expires=1)
         time.sleep(2)
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 6f349b6..33f3299 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTest(base.BaseObjectTest):
@@ -35,7 +34,7 @@
         cls.delete_containers(cls.containers)
         super(ObjectTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -50,7 +49,7 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -60,10 +59,10 @@
         # delete object
         resp, _ = self.object_client.delete_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'DELETE')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_object_metadata(self):
         # add metadata to storage object, test if metadata is retrievable
 
@@ -78,20 +77,20 @@
         orig_metadata = {meta_key: meta_value}
         resp, _ = self.object_client.update_object_metadata(
             self.container_name, object_name, orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # get object metadata
         resp, resp_metadata = self.object_client.list_object_metadata(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'HEAD')
 
         actual_meta_key = 'x-object-meta-' + meta_key
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_object(self):
         # retrieve object's data (in response body)
 
@@ -103,12 +102,12 @@
         # get object
         resp, body = self.object_client.get_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_in_same_container(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -135,7 +134,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_to_itself(self):
         # change the content type of an existing object
 
@@ -160,7 +159,7 @@
                                                           object_name)
         self.assertEqual(resp['content-type'], metadata['content-type'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_2d_way(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -195,7 +194,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_across_containers(self):
         # create a container to use as  asource container
         src_container_name = data_utils.rand_name(name='TestSourceContainer')
@@ -219,7 +218,7 @@
         resp, _ = self.object_client.update_object_metadata(src_container_name,
                                                             object_name,
                                                             orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # copy object from source container to destination container
@@ -237,7 +236,7 @@
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_object_upload_in_segments(self):
         # create object
         object_name = data_utils.rand_name(name='LObject')
@@ -280,7 +279,7 @@
             self.container_name, object_name)
         self.assertEqual(''.join(data_segments), body)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_if_different(self):
         # http://en.wikipedia.org/wiki/HTTP_ETag
         # Make a conditional request for an object using the If-None-Match
@@ -312,7 +311,7 @@
         md5 = hashlib.md5(local_data).hexdigest()
         headers = {'If-None-Match': md5}
         resp, body = self.object_client.get(url, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
 
@@ -326,7 +325,7 @@
         self.delete_containers([self.container_name])
         super(PublicObjectTest, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_container_object_without_using_creds(self):
         # make container public-readable and access an object in it object
         # anonymously, without using credentials
@@ -335,7 +334,7 @@
         cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -350,7 +349,7 @@
         # list container metadata
         resp_meta, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp_meta)
@@ -367,7 +366,7 @@
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_object_with_another_user_creds(self):
         # make container public-readable and access an object in it using
         # another user's credentials
@@ -375,7 +374,7 @@
         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.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -390,7 +389,7 @@
         # list container metadata
         resp, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp)
diff --git a/tempest/api/object_storage/test_object_version.py b/tempest/api/object_storage/test_object_version.py
index 75293d2..8d2ff9b 100644
--- a/tempest/api/object_storage/test_object_version.py
+++ b/tempest/api/object_storage/test_object_version.py
@@ -15,7 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -40,7 +40,7 @@
         header_value = resp.get('x-versions-location', 'Missing Header')
         self.assertEqual(header_value, versioned)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_versioned_container(self):
         # create container
         vers_container_name = data_utils.rand_name(name='TestVersionContainer')
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 243c3ce..3e621f4 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -17,6 +17,7 @@
 from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
+from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -28,25 +29,28 @@
     _interface = 'json'
 
     template = """
-HeatTemplateFormatVersion: '2012-12-12'
-Description: |
+heat_template_version: '2013-05-23'
+description: |
   Template which creates single EC2 instance
-Parameters:
+parameters:
   KeyName:
-    Type: String
+    type: string
   InstanceType:
-    Type: String
+    type: string
   ImageId:
-    Type: String
+    type: string
   ExternalRouterId:
-    Type: String
-Resources:
+    type: string
+  ExternalNetworkId:
+    type: string
+resources:
   Network:
-    Type: OS::Quantum::Net
-    Properties: {name: NewNetwork}
+    type: OS::Neutron::Net
+    properties:
+      name: NewNetwork
   Subnet:
-    Type: OS::Quantum::Subnet
-    Properties:
+    type: OS::Neutron::Subnet
+    properties:
       network_id: {Ref: Network}
       name: NewSubnet
       ip_version: 4
@@ -54,39 +58,44 @@
       dns_nameservers: ["8.8.8.8"]
       allocation_pools:
       - {end: 10.0.3.150, start: 10.0.3.20}
+  Router:
+    type: OS::Neutron::Router
+    properties:
+      name: NewRouter
+      admin_state_up: false
+      external_gateway_info:
+        network: {get_param: ExternalNetworkId}
+        enable_snat: false
   RouterInterface:
-    Type: OS::Quantum::RouterInterface
-    Properties:
-      router_id: {Ref: ExternalRouterId}
-      subnet_id: {Ref: Subnet}
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: {get_param: ExternalRouterId}
+      subnet_id: {get_resource: Subnet}
   Server:
-    Type: AWS::EC2::Instance
+    type: AWS::EC2::Instance
     Metadata:
-      Name: SmokeServer
-    Properties:
-      ImageId: {Ref: ImageId}
-      InstanceType: {Ref: InstanceType}
-      KeyName: {Ref: KeyName}
-      SubnetId: {Ref: Subnet}
+      Name: SmokeServerNeutron
+    properties:
+      ImageId: {get_param: ImageId}
+      InstanceType: {get_param: InstanceType}
+      KeyName: {get_param: KeyName}
+      SubnetId: {get_resource: Subnet}
       UserData:
-        Fn::Base64:
-          Fn::Join:
-          - ''
-          - - '#!/bin/bash -v
+        str_replace:
+          template: |
+            #!/bin/bash -v
 
-              '
-            - /opt/aws/bin/cfn-signal -e 0 -r "SmokeServer created" '
-            - {Ref: WaitHandle}
-            - '''
-
-              '
-  WaitHandle:
-    Type: AWS::CloudFormation::WaitConditionHandle
+            /opt/aws/bin/cfn-signal -e 0 -r "SmokeServerNeutron created" \
+            'wait_handle'
+          params:
+            wait_handle: {get_resource: WaitHandleNeutron}
+  WaitHandleNeutron:
+    type: AWS::CloudFormation::WaitConditionHandle
   WaitCondition:
-    Type: AWS::CloudFormation::WaitCondition
+    type: AWS::CloudFormation::WaitCondition
     DependsOn: Server
-    Properties:
-      Handle: {Ref: WaitHandle}
+    properties:
+      Handle: {get_resource: WaitHandleNeutron}
       Timeout: '600'
 """
 
@@ -104,6 +113,7 @@
         cls.keypair_name = (CONF.orchestration.keypair_name or
                             cls._create_keypair()['name'])
         cls.external_router_id = cls._get_external_router_id()
+        cls.external_network_id = CONF.network.public_network_id
 
         # create the stack
         cls.stack_identifier = cls.create_stack(
@@ -113,11 +123,26 @@
                 'KeyName': cls.keypair_name,
                 'InstanceType': CONF.orchestration.instance_type,
                 'ImageId': CONF.orchestration.image_ref,
-                'ExternalRouterId': cls.external_router_id
+                'ExternalRouterId': cls.external_router_id,
+                'ExternalNetworkId': cls.external_network_id
             })
         cls.stack_id = cls.stack_identifier.split('/')[1]
-        cls.client.wait_for_stack_status(cls.stack_id, 'CREATE_COMPLETE')
-        _, resources = cls.client.list_resources(cls.stack_identifier)
+        try:
+            cls.client.wait_for_stack_status(cls.stack_id, 'CREATE_COMPLETE')
+            _, resources = cls.client.list_resources(cls.stack_identifier)
+        except exceptions.TimeoutException as e:
+            # attempt to log the server console to help with debugging
+            # the cause of the server not signalling the waitcondition
+            # to heat.
+            resp, body = cls.client.get_resource(cls.stack_identifier,
+                                                 'SmokeServerNeutron')
+            server_id = body['physical_resource_id']
+            LOG.debug('Console output for %s', server_id)
+            resp, output = cls.servers_client.get_console_output(
+                server_id, None)
+            LOG.debug(output)
+            raise e
+
         cls.test_resources = {}
         for resource in resources:
             cls.test_resources[resource['logical_resource_id']] = resource
@@ -133,9 +158,9 @@
     @attr(type='slow')
     def test_created_resources(self):
         """Verifies created neutron resources."""
-        resources = [('Network', 'OS::Quantum::Net'),
-                     ('Subnet', 'OS::Quantum::Subnet'),
-                     ('RouterInterface', 'OS::Quantum::RouterInterface'),
+        resources = [('Network', 'OS::Neutron::Net'),
+                     ('Subnet', 'OS::Neutron::Subnet'),
+                     ('RouterInterface', 'OS::Neutron::RouterInterface'),
                      ('Server', 'AWS::EC2::Instance')]
         for resource_name, resource_type in resources:
             resource = self.test_resources.get(resource_name, None)
@@ -173,6 +198,20 @@
         self.assertEqual('10.0.3.0/24', subnet['cidr'])
 
     @attr(type='slow')
+    def test_created_router(self):
+        """Verifies created router."""
+        router_id = self.test_resources.get('Router')['physical_resource_id']
+        resp, body = self.network_client.show_router(router_id)
+        self.assertEqual('200', resp['status'])
+        router = body['router']
+        self.assertEqual('NewRouter', router['name'])
+        self.assertEqual(self.external_network_id,
+                         router['external_gateway_info']['network_id'])
+        self.assertEqual(False,
+                         router['external_gateway_info']['enable_snat'])
+        self.assertEqual(False, router['admin_state_up'])
+
+    @attr(type='slow')
     def test_created_router_interface(self):
         """Verifies created router interface."""
         network_id = self.test_resources.get('Network')['physical_resource_id']
diff --git a/tempest/api/orchestration/stacks/test_server_cfn_init.py b/tempest/api/orchestration/stacks/test_server_cfn_init.py
index 4267c1d..5130f87 100644
--- a/tempest/api/orchestration/stacks/test_server_cfn_init.py
+++ b/tempest/api/orchestration/stacks/test_server_cfn_init.py
@@ -15,10 +15,10 @@
 
 from tempest.api.orchestration import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -147,7 +147,7 @@
                 'network': cls._get_default_network()['id']
             })
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     @testtools.skipIf(existing_keypair, 'Server ssh tests are disabled.')
     def test_can_log_into_created_server(self):
 
@@ -166,11 +166,12 @@
             body['physical_resource_id'])
 
         # Check that the user can authenticate with the generated password
-        linux_client = RemoteClient(server, 'ec2-user',
-                                    pkey=self.keypair['private_key'])
+        linux_client = remote_client.RemoteClient(server, 'ec2-user',
+                                                  pkey=self.keypair[
+                                                      'private_key'])
         linux_client.validate_authentication()
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     def test_stack_wait_condition_data(self):
 
         sid = self.stack_identifier
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index 1f661a6..c4614c6 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -10,7 +10,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest.common.utils import data_utils
 from tempest import config
+from tempest import exceptions
 import tempest.test
 
 CONF = config.CONF
@@ -22,6 +24,28 @@
 
     @classmethod
     def setUpClass(cls):
-        super(BaseTelemetryTest, cls).setUpClass()
         if not CONF.service_available.ceilometer:
             raise cls.skipException("Ceilometer support is required")
+        super(BaseTelemetryTest, cls).setUpClass()
+        os = cls.get_client_manager()
+        cls.telemetry_client = os.telemetry_client
+        cls.alarm_ids = []
+
+    @classmethod
+    def create_alarm(cls, **kwargs):
+        resp, body = cls.telemetry_client.create_alarm(
+            name=data_utils.rand_name('telemetry_alarm'),
+            type='threshold', **kwargs)
+        if resp['status'] == '201':
+            cls.alarm_ids.append(body['alarm_id'])
+        return resp, body
+
+    @classmethod
+    def tearDownClass(cls):
+        for alarm_id in cls.alarm_ids:
+            try:
+                cls.telemetry_client.delete_alarm(alarm_id)
+            except exceptions.NotFound:
+                pass
+        cls.clear_isolated_creds()
+        super(BaseTelemetryTest, cls).tearDownClass()
diff --git a/tempest/api/telemetry/test_telemetry_alarming_api.py b/tempest/api/telemetry/test_telemetry_alarming_api.py
new file mode 100644
index 0000000..907d3d0
--- /dev/null
+++ b/tempest/api/telemetry/test_telemetry_alarming_api.py
@@ -0,0 +1,43 @@
+#    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.telemetry import base
+from tempest import exceptions
+from tempest.test import attr
+
+
+class TelemetryAlarmingAPITestJSON(base.BaseTelemetryTest):
+    _interface = 'json'
+
+    @attr(type="gate")
+    def test_alarm_list(self):
+        resp, _ = self.telemetry_client.list_alarms()
+        self.assertEqual(int(resp['status']), 200)
+
+    @attr(type="gate")
+    def test_create_alarm(self):
+        rules = {'meter_name': 'cpu_util',
+                 'comparison_operator': 'gt',
+                 'threshold': 80.0,
+                 'period': 70}
+        resp, body = self.create_alarm(threshold_rule=rules)
+        self.alarm_id = body['alarm_id']
+        self.assertEqual(int(resp['status']), 201)
+        self.assertDictContainsSubset(rules, body['threshold_rule'])
+        resp, body = self.telemetry_client.get_alarm(self.alarm_id)
+        self.assertEqual(int(resp['status']), 200)
+        self.assertDictContainsSubset(rules, body['threshold_rule'])
+        resp, _ = self.telemetry_client.delete_alarm(self.alarm_id)
+        self.assertEqual(int(resp['status']), 204)
+        self.assertRaises(exceptions.NotFound,
+                          self.telemetry_client.get_alarm,
+                          self.alarm_id)
diff --git a/tempest/api/utils.py b/tempest/api/utils.py
index c62dc8d..00c93b7 100644
--- a/tempest/api/utils.py
+++ b/tempest/api/utils.py
@@ -15,7 +15,7 @@
 
 """Common utilities used in testing."""
 
-from tempest.test import BaseTestCase
+from tempest import test
 
 
 class skip_unless_attr(object):
@@ -30,7 +30,7 @@
             """Wrapped skipper function."""
             testobj = args[0]
             if not getattr(testobj, self.attr, False):
-                raise BaseTestCase.skipException(self.message)
+                raise test.BaseTestCase.skipException(self.message)
             func(*args, **kw)
         _skipper.__name__ = func.__name__
         _skipper.__doc__ = func.__doc__
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
new file mode 100644
index 0000000..47094f0
--- /dev/null
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -0,0 +1,67 @@
+# 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.api.volume.base import BaseVolumeV1AdminTest
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest.openstack.common import log as logging
+from tempest import test
+
+CONF = config.CONF
+LOG = logging.getLogger(__name__)
+
+
+class VolumesBackupsTest(BaseVolumeV1AdminTest):
+    _interface = "json"
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesBackupsTest, cls).setUpClass()
+
+        if not CONF.volume_feature_enabled.backup:
+            raise cls.skipException("Cinder backup feature disabled")
+
+        cls.volumes_adm_client = cls.os_adm.volumes_client
+        cls.backups_adm_client = cls.os_adm.backups_client
+        cls.volume = cls.create_volume()
+
+    @test.attr(type='smoke')
+    def test_volume_backup_create_get_restore_delete(self):
+        backup_name = data_utils.rand_name('Backup')
+        create_backup = self.backups_adm_client.create_backup
+        resp, backup = create_backup(self.volume['id'],
+                                     name=backup_name)
+        self.assertEqual(202, resp.status)
+        self.addCleanup(self.backups_adm_client.delete_backup,
+                        backup['id'])
+        self.assertEqual(backup['name'], backup_name)
+        self.volumes_adm_client.wait_for_volume_status(self.volume['id'],
+                                                       'available')
+        self.backups_adm_client.wait_for_backup_status(backup['id'],
+                                                       'available')
+
+        resp, backup = self.backups_adm_client.get_backup(backup['id'])
+        self.assertEqual(200, resp.status)
+        self.assertEqual(backup['name'], backup_name)
+
+        resp, restore = self.backups_adm_client.restore_backup(backup['id'])
+        self.assertEqual(202, resp.status)
+        self.addCleanup(self.volumes_adm_client.delete_volume,
+                        restore['volume_id'])
+        self.assertEqual(restore['backup_id'], backup['id'])
+        self.backups_adm_client.wait_for_backup_status(backup['id'],
+                                                       'available')
+        self.volumes_adm_client.wait_for_volume_status(restore['volume_id'],
+                                                       'available')
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index de2b240..8824977 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -69,18 +69,6 @@
     # only in a single location in the source, and could be more general.
 
     @classmethod
-    def create_volume(cls, size=1, **kwargs):
-        """Wrapper utility that returns a test volume."""
-        vol_name = data_utils.rand_name('Volume')
-        resp, volume = cls.volumes_client.create_volume(size,
-                                                        display_name=vol_name,
-                                                        **kwargs)
-        assert 200 == resp.status
-        cls.volumes.append(volume)
-        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
-        return volume
-
-    @classmethod
     def clear_volumes(cls):
         for volume in cls.volumes:
             try:
@@ -118,8 +106,21 @@
         super(BaseVolumeV1Test, cls).setUpClass()
         cls.snapshots_client = cls.os.snapshots_client
         cls.volumes_client = cls.os.volumes_client
+        cls.backups_client = cls.os.backups_client
         cls.volumes_extension_client = cls.os.volumes_extension_client
 
+    @classmethod
+    def create_volume(cls, size=1, **kwargs):
+        """Wrapper utility that returns a test volume."""
+        vol_name = data_utils.rand_name('Volume')
+        resp, volume = cls.volumes_client.create_volume(size,
+                                                        display_name=vol_name,
+                                                        **kwargs)
+        assert 200 == resp.status
+        cls.volumes.append(volume)
+        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
+        return volume
+
 
 class BaseVolumeV1AdminTest(BaseVolumeV1Test):
     """Base test case class for all Volume Admin API tests."""
@@ -144,3 +145,25 @@
             cls.os_adm = clients.AdminManager(interface=cls._interface)
         cls.client = cls.os_adm.volume_types_client
         cls.hosts_client = cls.os_adm.volume_hosts_client
+
+
+class BaseVolumeV2Test(BaseVolumeTest):
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.volume_feature_enabled.api_v2:
+            msg = "Volume API v2 not supported"
+            raise cls.skipException(msg)
+        super(BaseVolumeV2Test, cls).setUpClass()
+        cls.volumes_client = cls.os.volumes_v2_client
+
+    @classmethod
+    def create_volume(cls, size=1, **kwargs):
+        """Wrapper utility that returns a test volume."""
+        vol_name = data_utils.rand_name('Volume')
+        resp, volume = cls.volumes_client.create_volume(size,
+                                                        name=vol_name,
+                                                        **kwargs)
+        assert 202 == resp.status
+        cls.volumes.append(volume)
+        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
+        return volume
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index ec732d1..e94c700 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -13,7 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import ContainsAll
+from testtools import matchers
 
 from tempest.api.volume import base
 from tempest import test
@@ -43,7 +43,8 @@
         # Create metadata for the volume
         metadata = {"key1": "value1",
                     "key2": "value2",
-                    "key3": "value3"}
+                    "key3": "value3",
+                    "key4": "<value&special_chars>"}
 
         rsp, body = self.volumes_client.create_volume_metadata(self.volume_id,
                                                                metadata)
@@ -51,7 +52,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Delete one item metadata of the volume
         rsp, body = self.volumes_client.delete_volume_metadata_item(
             self.volume_id,
@@ -59,6 +60,8 @@
         self.assertEqual(200, rsp.status)
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertNotIn("key1", body)
+        del metadata["key1"]
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
 
     @test.attr(type='gate')
     def test_update_volume_metadata(self):
@@ -78,7 +81,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Update metadata
         resp, body = self.volumes_client.update_volume_metadata(
             self.volume_id,
@@ -87,7 +90,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(update.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(update.items()))
 
     @test.attr(type='gate')
     def test_update_volume_metadata_item(self):
@@ -104,7 +107,7 @@
             self.volume_id,
             metadata)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Update metadata item
         resp, body = self.volumes_client.update_volume_metadata_item(
             self.volume_id,
@@ -114,7 +117,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(expect.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(expect.items()))
 
 
 class VolumeMetadataTestXML(VolumeMetadataTest):
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 40b758c..f4b2d4c 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -13,6 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from testtools import matchers
+
 from tempest.api.volume import base
 from tempest import clients
 from tempest import config
@@ -47,7 +49,7 @@
                                          interface=cls._interface)
         else:
             cls.os_alt = clients.AltManager()
-            alt_tenant_name = cls.os_alt.tenant_name
+            alt_tenant_name = cls.os_alt.credentials['tenant_name']
             identity_client = cls._get_identity_admin_client()
             _, tenants = identity_client.list_tenants()
             cls.alt_tenant_id = [tnt['id'] for tnt in tenants
@@ -87,7 +89,7 @@
         # or equal to 1
         resp, body = self.client.list_volume_transfers()
         self.assertEqual(200, resp.status)
-        self.assertGreaterEqual(len(body), 1)
+        self.assertThat(len(body), matchers.GreaterThan(0))
 
         # Accept a volume transfer by alt_tenant
         resp, body = self.alt_client.accept_volume_transfer(transfer_id,
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 5924c7e..a22ad32 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -16,9 +16,7 @@
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import services
-from tempest.test import stresstest
+from tempest import test
 
 CONF = config.CONF
 
@@ -50,9 +48,9 @@
 
         super(VolumesActionsTest, cls).tearDownClass()
 
-    @stresstest(class_setup_per='process')
-    @attr(type='smoke')
-    @services('compute')
+    @test.stresstest(class_setup_per='process')
+    @test.attr(type='smoke')
+    @test.services('compute')
     def test_attach_detach_volume_to_instance(self):
         # Volume is attached and detached successfully from an instance
         mountpoint = '/dev/vdc'
@@ -65,9 +63,9 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_volume_status(self.volume['id'], 'available')
 
-    @stresstest(class_setup_per='process')
-    @attr(type='gate')
-    @services('compute')
+    @test.stresstest(class_setup_per='process')
+    @test.attr(type='gate')
+    @test.services('compute')
     def test_get_volume_attachment(self):
         # Verify that a volume's attachment information is retrieved
         mountpoint = '/dev/vdc'
@@ -91,8 +89,8 @@
         self.assertEqual(self.volume['id'], attachment['id'])
         self.assertEqual(self.volume['id'], attachment['volume_id'])
 
-    @attr(type='gate')
-    @services('image')
+    @test.attr(type='gate')
+    @test.services('image')
     def test_volume_upload(self):
         # NOTE(gfidente): the volume uploaded in Glance comes from setUpClass,
         # it is shared with the other tests. After it is uploaded in Glance,
@@ -108,7 +106,7 @@
         self.image_client.wait_for_image_status(image_id, 'active')
         self.client.wait_for_volume_status(self.volume['id'], 'available')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_extend(self):
         # Extend Volume Test.
         extend_size = int(self.volume['size']) + 1
@@ -119,7 +117,7 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(int(volume['size']), extend_size)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reserve_unreserve_volume(self):
         # Mark volume as reserved.
         resp, body = self.client.reserve_volume(self.volume['id'])
@@ -139,7 +137,7 @@
     def _is_true(self, val):
         return val in ['true', 'True', True]
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_readonly_update(self):
         # Update volume readonly true
         readonly = True
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 6d89e5b..175da01 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -13,13 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import ContainsAll
+from testtools import matchers
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -78,7 +77,7 @@
                          'The fetched Volume id is different '
                          'from the created Volume')
         self.assertThat(fetched_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
 
@@ -91,6 +90,12 @@
             self.assertEqual(boot_flag, False)
 
         # Update Volume
+        # Test volume update when display_name is same with original value
+        resp, update_volume = \
+            self.client.update_volume(volume['id'],
+                                      display_name=v_name)
+        self.assertEqual(200, resp.status)
+        # Test volume update when display_name is new
         new_v_name = data_utils.rand_name('new-Volume')
         new_desc = 'This is the new description of volume'
         resp, update_volume = \
@@ -108,9 +113,29 @@
         self.assertEqual(new_v_name, updated_volume['display_name'])
         self.assertEqual(new_desc, updated_volume['display_description'])
         self.assertThat(updated_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
+        # Test volume create when display_name is none and display_description
+        # contains specific characters,
+        # then test volume update if display_name is duplicated
+        new_volume = {}
+        new_v_desc = data_utils.rand_name('@#$%^* description')
+        resp, new_volume = \
+            self.client.create_volume(size=1,
+                                      display_description=new_v_desc,
+                                      availability_zone=volume[
+                                      'availability_zone'])
+        self.assertEqual(200, resp.status)
+        self.assertIn('id', new_volume)
+        self.addCleanup(self._delete_volume, new_volume['id'])
+        self.client.wait_for_volume_status(new_volume['id'], 'available')
+        resp, update_volume = \
+            self.client.update_volume(new_volume['id'],
+                                      display_name=volume['display_name'],
+                                      display_description=volume[
+                                      'display_description'])
+        self.assertEqual(200, resp.status)
 
         # NOTE(jdg): Revert back to strict true/false checking
         # after fix for bug #1227837 merges
@@ -120,16 +145,16 @@
         if 'imageRef' not in kwargs:
             self.assertEqual(boot_flag, False)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_create_get_update_delete(self):
         self._volume_create_get_update_delete()
 
-    @attr(type='smoke')
-    @services('image')
+    @test.attr(type='smoke')
+    @test.services('image')
     def test_volume_create_get_update_delete_from_image(self):
         self._volume_create_get_update_delete(imageRef=CONF.compute.image_ref)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_create_get_update_delete_as_clone(self):
         origin = self.create_volume()
         self._volume_create_get_update_delete(source_volid=origin['id'])
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 049544d..c356342 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -18,8 +18,8 @@
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from testtools.matchers import ContainsAll
+from tempest import test
+from testtools import matchers
 
 LOG = logging.getLogger(__name__)
 
@@ -111,12 +111,12 @@
                       ('details' if with_detail else '', key)
                 if key == 'metadata':
                     self.assertThat(volume[key].items(),
-                                    ContainsAll(params[key].items()),
+                                    matchers.ContainsAll(params[key].items()),
                                     msg)
                 else:
                     self.assertEqual(params[key], volume[key], msg)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_list(self):
         # Get a list of Volumes
         # Fetch all volumes
@@ -125,7 +125,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_details(self):
         # Get a list of Volumes with details
         # Fetch all Volumes
@@ -133,7 +133,7 @@
         self.assertEqual(200, resp.status)
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_by_name(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'display_name': volume['display_name']}
@@ -143,7 +143,7 @@
         self.assertEqual(fetched_vol[0]['display_name'],
                          volume['display_name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_details_by_name(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'display_name': volume['display_name']}
@@ -153,7 +153,7 @@
         self.assertEqual(fetched_vol[0]['display_name'],
                          volume['display_name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_by_status(self):
         params = {'status': 'available'}
         resp, fetched_list = self.client.list_volumes(params)
@@ -163,7 +163,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_details_by_status(self):
         params = {'status': 'available'}
         resp, fetched_list = self.client.list_volumes_with_detail(params)
@@ -172,7 +172,7 @@
             self.assertEqual('available', volume['status'])
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
@@ -184,7 +184,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_details_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
@@ -195,19 +195,19 @@
             self.assertEqual(zone, volume['availability_zone'])
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_param_metadata(self):
         # Test to list volumes when metadata param is given
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_detail_param_metadata(self):
         # Test to list volumes details when metadata param is given
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params, with_detail=True)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_param_display_name_and_status(self):
         # Test to list volume when display name and status param is given
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
@@ -215,7 +215,7 @@
                   'status': 'available'}
         self._list_by_param_value_and_assert(params)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_detail_param_display_name_and_status(self):
         # Test to list volume when name and status param is given
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 487ada6..56915e6 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -12,10 +12,12 @@
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
+from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.test import attr
 
 LOG = logging.getLogger(__name__)
+CONF = config.CONF
 
 
 class VolumesSnapshotTest(base.BaseVolumeV1Test):
@@ -35,6 +37,11 @@
     def tearDownClass(cls):
         super(VolumesSnapshotTest, cls).tearDownClass()
 
+    def _detach(self, volume_id):
+        """Detach volume."""
+        self.volumes_client.detach_volume(volume_id)
+        self.volumes_client.wait_for_volume_status(volume_id, 'available')
+
     def _list_by_param_values_and_assert(self, params, with_detail=False):
         """
         Perform list or list_details action with given params
@@ -57,6 +64,32 @@
                 self.assertEqual(params[key], snap[key], msg)
 
     @attr(type='gate')
+    def test_snapshot_create_with_volume_in_use(self):
+        # Create a snapshot when volume status is in-use
+        # Create a test instance
+        server_name = data_utils.rand_name('instance-')
+        resp, server = self.servers_client.create_server(server_name,
+                                                         self.image_ref,
+                                                         self.flavor_ref)
+        self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
+        self.addCleanup(self.servers_client.delete_server, server['id'])
+        mountpoint = '/dev/%s' % CONF.compute.volume_device_name
+        resp, body = self.volumes_client.attach_volume(
+            self.volume_origin['id'], server['id'], mountpoint)
+        self.assertEqual(202, resp.status)
+        self.volumes_client.wait_for_volume_status(self.volume_origin['id'],
+                                                   'in-use')
+        self.addCleanup(self._detach, self.volume_origin['id'])
+        # Snapshot a volume even if it's attached to an instance
+        snapshot = self.create_snapshot(self.volume_origin['id'],
+                                        force=True)
+        # Delete the snapshot
+        self.snapshots_client.delete_snapshot(snapshot['id'])
+        self.assertEqual(202, resp.status)
+        self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
+        self.snapshots.remove(snapshot)
+
+    @attr(type='gate')
     def test_snapshot_create_get_list_update_delete(self):
         # Create a snapshot
         s_name = data_utils.rand_name('snap')
diff --git a/tempest/api/volume/v2/__init__.py b/tempest/api/volume/v2/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/api/volume/v2/__init__.py
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
new file mode 100644
index 0000000..d0e8b99
--- /dev/null
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -0,0 +1,214 @@
+# Copyright 2012 OpenStack Foundation
+# 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 operator
+
+from tempest.api.volume import base
+from tempest.common.utils import data_utils
+from tempest.openstack.common import log as logging
+from tempest.test import attr
+from testtools.matchers import ContainsAll
+
+LOG = logging.getLogger(__name__)
+
+VOLUME_FIELDS = ('id', 'name')
+
+
+class VolumesV2ListTestJSON(base.BaseVolumeV2Test):
+
+    """
+    This test creates a number of 1G volumes. To run successfully,
+    ensure that the backing file for the volume group that Nova uses
+    has space for at least 3 1G volumes!
+    If you are running a Devstack environment, ensure that the
+    VOLUME_BACKING_FILE_SIZE is at least 4G in your localrc
+    """
+
+    _interface = 'json'
+
+    def assertVolumesIn(self, fetched_list, expected_list, fields=None):
+        if fields:
+            expected_list = map(operator.itemgetter(*fields), expected_list)
+            fetched_list = map(operator.itemgetter(*fields), fetched_list)
+
+        missing_vols = [v for v in expected_list if v not in fetched_list]
+        if len(missing_vols) == 0:
+            return
+
+        def str_vol(vol):
+            return "%s:%s" % (vol['id'], vol['name'])
+
+        raw_msg = "Could not find volumes %s in expected list %s; fetched %s"
+        self.fail(raw_msg % ([str_vol(v) for v in missing_vols],
+                             [str_vol(v) for v in expected_list],
+                             [str_vol(v) for v in fetched_list]))
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesV2ListTestJSON, cls).setUpClass()
+        cls.client = cls.volumes_client
+
+        # Create 3 test volumes
+        cls.volume_list = []
+        cls.volume_id_list = []
+        cls.metadata = {'Type': 'work'}
+        for i in range(3):
+            try:
+                volume = cls.create_volume(metadata=cls.metadata)
+                resp, volume = cls.client.get_volume(volume['id'])
+                cls.volume_list.append(volume)
+                cls.volume_id_list.append(volume['id'])
+            except Exception:
+                LOG.exception('Failed to create volume. %d volumes were '
+                              'created' % len(cls.volume_id_list))
+                if cls.volume_list:
+                    # We could not create all the volumes, though we were able
+                    # to create *some* of the volumes. This is typically
+                    # because the backing file size of the volume group is
+                    # too small.
+                    for volid in cls.volume_id_list:
+                        cls.client.delete_volume(volid)
+                        cls.client.wait_for_resource_deletion(volid)
+                raise
+
+    @classmethod
+    def tearDownClass(cls):
+        # Delete the created volumes
+        for volid in cls.volume_id_list:
+            resp, _ = cls.client.delete_volume(volid)
+            cls.client.wait_for_resource_deletion(volid)
+        super(VolumesV2ListTestJSON, cls).tearDownClass()
+
+    def _list_by_param_value_and_assert(self, params, expected_list=None,
+                                        with_detail=False):
+        """
+        Perform list or list_details action with given params
+        and validates result.
+        """
+        if with_detail:
+            resp, fetched_vol_list = \
+                self.client.list_volumes_with_detail(params=params)
+        else:
+            resp, fetched_vol_list = self.client.list_volumes(params=params)
+
+        self.assertEqual(200, resp.status)
+        if expected_list is None:
+            expected_list = self.volume_list
+        self.assertVolumesIn(fetched_vol_list, expected_list,
+                             fields=VOLUME_FIELDS)
+        # Validating params of fetched volumes
+        if with_detail:
+            for volume in fetched_vol_list:
+                for key in params:
+                    msg = "Failed to list volumes %s by %s" % \
+                          ('details' if with_detail else '', key)
+                    if key == 'metadata':
+                        self.assertThat(volume[key].items(),
+                                        ContainsAll(params[key].items()),
+                                        msg)
+                    else:
+                        self.assertEqual(params[key], volume[key], msg)
+
+    @attr(type='smoke')
+    def test_volume_list(self):
+        # Get a list of Volumes
+        # Fetch all volumes
+        resp, fetched_list = self.client.list_volumes()
+        self.assertEqual(200, resp.status)
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
+
+    @attr(type='gate')
+    def test_volume_list_with_details(self):
+        # Get a list of Volumes with details
+        # Fetch all Volumes
+        resp, fetched_list = self.client.list_volumes_with_detail()
+        self.assertEqual(200, resp.status)
+        self.assertVolumesIn(fetched_list, self.volume_list)
+
+    @attr(type='gate')
+    def test_volume_list_by_name(self):
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        params = {'name': volume['name']}
+        resp, fetched_vol = self.client.list_volumes(params)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(1, len(fetched_vol), str(fetched_vol))
+        self.assertEqual(fetched_vol[0]['name'], volume['name'])
+
+    @attr(type='gate')
+    def test_volume_list_details_by_name(self):
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        params = {'name': volume['name']}
+        resp, fetched_vol = self.client.list_volumes_with_detail(params)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(1, len(fetched_vol), str(fetched_vol))
+        self.assertEqual(fetched_vol[0]['name'], volume['name'])
+
+    @attr(type='gate')
+    def test_volumes_list_by_status(self):
+        params = {'status': 'available'}
+        self._list_by_param_value_and_assert(params)
+
+    @attr(type='gate')
+    def test_volumes_list_details_by_status(self):
+        params = {'status': 'available'}
+        self._list_by_param_value_and_assert(params, with_detail=True)
+
+    @attr(type='gate')
+    def test_volumes_list_by_availability_zone(self):
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        zone = volume['availability_zone']
+        params = {'availability_zone': zone}
+        self._list_by_param_value_and_assert(params)
+
+    @attr(type='gate')
+    def test_volumes_list_details_by_availability_zone(self):
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        zone = volume['availability_zone']
+        params = {'availability_zone': zone}
+        self._list_by_param_value_and_assert(params, with_detail=True)
+
+    @attr(type='gate')
+    def test_volume_list_with_param_metadata(self):
+        # Test to list volumes when metadata param is given
+        params = {'metadata': self.metadata}
+        self._list_by_param_value_and_assert(params)
+
+    @attr(type='gate')
+    def test_volume_list_with_detail_param_metadata(self):
+        # Test to list volumes details when metadata param is given
+        params = {'metadata': self.metadata}
+        self._list_by_param_value_and_assert(params, with_detail=True)
+
+    @attr(type='gate')
+    def test_volume_list_param_display_name_and_status(self):
+        # Test to list volume when display name and status param is given
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        params = {'name': volume['name'],
+                  'status': 'available'}
+        self._list_by_param_value_and_assert(params, expected_list=[volume])
+
+    @attr(type='gate')
+    def test_volume_list_with_detail_param_display_name_and_status(self):
+        # Test to list volume when name and status param is given
+        volume = self.volume_list[data_utils.rand_int_id(0, 2)]
+        params = {'name': volume['name'],
+                  'status': 'available'}
+        self._list_by_param_value_and_assert(params, expected_list=[volume],
+                                             with_detail=True)
+
+
+class VolumesV2ListTestXML(VolumesV2ListTestJSON):
+    _interface = 'xml'
diff --git a/tempest/auth.py b/tempest/auth.py
index 8d826cf..e1ba13b 100644
--- a/tempest/auth.py
+++ b/tempest/auth.py
@@ -68,10 +68,10 @@
         """
         Decorate request with authentication data
         """
-        raise NotImplemented
+        raise NotImplementedError
 
     def _get_auth(self):
-        raise NotImplemented
+        raise NotImplementedError
 
     @classmethod
     def check_credentials(cls, credentials):
@@ -98,7 +98,7 @@
         self.cache = None
 
     def is_expired(self, auth_data):
-        raise NotImplemented
+        raise NotImplementedError
 
     def auth_request(self, method, url, headers=None, body=None, filters=None):
         """
@@ -110,9 +110,6 @@
         :param filters: select a base URL out of the catalog
         :returns a Tuple (url, headers, body)
         """
-        LOG.debug("Auth request m:{m}, u:{u}, h:{h}, b:{b}, f:{f}".format(
-            m=method, u=url, h=headers, b=body, f=filters
-        ))
         orig_req = dict(url=url, headers=headers, body=body)
 
         auth_url, auth_headers, auth_body = self._decorate_request(
@@ -127,7 +124,6 @@
                     auth_data=self.alt_auth_data)
                 alt_auth_req = dict(url=alt_url, headers=alt_headers,
                                     body=alt_body)
-                self._log_auth_request(alt_auth_req, 'ALTERNATE')
                 auth_req[self.alt_part] = alt_auth_req[self.alt_part]
 
             else:
@@ -137,21 +133,8 @@
             # Next auth request will be normal, unless otherwise requested
             self.reset_alt_auth_data()
 
-        self._log_auth_request(auth_req, 'Authorized Request:')
-
         return auth_req['url'], auth_req['headers'], auth_req['body']
 
-    def _log_auth_request(self, auth_req, tag):
-        url = auth_req.get('url', None)
-        headers = copy.deepcopy(auth_req.get('headers', None))
-        body = auth_req.get('body', None)
-        if headers is not None:
-            if 'X-Auth-Token' in headers.keys():
-                headers['X-Auth-Token'] = '<Token Omitted>'
-        LOG.debug("[{tag}]: u: {url}, h: {headers}, b: {body}".format(
-            tag=tag, url=url, headers=headers, body=body
-        ))
-
     def reset_alt_auth_data(self):
         """
         Configure auth provider to provide valid authentication data
@@ -176,7 +159,7 @@
         """
         Extracts the base_url based on provided filters
         """
-        raise NotImplemented
+        raise NotImplementedError
 
 
 class KeystoneAuthProvider(AuthProvider):
@@ -194,7 +177,7 @@
         base_url = self.base_url(filters=filters, auth_data=auth_data)
         # build authenticated request
         # returns new request, it does not touch the original values
-        _headers = copy.deepcopy(headers)
+        _headers = copy.deepcopy(headers) if headers is not None else {}
         _headers['X-Auth-Token'] = token
         if url is None or url == "":
             _url = base_url
@@ -208,10 +191,10 @@
         return _url, _headers, body
 
     def _auth_client(self):
-        raise NotImplemented
+        raise NotImplementedError
 
     def _auth_params(self):
-        raise NotImplemented
+        raise NotImplementedError
 
     def _get_auth(self):
         # Bypasses the cache
@@ -223,7 +206,7 @@
             token, auth_data = auth_func(**auth_params)
             return token, auth_data
         else:
-            raise NotImplemented
+            raise NotImplementedError
 
     def get_token(self):
         return self.auth_data[0]
@@ -250,7 +233,7 @@
             else:
                 return xml_id.TokenClientXML()
         else:
-            raise NotImplemented
+            raise NotImplementedError
 
     def _auth_params(self):
         if self.client_type == 'tempest':
@@ -260,7 +243,7 @@
                 tenant=self.credentials.get('tenant_name', None),
                 auth_data=True)
         else:
-            raise NotImplemented
+            raise NotImplementedError
 
     def base_url(self, filters, auth_data=None):
         """
@@ -299,7 +282,7 @@
             path = "/" + filters['api_version']
             noversion_path = "/".join(parts.path.split("/")[2:])
             if noversion_path != "":
-                path += noversion_path
+                path += "/" + noversion_path
             _base_url = _base_url.replace(parts.path, path)
         if filters.get('skip_path', None) is not None:
             _base_url = _base_url.replace(parts.path, "/")
@@ -334,7 +317,7 @@
             else:
                 return xml_v3id.V3TokenClientXML()
         else:
-            raise NotImplemented
+            raise NotImplementedError
 
     def _auth_params(self):
         if self.client_type == 'tempest':
@@ -345,7 +328,7 @@
                 domain=self.credentials['domain_name'],
                 auth_data=True)
         else:
-            raise NotImplemented
+            raise NotImplementedError
 
     def base_url(self, filters, auth_data=None):
         """
@@ -388,7 +371,7 @@
                             ep['region'] == region]
         if len(filtered_catalog) == 0:
             # No matching region, take the first endpoint
-            filtered_catalog = [filtered_catalog[0]]
+            filtered_catalog = [service_catalog[0]]
         # There should be only one match. If not take the first.
         _base_url = filtered_catalog[0].get('url', None)
         if _base_url is None:
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index a5e0447..8c4ec45 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -83,6 +83,11 @@
         return self.cmd_with_auth(
             'neutron', action, flags, params, admin, fail_ok)
 
+    def savanna(self, action, flags='', params='', admin=True, fail_ok=False):
+        """Executes savanna command for the given action."""
+        return self.cmd_with_auth(
+            'savanna', action, flags, params, admin, fail_ok)
+
     def cmd_with_auth(self, cmd, action, flags='', params='',
                       admin=True, fail_ok=False):
         """Executes given command with auth attributes appended."""
diff --git a/tempest/cli/simple_read_only/test_neutron.py b/tempest/cli/simple_read_only/test_neutron.py
index ebf0dc4..c1d58b5 100644
--- a/tempest/cli/simple_read_only/test_neutron.py
+++ b/tempest/cli/simple_read_only/test_neutron.py
@@ -57,32 +57,34 @@
         self.assertTableStruct(ext, ['alias', 'name'])
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='dhcp_agent_scheduler', service='network')
     def test_neutron_dhcp_agent_list_hosting_net(self):
         self.neutron('dhcp-agent-list-hosting-net',
                      params=CONF.compute.fixed_network_name)
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='agent', service='network')
     def test_neutron_agent_list(self):
         agents = self.parser.listing(self.neutron('agent-list'))
         field_names = ['id', 'agent_type', 'host', 'alive', 'admin_state_up']
         self.assertTableStruct(agents, field_names)
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='router', service='network')
     def test_neutron_floatingip_list(self):
         self.neutron('floatingip-list')
 
-    @test.skip_because(bug="1240694")
     @test.attr(type='smoke')
     @test.requires_ext(extension='metering', service='network')
     def test_neutron_meter_label_list(self):
         self.neutron('meter-label-list')
 
-    @test.skip_because(bug="1240694")
     @test.attr(type='smoke')
     @test.requires_ext(extension='metering', service='network')
     def test_neutron_meter_label_rule_list(self):
         self.neutron('meter-label-rule-list')
 
+    @test.requires_ext(extension='lbaas_agent_scheduler', service='network')
     def _test_neutron_lbaas_command(self, command):
         try:
             self.neutron(command)
@@ -107,6 +109,7 @@
         self._test_neutron_lbaas_command('lb-vip-list')
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='external-net', service='network')
     def test_neutron_net_external_list(self):
         self.neutron('net-external-list')
 
@@ -115,19 +118,23 @@
         self.neutron('port-list')
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='quotas', service='network')
     def test_neutron_quota_list(self):
         self.neutron('quota-list')
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='router', service='network')
     def test_neutron_router_list(self):
         self.neutron('router-list')
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='security-group', service='network')
     def test_neutron_security_group_list(self):
         security_grp = self.parser.listing(self.neutron('security-group-list'))
         self.assertTableStruct(security_grp, ['id', 'name', 'description'])
 
     @test.attr(type='smoke')
+    @test.requires_ext(extension='security-group', service='network')
     def test_neutron_security_group_rule_list(self):
         self.neutron('security-group-rule-list')
 
diff --git a/tempest/cli/simple_read_only/test_savanna.py b/tempest/cli/simple_read_only/test_savanna.py
new file mode 100644
index 0000000..1e30978
--- /dev/null
+++ b/tempest/cli/simple_read_only/test_savanna.py
@@ -0,0 +1,70 @@
+# 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.
+
+import logging
+import subprocess
+
+from tempest import cli
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+LOG = logging.getLogger(__name__)
+
+
+class SimpleReadOnlySavannaClientTest(cli.ClientTestBase):
+    """Basic, read-only tests for Savanna CLI client.
+
+    Checks return values and output of read-only commands.
+    These tests do not presume any content, nor do they create
+    their own. They only verify the structure of output if present.
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.savanna:
+            msg = "Skipping all Savanna cli tests because it is not available"
+            raise cls.skipException(msg)
+        super(SimpleReadOnlySavannaClientTest, cls).setUpClass()
+
+    @test.attr(type='negative')
+    def test_savanna_fake_action(self):
+        self.assertRaises(subprocess.CalledProcessError,
+                          self.savanna,
+                          'this-does-not-exist')
+
+    def test_savanna_plugins_list(self):
+        plugins = self.parser.listing(self.savanna('plugin-list'))
+        self.assertTableStruct(plugins, ['name', 'versions', 'title'])
+
+    def test_savanna_plugins_show(self):
+        plugin = self.parser.listing(self.savanna('plugin-show',
+                                                  params='--name vanilla'))
+        self.assertTableStruct(plugin, ['Property', 'Value'])
+
+    def test_savanna_node_group_template_list(self):
+        plugins = self.parser.listing(self.savanna('node-group-template-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'plugin_name',
+                                         'node_processes', 'description'])
+
+    def test_savanna_cluster_template_list(self):
+        plugins = self.parser.listing(self.savanna('cluster-template-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'plugin_name',
+                                         'node_groups', 'description'])
+
+    def test_savanna_cluster_list(self):
+        plugins = self.parser.listing(self.savanna('cluster-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'status', 'node_count'])
diff --git a/tempest/clients.py b/tempest/clients.py
index fd46656..8db399a 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -13,10 +13,20 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import auth
+# Default client libs
+import cinderclient.client
+import glanceclient
+import heatclient.client
+import keystoneclient.exceptions
+import keystoneclient.v2_0.client
+import neutronclient.v2_0.client
+import novaclient.client
+import swiftclient
+
 from tempest.common.rest_client import NegativeRestClient
 from tempest import config
 from tempest import exceptions
+from tempest import manager
 from tempest.openstack.common import log as logging
 from tempest.services.baremetal.v1.client_json import BaremetalClientJSON
 from tempest.services import botoclients
@@ -63,8 +73,6 @@
 from tempest.services.compute.v3.json.hosts_client import HostsV3ClientJSON
 from tempest.services.compute.v3.json.hypervisor_client import \
     HypervisorV3ClientJSON
-from tempest.services.compute.v3.json.instance_usage_audit_log_client import \
-    InstanceUsagesAuditLogV3ClientJSON
 from tempest.services.compute.v3.json.interfaces_client import \
     InterfacesV3ClientJSON
 from tempest.services.compute.v3.json.keypairs_client import \
@@ -75,8 +83,6 @@
     ServersV3ClientJSON
 from tempest.services.compute.v3.json.services_client import \
     ServicesV3ClientJSON
-from tempest.services.compute.v3.json.tenant_usages_client import \
-    TenantUsagesV3ClientJSON
 from tempest.services.compute.v3.json.version_client import \
     VersionV3ClientJSON
 from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
@@ -152,14 +158,18 @@
     VolumeHostsClientJSON
 from tempest.services.volume.json.admin.volume_types_client import \
     VolumeTypesClientJSON
+from tempest.services.volume.json.backups_client import BackupsClientJSON
 from tempest.services.volume.json.extensions_client import \
     ExtensionsClientJSON as VolumeExtensionClientJSON
 from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
 from tempest.services.volume.json.volumes_client import VolumesClientJSON
+from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
+from tempest.services.volume.v2.xml.volumes_client import VolumesV2ClientXML
 from tempest.services.volume.xml.admin.volume_hosts_client import \
     VolumeHostsClientXML
 from tempest.services.volume.xml.admin.volume_types_client import \
     VolumeTypesClientXML
+from tempest.services.volume.xml.backups_client import BackupsClientXML
 from tempest.services.volume.xml.extensions_client import \
     ExtensionsClientXML as VolumeExtensionClientXML
 from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
@@ -169,10 +179,10 @@
 LOG = logging.getLogger(__name__)
 
 
-class Manager(object):
+class Manager(manager.Manager):
 
     """
-    Top level manager for OpenStack Compute clients
+    Top level manager for OpenStack tempest clients
     """
 
     def __init__(self, username=None, password=None, tenant_name=None,
@@ -187,153 +197,145 @@
         :param tenant_name: Override of the tenant name
         """
         self.interface = interface
-        self.auth_version = CONF.identity.auth_version
-        # FIXME(andreaf) Change Manager __init__ to accept a credentials dict
-        if username is None or password is None:
-            # Tenant None is a valid use case
-            self.credentials = self.get_default_credentials()
-        else:
-            self.credentials = dict(username=username, password=password,
-                                    tenant_name=tenant_name)
-        if self.auth_version == 'v3':
-            self.credentials['domain_name'] = 'Default'
-        # Setup an auth provider
-        auth_provider = self.get_auth_provider(self.credentials)
+        self.client_type = 'tempest'
+        # super cares for credentials validation
+        super(Manager, self).__init__(
+            username=username, password=password, tenant_name=tenant_name)
 
         if self.interface == 'xml':
             self.certificates_client = CertificatesClientXML(
-                auth_provider)
-            self.servers_client = ServersClientXML(auth_provider)
-            self.limits_client = LimitsClientXML(auth_provider)
-            self.images_client = ImagesClientXML(auth_provider)
-            self.keypairs_client = KeyPairsClientXML(auth_provider)
-            self.quotas_client = QuotasClientXML(auth_provider)
-            self.flavors_client = FlavorsClientXML(auth_provider)
-            self.extensions_client = ExtensionsClientXML(auth_provider)
+                self.auth_provider)
+            self.servers_client = ServersClientXML(self.auth_provider)
+            self.limits_client = LimitsClientXML(self.auth_provider)
+            self.images_client = ImagesClientXML(self.auth_provider)
+            self.keypairs_client = KeyPairsClientXML(self.auth_provider)
+            self.quotas_client = QuotasClientXML(self.auth_provider)
+            self.flavors_client = FlavorsClientXML(self.auth_provider)
+            self.extensions_client = ExtensionsClientXML(self.auth_provider)
             self.volumes_extensions_client = VolumesExtensionsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.floating_ips_client = FloatingIPsClientXML(
-                auth_provider)
-            self.snapshots_client = SnapshotsClientXML(auth_provider)
-            self.volumes_client = VolumesClientXML(auth_provider)
+                self.auth_provider)
+            self.backups_client = BackupsClientXML(self.auth_provider)
+            self.snapshots_client = SnapshotsClientXML(self.auth_provider)
+            self.volumes_client = VolumesClientXML(self.auth_provider)
+            self.volumes_v2_client = VolumesV2ClientXML(self.auth_provider)
             self.volume_types_client = VolumeTypesClientXML(
-                auth_provider)
-            self.identity_client = IdentityClientXML(auth_provider)
+                self.auth_provider)
+            self.identity_client = IdentityClientXML(self.auth_provider)
             self.identity_v3_client = IdentityV3ClientXML(
-                auth_provider)
+                self.auth_provider)
             self.security_groups_client = SecurityGroupsClientXML(
-                auth_provider)
-            self.interfaces_client = InterfacesClientXML(auth_provider)
-            self.endpoints_client = EndPointClientXML(auth_provider)
-            self.fixed_ips_client = FixedIPsClientXML(auth_provider)
+                self.auth_provider)
+            self.interfaces_client = InterfacesClientXML(self.auth_provider)
+            self.endpoints_client = EndPointClientXML(self.auth_provider)
+            self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
             self.availability_zone_client = AvailabilityZoneClientXML(
-                auth_provider)
-            self.service_client = ServiceClientXML(auth_provider)
-            self.aggregates_client = AggregatesClientXML(auth_provider)
-            self.services_client = ServicesClientXML(auth_provider)
+                self.auth_provider)
+            self.service_client = ServiceClientXML(self.auth_provider)
+            self.aggregates_client = AggregatesClientXML(self.auth_provider)
+            self.services_client = ServicesClientXML(self.auth_provider)
             self.tenant_usages_client = TenantUsagesClientXML(
-                auth_provider)
-            self.policy_client = PolicyClientXML(auth_provider)
-            self.hosts_client = HostsClientXML(auth_provider)
-            self.hypervisor_client = HypervisorClientXML(auth_provider)
-            self.network_client = NetworkClientXML(auth_provider)
+                self.auth_provider)
+            self.policy_client = PolicyClientXML(self.auth_provider)
+            self.hosts_client = HostsClientXML(self.auth_provider)
+            self.hypervisor_client = HypervisorClientXML(self.auth_provider)
+            self.network_client = NetworkClientXML(self.auth_provider)
             self.credentials_client = CredentialsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientXML(auth_provider)
+                InstanceUsagesAuditLogClientXML(self.auth_provider)
             self.volume_hosts_client = VolumeHostsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extension_client = VolumeExtensionClientXML(
-                auth_provider)
+                self.auth_provider)
             if CONF.service_available.ceilometer:
                 self.telemetry_client = TelemetryClientXML(
-                    auth_provider)
+                    self.auth_provider)
             self.token_client = TokenClientXML()
             self.token_v3_client = V3TokenClientXML()
 
         elif self.interface == 'json':
             self.certificates_client = CertificatesClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.certificates_v3_client = CertificatesV3ClientJSON(
-                auth_provider)
-            self.baremetal_client = BaremetalClientJSON(auth_provider)
-            self.servers_client = ServersClientJSON(auth_provider)
-            self.servers_v3_client = ServersV3ClientJSON(auth_provider)
-            self.limits_client = LimitsClientJSON(auth_provider)
-            self.images_client = ImagesClientJSON(auth_provider)
+                self.auth_provider)
+            self.baremetal_client = BaremetalClientJSON(self.auth_provider)
+            self.servers_client = ServersClientJSON(self.auth_provider)
+            self.servers_v3_client = ServersV3ClientJSON(self.auth_provider)
+            self.limits_client = LimitsClientJSON(self.auth_provider)
+            self.images_client = ImagesClientJSON(self.auth_provider)
             self.keypairs_v3_client = KeyPairsV3ClientJSON(
-                auth_provider)
-            self.keypairs_client = KeyPairsClientJSON(auth_provider)
+                self.auth_provider)
+            self.keypairs_client = KeyPairsClientJSON(self.auth_provider)
             self.keypairs_v3_client = KeyPairsV3ClientJSON(
-                auth_provider)
-            self.quotas_client = QuotasClientJSON(auth_provider)
-            self.quotas_v3_client = QuotasV3ClientJSON(auth_provider)
-            self.flavors_client = FlavorsClientJSON(auth_provider)
-            self.flavors_v3_client = FlavorsV3ClientJSON(auth_provider)
+                self.auth_provider)
+            self.quotas_client = QuotasClientJSON(self.auth_provider)
+            self.quotas_v3_client = QuotasV3ClientJSON(self.auth_provider)
+            self.flavors_client = FlavorsClientJSON(self.auth_provider)
+            self.flavors_v3_client = FlavorsV3ClientJSON(self.auth_provider)
             self.extensions_v3_client = ExtensionsV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.extensions_client = ExtensionsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extensions_client = VolumesExtensionsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.floating_ips_client = FloatingIPsClientJSON(
-                auth_provider)
-            self.snapshots_client = SnapshotsClientJSON(auth_provider)
-            self.volumes_client = VolumesClientJSON(auth_provider)
+                self.auth_provider)
+            self.backups_client = BackupsClientJSON(self.auth_provider)
+            self.snapshots_client = SnapshotsClientJSON(self.auth_provider)
+            self.volumes_client = VolumesClientJSON(self.auth_provider)
+            self.volumes_v2_client = VolumesV2ClientJSON(self.auth_provider)
             self.volume_types_client = VolumeTypesClientJSON(
-                auth_provider)
-            self.identity_client = IdentityClientJSON(auth_provider)
+                self.auth_provider)
+            self.identity_client = IdentityClientJSON(self.auth_provider)
             self.identity_v3_client = IdentityV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.security_groups_client = SecurityGroupsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.interfaces_v3_client = InterfacesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.interfaces_client = InterfacesClientJSON(
-                auth_provider)
-            self.endpoints_client = EndPointClientJSON(auth_provider)
-            self.fixed_ips_client = FixedIPsClientJSON(auth_provider)
+                self.auth_provider)
+            self.endpoints_client = EndPointClientJSON(self.auth_provider)
+            self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider)
             self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.availability_zone_client = AvailabilityZoneClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.services_v3_client = ServicesV3ClientJSON(
-                auth_provider)
-            self.service_client = ServiceClientJSON(auth_provider)
+                self.auth_provider)
+            self.service_client = ServiceClientJSON(self.auth_provider)
             self.aggregates_v3_client = AggregatesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.aggregates_client = AggregatesClientJSON(
-                auth_provider)
-            self.services_client = ServicesClientJSON(auth_provider)
-            self.tenant_usages_v3_client = TenantUsagesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
+            self.services_client = ServicesClientJSON(self.auth_provider)
             self.tenant_usages_client = TenantUsagesClientJSON(
-                auth_provider)
-            self.version_v3_client = VersionV3ClientJSON(auth_provider)
-            self.policy_client = PolicyClientJSON(auth_provider)
-            self.hosts_client = HostsClientJSON(auth_provider)
+                self.auth_provider)
+            self.version_v3_client = VersionV3ClientJSON(self.auth_provider)
+            self.policy_client = PolicyClientJSON(self.auth_provider)
+            self.hosts_client = HostsClientJSON(self.auth_provider)
             self.hypervisor_v3_client = HypervisorV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.hypervisor_client = HypervisorClientJSON(
-                auth_provider)
-            self.network_client = NetworkClientJSON(auth_provider)
+                self.auth_provider)
+            self.network_client = NetworkClientJSON(self.auth_provider)
             self.credentials_client = CredentialsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientJSON(auth_provider)
-            self.instance_usages_audit_log_v3_client = \
-                InstanceUsagesAuditLogV3ClientJSON(auth_provider)
+                InstanceUsagesAuditLogClientJSON(self.auth_provider)
             self.volume_hosts_client = VolumeHostsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extension_client = VolumeExtensionClientJSON(
-                auth_provider)
-            self.hosts_v3_client = HostsV3ClientJSON(auth_provider)
+                self.auth_provider)
+            self.hosts_v3_client = HostsV3ClientJSON(self.auth_provider)
             if CONF.service_available.ceilometer:
                 self.telemetry_client = TelemetryClientJSON(
-                    auth_provider)
+                    self.auth_provider)
             self.token_client = TokenClientJSON()
             self.token_v3_client = V3TokenClientJSON()
-            self.negative_client = NegativeRestClient(auth_provider)
+            self.negative_client = NegativeRestClient(self.auth_provider)
             self.negative_client.service = service
 
         else:
@@ -347,47 +349,22 @@
                            self.credentials.get('tenant_name'))
 
         # common clients
-        self.account_client = AccountClient(auth_provider)
+        self.account_client = AccountClient(self.auth_provider)
         if CONF.service_available.glance:
-            self.image_client = ImageClientJSON(auth_provider)
-            self.image_client_v2 = ImageClientV2JSON(auth_provider)
-        self.container_client = ContainerClient(auth_provider)
-        self.object_client = ObjectClient(auth_provider)
+            self.image_client = ImageClientJSON(self.auth_provider)
+            self.image_client_v2 = ImageClientV2JSON(self.auth_provider)
+        self.container_client = ContainerClient(self.auth_provider)
+        self.object_client = ObjectClient(self.auth_provider)
         self.orchestration_client = OrchestrationClient(
-            auth_provider)
+            self.auth_provider)
         self.ec2api_client = botoclients.APIClientEC2(*ec2_client_args)
         self.s3_client = botoclients.ObjectClientS3(*ec2_client_args)
         self.custom_object_client = ObjectClientCustomizedHeader(
-            auth_provider)
+            self.auth_provider)
         self.custom_account_client = \
-            AccountClientCustomizedHeader(auth_provider)
+            AccountClientCustomizedHeader(self.auth_provider)
         self.data_processing_client = DataProcessingClient(
-            auth_provider)
-
-    @classmethod
-    def get_auth_provider_class(cls, auth_version):
-        if auth_version == 'v2':
-            return auth.KeystoneV2AuthProvider
-        else:
-            return auth.KeystoneV3AuthProvider
-
-    def get_default_credentials(self):
-        return dict(
-            username=CONF.identity.username,
-            password=CONF.identity.password,
-            tenant_name=CONF.identity.tenant_name
-        )
-
-    def get_auth_provider(self, credentials=None):
-        auth_params = dict(client_type='tempest',
-                           interface=self.interface)
-        auth_provider_class = self.get_auth_provider_class(self.auth_version)
-        # If invalid / incomplete credentials are provided, use default ones
-        if credentials is None or \
-                not auth_provider_class.check_credentials(credentials):
-            credentials = self.credentials
-        auth_params['credentials'] = credentials
-        return auth_provider_class(**auth_params)
+            self.auth_provider)
 
 
 class AltManager(Manager):
@@ -443,8 +420,196 @@
     """
     def __init__(self, interface='json', service=None):
         base = super(OrchestrationManager, self)
+        # heat currently needs an admin user so that stacks can create users
+        # however the tests need the demo tenant so that the neutron
+        # private network is the default. DO NOT change this auth combination
+        # until heat can run with the demo user.
         base.__init__(CONF.identity.admin_username,
                       CONF.identity.admin_password,
                       CONF.identity.tenant_name,
                       interface=interface,
                       service=service)
+
+
+class OfficialClientManager(manager.Manager):
+    """
+    Manager that provides access to the official python clients for
+    calling various OpenStack APIs.
+    """
+
+    NOVACLIENT_VERSION = '2'
+    CINDERCLIENT_VERSION = '1'
+    HEATCLIENT_VERSION = '1'
+
+    def __init__(self, username, password, tenant_name):
+        # FIXME(andreaf) Auth provider for client_type 'official' is
+        # not implemented yet, setting to 'tempest' for now.
+        self.client_type = 'tempest'
+        self.interface = None
+        # super cares for credentials validation
+        super(OfficialClientManager, self).__init__(
+            username=username, password=password, tenant_name=tenant_name)
+        self.compute_client = self._get_compute_client(username,
+                                                       password,
+                                                       tenant_name)
+        self.identity_client = self._get_identity_client(username,
+                                                         password,
+                                                         tenant_name)
+        self.image_client = self._get_image_client()
+        self.network_client = self._get_network_client()
+        self.volume_client = self._get_volume_client(username,
+                                                     password,
+                                                     tenant_name)
+        self.object_storage_client = self._get_object_storage_client(
+            username,
+            password,
+            tenant_name)
+        self.orchestration_client = self._get_orchestration_client(
+            username,
+            password,
+            tenant_name)
+
+    def _get_compute_client(self, username, password, tenant_name):
+        # Novaclient will not execute operations for anyone but the
+        # identified user, so a new client needs to be created for
+        # each user that operations need to be performed for.
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        region = CONF.identity.region
+
+        client_args = (username, password, tenant_name, auth_url)
+
+        # Create our default Nova client to use in testing
+        service_type = CONF.compute.catalog_type
+        endpoint_type = CONF.compute.endpoint_type
+        return novaclient.client.Client(self.NOVACLIENT_VERSION,
+                                        *client_args,
+                                        service_type=service_type,
+                                        endpoint_type=endpoint_type,
+                                        region_name=region,
+                                        no_cache=True,
+                                        insecure=dscv,
+                                        http_log_debug=True)
+
+    def _get_image_client(self):
+        token = self.identity_client.auth_token
+        region = CONF.identity.region
+        endpoint_type = CONF.image.endpoint_type
+        endpoint = self.identity_client.service_catalog.url_for(
+            attr='region', filter_value=region,
+            service_type=CONF.image.catalog_type, endpoint_type=endpoint_type)
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        return glanceclient.Client('1', endpoint=endpoint, token=token,
+                                   insecure=dscv)
+
+    def _get_volume_client(self, username, password, tenant_name):
+        auth_url = CONF.identity.uri
+        region = CONF.identity.region
+        endpoint_type = CONF.volume.endpoint_type
+        return cinderclient.client.Client(self.CINDERCLIENT_VERSION,
+                                          username,
+                                          password,
+                                          tenant_name,
+                                          auth_url,
+                                          region_name=region,
+                                          endpoint_type=endpoint_type,
+                                          http_log_debug=True)
+
+    def _get_object_storage_client(self, username, password, tenant_name):
+        auth_url = CONF.identity.uri
+        # add current tenant to swift operator role group.
+        keystone_admin = self._get_identity_client(
+            CONF.identity.admin_username,
+            CONF.identity.admin_password,
+            CONF.identity.admin_tenant_name)
+
+        # enable test user to operate swift by adding operator role to him.
+        roles = keystone_admin.roles.list()
+        operator_role = CONF.object_storage.operator_role
+        member_role = [role for role in roles if role.name == operator_role][0]
+        # NOTE(maurosr): This is surrounded in the try-except block cause
+        # neutron tests doesn't have tenant isolation.
+        try:
+            keystone_admin.roles.add_user_role(self.identity_client.user_id,
+                                               member_role.id,
+                                               self.identity_client.tenant_id)
+        except keystoneclient.exceptions.Conflict:
+            pass
+
+        endpoint_type = CONF.object_storage.endpoint_type
+        os_options = {'endpoint_type': endpoint_type}
+        return swiftclient.Connection(auth_url, username, password,
+                                      tenant_name=tenant_name,
+                                      auth_version='2',
+                                      os_options=os_options)
+
+    def _get_orchestration_client(self, username=None, password=None,
+                                  tenant_name=None):
+        if not username:
+            username = CONF.identity.admin_username
+        if not password:
+            password = CONF.identity.admin_password
+        if not tenant_name:
+            tenant_name = CONF.identity.tenant_name
+
+        self._validate_credentials(username, password, tenant_name)
+
+        keystone = self._get_identity_client(username, password, tenant_name)
+        region = CONF.identity.region
+        endpoint_type = CONF.orchestration.endpoint_type
+        token = keystone.auth_token
+        service_type = CONF.orchestration.catalog_type
+        try:
+            endpoint = keystone.service_catalog.url_for(
+                attr='region',
+                filter_value=region,
+                service_type=service_type,
+                endpoint_type=endpoint_type)
+        except keystoneclient.exceptions.EndpointNotFound:
+            return None
+        else:
+            return heatclient.client.Client(self.HEATCLIENT_VERSION,
+                                            endpoint,
+                                            token=token,
+                                            username=username,
+                                            password=password)
+
+    def _get_identity_client(self, username, password, tenant_name):
+        # This identity client is not intended to check the security
+        # of the identity service, so use admin credentials by default.
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+
+        return keystoneclient.v2_0.client.Client(username=username,
+                                                 password=password,
+                                                 tenant_name=tenant_name,
+                                                 auth_url=auth_url,
+                                                 insecure=dscv)
+
+    def _get_network_client(self):
+        # The intended configuration is for the network client to have
+        # admin privileges and indicate for whom resources are being
+        # created via a 'tenant_id' parameter.  This will often be
+        # preferable to authenticating as a specific user because
+        # working with certain resources (public routers and networks)
+        # often requires admin privileges anyway.
+        username = CONF.identity.admin_username
+        password = CONF.identity.admin_password
+        tenant_name = CONF.identity.admin_tenant_name
+
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        endpoint_type = CONF.network.endpoint_type
+
+        return neutronclient.v2_0.client.Client(username=username,
+                                                password=password,
+                                                tenant_name=tenant_name,
+                                                endpoint_type=endpoint_type,
+                                                auth_url=auth_url,
+                                                insecure=dscv)
diff --git a/tempest/common/generate_json.py b/tempest/common/generate_json.py
index 0a0afe4..c8e86dc 100644
--- a/tempest/common/generate_json.py
+++ b/tempest/common/generate_json.py
@@ -203,36 +203,62 @@
     return invalids
 
 
-type_map_valid = {"string": generate_valid_string,
-                  "integer": generate_valid_integer,
-                  "object": generate_valid_object}
+type_map_valid = {
+    "string": generate_valid_string,
+    "integer": generate_valid_integer,
+    "object": generate_valid_object
+}
 
-type_map_invalid = {"string": [gen_int,
-                               gen_none,
-                               gen_str_min_length,
-                               gen_str_max_length],
-                    "integer": [gen_string,
-                                gen_none,
-                                gen_int_min,
-                                gen_int_max],
-                    "object": [gen_obj_remove_attr,
-                               gen_obj_add_attr,
-                               gen_inv_prop_obj]}
+type_map_invalid = {
+    "string": [
+        gen_int,
+        gen_none,
+        gen_str_min_length,
+        gen_str_max_length],
+    "integer": [
+        gen_string,
+        gen_none,
+        gen_int_min,
+        gen_int_max],
+    "object": [
+        gen_obj_remove_attr,
+        gen_obj_add_attr,
+        gen_inv_prop_obj]
+}
 
-schema = {"type": "object",
-          "properties":
-          {"name": {"type": "string"},
-           "http-method": {"enum": ["GET", "PUT", "HEAD",
-                                    "POST", "PATCH", "DELETE", 'COPY']},
-           "url": {"type": "string"},
-           "json-schema": jsonschema._utils.load_schema("draft4"),
-           "resources": {"type": "array", "items": {"type": "string"}},
-           "results": {"type": "object",
-                       "properties": {}}
-           },
-          "required": ["name", "http-method", "url"],
-          "additionalProperties": False,
-          }
+schema = {
+    "type": "object",
+    "properties": {
+        "name": {"type": "string"},
+        "http-method": {
+            "enum": ["GET", "PUT", "HEAD",
+                     "POST", "PATCH", "DELETE", 'COPY']
+        },
+        "url": {"type": "string"},
+        "json-schema": jsonschema._utils.load_schema("draft4"),
+        "resources": {
+            "type": "array",
+            "items": {
+                "oneOf": [
+                    {"type": "string"},
+                    {
+                        "type": "object",
+                        "properties": {
+                            "name": {"type": "string"},
+                            "expected_result": {"type": "integer"}
+                        }
+                    }
+                ]
+            }
+        },
+        "results": {
+            "type": "object",
+            "properties": {}
+        }
+    },
+    "required": ["name", "http-method", "url"],
+    "additionalProperties": False,
+}
 
 
 def validate_negative_test_schema(nts):
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 033fe70..03dccd4 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -38,19 +38,31 @@
 
 
 class RestClient(object):
+
     TYPE = "json"
+
+    # This is used by _parse_resp method
+    # Redefine it for purposes of your xml service client
+    # List should contain top-xml_tag-names of data, which is like list/array
+    # For example, in keystone it is users, roles, tenants and services
+    # All of it has children with same tag-names
+    list_tags = []
+
+    # This is used by _parse_resp method too
+    # Used for selection of dict-like xmls,
+    # like metadata for Vms in nova, and volumes in cinder
+    dict_tags = ["metadata", ]
+
     LOG = logging.getLogger(__name__)
 
     def __init__(self, auth_provider):
         self.auth_provider = auth_provider
 
-        self.endpoint_url = 'publicURL'
+        self.endpoint_url = None
         self.service = None
         # The version of the API this client implements
         self.api_version = None
         self._skip_path = False
-        self.headers = {'Content-Type': 'application/%s' % self.TYPE,
-                        'Accept': 'application/%s' % self.TYPE}
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
         self.general_header_lc = set(('cache-control', 'connection',
@@ -65,6 +77,17 @@
         self.http_obj = http.ClosingHttp(
             disable_ssl_certificate_validation=dscv)
 
+    def _get_type(self):
+        return self.TYPE
+
+    def get_headers(self, accept_type=None, send_type=None):
+        if accept_type is None:
+            accept_type = self._get_type()
+        if send_type is None:
+            send_type = self._get_type()
+        return {'Content-Type': 'application/%s' % send_type,
+                'Accept': 'application/%s' % accept_type}
+
     def __str__(self):
         STRING_LIMIT = 80
         str_format = ("config:%s, service:%s, base_url:%s, "
@@ -74,7 +97,7 @@
                              self.filters, self.build_interval,
                              self.build_timeout,
                              str(self.token)[0:STRING_LIMIT],
-                             str(self.headers)[0:STRING_LIMIT])
+                             str(self.get_headers())[0:STRING_LIMIT])
 
     def _get_region(self, service):
         """
@@ -91,6 +114,28 @@
             service_region = CONF.identity.region
         return service_region
 
+    def _get_endpoint_type(self, service):
+        """
+        Returns the endpoint type for a specific service
+        """
+        # If the client requests a specific endpoint type, then be it
+        if self.endpoint_url:
+            return self.endpoint_url
+        endpoint_type = None
+        for cfgname in dir(CONF._config):
+            # Find all config.FOO.catalog_type and assume FOO is a service.
+            cfg = getattr(CONF, cfgname)
+            catalog_type = getattr(cfg, 'catalog_type', None)
+            if catalog_type == service:
+                endpoint_type = getattr(cfg, 'endpoint_type', 'publicURL')
+                break
+        # Special case for compute v3 service which hasn't its own
+        # configuration group
+        else:
+            if service == CONF.compute.catalog_v3_type:
+                endpoint_type = CONF.compute.endpoint_type
+        return endpoint_type
+
     @property
     def user(self):
         return self.auth_provider.credentials.get('username', None)
@@ -115,7 +160,7 @@
     def filters(self):
         _filters = dict(
             service=self.service,
-            endpoint_type=self.endpoint_url,
+            endpoint_type=self._get_endpoint_type(self.service),
             region=self._get_region(self.service)
         )
         if self.api_version is not None:
@@ -150,7 +195,7 @@
                 details = pattern.format(read_code, expected_code)
                 raise exceptions.InvalidHttpSuccessCode(details)
 
-    def post(self, url, body, headers):
+    def post(self, url, body, headers=None):
         return self.request('POST', url, headers, body)
 
     def get(self, url, headers=None):
@@ -159,10 +204,10 @@
     def delete(self, url, headers=None, body=None):
         return self.request('DELETE', url, headers, body)
 
-    def patch(self, url, body, headers):
+    def patch(self, url, body, headers=None):
         return self.request('PATCH', url, headers, body)
 
-    def put(self, url, body, headers):
+    def put(self, url, body, headers=None):
         return self.request('PUT', url, headers, body)
 
     def head(self, url, headers=None):
@@ -174,7 +219,6 @@
     def get_versions(self):
         resp, body = self.get('')
         body = self._parse_resp(body)
-        body = body['versions']
         versions = map(lambda x: x['id'], body)
         return resp, versions
 
@@ -202,10 +246,10 @@
         headers = resp.copy()
         del headers['status']
         if headers.get('x-compute-request-id'):
-            self.LOG.info("Nova request id: %s" %
+            self.LOG.info("Nova/Cinder request id: %s" %
                           headers.pop('x-compute-request-id'))
         elif headers.get('x-openstack-request-id'):
-            self.LOG.info("Glance request id %s" %
+            self.LOG.info("OpenStack request id %s" %
                           headers.pop('x-openstack-request-id'))
         if len(headers):
             self.LOG.debug('Response Headers: ' + str(headers))
@@ -218,7 +262,48 @@
                                hashlib.md5(str_body).hexdigest())
 
     def _parse_resp(self, body):
-        return json.loads(body)
+        if self._get_type() is "json":
+            body = json.loads(body)
+
+            # We assume, that if the first value of the deserialized body's
+            # item set is a dict or a list, that we just return the first value
+            # of deserialized body.
+            # Essentially "cutting out" the first placeholder element in a body
+            # that looks like this:
+            #
+            #  {
+            #    "users": [
+            #      ...
+            #    ]
+            #  }
+            try:
+                # Ensure there are not more than one top-level keys
+                if len(body.keys()) > 1:
+                    return body
+                # Just return the "wrapped" element
+                first_key, first_item = body.items()[0]
+                if isinstance(first_item, (dict, list)):
+                    return first_item
+            except (ValueError, IndexError):
+                pass
+            return body
+        elif self._get_type() is "xml":
+            element = etree.fromstring(body)
+            if any(s in element.tag for s in self.dict_tags):
+                # Parse dictionary-like xmls (metadata, etc)
+                dictionary = {}
+                for el in element.getchildren():
+                    dictionary[u"%s" % el.get("key")] = u"%s" % el.text
+                return dictionary
+            if any(s in element.tag for s in self.list_tags):
+                # Parse list-like xmls (users, roles, etc)
+                array = []
+                for child in element.getchildren():
+                    array.append(xml_to_json(child))
+                return array
+
+            # Parse one-item-like xmls (user, role, etc)
+            return xml_to_json(element)
 
     def response_checker(self, method, url, headers, body, resp, resp_body):
         if (resp.status in set((204, 205, 304)) or resp.status < 200 or
@@ -248,8 +333,7 @@
         if not resp_body and resp.status >= 400:
             self.LOG.warning("status >= 400 response with empty body")
 
-    def _request(self, method, url,
-                 headers=None, body=None):
+    def _request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
         # Authenticate the request with the auth provider
         req_url, req_headers, req_body = self.auth_provider.auth_request(
@@ -265,12 +349,13 @@
 
         return resp, resp_body
 
-    def request(self, method, url,
-                headers=None, body=None):
+    def request(self, method, url, headers=None, body=None):
         retry = 0
 
         if headers is None:
-            headers = {}
+            # NOTE(vponomaryov): if some client do not need headers,
+            # it should explicitly pass empty dict
+            headers = self.get_headers()
 
         resp, resp_body = self._request(method, url,
                                         headers=headers, body=body)
@@ -390,10 +475,13 @@
         if (not isinstance(resp_body, collections.Mapping) or
                 'retry-after' not in resp):
             return True
-        over_limit = resp_body.get('overLimit', None)
-        if not over_limit:
-            return True
-        return 'exceed' in over_limit.get('message', 'blabla')
+        if self._get_type() is "json":
+            over_limit = resp_body.get('overLimit', None)
+            if not over_limit:
+                return True
+            return 'exceed' in over_limit.get('message', 'blabla')
+        elif self._get_type() is "xml":
+            return 'exceed' in resp_body.get('message', 'blabla')
 
     def wait_for_resource_deletion(self, id):
         """Waits for a resource to be deleted."""
@@ -414,19 +502,6 @@
         raise NotImplementedError(message)
 
 
-class RestClientXML(RestClient):
-    TYPE = "xml"
-
-    def _parse_resp(self, body):
-        return xml_to_json(etree.fromstring(body))
-
-    def is_absolute_limit(self, resp, resp_body):
-        if (not isinstance(resp_body, collections.Mapping) or
-                'retry-after' not in resp):
-            return True
-        return 'exceed' in resp_body.get('message', 'blabla')
-
-
 class NegativeRestClient(RestClient):
     """
     Version of RestClient that does not raise exceptions.
@@ -440,11 +515,11 @@
         if method == "GET":
             resp, body = self.get(url)
         elif method == "POST":
-            resp, body = self.post(url, body, self.headers)
+            resp, body = self.post(url, body)
         elif method == "PUT":
-            resp, body = self.put(url, body, self.headers)
+            resp, body = self.put(url, body)
         elif method == "PATCH":
-            resp, body = self.patch(url, body, self.headers)
+            resp, body = self.patch(url, body)
         elif method == "HEAD":
             resp, body = self.head(url)
         elif method == "DELETE":
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index c772ce9..b6fa0a0 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -72,7 +72,7 @@
                             look_for_keys=self.look_for_keys,
                             key_filename=self.key_filename,
                             timeout=self.channel_timeout, pkey=self.pkey)
-                LOG.info("ssh connection to %s@%s sucessfuly created",
+                LOG.info("ssh connection to %s@%s successfuly created",
                          self.username, self.host)
                 return ssh
             except (socket.error,
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index bb2fcfb..94fc23c 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -13,9 +13,9 @@
 import re
 import time
 
-from tempest.common.ssh import Client
+from tempest.common import ssh
 from tempest import config
-from tempest.exceptions import ServerUnreachable
+from tempest import exceptions
 
 CONF = config.CONF
 
@@ -37,10 +37,10 @@
                     ip_address = address['addr']
                     break
             else:
-                raise ServerUnreachable()
-        self.ssh_client = Client(ip_address, username, password, ssh_timeout,
-                                 pkey=pkey,
-                                 channel_timeout=ssh_channel_timeout)
+                raise exceptions.ServerUnreachable()
+        self.ssh_client = ssh.Client(ip_address, username, password,
+                                     ssh_timeout, pkey=pkey,
+                                     channel_timeout=ssh_channel_timeout)
 
     def validate_authentication(self):
         """Validate ssh connection and authentication
diff --git a/tempest/common/utils/test_utils.py b/tempest/common/utils/test_utils.py
index eca716e..cc0d831 100644
--- a/tempest/common/utils/test_utils.py
+++ b/tempest/common/utils/test_utils.py
@@ -12,9 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import clients
 from tempest.common.utils import misc
 from tempest import config
-from tempest.scenario import manager
 
 import json
 import re
@@ -35,7 +35,7 @@
         self.non_ssh_image_pattern = \
             CONF.input_scenario.non_ssh_image_regex
         # Setup clients
-        ocm = manager.OfficialClientManager(CONF.identity.username,
+        ocm = clients.OfficialClientManager(CONF.identity.username,
                                             CONF.identity.password,
                                             CONF.identity.tenant_name)
         self.client = ocm.compute_client
@@ -95,7 +95,7 @@
                                             digit=string.digits)
 
     def __init__(self):
-        ocm = manager.OfficialClientManager(CONF.identity.username,
+        ocm = clients.OfficialClientManager(CONF.identity.username,
                                             CONF.identity.password,
                                             CONF.identity.tenant_name)
         self.client = ocm.compute_client
@@ -112,6 +112,8 @@
         """
         :return: a scenario with name and uuid of images
         """
+        if not CONF.service_available.glance:
+            return []
         if not hasattr(self, '_scenario_images'):
             images = self.client.images.list(detailed=False)
             self._scenario_images = [
diff --git a/tempest/config.py b/tempest/config.py
index d24ab34..e1a19f3 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -53,6 +53,11 @@
                     "services' region name unless they are set explicitly. "
                     "If no such region is found in the service catalog, the "
                     "first found one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the identity service."),
     cfg.StrOpt('username',
                default='demo',
                help="Username to use for Nova API requests."),
@@ -99,7 +104,13 @@
     cfg.BoolOpt('trust',
                 default=True,
                 help='Does the identity service have delegation and '
-                     'impersonation enabled')
+                     'impersonation enabled'),
+    cfg.BoolOpt('api_v2',
+                default=True,
+                help='Is the v2 identity API enabled'),
+    cfg.BoolOpt('api_v3',
+                default=True,
+                help='Is the v3 identity API enabled'),
 ]
 
 compute_group = cfg.OptGroup(name='compute',
@@ -187,6 +198,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the compute service."),
     cfg.StrOpt('catalog_v3_type',
                default='computev3',
                help="Catalog type of the Compute v3 service."),
@@ -219,8 +235,8 @@
                 help="If false, skip disk config tests"),
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled compute extensions with a special '
+                     'entry all which indicates every extension is enabled'),
     cfg.ListOpt('api_v3_extensions',
                 default=['all'],
                 help='A list of enabled v3 extensions with a special entry all'
@@ -280,6 +296,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the image service."),
     cfg.StrOpt('http_image',
                default='http://download.cirros-cloud.net/0.3.1/'
                'cirros-0.3.1-x86_64-uec.tar.gz',
@@ -311,12 +332,26 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the network service."),
     cfg.StrOpt('tenant_network_cidr',
                default="10.100.0.0/16",
-               help="The cidr block to allocate tenant networks from"),
+               help="The cidr block to allocate tenant ipv4 subnets from"),
     cfg.IntOpt('tenant_network_mask_bits',
                default=28,
-               help="The mask bits for tenant networks"),
+               help="The mask bits for tenant ipv4 subnets"),
+    cfg.BoolOpt('ipv6_enabled',
+                default=True,
+                help="Allow the execution of IPv6 tests"),
+    cfg.StrOpt('tenant_network_v6_cidr',
+               default="2003::/64",
+               help="The cidr block to allocate tenant ipv6 subnets from"),
+    cfg.IntOpt('tenant_network_v6_mask_bits',
+               default=96,
+               help="The mask bits for tenant ipv6 subnets"),
     cfg.BoolOpt('tenant_networks_reachable',
                 default=False,
                 help="Whether tenant network connectivity should be "
@@ -337,8 +372,8 @@
 NetworkFeaturesGroup = [
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled network extensions with a special '
+                     'entry all which indicates every extension is enabled'),
 ]
 
 volume_group = cfg.OptGroup(name='volume',
@@ -361,6 +396,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the volume service."),
     cfg.StrOpt('backend1_name',
                default='BACKEND_1',
                help="Name of the backend1 (must be declared in cinder.conf)"),
@@ -385,13 +425,19 @@
     cfg.BoolOpt('multi_backend',
                 default=False,
                 help="Runs Cinder multi-backend test (requires 2 backends)"),
+    cfg.BoolOpt('backup',
+                default=True,
+                help='Runs Cinder volumes backup test'),
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled volume extensions with a special '
+                     'entry all which indicates every extension is enabled'),
     cfg.BoolOpt('api_v1',
                 default=True,
                 help="Is the v1 volume API enabled"),
+    cfg.BoolOpt('api_v2',
+                default=True,
+                help="Is the v2 volume API enabled"),
 ]
 
 
@@ -408,6 +454,11 @@
                     "value of identity.region is used instead. If no such "
                     "region is found in the service catalog, the first found "
                     "one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the object-store service."),
     cfg.IntOpt('container_sync_timeout',
                default=120,
                help="Number of seconds to time on waiting for a container "
@@ -448,6 +499,11 @@
                     "value of identity.region is used instead. If no such "
                     "region is found in the service catalog, the first found "
                     "one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the orchestration service."),
     cfg.BoolOpt('allow_tenant_isolation',
                 default=False,
                 help="Allows test cases to create/destroy tenants and "
@@ -591,7 +647,12 @@
                 default=False,
                 help='Prevent the cleaning (tearDownClass()) between'
                      ' each stress test run if an exception occurs'
-                     ' during this run.')
+                     ' during this run.'),
+    cfg.BoolOpt('full_clean_stack',
+                default=False,
+                help='Allows a full cleaning process after a stress test.'
+                     ' Caution : this cleanup will remove every objects of'
+                     ' every tenant.')
 ]
 
 
@@ -602,6 +663,9 @@
                default='/opt/stack/new/devstack/files/images/'
                'cirros-0.3.1-x86_64-uec',
                help='Directory containing image files'),
+    cfg.StrOpt('qcow2_img_file',
+               default='cirros-0.3.1-x86_64-disk.img',
+               help='QCOW2 image file name'),
     cfg.StrOpt('ami_img_file',
                default='cirros-0.3.1-x86_64-blank.img',
                help='AMI image file name'),
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 3b3f3eb..ac88faa 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -100,6 +100,10 @@
     message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
 
 
+class VolumeBackupException(TempestException):
+    message = "Volume backup %(backup_id)s failed and is in ERROR status"
+
+
 class StackBuildErrorException(TempestException):
     message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
                "due to '%(stack_status_reason)s'")
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index 2e499a2..55be60a 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -21,6 +21,7 @@
 TEST_DEFINITION = re.compile(r'^\s*def test.*')
 SETUPCLASS_DEFINITION = re.compile(r'^\s*def setUpClass')
 SCENARIO_DECORATOR = re.compile(r'\s*@.*services\(')
+VI_HEADER_RE = re.compile(r"^#\s+vim?:.+")
 
 
 def import_no_clients_in_api(physical_line, filename):
@@ -58,7 +59,22 @@
                     "T105: setUpClass can not be used with unit tests")
 
 
+def no_vi_headers(physical_line, line_number, lines):
+    """Check for vi editor configuration in source files.
+
+    By default vi modelines can only appear in the first or
+    last 5 lines of a source file.
+
+    T106
+    """
+    # NOTE(gilliard): line_number is 1-indexed
+    if line_number <= 5 or line_number > len(lines) - 5:
+        if VI_HEADER_RE.match(physical_line):
+            return 0, "T106: Don't put vi configuration in source files"
+
+
 def factory(register):
     register(import_no_clients_in_api)
     register(scenario_tests_need_service_tags)
     register(no_setupclass_for_unit_tests)
+    register(no_vi_headers)
diff --git a/tempest/manager.py b/tempest/manager.py
index 93ff10f..708447e 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -13,8 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import auth
+from tempest import config
 from tempest import exceptions
 
+CONF = config.CONF
+
 
 class Manager(object):
 
@@ -25,7 +29,27 @@
     and a client object for a test case to use in performing actions.
     """
 
-    def __init__(self):
+    def __init__(self, username=None, password=None, tenant_name=None):
+        """
+        We allow overriding of the credentials used within the various
+        client classes managed by the Manager object. Left as None, the
+        standard username/password/tenant_name[/domain_name] is used.
+
+        :param credentials: Override of the credentials
+        """
+        self.auth_version = CONF.identity.auth_version
+        # FIXME(andreaf) Change Manager __init__ to accept a credentials dict
+        if username is None or password is None:
+            # Tenant None is a valid use case
+            self.credentials = self.get_default_credentials()
+        else:
+            self.credentials = dict(username=username, password=password,
+                                    tenant_name=tenant_name)
+        if self.auth_version == 'v3':
+            self.credentials['domain_name'] = 'Default'
+        # Creates an auth provider for the credentials
+        self.auth_provider = self.get_auth_provider(self.credentials)
+        # FIXME(andreaf) unused
         self.client_attr_names = []
 
     # we do this everywhere, have it be part of the super class
@@ -36,3 +60,28 @@
                    "tenant_name: %(t)s" %
                    {'u': username, 'p': password, 't': tenant_name})
             raise exceptions.InvalidConfiguration(msg)
+
+    @classmethod
+    def get_auth_provider_class(cls, auth_version):
+        if auth_version == 'v2':
+            return auth.KeystoneV2AuthProvider
+        else:
+            return auth.KeystoneV3AuthProvider
+
+    def get_default_credentials(self):
+        return dict(
+            username=CONF.identity.username,
+            password=CONF.identity.password,
+            tenant_name=CONF.identity.tenant_name
+        )
+
+    def get_auth_provider(self, credentials=None):
+        auth_params = dict(client_type=getattr(self, 'client_type', None),
+                           interface=getattr(self, 'interface', None))
+        auth_provider_class = self.get_auth_provider_class(self.auth_version)
+        # If invalid / incomplete credentials are provided, use default ones
+        if credentials is None or \
+                not auth_provider_class.check_credentials(credentials):
+            credentials = self.credentials
+        auth_params['credentials'] = credentials
+        return auth_provider_class(**auth_params)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 0fc304a..6757da6 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -18,26 +18,17 @@
 import os
 import subprocess
 
-# Default client libs
-import cinderclient.client
-import glanceclient
-import heatclient.client
-import keystoneclient.exceptions
-import keystoneclient.v2_0.client
 import netaddr
 from neutronclient.common import exceptions as exc
-import neutronclient.v2_0.client
-import novaclient.client
 from novaclient import exceptions as nova_exceptions
-import swiftclient
 
 from tempest.api.network import common as net_common
+from tempest import clients
 from tempest.common import isolated_creds
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-import tempest.manager
 from tempest.openstack.common import log
 import tempest.test
 
@@ -53,173 +44,6 @@
 LOG_cinder_client.addHandler(log.NullHandler())
 
 
-class OfficialClientManager(tempest.manager.Manager):
-    """
-    Manager that provides access to the official python clients for
-    calling various OpenStack APIs.
-    """
-
-    NOVACLIENT_VERSION = '2'
-    CINDERCLIENT_VERSION = '1'
-    HEATCLIENT_VERSION = '1'
-
-    def __init__(self, username, password, tenant_name):
-        super(OfficialClientManager, self).__init__()
-        self.compute_client = self._get_compute_client(username,
-                                                       password,
-                                                       tenant_name)
-        self.identity_client = self._get_identity_client(username,
-                                                         password,
-                                                         tenant_name)
-        self.image_client = self._get_image_client()
-        self.network_client = self._get_network_client()
-        self.volume_client = self._get_volume_client(username,
-                                                     password,
-                                                     tenant_name)
-        self.object_storage_client = self._get_object_storage_client(
-            username,
-            password,
-            tenant_name)
-        self.orchestration_client = self._get_orchestration_client(
-            username,
-            password,
-            tenant_name)
-
-    def _get_compute_client(self, username, password, tenant_name):
-        # Novaclient will not execute operations for anyone but the
-        # identified user, so a new client needs to be created for
-        # each user that operations need to be performed for.
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        region = CONF.identity.region
-
-        client_args = (username, password, tenant_name, auth_url)
-
-        # Create our default Nova client to use in testing
-        service_type = CONF.compute.catalog_type
-        return novaclient.client.Client(self.NOVACLIENT_VERSION,
-                                        *client_args,
-                                        service_type=service_type,
-                                        region_name=region,
-                                        no_cache=True,
-                                        insecure=dscv,
-                                        http_log_debug=True)
-
-    def _get_image_client(self):
-        token = self.identity_client.auth_token
-        region = CONF.identity.region
-        endpoint = self.identity_client.service_catalog.url_for(
-            attr='region', filter_value=region,
-            service_type=CONF.image.catalog_type, endpoint_type='publicURL')
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        return glanceclient.Client('1', endpoint=endpoint, token=token,
-                                   insecure=dscv)
-
-    def _get_volume_client(self, username, password, tenant_name):
-        auth_url = CONF.identity.uri
-        region = CONF.identity.region
-        return cinderclient.client.Client(self.CINDERCLIENT_VERSION,
-                                          username,
-                                          password,
-                                          tenant_name,
-                                          auth_url,
-                                          region_name=region,
-                                          http_log_debug=True)
-
-    def _get_object_storage_client(self, username, password, tenant_name):
-        auth_url = CONF.identity.uri
-        # add current tenant to swift operator role group.
-        keystone_admin = self._get_identity_client(
-            CONF.identity.admin_username,
-            CONF.identity.admin_password,
-            CONF.identity.admin_tenant_name)
-
-        # enable test user to operate swift by adding operator role to him.
-        roles = keystone_admin.roles.list()
-        operator_role = CONF.object_storage.operator_role
-        member_role = [role for role in roles if role.name == operator_role][0]
-        # NOTE(maurosr): This is surrounded in the try-except block cause
-        # neutron tests doesn't have tenant isolation.
-        try:
-            keystone_admin.roles.add_user_role(self.identity_client.user_id,
-                                               member_role.id,
-                                               self.identity_client.tenant_id)
-        except keystoneclient.exceptions.Conflict:
-            pass
-
-        return swiftclient.Connection(auth_url, username, password,
-                                      tenant_name=tenant_name,
-                                      auth_version='2')
-
-    def _get_orchestration_client(self, username=None, password=None,
-                                  tenant_name=None):
-        if not username:
-            username = CONF.identity.admin_username
-        if not password:
-            password = CONF.identity.admin_password
-        if not tenant_name:
-            tenant_name = CONF.identity.tenant_name
-
-        self._validate_credentials(username, password, tenant_name)
-
-        keystone = self._get_identity_client(username, password, tenant_name)
-        region = CONF.identity.region
-        token = keystone.auth_token
-        service_type = CONF.orchestration.catalog_type
-        try:
-            endpoint = keystone.service_catalog.url_for(
-                attr='region',
-                filter_value=region,
-                service_type=service_type,
-                endpoint_type='publicURL')
-        except keystoneclient.exceptions.EndpointNotFound:
-            return None
-        else:
-            return heatclient.client.Client(self.HEATCLIENT_VERSION,
-                                            endpoint,
-                                            token=token,
-                                            username=username,
-                                            password=password)
-
-    def _get_identity_client(self, username, password, tenant_name):
-        # This identity client is not intended to check the security
-        # of the identity service, so use admin credentials by default.
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-
-        return keystoneclient.v2_0.client.Client(username=username,
-                                                 password=password,
-                                                 tenant_name=tenant_name,
-                                                 auth_url=auth_url,
-                                                 insecure=dscv)
-
-    def _get_network_client(self):
-        # The intended configuration is for the network client to have
-        # admin privileges and indicate for whom resources are being
-        # created via a 'tenant_id' parameter.  This will often be
-        # preferable to authenticating as a specific user because
-        # working with certain resources (public routers and networks)
-        # often requires admin privileges anyway.
-        username = CONF.identity.admin_username
-        password = CONF.identity.admin_password
-        tenant_name = CONF.identity.admin_tenant_name
-
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-
-        return neutronclient.v2_0.client.Client(username=username,
-                                                password=password,
-                                                tenant_name=tenant_name,
-                                                auth_url=auth_url,
-                                                insecure=dscv)
-
-
 class OfficialClientTest(tempest.test.BaseTestCase):
     """
     Official Client test base class for scenario testing.
@@ -242,7 +66,8 @@
 
         username, password, tenant_name = cls.credentials()
 
-        cls.manager = OfficialClientManager(username, password, tenant_name)
+        cls.manager = clients.OfficialClientManager(
+            username, password, tenant_name)
         cls.compute_client = cls.manager.compute_client
         cls.image_client = cls.manager.image_client
         cls.identity_client = cls.manager.identity_client
@@ -276,6 +101,41 @@
         return cls._get_credentials(cls.isolated_creds.get_admin_creds,
                                     'admin_')
 
+    @staticmethod
+    def cleanup_resource(resource, test_name):
+
+        LOG.debug("Deleting %r from shared resources of %s" %
+                  (resource, test_name))
+        try:
+            # OpenStack resources are assumed to have a delete()
+            # method which destroys the resource...
+            resource.delete()
+        except Exception as e:
+            # If the resource is already missing, mission accomplished.
+            # add status code as workaround for bug 1247568
+            if (e.__class__.__name__ == 'NotFound' or
+                    (hasattr(e, 'status_code') and e.status_code == 404)):
+                return
+            raise
+
+        def is_deletion_complete():
+            # Deletion testing is only required for objects whose
+            # existence cannot be checked via retrieval.
+            if isinstance(resource, dict):
+                return True
+            try:
+                resource.get()
+            except Exception as e:
+                # Clients are expected to return an exception
+                # called 'NotFound' if retrieval fails.
+                if e.__class__.__name__ == 'NotFound':
+                    return True
+                raise
+            return False
+
+        # Block until resource deletion has completed or timed-out
+        tempest.test.call_until_true(is_deletion_complete, 10, 1)
+
     @classmethod
     def tearDownClass(cls):
         # NOTE(jaypipes): Because scenario tests are typically run in a
@@ -285,38 +145,7 @@
         # the scenario test class object
         while cls.os_resources:
             thing = cls.os_resources.pop()
-            LOG.debug("Deleting %r from shared resources of %s" %
-                      (thing, cls.__name__))
-
-            try:
-                # OpenStack resources are assumed to have a delete()
-                # method which destroys the resource...
-                thing.delete()
-            except Exception as e:
-                # If the resource is already missing, mission accomplished.
-                # add status code as workaround for bug 1247568
-                if (e.__class__.__name__ == 'NotFound' or
-                    hasattr(e, 'status_code') and e.status_code == 404):
-                    continue
-                raise
-
-            def is_deletion_complete():
-                # Deletion testing is only required for objects whose
-                # existence cannot be checked via retrieval.
-                if isinstance(thing, dict):
-                    return True
-                try:
-                    thing.get()
-                except Exception as e:
-                    # Clients are expected to return an exception
-                    # called 'NotFound' if retrieval fails.
-                    if e.__class__.__name__ == 'NotFound':
-                        return True
-                    raise
-                return False
-
-            # Block until resource deletion has completed or timed-out
-            tempest.test.call_until_true(is_deletion_complete, 10, 1)
+            cls.cleanup_resource(thing, cls.__name__)
         cls.isolated_creds.clear_isolated_creds()
         super(OfficialClientTest, cls).tearDownClass()
 
@@ -529,7 +358,7 @@
             username = CONF.scenario.ssh_user
         if private_key is None:
             private_key = self.keypair.private_key
-        return RemoteClient(ip, username, pkey=private_key)
+        return remote_client.RemoteClient(ip, username, pkey=private_key)
 
     def _log_console_output(self, servers=None):
         if not servers:
@@ -538,6 +367,54 @@
             LOG.debug('Console output for %s', server.id)
             LOG.debug(server.get_console_output())
 
+    def wait_for_volume_status(self, status):
+        volume_id = self.volume.id
+        self.status_timeout(
+            self.volume_client.volumes, volume_id, status)
+
+    def _image_create(self, name, fmt, path, properties={}):
+        name = data_utils.rand_name('%s-' % name)
+        image_file = open(path, 'rb')
+        self.addCleanup(image_file.close)
+        params = {
+            'name': name,
+            'container_format': fmt,
+            'disk_format': fmt,
+            'is_public': 'True',
+        }
+        params.update(properties)
+        image = self.image_client.images.create(**params)
+        self.addCleanup(self.image_client.images.delete, image)
+        self.assertEqual("queued", image.status)
+        image.update(data=image_file)
+        return image.id
+
+    def glance_image_create(self):
+        qcow2_img_path = (CONF.scenario.img_dir + "/" +
+                          CONF.scenario.qcow2_img_file)
+        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
+        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
+        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
+        LOG.debug("paths: img: %s, ami: %s, ari: %s, aki: %s"
+                  % (qcow2_img_path, ami_img_path, ari_img_path, aki_img_path))
+        try:
+            self.image = self._image_create('scenario-img',
+                                            'bare',
+                                            qcow2_img_path,
+                                            properties={'disk_format':
+                                                        'qcow2'})
+        except IOError:
+            LOG.debug("A qcow2 image was not got. Try to get a uec image.")
+            kernel = self._image_create('scenario-aki', 'aki', aki_img_path)
+            ramdisk = self._image_create('scenario-ari', 'ari', ari_img_path)
+            properties = {
+                'properties': {'kernel_id': kernel, 'ramdisk_id': ramdisk}
+            }
+            self.image = self._image_create('scenario-ami', 'ami',
+                                            path=ami_img_path,
+                                            properties=properties)
+        LOG.debug("image:%s" % self.image)
+
 
 class NetworkScenarioTest(OfficialClientTest):
     """
@@ -585,56 +462,65 @@
         self.set_resource(name, network)
         return network
 
-    def _list_networks(self):
-        nets = self.network_client.list_networks()
+    def _list_networks(self, **kwargs):
+        nets = self.network_client.list_networks(**kwargs)
         return nets['networks']
 
-    def _list_subnets(self):
-        subnets = self.network_client.list_subnets()
+    def _list_subnets(self, **kwargs):
+        subnets = self.network_client.list_subnets(**kwargs)
         return subnets['subnets']
 
-    def _list_routers(self):
-        routers = self.network_client.list_routers()
+    def _list_routers(self, **kwargs):
+        routers = self.network_client.list_routers(**kwargs)
         return routers['routers']
 
-    def _list_ports(self):
-        ports = self.network_client.list_ports()
+    def _list_ports(self, **kwargs):
+        ports = self.network_client.list_ports(**kwargs)
         return ports['ports']
 
     def _get_tenant_own_network_num(self, tenant_id):
-        nets = self._list_networks()
-        ownnets = [value for value in nets if tenant_id == value['tenant_id']]
-        return len(ownnets)
+        nets = self._list_networks(tenant_id=tenant_id)
+        return len(nets)
 
     def _get_tenant_own_subnet_num(self, tenant_id):
-        subnets = self._list_subnets()
-        ownsubnets = ([value for value in subnets
-                      if tenant_id == value['tenant_id']])
-        return len(ownsubnets)
+        subnets = self._list_subnets(tenant_id=tenant_id)
+        return len(subnets)
 
     def _get_tenant_own_port_num(self, tenant_id):
-        ports = self._list_ports()
-        ownports = ([value for value in ports
-                    if tenant_id == value['tenant_id']])
-        return len(ownports)
+        ports = self._list_ports(tenant_id=tenant_id)
+        return len(ports)
 
     def _create_subnet(self, network, namestart='subnet-smoke-'):
         """
         Create a subnet for the given network within the cidr block
         configured for tenant networks.
         """
+
+        def cidr_in_use(cidr, tenant_id):
+            """
+            :return True if subnet with cidr already exist in tenant
+                False else
+            """
+            cidr_in_use = self._list_subnets(tenant_id=tenant_id, cidr=cidr)
+            return len(cidr_in_use) != 0
+
         tenant_cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
         result = None
         # Repeatedly attempt subnet creation with sequential cidr
         # blocks until an unallocated block is found.
         for subnet_cidr in tenant_cidr.subnet(
             CONF.network.tenant_network_mask_bits):
+            str_cidr = str(subnet_cidr)
+            if cidr_in_use(str_cidr, tenant_id=network.tenant_id):
+                continue
+
             body = dict(
                 subnet=dict(
+                    name=data_utils.rand_name(namestart),
                     ip_version=4,
                     network_id=network.id,
                     tenant_id=network.tenant_id,
-                    cidr=str(subnet_cidr),
+                    cidr=str_cidr,
                 ),
             )
             try:
@@ -647,7 +533,7 @@
         self.assertIsNotNone(result, 'Unable to allocate tenant network')
         subnet = net_common.DeletableSubnet(client=self.network_client,
                                             **result['subnet'])
-        self.assertEqual(subnet.cidr, str(subnet_cidr))
+        self.assertEqual(subnet.cidr, str_cidr)
         self.set_resource(data_utils.rand_name(namestart), subnet)
         return subnet
 
@@ -664,19 +550,15 @@
         self.set_resource(name, port)
         return port
 
-    def _get_server_port_id(self, server):
-        result = self.network_client.list_ports(device_id=server.id)
-        ports = result.get('ports', [])
+    def _get_server_port_id(self, server, ip_addr=None):
+        ports = self._list_ports(device_id=server.id, fixed_ip=ip_addr)
         self.assertEqual(len(ports), 1,
                          "Unable to determine which port to target.")
         return ports[0]['id']
 
-    def _create_floating_ip(self, thing, external_network_id,
-                            port_filters=None):
-        if port_filters is None:
+    def _create_floating_ip(self, thing, external_network_id, port_id=None):
+        if not port_id:
             port_id = self._get_server_port_id(thing)
-        else:
-            port_id = port_filters
         body = dict(
             floatingip=dict(
                 floating_network_id=external_network_id,
@@ -1030,9 +912,6 @@
         router = self._get_router(tenant_id)
         subnet = self._create_subnet(network)
         subnet.add_to_router(router.id)
-        self.networks.append(network)
-        self.subnets.append(subnet)
-        self.routers.append(router)
         return network, subnet, router
 
 
diff --git a/tempest/scenario/orchestration/test_autoscaling.py b/tempest/scenario/orchestration/test_autoscaling.py
index cd7a2b2..82ba3c5 100644
--- a/tempest/scenario/orchestration/test_autoscaling.py
+++ b/tempest/scenario/orchestration/test_autoscaling.py
@@ -15,10 +15,7 @@
 
 from tempest import config
 from tempest.scenario import manager
-from tempest.test import attr
-from tempest.test import call_until_true
-from tempest.test import services
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -64,9 +61,9 @@
         if not CONF.orchestration.keypair_name:
             self.set_resource('stack', self.stack)
 
-    @skip_because(bug="1257575")
-    @attr(type='slow')
-    @services('orchestration', 'compute')
+    @test.skip_because(bug="1257575")
+    @test.attr(type='slow')
+    @test.services('orchestration', 'compute')
     def test_scale_up_then_down(self):
 
         self.assign_keypair()
@@ -98,8 +95,8 @@
             return self.server_count
 
         def assertScale(from_servers, to_servers):
-            call_until_true(lambda: server_count() == to_servers,
-                            timeout, interval)
+            test.call_until_true(lambda: server_count() == to_servers,
+                                 timeout, interval)
             self.assertEqual(to_servers, self.server_count,
                              'Failed scaling from %d to %d servers. '
                              'Current server count: %s' % (
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index f2b681e..8e34c16 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 from tempest.common import tempest_fixtures as fixtures
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
 from tempest import test
@@ -107,7 +107,7 @@
     def test_aggregate_basic_ops(self):
         self.useFixture(fixtures.LockFixture('availability_zone'))
         az = 'foo_zone'
-        aggregate_name = rand_name('aggregate-scenario')
+        aggregate_name = data_utils.rand_name('aggregate-scenario')
         aggregate = self._create_aggregate(name=aggregate_name,
                                            availability_zone=az)
 
@@ -119,7 +119,7 @@
         self._check_aggregate_details(aggregate, aggregate_name, az, [host],
                                       metadata)
 
-        aggregate_name = rand_name('renamed-aggregate-scenario')
+        aggregate_name = data_utils.rand_name('renamed-aggregate-scenario')
         aggregate = self._update_aggregate(aggregate, aggregate_name, None)
 
         additional_metadata = {'foo': 'bar'}
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 19996e5..6418a73 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -19,7 +19,7 @@
 
 from tempest import config
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -69,7 +69,7 @@
         response = self.opener.open(CONF.dashboard.dashboard_url)
         self.assertIn('Overview', response.read())
 
-    @services('dashboard')
+    @test.services('dashboard')
     def test_basic_scenario(self):
         self.check_login_page()
         self.user_login()
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index e8030c9..b7a30f8 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -17,7 +17,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -47,43 +47,6 @@
             self.status_timeout(
                 self.compute_client.servers, server.id, status)
 
-    def _wait_for_volume_status(self, status):
-        volume_id = self.volume.id
-        self.status_timeout(
-            self.volume_client.volumes, volume_id, status)
-
-    def _image_create(self, name, fmt, path, properties={}):
-        name = data_utils.rand_name('%s-' % name)
-        image_file = open(path, 'rb')
-        self.addCleanup(image_file.close)
-        params = {
-            'name': name,
-            'container_format': fmt,
-            'disk_format': fmt,
-            'is_public': 'True',
-        }
-        params.update(properties)
-        image = self.image_client.images.create(**params)
-        self.addCleanup(self.image_client.images.delete, image)
-        self.assertEqual("queued", image.status)
-        image.update(data=image_file)
-        return image.id
-
-    def glance_image_create(self):
-        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
-        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
-        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
-        LOG.debug("paths: ami: %s, ari: %s, aki: %s"
-                  % (ami_img_path, ari_img_path, aki_img_path))
-        kernel_id = self._image_create('scenario-aki', 'aki', aki_img_path)
-        ramdisk_id = self._image_create('scenario-ari', 'ari', ari_img_path)
-        properties = {
-            'properties': {'kernel_id': kernel_id, 'ramdisk_id': ramdisk_id}
-        }
-        self.image = self._image_create('scenario-ami', 'ami',
-                                        path=ami_img_path,
-                                        properties=properties)
-
     def nova_boot(self):
         name = data_utils.rand_name('scenario-server-')
         client = self.compute_client
@@ -100,7 +63,7 @@
             self.set_resource(server.name, server)
         self._wait_for_server_status('ACTIVE')
 
-    @services('compute', 'image')
+    @test.services('compute', 'image')
     def test_large_ops_scenario(self):
         if CONF.scenario.large_ops_number < 1:
             return
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 68f6e62..2f7d9d9 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -174,9 +174,8 @@
     def _assign_floating_ip_to_vip(self, vip):
         public_network_id = config.network.public_network_id
         port_id = vip['port_id']
-        floating_ip = self._create_floating_ip(vip,
-                                               public_network_id,
-                                               port_filters=port_id)
+        floating_ip = self._create_floating_ip(vip, public_network_id,
+                                               port_id=port_id)
         self.floating_ips.setdefault(vip['id'], [])
         self.floating_ips[vip['id']].append(floating_ip)
 
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 846e0cc..39b7760 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -13,11 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.common.utils import data_utils
+from tempest.common import debug
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -42,43 +42,6 @@
         self.status_timeout(
             self.compute_client.servers, server_id, status)
 
-    def _wait_for_volume_status(self, status):
-        volume_id = self.volume.id
-        self.status_timeout(
-            self.volume_client.volumes, volume_id, status)
-
-    def _image_create(self, name, fmt, path, properties={}):
-        name = data_utils.rand_name('%s-' % name)
-        image_file = open(path, 'rb')
-        self.addCleanup(image_file.close)
-        params = {
-            'name': name,
-            'container_format': fmt,
-            'disk_format': fmt,
-            'is_public': 'True',
-        }
-        params.update(properties)
-        image = self.image_client.images.create(**params)
-        self.addCleanup(self.image_client.images.delete, image)
-        self.assertEqual("queued", image.status)
-        image.update(data=image_file)
-        return image.id
-
-    def glance_image_create(self):
-        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
-        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
-        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
-        LOG.debug("paths: ami: %s, ari: %s, aki: %s"
-                  % (ami_img_path, ari_img_path, aki_img_path))
-        kernel_id = self._image_create('scenario-aki', 'aki', aki_img_path)
-        ramdisk_id = self._image_create('scenario-ari', 'ari', ari_img_path)
-        properties = {
-            'properties': {'kernel_id': kernel_id, 'ramdisk_id': ramdisk_id}
-        }
-        self.image = self._image_create('scenario-ami', 'ami',
-                                        path=ami_img_path,
-                                        properties=properties)
-
     def nova_keypair_add(self):
         self.keypair = self.create_keypair()
 
@@ -114,7 +77,7 @@
                                       self.volume.id,
                                       '/dev/vdb')
         self.assertEqual(self.volume.id, volume.id)
-        self._wait_for_volume_status('in-use')
+        self.wait_for_volume_status('in-use')
 
     def nova_reboot(self):
         self.server.reboot()
@@ -130,9 +93,11 @@
     def ssh_to_server(self):
         try:
             self.linux_client = self.get_remote_client(self.floating_ip.ip)
+            self.linux_client.validate_authentication()
         except Exception:
             LOG.exception('ssh to server failed')
             self._log_console_output()
+            debug.log_ip_ns()
             raise
 
     def check_partitions(self):
@@ -142,12 +107,12 @@
     def nova_volume_detach(self):
         detach_volume_client = self.compute_client.volumes.delete_server_volume
         detach_volume_client(self.server.id, self.volume.id)
-        self._wait_for_volume_status('available')
+        self.wait_for_volume_status('available')
 
         volume = self.volume_client.volumes.get(self.volume.id)
         self.assertEqual('available', volume.status)
 
-    @services('compute', 'volume', 'image', 'network')
+    @test.services('compute', 'volume', 'image', 'network')
     def test_minimum_basic_scenario(self):
         self.glance_image_create()
         self.nova_keypair_add()
@@ -160,10 +125,11 @@
         self.nova_volume_attach()
         self.addCleanup(self.nova_volume_detach)
         self.cinder_show()
-        self.nova_reboot()
 
         self.nova_floating_ip_create()
         self.nova_floating_ip_add()
         self._create_loginable_secgroup_rule_nova()
         self.ssh_to_server()
+        self.nova_reboot()
+        self.ssh_to_server()
         self.check_partitions()
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 020a256..a4002d4 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -19,9 +19,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-
-from tempest.test import attr
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -113,47 +111,62 @@
     @classmethod
     def setUpClass(cls):
         super(TestNetworkBasicOps, cls).setUpClass()
+        for ext in ['router', 'security-group']:
+            if not test.is_extension_enabled(ext, 'network'):
+                msg = "%s extension not enabled." % ext
+                raise cls.skipException(msg)
         cls.check_preconditions()
-        # TODO(mnewby) Consider looking up entities as needed instead
-        # of storing them as collections on the class.
-        cls.security_groups = {}
-        cls.networks = []
-        cls.subnets = []
-        cls.routers = []
-        cls.servers = {}
-        cls.floating_ips = {}
 
-    def _create_security_groups(self):
-        self.security_groups[self.tenant_id] =\
+    def cleanup_wrapper(self, resource):
+        self.cleanup_resource(resource, self.__class__.__name__)
+
+    def setUp(self):
+        super(TestNetworkBasicOps, self).setUp()
+        self.security_group = \
             self._create_security_group_neutron(tenant_id=self.tenant_id)
+        self.addCleanup(self.cleanup_wrapper, self.security_group)
+        self.network, self.subnet, self.router = self._create_networks()
+        for r in [self.network, self.router, self.subnet]:
+            self.addCleanup(self.cleanup_wrapper, r)
+        self.check_networks()
+        self.servers = {}
+        name = data_utils.rand_name('server-smoke')
+        serv_dict = self._create_server(name, self.network)
+        self.servers[serv_dict['server']] = serv_dict['keypair']
+        self._check_tenant_network_connectivity()
+        self.floating_ips = {}
+        self._create_and_associate_floating_ips()
 
-    def _check_networks(self):
-        # Checks that we see the newly created network/subnet/router via
-        # checking the result of list_[networks,routers,subnets]
+    def check_networks(self):
+        """
+        Checks that we see the newly created network/subnet/router via
+        checking the result of list_[networks,routers,subnets]
+        """
+
         seen_nets = self._list_networks()
         seen_names = [n['name'] for n in seen_nets]
         seen_ids = [n['id'] for n in seen_nets]
-        for mynet in self.networks:
-            self.assertIn(mynet.name, seen_names)
-            self.assertIn(mynet.id, seen_ids)
+        self.assertIn(self.network.name, seen_names)
+        self.assertIn(self.network.id, seen_ids)
+
         seen_subnets = self._list_subnets()
         seen_net_ids = [n['network_id'] for n in seen_subnets]
         seen_subnet_ids = [n['id'] for n in seen_subnets]
-        for mynet in self.networks:
-            self.assertIn(mynet.id, seen_net_ids)
-        for mysubnet in self.subnets:
-            self.assertIn(mysubnet.id, seen_subnet_ids)
+        self.assertIn(self.network.id, seen_net_ids)
+        self.assertIn(self.subnet.id, seen_subnet_ids)
+
         seen_routers = self._list_routers()
         seen_router_ids = [n['id'] for n in seen_routers]
         seen_router_names = [n['name'] for n in seen_routers]
-        for myrouter in self.routers:
-            self.assertIn(myrouter.name, seen_router_names)
-            self.assertIn(myrouter.id, seen_router_ids)
+        self.assertIn(self.router.name,
+                      seen_router_names)
+        self.assertIn(self.router.id,
+                      seen_router_ids)
 
     def _create_server(self, name, network):
-        tenant_id = network.tenant_id
         keypair = self.create_keypair(name='keypair-%s' % name)
-        security_groups = [self.security_groups[tenant_id].name]
+        self.addCleanup(self.cleanup_wrapper, keypair)
+        security_groups = [self.security_group.name]
         create_kwargs = {
             'nics': [
                 {'net-id': network.id},
@@ -162,8 +175,8 @@
             'security_groups': security_groups,
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
-        self.servers[server] = keypair
-        return server
+        self.addCleanup(self.cleanup_wrapper, server)
+        return dict(server=server, keypair=keypair)
 
     def _create_servers(self):
         for i, network in enumerate(self.networks):
@@ -179,7 +192,7 @@
         # key-based authentication by cloud-init.
         ssh_login = CONF.compute.image_ssh_user
         try:
-            for server, key in self.servers.items():
+            for server, key in self.servers.iteritems():
                 for net_name, ip_addresses in server.networks.iteritems():
                     for ip_address in ip_addresses:
                         self._check_vm_connectivity(ip_address, ssh_login,
@@ -195,6 +208,7 @@
         for server in self.servers.keys():
             floating_ip = self._create_floating_ip(server, public_network_id)
             self.floating_ips[floating_ip] = server
+            self.addCleanup(self.cleanup_wrapper, floating_ip)
 
     def _check_public_network_connectivity(self, should_connect=True,
                                            msg=None):
@@ -227,23 +241,17 @@
             self.floating_ips[floating_ip] = None
 
     def _reassociate_floating_ips(self):
-        network = self.networks[0]
         for floating_ip in self.floating_ips.keys():
             name = data_utils.rand_name('new_server-smoke-')
             # create a new server for the floating ip
-            server = self._create_server(name, network)
-            self._associate_floating_ip(floating_ip, server)
-            self.floating_ips[floating_ip] = server
+            serv_dict = self._create_server(name, self.network)
+            self.servers[serv_dict['server']] = serv_dict['keypair']
+            self._associate_floating_ip(floating_ip, serv_dict['server'])
+            self.floating_ips[floating_ip] = serv_dict['server']
 
-    @attr(type='smoke')
-    @services('compute', 'network')
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
     def test_network_basic_ops(self):
-        self._create_security_groups()
-        self._create_networks()
-        self._check_networks()
-        self._create_servers()
-        self._create_and_associate_floating_ips()
-        self._check_tenant_network_connectivity()
         self._check_public_network_connectivity(should_connect=True)
         self._disassociate_floating_ips()
         self._check_public_network_connectivity(should_connect=False,
diff --git a/tempest/scenario/test_cross_tenant_connectivity.py b/tempest/scenario/test_security_groups_basic_ops.py
similarity index 77%
rename from tempest/scenario/test_cross_tenant_connectivity.py
rename to tempest/scenario/test_security_groups_basic_ops.py
index edcf091..8e4192d 100644
--- a/tempest/scenario/test_cross_tenant_connectivity.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -13,23 +13,21 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import clients
 from tempest.common import debug
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.scenario.manager import OfficialClientManager
-from tempest.test import attr
-from tempest.test import call_until_true
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
 LOG = logging.getLogger(__name__)
 
 
-class TestNetworkCrossTenant(manager.NetworkScenarioTest):
+class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
 
     """
     This test suite assumes that Nova has been configured to
@@ -50,7 +48,7 @@
     failure - ping_timeout reached
 
     setup:
-        for each tenant (demo and alt):
+        for primary tenant:
             1. create a network&subnet
             2. create a router (if public router isn't configured)
             3. connect tenant network to public network via router
@@ -59,8 +57,6 @@
                 b. a VM with a floating ip
             5. create a general empty security group (same as "default", but
             without rules allowing in-tenant traffic)
-            6. for demo tenant - create another server to test in-tenant
-            connections
 
     tests:
         1. _verify_network_details
@@ -80,7 +76,7 @@
             been created on source tenant
 
     assumptions:
-        1. alt_tenant/user existed and is different from demo_tenant/user
+        1. alt_tenant/user existed and is different from primary_tenant/user
         2. Public network is defined and reachable from the Tempest host
         3. Public router can either be:
             * defined, in which case all tenants networks can connect directly
@@ -92,7 +88,7 @@
     """
 
     class TenantProperties():
-        '''
+        """
         helper class to save tenant details
             id
             credentials
@@ -101,14 +97,15 @@
             security groups
             servers
             access point
-        '''
+        """
 
         def __init__(self, tenant_id, tenant_user, tenant_pass, tenant_name):
-            self.manager = OfficialClientManager(
+            self.manager = clients.OfficialClientManager(
                 tenant_user,
                 tenant_pass,
                 tenant_name
             )
+            self.keypair = None
             self.tenant_id = tenant_id
             self.tenant_name = tenant_name
             self.tenant_user = tenant_user
@@ -119,7 +116,7 @@
             self.security_groups = {}
             self.servers = list()
 
-        def _set_network(self, network, subnet, router):
+        def set_network(self, network, subnet, router):
             self.network = network
             self.subnet = subnet
             self.router = router
@@ -129,7 +126,7 @@
 
     @classmethod
     def check_preconditions(cls):
-        super(TestNetworkCrossTenant, cls).check_preconditions()
+        super(TestSecurityGroupsBasicOps, cls).check_preconditions()
         if (cls.alt_tenant_id is None) or (cls.tenant_id is cls.alt_tenant_id):
             msg = 'No alt_tenant defined'
             cls.enabled = False
@@ -143,7 +140,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(TestNetworkCrossTenant, cls).setUpClass()
+        super(TestSecurityGroupsBasicOps, cls).setUpClass()
         alt_creds = cls.alt_credentials()
         cls.alt_tenant_id = cls.manager._get_identity_client(
             *alt_creds
@@ -151,48 +148,47 @@
         cls.check_preconditions()
         # TODO(mnewby) Consider looking up entities as needed instead
         # of storing them as collections on the class.
-        cls.keypairs = {}
-        cls.security_groups = {}
         cls.networks = []
         cls.subnets = []
         cls.routers = []
-        cls.servers = []
         cls.floating_ips = {}
         cls.tenants = {}
-        cls.demo_tenant = cls.TenantProperties(
-            cls.tenant_id,
-            *cls.credentials()
-        )
-        cls.alt_tenant = cls.TenantProperties(
-            cls.alt_tenant_id,
-            *alt_creds
-        )
-        for tenant in [cls.demo_tenant, cls.alt_tenant]:
+        cls.primary_tenant = cls.TenantProperties(cls.tenant_id,
+                                                  *cls.credentials())
+        cls.alt_tenant = cls.TenantProperties(cls.alt_tenant_id,
+                                              *alt_creds)
+        for tenant in [cls.primary_tenant, cls.alt_tenant]:
             cls.tenants[tenant.tenant_id] = tenant
-        if not CONF.network.public_router_id:
-            cls.floating_ip_access = True
-        else:
-            cls.floating_ip_access = False
+        cls.floating_ip_access = not CONF.network.public_router_id
 
-    @classmethod
-    def tearDownClass(cls):
-        super(TestNetworkCrossTenant, cls).tearDownClass()
+    def cleanup_wrapper(self, resource):
+        self.cleanup_resource(resource, self.__class__.__name__)
+
+    def setUp(self):
+        super(TestSecurityGroupsBasicOps, self).setUp()
+        self._deploy_tenant(self.primary_tenant)
+        self._verify_network_details(self.primary_tenant)
+        self._verify_mac_addr(self.primary_tenant)
 
     def _create_tenant_keypairs(self, tenant_id):
-        self.keypairs[tenant_id] = self.create_keypair(
+        keypair = self.create_keypair(
             name=data_utils.rand_name('keypair-smoke-'))
+        self.addCleanup(self.cleanup_wrapper, keypair)
+        self.tenants[tenant_id].keypair = keypair
 
     def _create_tenant_security_groups(self, tenant):
-        self.security_groups.setdefault(self.tenant_id, [])
         access_sg = self._create_empty_security_group(
             namestart='secgroup_access-',
             tenant_id=tenant.tenant_id
         )
+        self.addCleanup(self.cleanup_wrapper, access_sg)
+
         # don't use default secgroup since it allows in-tenant traffic
         def_sg = self._create_empty_security_group(
             namestart='secgroup_general-',
             tenant_id=tenant.tenant_id
         )
+        self.addCleanup(self.cleanup_wrapper, def_sg)
         tenant.security_groups.update(access=access_sg, default=def_sg)
         ssh_rule = dict(
             protocol='tcp',
@@ -200,9 +196,9 @@
             port_range_max=22,
             direction='ingress',
         )
-        self._create_security_group_rule(secgroup=access_sg,
-                                         **ssh_rule
-                                         )
+        rule = self._create_security_group_rule(secgroup=access_sg,
+                                                **ssh_rule)
+        self.addCleanup(self.cleanup_wrapper, rule)
 
     def _verify_network_details(self, tenant):
         # Checks that we see the newly created network/subnet/router via
@@ -245,11 +241,12 @@
             'nics': [
                 {'net-id': tenant.network.id},
             ],
-            'key_name': self.keypairs[tenant.tenant_id].name,
+            'key_name': tenant.keypair.name,
             'security_groups': security_groups,
             'tenant_id': tenant.tenant_id
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
+        self.addCleanup(self.cleanup_wrapper, server)
         return server
 
     def _create_tenant_servers(self, tenant, num=1):
@@ -260,7 +257,6 @@
             )
             name = data_utils.rand_name(name)
             server = self._create_server(name, tenant)
-            self.servers.append(server)
             tenant.servers.append(server)
 
     def _set_access_point(self, tenant):
@@ -275,17 +271,20 @@
         name = data_utils.rand_name(name)
         server = self._create_server(name, tenant,
                                      security_groups=secgroups)
-        self.servers.append(server)
         tenant.access_point = server
         self._assign_floating_ips(server)
 
     def _assign_floating_ips(self, server):
         public_network_id = CONF.network.public_network_id
         floating_ip = self._create_floating_ip(server, public_network_id)
+        self.addCleanup(self.cleanup_wrapper, floating_ip)
         self.floating_ips.setdefault(server, floating_ip)
 
     def _create_tenant_network(self, tenant):
-        tenant._set_network(*self._create_networks(tenant.tenant_id))
+        network, subnet, router = self._create_networks(tenant.tenant_id)
+        for r in [network, router, subnet]:
+            self.addCleanup(self.cleanup_wrapper, r)
+        tenant.set_network(network, subnet, router)
 
     def _set_compute_context(self, tenant):
         self.compute_client = tenant.manager.compute_client
@@ -299,8 +298,6 @@
             router (if public not defined)
             access security group
             access-point server
-            for demo_tenant:
-                creates general server to test against
         """
         if not isinstance(tenant_or_id, self.TenantProperties):
             tenant = self.tenants[tenant_or_id]
@@ -312,19 +309,20 @@
         self._create_tenant_keypairs(tenant_id)
         self._create_tenant_network(tenant)
         self._create_tenant_security_groups(tenant)
-        if tenant is self.demo_tenant:
-            self._create_tenant_servers(tenant, num=1)
         self._set_access_point(tenant)
 
     def _get_server_ip(self, server, floating=False):
-        '''
+        """
         returns the ip (floating/internal) of a server
-        '''
+        """
         if floating:
-            return self.floating_ips[server].floating_ip_address
+            server_ip = self.floating_ips[server].floating_ip_address
         else:
+            server_ip = None
             network_name = self.tenants[server.tenant_id].network.name
-            return server.networks[network_name][0]
+            if network_name in server.networks:
+                server_ip = server.networks[network_name][0]
+        return server_ip
 
     def _connect_to_access_point(self, tenant):
         """
@@ -332,7 +330,7 @@
         """
         access_point_ssh = \
             self.floating_ips[tenant.access_point].floating_ip_address
-        private_key = self.keypairs[tenant.tenant_id].private_key
+        private_key = tenant.keypair.private_key
         access_point_ssh = self._ssh_to_server(access_point_ssh,
                                                private_key=private_key)
         return access_point_ssh
@@ -355,9 +353,9 @@
                 return not should_succeed
             return should_succeed
 
-        return call_until_true(ping_remote,
-                               CONF.compute.ping_timeout,
-                               1)
+        return test.call_until_true(ping_remote,
+                                    CONF.compute.ping_timeout,
+                                    1)
 
     def _check_connectivity(self, access_point, ip, should_succeed=True):
         if should_succeed:
@@ -391,17 +389,17 @@
             secgroup=tenant.security_groups['default'],
             **ruleset
         )
+        self.addCleanup(self.cleanup_wrapper, rule)
         access_point_ssh = self._connect_to_access_point(tenant)
         for server in tenant.servers:
             self._check_connectivity(access_point=access_point_ssh,
                                      ip=self._get_server_ip(server))
-        rule.delete()
 
     def _test_cross_tenant_block(self, source_tenant, dest_tenant):
-        '''
+        """
         if public router isn't defined, then dest_tenant access is via
         floating-ip
-        '''
+        """
         access_point_ssh = self._connect_to_access_point(source_tenant)
         ip = self._get_server_ip(dest_tenant.access_point,
                                  floating=self.floating_ip_access)
@@ -409,10 +407,10 @@
                                  should_succeed=False)
 
     def _test_cross_tenant_allow(self, source_tenant, dest_tenant):
-        '''
+        """
         check for each direction:
         creating rule for tenant incoming traffic enables only 1way traffic
-        '''
+        """
         ruleset = dict(
             protocol='icmp',
             direction='ingress'
@@ -421,37 +419,26 @@
             secgroup=dest_tenant.security_groups['default'],
             **ruleset
         )
-        try:
-            access_point_ssh = self._connect_to_access_point(source_tenant)
-            ip = self._get_server_ip(dest_tenant.access_point,
-                                     floating=self.floating_ip_access)
-            self._check_connectivity(access_point_ssh, ip)
+        self.addCleanup(self.cleanup_wrapper, rule_s2d)
+        access_point_ssh = self._connect_to_access_point(source_tenant)
+        ip = self._get_server_ip(dest_tenant.access_point,
+                                 floating=self.floating_ip_access)
+        self._check_connectivity(access_point_ssh, ip)
 
-            # test that reverse traffic is still blocked
-            self._test_cross_tenant_block(dest_tenant, source_tenant)
+        # test that reverse traffic is still blocked
+        self._test_cross_tenant_block(dest_tenant, source_tenant)
 
-            # allow reverse traffic and check
-            rule_d2s = self._create_security_group_rule(
-                secgroup=source_tenant.security_groups['default'],
-                **ruleset
-            )
-            try:
-                access_point_ssh_2 = self._connect_to_access_point(dest_tenant)
-                ip = self._get_server_ip(source_tenant.access_point,
-                                         floating=self.floating_ip_access)
-                self._check_connectivity(access_point_ssh_2, ip)
+        # allow reverse traffic and check
+        rule_d2s = self._create_security_group_rule(
+            secgroup=source_tenant.security_groups['default'],
+            **ruleset
+        )
+        self.addCleanup(self.cleanup_wrapper, rule_d2s)
 
-                # clean_rules
-                rule_s2d.delete()
-                rule_d2s.delete()
-
-            except Exception as e:
-                rule_d2s.delete()
-                raise e
-
-        except Exception as e:
-            rule_s2d.delete()
-            raise e
+        access_point_ssh_2 = self._connect_to_access_point(dest_tenant)
+        ip = self._get_server_ip(source_tenant.access_point,
+                                 floating=self.floating_ip_access)
+        self._check_connectivity(access_point_ssh_2, ip)
 
     def _verify_mac_addr(self, tenant):
         """
@@ -471,24 +458,36 @@
         subnet_id = tenant.subnet.id
         self.assertIn((subnet_id, server_ip, mac_addr), port_detail_list)
 
-    @attr(type='smoke')
-    @services('compute', 'network')
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
     def test_cross_tenant_traffic(self):
         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)
+            # deploy new tenant
+            self._deploy_tenant(self.alt_tenant)
+            self._verify_network_details(self.alt_tenant)
+            self._verify_mac_addr(self.alt_tenant)
 
             # cross tenant check
-            source_tenant = self.demo_tenant
+            source_tenant = self.primary_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)
+            for tenant in self.tenants.values():
+                self._log_console_output(servers=tenant.servers)
+            raise
+
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
+    def test_in_tenant_traffic(self):
+        try:
+            self._create_tenant_servers(self.primary_tenant, num=1)
+
+            # in-tenant check
+            self._test_in_tenant_block(self.primary_tenant)
+            self._test_in_tenant_allow(self.primary_tenant)
+
+        except Exception:
+            for tenant in self.tenants.values():
+                self._log_console_output(servers=tenant.servers)
             raise
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index 9626157..c0eb6e7 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -16,7 +16,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -47,7 +47,7 @@
             msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
             raise cls.skipException(msg)
 
-    @services('compute')
+    @test.services('compute')
     def test_resize_server_confirm(self):
         # We create an instance for use in this test
         instance = self.create_server()
@@ -65,7 +65,7 @@
         self.status_timeout(
             self.compute_client.servers, instance_id, 'ACTIVE')
 
-    @services('compute')
+    @test.services('compute')
     def test_server_sequence_suspend_resume(self):
         # We create an instance for use in this test
         instance = self.create_server()
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 73ff6b4..1144414 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -18,7 +18,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 import testscenarios
 
@@ -162,7 +162,7 @@
                 self._log_console_output()
                 raise
 
-    @services('compute', 'network')
+    @test.services('compute', 'network')
     def test_server_basicops(self):
         self.add_keypair()
         self.create_security_group()
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 2bb3d84..37beb07 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -16,7 +16,7 @@
 from tempest import config
 from tempest.openstack.common import log
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -69,7 +69,7 @@
     def _set_floating_ip_to_server(self, server, floating_ip):
         server.add_floating_ip(floating_ip)
 
-    @services('compute', 'network', 'image')
+    @test.services('compute', 'network', 'image')
     def test_snapshot_pattern(self):
         # prepare for booting a instance
         self._add_keypair()
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 8d043ae..841f9e1 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -114,7 +114,7 @@
         detach_volume_client(server.id, volume.id)
         self._wait_for_volume_status(volume, 'available')
 
-    def _wait_for_volume_availible_on_the_system(self, server_or_ip):
+    def _wait_for_volume_available_on_the_system(self, server_or_ip):
         ssh = self.get_remote_client(server_or_ip)
 
         def _func():
@@ -161,7 +161,7 @@
             ip_for_server = server
 
         self._attach_volume(server, volume)
-        self._wait_for_volume_availible_on_the_system(ip_for_server)
+        self._wait_for_volume_available_on_the_system(ip_for_server)
         self._create_timestamp(ip_for_server)
         self._detach_volume(server, volume)
 
@@ -189,7 +189,7 @@
 
         # attach volume2 to instance2
         self._attach_volume(server_from_snapshot, volume_from_snapshot)
-        self._wait_for_volume_availible_on_the_system(ip_for_snapshot)
+        self._wait_for_volume_available_on_the_system(ip_for_snapshot)
 
         # check the existence of the timestamp file in the volume2
         self._check_timestamp(ip_for_snapshot)
diff --git a/tempest/scenario/test_swift_basic_ops.py b/tempest/scenario/test_swift_basic_ops.py
index 60df606..86e0867 100644
--- a/tempest/scenario/test_swift_basic_ops.py
+++ b/tempest/scenario/test_swift_basic_ops.py
@@ -14,11 +14,11 @@
 #    under the License.
 
 
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -53,7 +53,8 @@
         LOG.debug('Swift status information obtained successfully')
 
     def _create_container(self, container_name=None):
-        name = container_name or rand_name('swift-scenario-container')
+        name = container_name or data_utils.rand_name(
+            'swift-scenario-container')
         self.object_storage_client.put_container(name)
         # look for the container to assure it is created
         self._list_and_check_container_objects(name)
@@ -65,9 +66,9 @@
         LOG.debug('Container %s deleted' % (container_name))
 
     def _upload_object_to_container(self, container_name, obj_name=None):
-        obj_name = obj_name or rand_name('swift-scenario-object')
+        obj_name = obj_name or data_utils.rand_name('swift-scenario-object')
         self.object_storage_client.put_object(container_name, obj_name,
-                                              rand_name('obj_data'),
+                                              data_utils.rand_name('obj_data'),
                                               content_type='text/plain')
         return obj_name
 
@@ -93,7 +94,7 @@
             for obj in not_present_obj:
                 self.assertNotIn(obj, object_list)
 
-    @services('object_storage')
+    @test.services('object_storage')
     def test_swift_basic_ops(self):
         self._get_swift_stat()
         container_name = self._create_container()
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 7b002eb..9a250d7 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -14,7 +14,7 @@
 from tempest import config
 from tempest.openstack.common import log
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -127,7 +127,7 @@
         actual = self._get_content(ssh_client)
         self.assertEqual(expected, actual)
 
-    @services('compute', 'volume', 'image')
+    @test.services('compute', 'volume', 'image')
     def test_volume_boot_pattern(self):
         keypair = self.create_keypair()
         self._create_loginable_secgroup_rule_nova()
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 6e86466..5f6b513 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -114,7 +114,7 @@
         """
         uri = self._get_uri(resource, permanent=permanent)
 
-        resp, body = self.get(uri, self.headers)
+        resp, body = self.get(uri)
 
         return resp, self.deserialize(body)
 
@@ -127,7 +127,7 @@
 
         """
         uri = self._get_uri(resource, uuid=uuid, permanent=permanent)
-        resp, body = self.get(uri, self.headers)
+        resp, body = self.get(uri)
 
         return resp, self.deserialize(body)
 
@@ -145,7 +145,7 @@
         body = self.serialize(object_type, object_dict)
         uri = self._get_uri(resource)
 
-        resp, body = self.post(uri, headers=self.headers, body=body)
+        resp, body = self.post(uri, body=body)
 
         return resp, self.deserialize(body)
 
@@ -160,7 +160,7 @@
         """
         uri = self._get_uri(resource, uuid)
 
-        resp, body = self.delete(uri, self.headers)
+        resp, body = self.delete(uri)
         return resp, body
 
     def _patch_request(self, resource, uuid, patch_object):
@@ -176,7 +176,7 @@
         uri = self._get_uri(resource, uuid)
         patch_body = json.dumps(patch_object)
 
-        resp, body = self.patch(uri, headers=self.headers, body=patch_body)
+        resp, body = self.patch(uri, body=patch_body)
         return resp, self.deserialize(body)
 
     @handle_errors
diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py
index 03e87b1..b52d48c 100644
--- a/tempest/services/botoclients.py
+++ b/tempest/services/botoclients.py
@@ -35,6 +35,7 @@
     def __init__(self, username=None, password=None,
                  auth_url=None, tenant_name=None,
                  *args, **kwargs):
+        # FIXME(andreaf) replace credentials and auth_url with auth_provider
 
         self.connection_timeout = str(CONF.boto.http_socket_timeout)
         self.num_retries = str(CONF.boto.num_retries)
@@ -45,6 +46,7 @@
                         "tenant_name": tenant_name}
 
     def _keystone_aws_get(self):
+        # FIXME(andreaf) Move EC2 credentials to AuthProvider
         import keystoneclient.v2_0.client
 
         keystone = keystoneclient.v2_0.client.Client(**self.ks_cred)
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index aa52081..e26f570 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -43,7 +43,7 @@
     def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
         post_body = json.dumps({'aggregate': kwargs})
-        resp, body = self.post('os-aggregates', post_body, self.headers)
+        resp, body = self.post('os-aggregates', post_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -55,8 +55,7 @@
             'availability_zone': availability_zone
         }
         put_body = json.dumps({'aggregate': put_body})
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              put_body, self.headers)
+        resp, body = self.put('os-aggregates/%s' % str(aggregate_id), put_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -79,7 +78,7 @@
         }
         post_body = json.dumps({'add_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -90,7 +89,7 @@
         }
         post_body = json.dumps({'remove_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -101,6 +100,6 @@
         }
         post_body = json.dumps({'set_metadata': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index b7135f6..de0f1a8 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -36,6 +36,6 @@
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = json.loads(body)
         return resp, body['certificate']
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 144b7dc..af750a3 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -36,5 +36,5 @@
     def reserve_fixed_ip(self, ip, body):
         """This reserves and unreserves fixed ips."""
         url = "os-fixed-ips/%s/action" % (ip)
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 96ab6d7..289b09e 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -69,7 +69,7 @@
         if kwargs.get('is_public'):
             post_body['os-flavor-access:is_public'] = kwargs.get('is_public')
         post_body = json.dumps({'flavor': post_body})
-        resp, body = self.post('flavors', post_body, self.headers)
+        resp, body = self.post('flavors', post_body)
 
         body = json.loads(body)
         return resp, body['flavor']
@@ -92,7 +92,7 @@
         """Sets extra Specs to the mentioned flavor."""
         post_body = json.dumps({'extra_specs': specs})
         resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -112,8 +112,7 @@
     def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
         """Update specified extra Specs of the mentioned flavor and key."""
         resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key),
-                              json.dumps(kwargs), self.headers)
+                              (flavor_id, key), json.dumps(kwargs))
         body = json.loads(body)
         return resp, body
 
@@ -124,8 +123,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -137,8 +135,7 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -150,7 +147,6 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 2bf5241..0385160 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -52,7 +52,7 @@
         url = 'os-floating-ips'
         post_body = {'pool': pool_name}
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['floating_ip']
 
@@ -72,7 +72,7 @@
         }
 
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def disassociate_floating_ip_from_server(self, floating_ip, server_id):
@@ -85,7 +85,7 @@
         }
 
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def is_resource_deleted(self, id):
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index aa63927..d826a78 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -55,8 +55,7 @@
         request_body.update(**kwargs)
         request_body = json.dumps(request_body)
 
-        resp, body = self.put("os-hosts/%s" % str(hostname), request_body,
-                              self.headers)
+        resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 7324d84..b3d8c35 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -46,7 +46,7 @@
 
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def list_images(self, params=None):
@@ -93,16 +93,14 @@
     def set_image_metadata(self, image_id, meta):
         """Sets the metadata for an image."""
         post_body = json.dumps({'metadata': meta})
-        resp, body = self.put('images/%s/metadata' % str(image_id),
-                              post_body, self.headers)
+        resp, body = self.put('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_image_metadata(self, image_id, meta):
         """Updates the metadata for an image."""
         post_body = json.dumps({'metadata': meta})
-        resp, body = self.post('images/%s/metadata' % str(image_id),
-                               post_body, self.headers)
+        resp, body = self.post('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -116,7 +114,7 @@
         """Sets the value for a specific image metadata key."""
         post_body = json.dumps({'meta': meta})
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['meta']
 
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index d9a2030..f4c4c64 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -46,7 +46,6 @@
             post_body['interfaceAttachment']['fixed_ips'] = [fip]
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/os-interface' % server,
-                               headers=self.headers,
                                body=post_body)
         body = json.loads(body)
         return resp, body['interfaceAttachment']
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index 3e2d4a7..356c2e6 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -47,8 +47,7 @@
         if pub_key:
             post_body['keypair']['public_key'] = pub_key
         post_body = json.dumps(post_body)
-        resp, body = self.post("os-keypairs",
-                               headers=self.headers, body=post_body)
+        resp, body = self.post("os-keypairs", body=post_body)
         body = json.loads(body)
         return resp, body['keypair']
 
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 2007d4e..7607cc0 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -96,8 +96,7 @@
             post_body['security_groups'] = security_groups
 
         post_body = json.dumps({'quota_set': post_body})
-        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body,
-                              self.headers)
+        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body)
 
         body = json.loads(body)
         return resp, body['quota_set']
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index edaf4a3..2cd2d2e 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -58,7 +58,7 @@
             'description': description,
         }
         post_body = json.dumps({'security_group': post_body})
-        resp, body = self.post('os-security-groups', post_body, self.headers)
+        resp, body = self.post('os-security-groups', post_body)
         body = json.loads(body)
         return resp, body['security_group']
 
@@ -77,7 +77,7 @@
             post_body['description'] = description
         post_body = json.dumps({'security_group': post_body})
         resp, body = self.put('os-security-groups/%s' % str(security_group_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['security_group']
 
@@ -107,7 +107,7 @@
         }
         post_body = json.dumps({'security_group_rule': post_body})
         url = 'os-security-group-rules'
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['security_group_rule']
 
@@ -123,3 +123,10 @@
             if sg['id'] == security_group_id:
                 return resp, sg['rules']
         raise exceptions.NotFound('No such Security Group')
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_security_group(id)
+        except exceptions.NotFound:
+            return True
+        return False
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 371a59c..025c4e5 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -78,7 +78,7 @@
             if value is not None:
                 post_body[post_param] = value
         post_body = json.dumps({'server': post_body})
-        resp, body = self.post('servers', post_body, self.headers)
+        resp, body = self.post('servers', post_body)
 
         body = json.loads(body)
         # NOTE(maurosr): this deals with the case of multiple server create
@@ -116,8 +116,7 @@
             post_body['OS-DCF:diskConfig'] = disk_config
 
         post_body = json.dumps({'server': post_body})
-        resp, body = self.put("servers/%s" % str(server_id),
-                              post_body, self.headers)
+        resp, body = self.put("servers/%s" % str(server_id), post_body)
         body = json.loads(body)
         return resp, body['server']
 
@@ -194,7 +193,7 @@
     def action(self, server_id, action_name, response_key, **kwargs):
         post_body = json.dumps({action_name: kwargs})
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         if response_key is not None:
             body = json.loads(body)[response_key]
         return resp, body
@@ -269,14 +268,14 @@
         else:
             post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_server_metadata(self, server_id, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.post('servers/%s/metadata' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -288,7 +287,7 @@
     def set_server_metadata_item(self, server_id, key, meta):
         post_body = json.dumps({'meta': meta})
         resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['meta']
 
@@ -312,7 +311,7 @@
             }
         })
         resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def detach_volume(self, server_id, volume_id):
@@ -340,8 +339,7 @@
 
         req_body = json.dumps({'os-migrateLive': migrate_params})
 
-        resp, body = self.post("servers/%s/action" % str(server_id),
-                               req_body, self.headers)
+        resp, body = self.post("servers/%s/action" % str(server_id), req_body)
         return resp, body
 
     def migrate_server(self, server_id, **kwargs):
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 4abee47..8380dc2 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -45,7 +45,7 @@
         binary: Service binary
         """
         post_body = json.dumps({'binary': binary, 'host': host_name})
-        resp, body = self.put('os-services/enable', post_body, self.headers)
+        resp, body = self.put('os-services/enable', post_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -56,6 +56,6 @@
         binary: Service binary
         """
         post_body = json.dumps({'binary': binary, 'host': host_name})
-        resp, body = self.put('os-services/disable', post_body, self.headers)
+        resp, body = self.put('os-services/disable', post_body)
         body = json.loads(body)
         return resp, body['service']
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index ba7b5df..4b9dc0b 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -75,7 +75,7 @@
         }
 
         post_body = json.dumps({'volume': post_body})
-        resp, body = self.post('os-volumes', post_body, self.headers)
+        resp, body = self.post('os-volumes', post_body)
         body = json.loads(body)
         return resp, body['volume']
 
diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py
index 6bc758c..20ce87b 100644
--- a/tempest/services/compute/v3/json/aggregates_client.py
+++ b/tempest/services/compute/v3/json/aggregates_client.py
@@ -43,7 +43,7 @@
     def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
         post_body = json.dumps({'aggregate': kwargs})
-        resp, body = self.post('os-aggregates', post_body, self.headers)
+        resp, body = self.post('os-aggregates', post_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -55,8 +55,7 @@
             'availability_zone': availability_zone
         }
         put_body = json.dumps({'aggregate': put_body})
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              put_body, self.headers)
+        resp, body = self.put('os-aggregates/%s' % str(aggregate_id), put_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -79,7 +78,7 @@
         }
         post_body = json.dumps({'add_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -90,7 +89,7 @@
         }
         post_body = json.dumps({'remove_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -101,6 +100,6 @@
         }
         post_body = json.dumps({'set_metadata': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
diff --git a/tempest/services/compute/v3/json/certificates_client.py b/tempest/services/compute/v3/json/certificates_client.py
index 0c9f9ac..620eedf 100644
--- a/tempest/services/compute/v3/json/certificates_client.py
+++ b/tempest/services/compute/v3/json/certificates_client.py
@@ -36,6 +36,6 @@
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = json.loads(body)
         return resp, body['certificate']
diff --git a/tempest/services/compute/v3/json/flavors_client.py b/tempest/services/compute/v3/json/flavors_client.py
index df3d0c1..f9df2b8 100644
--- a/tempest/services/compute/v3/json/flavors_client.py
+++ b/tempest/services/compute/v3/json/flavors_client.py
@@ -69,7 +69,7 @@
         if kwargs.get('is_public'):
             post_body['flavor-access:is_public'] = kwargs.get('is_public')
         post_body = json.dumps({'flavor': post_body})
-        resp, body = self.post('flavors', post_body, self.headers)
+        resp, body = self.post('flavors', post_body)
 
         body = json.loads(body)
         return resp, body['flavor']
@@ -92,7 +92,7 @@
         """Sets extra Specs to the mentioned flavor."""
         post_body = json.dumps({'extra_specs': specs})
         resp, body = self.post('flavors/%s/flavor-extra-specs' % flavor_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -112,8 +112,7 @@
     def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
         """Update specified extra Specs of the mentioned flavor and key."""
         resp, body = self.put('flavors/%s/flavor-extra-specs/%s' %
-                              (flavor_id, key),
-                              json.dumps(kwargs), self.headers)
+                              (flavor_id, key), json.dumps(kwargs))
         body = json.loads(body)
         return resp, body
 
@@ -124,8 +123,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/flavor-access' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/flavor-access' % flavor_id)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -137,8 +135,7 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -150,7 +147,6 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
diff --git a/tempest/services/compute/v3/json/hosts_client.py b/tempest/services/compute/v3/json/hosts_client.py
index e33dd5f..76af626 100644
--- a/tempest/services/compute/v3/json/hosts_client.py
+++ b/tempest/services/compute/v3/json/hosts_client.py
@@ -55,8 +55,7 @@
         request_body.update(**kwargs)
         request_body = json.dumps({'host': request_body})
 
-        resp, body = self.put("os-hosts/%s" % str(hostname), request_body,
-                              self.headers)
+        resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py b/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
deleted file mode 100644
index 3a6ac5f..0000000
--- a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
+++ /dev/null
@@ -1,38 +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.
-
-import json
-
-from tempest.common.rest_client import RestClient
-from tempest import config
-
-CONF = config.CONF
-
-
-class InstanceUsagesAuditLogV3ClientJSON(RestClient):
-
-    def __init__(self, auth_provider):
-        super(InstanceUsagesAuditLogV3ClientJSON, self).__init__(
-            auth_provider)
-        self.service = CONF.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)
-        body = json.loads(body)
-        return resp, body["instance_usage_audit_log"]
diff --git a/tempest/services/compute/v3/json/interfaces_client.py b/tempest/services/compute/v3/json/interfaces_client.py
index 053b9af..c167520 100644
--- a/tempest/services/compute/v3/json/interfaces_client.py
+++ b/tempest/services/compute/v3/json/interfaces_client.py
@@ -45,7 +45,6 @@
             post_body['fixed_ips'] = [dict(ip_address=fixed_ip)]
         post_body = json.dumps({'interface_attachment': post_body})
         resp, body = self.post('servers/%s/os-attach-interfaces' % server,
-                               headers=self.headers,
                                body=post_body)
         body = json.loads(body)
         return resp, body['interface_attachment']
diff --git a/tempest/services/compute/v3/json/keypairs_client.py b/tempest/services/compute/v3/json/keypairs_client.py
index 05dbe25..821b86f 100644
--- a/tempest/services/compute/v3/json/keypairs_client.py
+++ b/tempest/services/compute/v3/json/keypairs_client.py
@@ -47,8 +47,7 @@
         if pub_key:
             post_body['keypair']['public_key'] = pub_key
         post_body = json.dumps(post_body)
-        resp, body = self.post("keypairs",
-                               headers=self.headers, body=post_body)
+        resp, body = self.post("keypairs", body=post_body)
         body = json.loads(body)
         return resp, body['keypair']
 
diff --git a/tempest/services/compute/v3/json/quotas_client.py b/tempest/services/compute/v3/json/quotas_client.py
index 1ec8651..a01b9d2 100644
--- a/tempest/services/compute/v3/json/quotas_client.py
+++ b/tempest/services/compute/v3/json/quotas_client.py
@@ -84,8 +84,7 @@
             post_body['security_groups'] = security_groups
 
         post_body = json.dumps({'quota_set': post_body})
-        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body,
-                              self.headers)
+        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body)
 
         body = json.loads(body)
         return resp, body['quota_set']
diff --git a/tempest/services/compute/v3/json/servers_client.py b/tempest/services/compute/v3/json/servers_client.py
index 11538f5..840e914 100644
--- a/tempest/services/compute/v3/json/servers_client.py
+++ b/tempest/services/compute/v3/json/servers_client.py
@@ -84,7 +84,7 @@
             if value is not None:
                 post_body[post_param] = value
         post_body = json.dumps({'server': post_body})
-        resp, body = self.post('servers', post_body, self.headers)
+        resp, body = self.post('servers', post_body)
 
         body = json.loads(body)
         # NOTE(maurosr): this deals with the case of multiple server create
@@ -121,8 +121,7 @@
             post_body['os-disk-config:disk_config'] = disk_config
 
         post_body = json.dumps({'server': post_body})
-        resp, body = self.put("servers/%s" % str(server_id),
-                              post_body, self.headers)
+        resp, body = self.put("servers/%s" % str(server_id), post_body)
         body = json.loads(body)
         return resp, body['server']
 
@@ -199,7 +198,7 @@
     def action(self, server_id, action_name, response_key, **kwargs):
         post_body = json.dumps({action_name: kwargs})
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         if response_key is not None:
             body = json.loads(body)[response_key]
         return resp, body
@@ -216,6 +215,21 @@
         return self.action(server_id, 'change_password', None,
                            admin_password=admin_password)
 
+    def get_password(self, server_id):
+        resp, body = self.get("servers/%s/os-server-password" %
+                              str(server_id))
+        body = json.loads(body)
+        return resp, body
+
+    def delete_password(self, server_id):
+        """
+        Removes the encrypted server password from the metadata server
+        Note that this does not actually change the instance server
+        password.
+        """
+        return self.delete("servers/%s/os-server-password" %
+                           str(server_id))
+
     def reboot(self, server_id, reboot_type):
         """Reboots a server."""
         return self.action(server_id, 'reboot', None, type=reboot_type)
@@ -258,7 +272,7 @@
 
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def list_server_metadata(self, server_id):
@@ -272,14 +286,14 @@
         else:
             post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_server_metadata(self, server_id, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.post('servers/%s/metadata' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -291,7 +305,7 @@
     def set_server_metadata_item(self, server_id, key, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -327,7 +341,7 @@
         req_body = json.dumps({'migrate_live': migrate_params})
 
         resp, body = self.post("servers/%s/action" % str(server_id),
-                               req_body, self.headers)
+                               req_body)
         return resp, body
 
     def migrate_server(self, server_id, **kwargs):
diff --git a/tempest/services/compute/v3/json/services_client.py b/tempest/services/compute/v3/json/services_client.py
index 1082ea9..e20dfde 100644
--- a/tempest/services/compute/v3/json/services_client.py
+++ b/tempest/services/compute/v3/json/services_client.py
@@ -50,7 +50,7 @@
                 'host': host_name
             }
         })
-        resp, body = self.put('os-services/enable', post_body, self.headers)
+        resp, body = self.put('os-services/enable', post_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -66,6 +66,6 @@
                 'host': host_name
             }
         })
-        resp, body = self.put('os-services/disable', post_body, self.headers)
+        resp, body = self.put('os-services/disable', post_body)
         body = json.loads(body)
         return resp, body['service']
diff --git a/tempest/services/compute/v3/json/tenant_usages_client.py b/tempest/services/compute/v3/json/tenant_usages_client.py
deleted file mode 100644
index 6d59e20..0000000
--- a/tempest/services/compute/v3/json/tenant_usages_client.py
+++ /dev/null
@@ -1,47 +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 json
-import urllib
-
-from tempest.common.rest_client import RestClient
-from tempest import config
-
-CONF = config.CONF
-
-
-class TenantUsagesV3ClientJSON(RestClient):
-
-    def __init__(self, auth_provider):
-        super(TenantUsagesV3ClientJSON, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_v3_type
-
-    def list_tenant_usages(self, params=None):
-        url = 'os-simple-tenant-usage'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body['tenant_usages'][0]
-
-    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)
-        body = json.loads(body)
-        return resp, body['tenant_usage']
diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py
index ba08f58..5b250ee 100644
--- a/tempest/services/compute/xml/aggregates_client.py
+++ b/tempest/services/compute/xml/aggregates_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -26,7 +26,8 @@
 CONF = config.CONF
 
 
-class AggregatesClientXML(RestClientXML):
+class AggregatesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(AggregatesClientXML, self).__init__(auth_provider)
@@ -51,14 +52,13 @@
 
     def list_aggregates(self):
         """Get aggregate list."""
-        resp, body = self.get("os-aggregates", self.headers)
+        resp, body = self.get("os-aggregates")
         aggregates = self._parse_array(etree.fromstring(body))
         return resp, aggregates
 
     def get_aggregate(self, aggregate_id):
         """Get details of the given aggregate."""
-        resp, body = self.get("os-aggregates/%s" % str(aggregate_id),
-                              self.headers)
+        resp, body = self.get("os-aggregates/%s" % str(aggregate_id))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -68,8 +68,7 @@
                             name=name,
                             availability_zone=availability_zone)
         resp, body = self.post('os-aggregates',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -79,15 +78,13 @@
                            name=name,
                            availability_zone=availability_zone)
         resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
     def delete_aggregate(self, aggregate_id):
         """Deletes the given aggregate."""
-        return self.delete("os-aggregates/%s" % str(aggregate_id),
-                           self.headers)
+        return self.delete("os-aggregates/%s" % str(aggregate_id))
 
     def is_resource_deleted(self, id):
         try:
@@ -100,8 +97,7 @@
         """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)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -109,8 +105,7 @@
         """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)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -124,7 +119,6 @@
             meta.append(Text(v))
             metadata.append(meta)
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py
index 38280b5..4d71186 100644
--- a/tempest/services/compute/xml/availability_zone_client.py
+++ b/tempest/services/compute/xml/availability_zone_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class AvailabilityZoneClientXML(RestClientXML):
+class AvailabilityZoneClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(AvailabilityZoneClientXML, self).__init__(
@@ -33,11 +34,11 @@
         return [xml_to_json(x) for x in node]
 
     def get_availability_zone_list(self):
-        resp, body = self.get('os-availability-zone', self.headers)
+        resp, body = self.get('os-availability-zone')
         availability_zone = self._parse_array(etree.fromstring(body))
         return resp, availability_zone
 
     def get_availability_zone_list_detail(self):
-        resp, body = self.get('os-availability-zone/detail', self.headers)
+        resp, body = self.get('os-availability-zone/detail')
         availability_zone = self._parse_array(etree.fromstring(body))
         return resp, availability_zone
diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py
index aad20a4..24ffca8 100644
--- a/tempest/services/compute/xml/certificates_client.py
+++ b/tempest/services/compute/xml/certificates_client.py
@@ -14,13 +14,14 @@
 #    under the License.
 
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 
 CONF = config.CONF
 
 
-class CertificatesClientXML(RestClientXML):
+class CertificatesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(CertificatesClientXML, self).__init__(auth_provider)
@@ -28,13 +29,13 @@
 
     def get_certificate(self, id):
         url = "os-certificates/%s" % (id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_resp(body)
         return resp, body
 
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = self._parse_resp(body)
         return resp, body
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
index 9753ca8..3e8254c 100644
--- a/tempest/services/compute/xml/extensions_client.py
+++ b/tempest/services/compute/xml/extensions_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class ExtensionsClientXML(RestClientXML):
+class ExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ExtensionsClientXML, self).__init__(auth_provider)
@@ -36,7 +37,7 @@
 
     def list_extensions(self):
         url = 'extensions'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -46,6 +47,6 @@
         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)
+        resp, body = self.get('extensions/%s' % extension_alias)
         body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py
index 599e168..0475530 100644
--- a/tempest/services/compute/xml/fixed_ips_client.py
+++ b/tempest/services/compute/xml/fixed_ips_client.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -23,7 +23,8 @@
 CONF = config.CONF
 
 
-class FixedIPsClientXML(RestClientXML):
+class FixedIPsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(FixedIPsClientXML, self).__init__(auth_provider)
@@ -31,7 +32,7 @@
 
     def get_fixed_ip_details(self, fixed_ip):
         url = "os-fixed-ips/%s" % (fixed_ip)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_resp(body)
         return resp, body
 
@@ -44,5 +45,5 @@
         key, value = body.popitem()
         xml_body = Element(key)
         xml_body.append(Text(value))
-        resp, body = self.post(url, str(Document(xml_body)), self.headers)
+        resp, body = self.post(url, str(Document(xml_body)))
         return resp, body
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index fb16d20..68a27c9 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -33,7 +33,8 @@
     "http://docs.openstack.org/compute/ext/flavor_access/api/v2"
 
 
-class FlavorsClientXML(RestClientXML):
+class FlavorsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(FlavorsClientXML, self).__init__(auth_provider)
@@ -81,7 +82,7 @@
         if params:
             url += "?%s" % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         flavors = self._parse_array(etree.fromstring(body))
         return resp, flavors
 
@@ -94,7 +95,7 @@
         return self._list_flavors(url, params)
 
     def get_flavor_details(self, flavor_id):
-        resp, body = self.get("flavors/%s" % str(flavor_id), self.headers)
+        resp, body = self.get("flavors/%s" % str(flavor_id))
         body = xml_to_json(etree.fromstring(body))
         flavor = self._format_flavor(body)
         return resp, flavor
@@ -120,14 +121,14 @@
                             kwargs.get('is_public'))
         flavor.add_attr('xmlns:OS-FLV-EXT-DATA', XMLNS_OS_FLV_EXT_DATA)
         flavor.add_attr('xmlns:os-flavor-access', XMLNS_OS_FLV_ACCESS)
-        resp, body = self.post('flavors', str(Document(flavor)), self.headers)
+        resp, body = self.post('flavors', str(Document(flavor)))
         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)
+        return self.delete("flavors/%s" % str(flavor_id))
 
     def is_resource_deleted(self, id):
         # Did not use get_flavor_details(id) for verification as it gives
@@ -145,21 +146,20 @@
         for key in specs.keys():
             extra_specs.add_attr(key, specs[key])
         resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               str(Document(extra_specs)), self.headers)
+                               str(Document(extra_specs)))
         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/os-extra_specs' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
         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/os-extra_specs/%s' %
-                                  (str(flavor_id), key), self.headers)
+                                  (str(flavor_id), key))
         body = {}
         element = etree.fromstring(xml_body)
         key = element.get('key')
@@ -176,8 +176,7 @@
             element.append(value)
 
         resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key),
-                              str(doc), self.headers)
+                              (flavor_id, key), str(doc))
         body = xml_to_json(etree.fromstring(body))
         return resp, {key: body}
 
@@ -191,8 +190,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % str(flavor_id),
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-flavor-access' % str(flavor_id))
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -202,8 +200,7 @@
         server = Element("addTenantAccess")
         doc.append(server)
         server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
+        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
         body = self._parse_array_access(etree.fromstring(body))
         return resp, body
 
@@ -213,7 +210,6 @@
         server = Element("removeTenantAccess")
         doc.append(server)
         server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
+        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
         body = self._parse_array_access(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
index 0119d8a..be54753 100644
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 import urllib
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -27,7 +27,9 @@
 CONF = config.CONF
 
 
-class FloatingIPsClientXML(RestClientXML):
+class FloatingIPsClientXML(rest_client.RestClient):
+    TYPE = "xml"
+
     def __init__(self, auth_provider):
         super(FloatingIPsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
@@ -48,14 +50,14 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_floating_ip_details(self, floating_ip_id):
         """Get the details of a floating IP."""
         url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_floating_ip(etree.fromstring(body))
         if resp.status == 404:
             raise exceptions.NotFound(body)
@@ -69,16 +71,16 @@
             pool = Element("pool")
             pool.append(Text(pool_name))
             doc.append(pool)
-            resp, body = self.post(url, str(doc), self.headers)
+            resp, body = self.post(url, str(doc))
         else:
-            resp, body = self.post(url, None, self.headers)
+            resp, body = self.post(url, None)
         body = self._parse_floating_ip(etree.fromstring(body))
         return resp, body
 
     def delete_floating_ip(self, floating_ip_id):
         """Deletes the provided floating IP from the project."""
         url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
 
     def associate_floating_ip_to_server(self, floating_ip, server_id):
@@ -88,7 +90,7 @@
         server = Element("addFloatingIp")
         doc.append(server)
         server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc), self.headers)
+        resp, body = self.post(url, str(doc))
         return resp, body
 
     def disassociate_floating_ip_from_server(self, floating_ip, server_id):
@@ -98,7 +100,7 @@
         server = Element("removeFloatingIp")
         doc.append(server)
         server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc), self.headers)
+        resp, body = self.post(url, str(doc))
         return resp, body
 
     def is_resource_deleted(self, id):
@@ -114,6 +116,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py
index daa83c9..b74cd04 100644
--- a/tempest/services/compute/xml/hosts_client.py
+++ b/tempest/services/compute/xml/hosts_client.py
@@ -15,7 +15,7 @@
 import urllib
 
 from lxml import etree
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -24,7 +24,8 @@
 CONF = config.CONF
 
 
-class HostsClientXML(RestClientXML):
+class HostsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(HostsClientXML, self).__init__(auth_provider)
@@ -37,7 +38,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -45,7 +46,7 @@
     def show_host_detail(self, hostname):
         """Show detail information for the host."""
 
-        resp, body = self.get("os-hosts/%s" % str(hostname), self.headers)
+        resp, body = self.get("os-hosts/%s" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(node)]
         return resp, body
@@ -58,8 +59,7 @@
             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)
+                              str(Document(request_body)))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -67,8 +67,7 @@
     def startup_host(self, hostname):
         """Startup a host."""
 
-        resp, body = self.get("os-hosts/%s/startup" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/startup" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -76,8 +75,7 @@
     def shutdown_host(self, hostname):
         """Shutdown a host."""
 
-        resp, body = self.get("os-hosts/%s/shutdown" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/shutdown" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -85,8 +83,7 @@
     def reboot_host(self, hostname):
         """Reboot a host."""
 
-        resp, body = self.get("os-hosts/%s/reboot" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/reboot" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py
index 5abaad8..ecd7541 100644
--- a/tempest/services/compute/xml/hypervisor_client.py
+++ b/tempest/services/compute/xml/hypervisor_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class HypervisorClientXML(RestClientXML):
+class HypervisorClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(HypervisorClientXML, self).__init__(auth_provider)
@@ -33,46 +34,42 @@
 
     def get_hypervisor_list(self):
         """List hypervisors information."""
-        resp, body = self.get('os-hypervisors', self.headers)
+        resp, body = self.get('os-hypervisors')
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_list_details(self):
         """Show detailed hypervisors information."""
-        resp, body = self.get('os-hypervisors/detail', self.headers)
+        resp, body = self.get('os-hypervisors/detail')
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_show_details(self, hyper_id):
         """Display the details of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s' % hyper_id,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s' % hyper_id)
         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)
+        resp, body = self.get('os-hypervisors/%s/servers' % hyper_name)
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_stats(self):
         """Get hypervisor statistics over all compute nodes."""
-        resp, body = self.get('os-hypervisors/statistics', self.headers)
+        resp, body = self.get('os-hypervisors/statistics')
         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)
+        resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
         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/%s/search' % hyper_name,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s/search' % hyper_name)
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
index d90a7d8..9d529be 100644
--- a/tempest/services/compute/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest.common import waiters
 from tempest import config
 from tempest import exceptions
@@ -30,7 +30,8 @@
 CONF = config.CONF
 
 
-class ImagesClientXML(RestClientXML):
+class ImagesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ImagesClientXML, self).__init__(auth_provider)
@@ -102,7 +103,7 @@
                 data.append(Text(v))
                 metadata.append(data)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         return resp, body
 
     def list_images(self, params=None):
@@ -111,7 +112,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_images(etree.fromstring(body))
         return resp, body['images']
 
@@ -123,20 +124,20 @@
 
             url = "images/detail?" + param_list
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_images(etree.fromstring(body))
         return resp, body['images']
 
     def get_image(self, image_id):
         """Returns the details of a single image."""
-        resp, body = self.get("images/%s" % str(image_id), self.headers)
+        resp, body = self.get("images/%s" % str(image_id))
         self.expected_success(200, resp)
         body = self._parse_image(etree.fromstring(body))
         return resp, body
 
     def delete_image(self, image_id):
         """Deletes the provided image."""
-        return self.delete("images/%s" % str(image_id), self.headers)
+        return self.delete("images/%s" % str(image_id))
 
     def wait_for_image_status(self, image_id, status):
         """Waits for an image to reach a given status."""
@@ -152,8 +153,7 @@
 
     def list_image_metadata(self, image_id):
         """Lists all metadata items for an image."""
-        resp, body = self.get("images/%s/metadata" % str(image_id),
-                              self.headers)
+        resp, body = self.get("images/%s/metadata" % str(image_id))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -161,7 +161,7 @@
         """Sets the metadata for an image."""
         post_body = self._metadata_body(meta)
         resp, body = self.put('images/%s/metadata' % image_id,
-                              str(Document(post_body)), self.headers)
+                              str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -169,14 +169,14 @@
         """Updates the metadata for an image."""
         post_body = self._metadata_body(meta)
         resp, body = self.post('images/%s/metadata' % str(image_id),
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_image_metadata_item(self, image_id, key):
         """Returns the value for a specific image metadata key."""
         resp, body = self.get("images/%s/metadata/%s.xml" %
-                              (str(image_id), key), self.headers)
+                              (str(image_id), key))
         body = self._parse_metadata(etree.fromstring(body))
         return resp, body
 
@@ -186,7 +186,7 @@
             post_body = Element('meta', key=key)
             post_body.append(Text(v))
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              str(Document(post_body)), self.headers)
+                              str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -194,14 +194,13 @@
         """Sets the value for a specific image metadata key."""
         post_body = Document('meta', Text(meta), key=key)
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = xml_to_json(etree.fromstring(body))
         return resp, body['meta']
 
     def delete_image_metadata_item(self, image_id, key):
         """Deletes a single image metadata key/value pair."""
-        return self.delete("images/%s/metadata/%s" % (str(image_id), key),
-                           self.headers)
+        return self.delete("images/%s/metadata/%s" % (str(image_id), key))
 
     def is_resource_deleted(self, id):
         try:
diff --git a/tempest/services/compute/xml/instance_usage_audit_log_client.py b/tempest/services/compute/xml/instance_usage_audit_log_client.py
index 562774b..1cd8c07 100644
--- a/tempest/services/compute/xml/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/xml/instance_usage_audit_log_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class InstanceUsagesAuditLogClientXML(RestClientXML):
+class InstanceUsagesAuditLogClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(InstanceUsagesAuditLogClientXML, self).__init__(
@@ -31,12 +32,12 @@
 
     def list_instance_usage_audit_logs(self):
         url = 'os-instance_usage_audit_log'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         instance_usage_audit_logs = xml_to_json(etree.fromstring(body))
         return resp, instance_usage_audit_logs
 
     def get_instance_usage_audit_log(self, time_before):
         url = 'os-instance_usage_audit_log/%s' % time_before
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         instance_usage_audit_log = xml_to_json(etree.fromstring(body))
         return resp, instance_usage_audit_log
diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py
index 4194d7d..5df6187 100644
--- a/tempest/services/compute/xml/interfaces_client.py
+++ b/tempest/services/compute/xml/interfaces_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -28,7 +28,8 @@
 CONF = config.CONF
 
 
-class InterfacesClientXML(RestClientXML):
+class InterfacesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(InterfacesClientXML, self).__init__(auth_provider)
@@ -42,7 +43,7 @@
         return iface
 
     def list_interfaces(self, server):
-        resp, body = self.get('servers/%s/os-interface' % server, self.headers)
+        resp, body = self.get('servers/%s/os-interface' % server)
         node = etree.fromstring(body)
         interfaces = [self._process_xml_interface(x)
                       for x in node.getchildren()]
@@ -70,14 +71,12 @@
             iface.append(_fixed_ips)
         doc.append(iface)
         resp, body = self.post('servers/%s/os-interface' % 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-interface/%s' % (server, port_id),
-                              self.headers)
+        resp, body = self.get('servers/%s/os-interface/%s' % (server, port_id))
         body = self._process_xml_interface(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
index 92fade4..fb498c0 100644
--- a/tempest/services/compute/xml/keypairs_client.py
+++ b/tempest/services/compute/xml/keypairs_client.py
@@ -16,7 +16,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -26,20 +26,21 @@
 CONF = config.CONF
 
 
-class KeyPairsClientXML(RestClientXML):
+class KeyPairsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(KeyPairsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_keypairs(self):
-        resp, body = self.get("os-keypairs", self.headers)
+        resp, body = self.get("os-keypairs")
         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("os-keypairs/%s" % str(key_name), self.headers)
+        resp, body = self.get("os-keypairs/%s" % str(key_name))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -61,8 +62,7 @@
 
         doc.append(keypair_element)
 
-        resp, body = self.post("os-keypairs",
-                               headers=self.headers, body=str(doc))
+        resp, body = self.post("os-keypairs", body=str(doc))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
index 2a8fbec..2327626 100644
--- a/tempest/services/compute/xml/limits_client.py
+++ b/tempest/services/compute/xml/limits_client.py
@@ -15,7 +15,7 @@
 
 from lxml import objectify
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 
 CONF = config.CONF
@@ -23,14 +23,15 @@
 NS = "{http://docs.openstack.org/common/api/v1.0}"
 
 
-class LimitsClientXML(RestClientXML):
+class LimitsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(LimitsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_absolute_limits(self):
-        resp, body = self.get("limits", self.headers)
+        resp, body = self.get("limits")
         body = objectify.fromstring(body)
         lim = NS + 'absolute'
         ret = {}
@@ -41,7 +42,7 @@
         return resp, ret
 
     def get_specific_absolute_limit(self, absolute_limit):
-        resp, body = self.get("limits", self.headers)
+        resp, body = self.get("limits")
         body = objectify.fromstring(body)
         lim = NS + 'absolute'
         ret = {}
diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py
index f1041f0..eb287c2 100644
--- a/tempest/services/compute/xml/quotas_client.py
+++ b/tempest/services/compute/xml/quotas_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -25,7 +25,8 @@
 CONF = config.CONF
 
 
-class QuotasClientXML(RestClientXML):
+class QuotasClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(QuotasClientXML, self).__init__(auth_provider)
@@ -50,7 +51,7 @@
         """List the quota set for a tenant."""
 
         url = 'os-quota-sets/%s' % str(tenant_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
@@ -59,7 +60,7 @@
         """List the default quota set for a tenant."""
 
         url = 'os-quota-sets/%s/defaults' % str(tenant_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
@@ -119,8 +120,7 @@
             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)
+                              str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index 83072be..d53e8da 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 import urllib
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -28,7 +28,8 @@
 CONF = config.CONF
 
 
-class SecurityGroupsClientXML(RestClientXML):
+class SecurityGroupsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(SecurityGroupsClientXML, self).__init__(auth_provider)
@@ -51,14 +52,14 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_security_group(self, security_group_id):
         """Get the details of a Security Group."""
         url = "os-security-groups/%s" % str(security_group_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -73,8 +74,7 @@
         des.append(Text(content=description))
         security_group.append(des)
         resp, body = self.post('os-security-groups',
-                               str(Document(security_group)),
-                               self.headers)
+                               str(Document(security_group)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -97,15 +97,13 @@
             security_group.append(des)
         resp, body = self.put('os-security-groups/%s' %
                               str(security_group_id),
-                              str(Document(security_group)),
-                              self.headers)
+                              str(Document(security_group)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_security_group(self, security_group_id):
         """Deletes the provided Security Group."""
-        return self.delete('os-security-groups/%s' %
-                           str(security_group_id), self.headers)
+        return self.delete('os-security-groups/%s' % str(security_group_id))
 
     def create_security_group_rule(self, parent_group_id, ip_proto, from_port,
                                    to_port, **kwargs):
@@ -136,19 +134,19 @@
                 group_rule.append(element)
 
         url = 'os-security-group-rules'
-        resp, body = self.post(url, str(Document(group_rule)), self.headers)
+        resp, body = self.post(url, str(Document(group_rule)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_security_group_rule(self, group_rule_id):
         """Deletes the provided Security Group rule."""
         return self.delete('os-security-group-rules/%s' %
-                           str(group_rule_id), self.headers)
+                           str(group_rule_id))
 
     def list_security_group_rules(self, security_group_id):
         """List all rules for a security group."""
         url = "os-security-groups"
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         secgroups = body.getchildren()
         for secgroup in secgroups:
@@ -157,3 +155,10 @@
                 rules = [xml_to_json(x) for x in node.getchildren()]
                 return resp, rules
         raise exceptions.NotFound('No such Security Group')
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_security_group(id)
+        except exceptions.NotFound:
+            return True
+        return False
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index 37980c9..da01b83 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -19,7 +19,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest.common import waiters
 from tempest import config
 from tempest import exceptions
@@ -139,7 +139,8 @@
     return json
 
 
-class ServersClientXML(RestClientXML):
+class ServersClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServersClientXML, self).__init__(auth_provider)
@@ -186,7 +187,7 @@
 
     def get_server(self, server_id):
         """Returns the details of an existing server."""
-        resp, body = self.get("servers/%s" % str(server_id), self.headers)
+        resp, body = self.get("servers/%s" % str(server_id))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -245,7 +246,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         servers = self._parse_array(etree.fromstring(body))
         return resp, {"servers": servers}
 
@@ -254,7 +255,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         servers = self._parse_array(etree.fromstring(body))
         return resp, {"servers": servers}
 
@@ -282,8 +283,7 @@
                 meta.append(Text(v))
                 metadata.append(meta)
 
-        resp, body = self.put('servers/%s' % str(server_id),
-                              str(doc), self.headers)
+        resp, body = self.put('servers/%s' % str(server_id), str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def create_server(self, name, image_ref, flavor_ref, **kwargs):
@@ -356,7 +356,7 @@
                 temp.append(Text(k['contents']))
                 personality.append(temp)
 
-        resp, body = self.post('servers', str(Document(server)), self.headers)
+        resp, body = self.post('servers', str(Document(server)))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -394,7 +394,7 @@
 
     def list_addresses(self, server_id):
         """Lists all addresses for a server."""
-        resp, body = self.get("servers/%s/ips" % str(server_id), self.headers)
+        resp, body = self.get("servers/%s/ips" % str(server_id))
 
         networks = {}
         xml_list = etree.fromstring(body)
@@ -407,8 +407,7 @@
     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_id))
         network = self._parse_network(etree.fromstring(body))
 
         return resp, network
@@ -417,8 +416,7 @@
         if 'xmlns' not in kwargs:
             kwargs['xmlns'] = XMLNS_11
         doc = Document((Element(action_name, **kwargs)))
-        resp, body = self.post("servers/%s/action" % server_id,
-                               str(doc), self.headers)
+        resp, body = self.post("servers/%s/action" % server_id, str(doc))
         if response_key is not None:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -435,8 +433,7 @@
                            adminPass=password)
 
     def get_password(self, server_id):
-        resp, body = self.get("servers/%s/os-server-password" %
-                              str(server_id), self.headers)
+        resp, body = self.get("servers/%s/os-server-password" % str(server_id))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -446,8 +443,7 @@
         Note that this does not actually change the instance server
         password.
         """
-        return self.delete("servers/%s/os-server-password" %
-                           str(server_id))
+        return self.delete("servers/%s/os-server-password" % str(server_id))
 
     def reboot(self, server_id, reboot_type):
         return self.action(server_id, "reboot", None, type=reboot_type)
@@ -478,7 +474,7 @@
                 metadata.append(meta)
 
         resp, body = self.post('servers/%s/action' % server_id,
-                               str(Document(rebuild)), self.headers)
+                               str(Document(rebuild)))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -523,12 +519,11 @@
                            host=dest_host)
 
         resp, body = self.post("servers/%s/action" % str(server_id),
-                               str(Document(req_body)), self.headers)
+                               str(Document(req_body)))
         return resp, body
 
     def list_server_metadata(self, server_id):
-        resp, body = self.get("servers/%s/metadata" % str(server_id),
-                              self.headers)
+        resp, body = self.get("servers/%s/metadata" % str(server_id))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -541,8 +536,7 @@
                 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)
+        resp, body = self.put('servers/%s/metadata' % str(server_id), str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def update_server_metadata(self, server_id, meta):
@@ -554,13 +548,12 @@
             meta_element.append(Text(v))
             metadata.append(meta_element)
         resp, body = self.post("/servers/%s/metadata" % str(server_id),
-                               str(doc), headers=self.headers)
+                               str(doc))
         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)
+        resp, body = self.get("servers/%s/metadata/%s" % (str(server_id), key))
         return resp, dict([(etree.fromstring(body).attrib['key'],
                             xml_to_json(etree.fromstring(body)))])
 
@@ -571,7 +564,7 @@
             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)
+                              str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def delete_server_metadata_item(self, server_id, key):
@@ -588,7 +581,7 @@
         List the virtual interfaces used in an instance.
         """
         resp, body = self.get('/'.join(['servers', server_id,
-                              'os-virtual-interfaces']), self.headers)
+                              'os-virtual-interfaces']))
         virt_int = self._parse_xml_virtual_interfaces(etree.fromstring(body))
         return resp, virt_int
 
@@ -604,7 +597,7 @@
         post_body = Element("volumeAttachment", volumeId=volume_id,
                             device=device)
         resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         return resp, body
 
     def detach_volume(self, server_id, volume_id):
@@ -616,22 +609,20 @@
 
     def get_server_diagnostics(self, server_id):
         """Get the usage data for a server."""
-        resp, body = self.get("servers/%s/diagnostics" % server_id,
-                              self.headers)
+        resp, body = self.get("servers/%s/diagnostics" % server_id)
         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)
+        resp, body = self.get("servers/%s/os-instance-actions" % server_id)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_instance_action(self, server_id, request_id):
         """Returns the action details of the provided server."""
         resp, body = self.get("servers/%s/os-instance-actions/%s" %
-                              (server_id, request_id), self.headers)
+                              (server_id, request_id))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py
index c28dc12..d7b8a60 100644
--- a/tempest/services/compute/xml/services_client.py
+++ b/tempest/services/compute/xml/services_client.py
@@ -18,7 +18,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 CONF = config.CONF
 
 
-class ServicesClientXML(RestClientXML):
+class ServicesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServicesClientXML, self).__init__(auth_provider)
@@ -38,7 +39,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -53,8 +54,7 @@
         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)
+        resp, body = self.put('os-services/enable', str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -68,7 +68,6 @@
         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)
+        resp, body = self.put('os-services/disable', str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py
index 93eeb00..79f0ac9 100644
--- a/tempest/services/compute/xml/tenant_usages_client.py
+++ b/tempest/services/compute/xml/tenant_usages_client.py
@@ -17,14 +17,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class TenantUsagesClientXML(RestClientXML):
+class TenantUsagesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(TenantUsagesClientXML, self).__init__(auth_provider)
@@ -39,7 +40,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         tenant_usage = self._parse_array(etree.fromstring(body))
         return resp, tenant_usage['tenant_usage']
 
@@ -48,6 +49,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         tenant_usage = self._parse_array(etree.fromstring(body))
         return resp, tenant_usage
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
index 941cd69..570b715 100644
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -18,7 +18,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -30,7 +30,8 @@
 CONF = config.CONF
 
 
-class VolumesExtensionsClientXML(RestClientXML):
+class VolumesExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumesExtensionsClientXML, self).__init__(
@@ -60,7 +61,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -74,7 +75,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -84,7 +85,7 @@
     def get_volume(self, volume_id):
         """Returns the details of a single volume."""
         url = "os-volumes/%s" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume(body)
 
@@ -110,8 +111,7 @@
                 meta.append(Text(value))
                 _metadata.append(meta)
 
-        resp, body = self.post('os-volumes', str(Document(volume)),
-                               self.headers)
+        resp, body = self.post('os-volumes', str(Document(volume)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/json/identity_client.py b/tempest/services/identity/json/identity_client.py
index c018215..349a9e9 100644
--- a/tempest/services/identity/json/identity_client.py
+++ b/tempest/services/identity/json/identity_client.py
@@ -12,20 +12,23 @@
 
 import json
 
-from tempest.common.rest_client import RestClient
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 
 CONF = config.CONF
 
 
-class IdentityClientJSON(RestClient):
+class IdentityClientJSON(rest_client.RestClient):
 
     def __init__(self, auth_provider):
         super(IdentityClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
 
+        # Needed for xml service client
+        self.list_tags = ["roles", "tenants", "users", "services"]
+
     def has_admin_extensions(self):
         """
         Returns True if the KSADM Admin Extensions are supported
@@ -43,9 +46,8 @@
             'name': name,
         }
         post_body = json.dumps({'role': post_body})
-        resp, body = self.post('OS-KSADM/roles', post_body, self.headers)
-        body = json.loads(body)
-        return resp, body['role']
+        resp, body = self.post('OS-KSADM/roles', post_body)
+        return resp, self._parse_resp(body)
 
     def create_tenant(self, name, **kwargs):
         """
@@ -60,30 +62,24 @@
             'enabled': kwargs.get('enabled', True),
         }
         post_body = json.dumps({'tenant': post_body})
-        resp, body = self.post('tenants', post_body, self.headers)
-        body = json.loads(body)
-        return resp, body['tenant']
+        resp, body = self.post('tenants', post_body)
+        return resp, self._parse_resp(body)
 
     def delete_role(self, role_id):
         """Delete a role."""
-        resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
-        return resp, body
+        return self.delete('OS-KSADM/roles/%s' % str(role_id))
 
     def list_user_roles(self, tenant_id, user_id):
         """Returns a list of roles assigned to a user for a tenant."""
         url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
         resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body['roles']
+        return resp, self._parse_resp(body)
 
     def assign_user_role(self, tenant_id, user_id, role_id):
         """Add roles to a user on a tenant."""
-        post_body = json.dumps({})
         resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
-                              (tenant_id, user_id, role_id), post_body,
-                              self.headers)
-        body = json.loads(body)
-        return resp, body['role']
+                              (tenant_id, user_id, role_id), "")
+        return resp, self._parse_resp(body)
 
     def remove_user_role(self, tenant_id, user_id, role_id):
         """Removes a role assignment for a user on a tenant."""
@@ -92,20 +88,17 @@
 
     def delete_tenant(self, tenant_id):
         """Delete a tenant."""
-        resp, body = self.delete('tenants/%s' % str(tenant_id))
-        return resp, body
+        return self.delete('tenants/%s' % str(tenant_id))
 
     def get_tenant(self, tenant_id):
         """Get tenant details."""
         resp, body = self.get('tenants/%s' % str(tenant_id))
-        body = json.loads(body)
-        return resp, body['tenant']
+        return resp, self._parse_resp(body)
 
     def list_roles(self):
         """Returns roles."""
         resp, body = self.get('OS-KSADM/roles')
-        body = json.loads(body)
-        return resp, body['roles']
+        return resp, self._parse_resp(body)
 
     def list_tenants(self):
         """Returns tenants."""
@@ -133,10 +126,8 @@
             'enabled': en,
         }
         post_body = json.dumps({'tenant': post_body})
-        resp, body = self.post('tenants/%s' % tenant_id, post_body,
-                               self.headers)
-        body = json.loads(body)
-        return resp, body['tenant']
+        resp, body = self.post('tenants/%s' % tenant_id, post_body)
+        return resp, self._parse_resp(body)
 
     def create_user(self, name, password, tenant_id, email, **kwargs):
         """Create a user."""
@@ -149,34 +140,28 @@
         if kwargs.get('enabled') is not None:
             post_body['enabled'] = kwargs.get('enabled')
         post_body = json.dumps({'user': post_body})
-        resp, body = self.post('users', post_body, self.headers)
-        body = json.loads(body)
-        return resp, body['user']
+        resp, body = self.post('users', post_body)
+        return resp, self._parse_resp(body)
 
     def update_user(self, user_id, **kwargs):
         """Updates a user."""
         put_body = json.dumps({'user': kwargs})
-        resp, body = self.put('users/%s' % user_id, put_body,
-                              self.headers)
-        body = json.loads(body)
-        return resp, body['user']
+        resp, body = self.put('users/%s' % user_id, put_body)
+        return resp, self._parse_resp(body)
 
     def get_user(self, user_id):
         """GET a user."""
         resp, body = self.get("users/%s" % user_id)
-        body = json.loads(body)
-        return resp, body['user']
+        return resp, self._parse_resp(body)
 
     def delete_user(self, user_id):
         """Delete a user."""
-        resp, body = self.delete("users/%s" % user_id)
-        return resp, body
+        return self.delete("users/%s" % user_id)
 
     def get_users(self):
         """Get the list of users."""
         resp, body = self.get("users")
-        body = json.loads(body)
-        return resp, body['users']
+        return resp, self._parse_resp(body)
 
     def enable_disable_user(self, user_id, enabled):
         """Enables or disables a user."""
@@ -184,21 +169,17 @@
             'enabled': enabled
         }
         put_body = json.dumps({'user': put_body})
-        resp, body = self.put('users/%s/enabled' % user_id,
-                              put_body, self.headers)
-        body = json.loads(body)
-        return resp, body
+        resp, body = self.put('users/%s/enabled' % user_id, put_body)
+        return resp, self._parse_resp(body)
 
     def delete_token(self, token_id):
         """Delete a token."""
-        resp, body = self.delete("tokens/%s" % token_id)
-        return resp, body
+        return self.delete("tokens/%s" % token_id)
 
     def list_users_for_tenant(self, tenant_id):
         """List users for a Tenant."""
         resp, body = self.get('/tenants/%s/users' % tenant_id)
-        body = json.loads(body)
-        return resp, body['users']
+        return resp, self._parse_resp(body)
 
     def get_user_by_username(self, tenant_id, username):
         resp, users = self.list_users_for_tenant(tenant_id)
@@ -215,22 +196,19 @@
             'description': kwargs.get('description')
         }
         post_body = json.dumps({'OS-KSADM:service': post_body})
-        resp, body = self.post('/OS-KSADM/services', post_body, self.headers)
-        body = json.loads(body)
-        return resp, body['OS-KSADM:service']
+        resp, body = self.post('/OS-KSADM/services', post_body)
+        return resp, self._parse_resp(body)
 
     def get_service(self, service_id):
         """Get Service."""
         url = '/OS-KSADM/services/%s' % service_id
         resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body['OS-KSADM:service']
+        return resp, self._parse_resp(body)
 
     def list_services(self):
         """List Service - Returns Services."""
         resp, body = self.get('/OS-KSADM/services/')
-        body = json.loads(body)
-        return resp, body['OS-KSADM:services']
+        return resp, self._parse_resp(body)
 
     def delete_service(self, service_id):
         """Delete Service."""
@@ -238,7 +216,7 @@
         return self.delete(url)
 
 
-class TokenClientJSON(RestClient):
+class TokenClientJSON(IdentityClientJSON):
 
     def __init__(self):
         super(TokenClientJSON, self).__init__(None)
@@ -261,15 +239,17 @@
             }
         }
         body = json.dumps(creds)
-        resp, body = self.post(self.auth_url, headers=self.headers, body=body)
+        resp, body = self.post(self.auth_url, body=body)
 
         return resp, body['access']
 
     def request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
         if headers is None:
-            headers = {}
-
+            # Always accept 'json', for TokenClientXML too.
+            # Because XML response is not easily
+            # converted to the corresponding JSON one
+            headers = self.get_headers(accept_type="json")
         self._log_request(method, url, headers, body)
         resp, resp_body = self.http_obj.request(url, method,
                                                 headers=headers, body=body)
@@ -282,7 +262,9 @@
             raise exceptions.IdentityError(
                 'Unexpected status code {0}'.format(resp.status))
 
-        return resp, json.loads(resp_body)
+        if isinstance(resp_body, str):
+            resp_body = json.loads(resp_body)
+        return resp, resp_body
 
     def get_token(self, user, password, tenant, auth_data=False):
         """
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index a0fbb76..5d6632a 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -40,8 +40,7 @@
             "user_id": user_id
         }
         post_body = json.dumps({'credential': post_body})
-        resp, body = self.post('credentials', post_body,
-                               self.headers)
+        resp, body = self.post('credentials', post_body)
         body = json.loads(body)
         body['credential']['blob'] = json.loads(body['credential']['blob'])
         return resp, body['credential']
@@ -63,8 +62,7 @@
             "user_id": user_id
         }
         post_body = json.dumps({'credential': post_body})
-        resp, body = self.patch('credentials/%s' % credential_id, post_body,
-                                self.headers)
+        resp, body = self.patch('credentials/%s' % credential_id, post_body)
         body = json.loads(body)
         body['credential']['blob'] = json.loads(body['credential']['blob'])
         return resp, body['credential']
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index 1b78115..652c345 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -47,7 +47,7 @@
             'enabled': enabled
         }
         post_body = json.dumps({'endpoint': post_body})
-        resp, body = self.post('endpoints', post_body, self.headers)
+        resp, body = self.post('endpoints', post_body)
         body = json.loads(body)
         return resp, body['endpoint']
 
@@ -66,8 +66,7 @@
         if enabled is not None:
             post_body['enabled'] = enabled
         post_body = json.dumps({'endpoint': post_body})
-        resp, body = self.patch('endpoints/%s' % endpoint_id, post_body,
-                                self.headers)
+        resp, body = self.patch('endpoints/%s' % endpoint_id, post_body)
         body = json.loads(body)
         return resp, body['endpoint']
 
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index ab1dc94..b044e4d 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -49,8 +48,7 @@
             'password': password
         }
         post_body = json.dumps({'user': post_body})
-        resp, body = self.post('users', post_body,
-                               self.headers)
+        resp, body = self.post('users', post_body)
         body = json.loads(body)
         return resp, body['user']
 
@@ -72,14 +70,13 @@
             'description': description
         }
         post_body = json.dumps({'user': post_body})
-        resp, body = self.patch('users/%s' % user_id, post_body,
-                                self.headers)
+        resp, body = self.patch('users/%s' % user_id, post_body)
         body = json.loads(body)
         return resp, body['user']
 
     def list_user_projects(self, user_id):
         """Lists the projects on which a user has roles assigned."""
-        resp, body = self.get('users/%s/projects' % user_id, self.headers)
+        resp, body = self.get('users/%s/projects' % user_id)
         body = json.loads(body)
         return resp, body['projects']
 
@@ -112,7 +109,7 @@
             'name': name
         }
         post_body = json.dumps({'project': post_body})
-        resp, body = self.post('projects', post_body, self.headers)
+        resp, body = self.post('projects', post_body)
         body = json.loads(body)
         return resp, body['project']
 
@@ -135,8 +132,7 @@
             'domain_id': domain_id,
         }
         post_body = json.dumps({'project': post_body})
-        resp, body = self.patch('projects/%s' % project_id, post_body,
-                                self.headers)
+        resp, body = self.patch('projects/%s' % project_id, post_body)
         body = json.loads(body)
         return resp, body['project']
 
@@ -157,7 +153,7 @@
             'name': name
         }
         post_body = json.dumps({'role': post_body})
-        resp, body = self.post('roles', post_body, self.headers)
+        resp, body = self.post('roles', post_body)
         body = json.loads(body)
         return resp, body['role']
 
@@ -173,8 +169,7 @@
             'name': name
         }
         post_body = json.dumps({'role': post_body})
-        resp, body = self.patch('roles/%s' % str(role_id), post_body,
-                                self.headers)
+        resp, body = self.patch('roles/%s' % str(role_id), post_body)
         body = json.loads(body)
         return resp, body['role']
 
@@ -186,8 +181,7 @@
     def assign_user_role(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), None,
-                              self.headers)
+                              (project_id, user_id, role_id), None)
         return resp, body
 
     def create_domain(self, name, **kwargs):
@@ -200,7 +194,7 @@
             'name': name
         }
         post_body = json.dumps({'domain': post_body})
-        resp, body = self.post('domains', post_body, self.headers)
+        resp, body = self.post('domains', post_body)
         body = json.loads(body)
         return resp, body['domain']
 
@@ -227,8 +221,7 @@
             'name': name
         }
         post_body = json.dumps({'domain': post_body})
-        resp, body = self.patch('domains/%s' % domain_id, post_body,
-                                self.headers)
+        resp, body = self.patch('domains/%s' % domain_id, post_body)
         body = json.loads(body)
         return resp, body['domain']
 
@@ -263,13 +256,13 @@
             'name': name
         }
         post_body = json.dumps({'group': post_body})
-        resp, body = self.post('groups', post_body, self.headers)
+        resp, body = self.post('groups', post_body)
         body = json.loads(body)
         return resp, body['group']
 
     def get_group(self, group_id):
         """Get group details."""
-        resp, body = self.get('groups/%s' % group_id, self.headers)
+        resp, body = self.get('groups/%s' % group_id)
         body = json.loads(body)
         return resp, body['group']
 
@@ -283,8 +276,7 @@
             'description': description
         }
         post_body = json.dumps({'group': post_body})
-        resp, body = self.patch('groups/%s' % group_id, post_body,
-                                self.headers)
+        resp, body = self.patch('groups/%s' % group_id, post_body)
         body = json.loads(body)
         return resp, body['group']
 
@@ -296,33 +288,30 @@
     def add_group_user(self, group_id, user_id):
         """Add user into group."""
         resp, body = self.put('groups/%s/users/%s' % (group_id, user_id),
-                              None, self.headers)
+                              None)
         return resp, body
 
     def list_group_users(self, group_id):
         """List users in group."""
-        resp, body = self.get('groups/%s/users' % group_id, self.headers)
+        resp, body = self.get('groups/%s/users' % group_id)
         body = json.loads(body)
         return resp, body['users']
 
     def delete_group_user(self, group_id, user_id):
         """Delete user in group."""
-        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id),
-                                 self.headers)
+        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id))
         return resp, body
 
     def assign_user_role_on_project(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), None,
-                              self.headers)
+                              (project_id, user_id, role_id), None)
         return resp, body
 
     def assign_user_role_on_domain(self, domain_id, user_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/users/%s/roles/%s' %
-                              (domain_id, user_id, role_id), None,
-                              self.headers)
+                              (domain_id, user_id, role_id), None)
         return resp, body
 
     def list_user_roles_on_project(self, project_id, user_id):
@@ -354,15 +343,13 @@
     def assign_group_role_on_project(self, project_id, group_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/groups/%s/roles/%s' %
-                              (project_id, group_id, role_id), None,
-                              self.headers)
+                              (project_id, group_id, role_id), None)
         return resp, body
 
     def assign_group_role_on_domain(self, domain_id, group_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/groups/%s/roles/%s' %
-                              (domain_id, group_id, role_id), None,
-                              self.headers)
+                              (domain_id, group_id, role_id), None)
         return resp, body
 
     def list_group_roles_on_project(self, project_id, group_id):
@@ -404,7 +391,7 @@
             'expires_at': expires_at
         }
         post_body = json.dumps({'trust': post_body})
-        resp, body = self.post('OS-TRUST/trusts', post_body, self.headers)
+        resp, body = self.post('OS-TRUST/trusts', post_body)
         body = json.loads(body)
         return resp, body['trust']
 
@@ -457,11 +444,10 @@
     def __init__(self):
         super(V3TokenClientJSON, self).__init__(None)
         auth_url = CONF.identity.uri_v3
-        # If the v3 url is not set, get it from the v2 one
-        if auth_url is None:
-            auth_url = CONF.identity.uri.replace(urlparse.urlparse(
-                CONF.identity.uri).path, "/v3")
-
+        if not auth_url and CONF.identity_feature_enabled.api_v3:
+            raise exceptions.InvalidConfiguration('you must specify a v3 uri '
+                                                  'if using the v3 identity '
+                                                  'api')
         if 'auth/tokens' not in auth_url:
             auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
@@ -507,11 +493,16 @@
             creds['auth']['scope'] = scope
 
         body = json.dumps(creds)
-        resp, body = self.post(self.auth_url, headers=self.headers, body=body)
+        resp, body = self.post(self.auth_url, body=body)
         return resp, body
 
     def request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
+        if headers is None:
+            # Always accept 'json', for xml token client too.
+            # Because XML response is not easily
+            # converted to the corresponding JSON one
+            headers = self.get_headers(accept_type="json")
         self._log_request(method, url, headers, body)
         resp, resp_body = self.http_obj.request(url, method,
                                                 headers=headers, body=body)
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index c376979..5a3f891 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -36,7 +36,7 @@
             "type": type
         }
         post_body = json.dumps({'policy': post_body})
-        resp, body = self.post('policies', post_body, self.headers)
+        resp, body = self.post('policies', post_body)
         body = json.loads(body)
         return resp, body['policy']
 
@@ -62,8 +62,7 @@
         }
         post_body = json.dumps({'policy': post_body})
         url = 'policies/%s' % policy_id
-        resp, body = self.patch(url, post_body,
-                                self.headers)
+        resp, body = self.patch(url, post_body)
         body = json.loads(body)
         return resp, body['policy']
 
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index 92f7629..c1faebb 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -41,8 +41,7 @@
             'name': name
         }
         patch_body = json.dumps({'service': patch_body})
-        resp, body = self.patch('services/%s' % service_id,
-                                patch_body, self.headers)
+        resp, body = self.patch('services/%s' % service_id, patch_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -52,3 +51,21 @@
         resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['service']
+
+    def create_service(self, serv_type, name=None, description=None,
+                       enabled=True):
+        body_dict = {
+            "name": name,
+            'type': serv_type,
+            'enabled': enabled,
+            "description": description,
+        }
+        body = json.dumps({'service': body_dict})
+        resp, body = self.post("services", body)
+        body = json.loads(body)
+        return resp, body["service"]
+
+    def delete_service(self, serv_id):
+        url = "services/" + serv_id
+        resp, body = self.delete(url)
+        return resp, body
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
index eca86ab..22ed44d 100644
--- a/tempest/services/identity/v3/xml/credentials_client.py
+++ b/tempest/services/identity/v3/xml/credentials_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -29,7 +29,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class CredentialsClientXML(RestClientXML):
+class CredentialsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(CredentialsClientXML, self).__init__(auth_provider)
@@ -61,8 +62,7 @@
         credential = Element('credential', project_id=project_id,
                              type=cred_type, user_id=user_id)
         credential.append(blob)
-        resp, body = self.post('credentials', str(Document(credential)),
-                               self.headers)
+        resp, body = self.post('credentials', str(Document(credential)))
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
@@ -85,27 +85,25 @@
                              type=cred_type, user_id=user_id)
         credential.append(blob)
         resp, body = self.patch('credentials/%s' % credential_id,
-                                str(Document(credential)),
-                                self.headers)
+                                str(Document(credential)))
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
 
     def get_credential(self, credential_id):
         """To GET Details of a credential."""
-        resp, body = self.get('credentials/%s' % credential_id, self.headers)
+        resp, body = self.get('credentials/%s' % credential_id)
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
 
     def list_credentials(self):
         """Lists out all the available credentials."""
-        resp, body = self.get('credentials', self.headers)
+        resp, body = self.get('credentials')
         body = self._parse_creds(etree.fromstring(body))
         return resp, body
 
     def delete_credential(self, credential_id):
         """Deletes a credential."""
-        resp, body = self.delete('credentials/%s' % credential_id,
-                                 self.headers)
+        resp, body = self.delete('credentials/%s' % credential_id)
         return resp, body
diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py
index a20a9f5..a32eede 100644
--- a/tempest/services/identity/v3/xml/endpoints_client.py
+++ b/tempest/services/identity/v3/xml/endpoints_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 
 from tempest.common import http
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class EndPointClientXML(RestClientXML):
+class EndPointClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(EndPointClientXML, self).__init__(auth_provider)
@@ -58,7 +59,7 @@
 
     def list_endpoints(self):
         """Get the list of endpoints."""
-        resp, body = self.get("endpoints", self.headers)
+        resp, body = self.get("endpoints")
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -72,8 +73,7 @@
                                   interface=interface,
                                   url=url, region=region,
                                   enabled=enabled)
-        resp, body = self.post('endpoints', str(Document(create_endpoint)),
-                               self.headers)
+        resp, body = self.post('endpoints', str(Document(create_endpoint)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -94,8 +94,7 @@
             endpoint.add_attr("region", region)
         if enabled is not None:
             endpoint.add_attr("enabled", enabled)
-        resp, body = self.patch('endpoints/%s' % str(endpoint_id),
-                                str(doc), self.headers)
+        resp, body = self.patch('endpoints/%s' % str(endpoint_id), str(doc))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py
index e7b85c1..e8e70d8 100644
--- a/tempest/services/identity/v3/xml/identity_client.py
+++ b/tempest/services/identity/v3/xml/identity_client.py
@@ -14,11 +14,10 @@
 #    under the License.
 
 import json
-import urlparse
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -31,7 +30,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class IdentityV3ClientXML(RestClientXML):
+class IdentityV3ClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(IdentityV3ClientXML, self).__init__(auth_provider)
@@ -98,8 +98,7 @@
                             enabled=str(en).lower(),
                             project_id=project_id,
                             domain_id=domain_id)
-        resp, body = self.post('users', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('users', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -120,32 +119,31 @@
                               description=description,
                               enabled=str(en).lower())
         resp, body = self.patch('users/%s' % user_id,
-                                str(Document(update_user)),
-                                self.headers)
+                                str(Document(update_user)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_user_projects(self, user_id):
         """Lists the projects on which a user has roles assigned."""
-        resp, body = self.get('users/%s/projects' % user_id, self.headers)
+        resp, body = self.get('users/%s/projects' % user_id)
         body = self._parse_projects(etree.fromstring(body))
         return resp, body
 
     def get_users(self):
         """Get the list of users."""
-        resp, body = self.get("users", self.headers)
+        resp, body = self.get("users")
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_user(self, user_id):
         """GET a user."""
-        resp, body = self.get("users/%s" % user_id, self.headers)
+        resp, body = self.get("users/%s" % user_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_user(self, user_id):
         """Deletes a User."""
-        resp, body = self.delete("users/%s" % user_id, self.headers)
+        resp, body = self.delete("users/%s" % user_id)
         return resp, body
 
     def create_project(self, name, **kwargs):
@@ -160,14 +158,13 @@
                             enabled=str(en).lower(),
                             name=name)
         resp, body = self.post('projects',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_projects(self):
         """Get the list of projects."""
-        resp, body = self.get("projects", self.headers)
+        resp, body = self.get("projects")
         body = self._parse_projects(etree.fromstring(body))
         return resp, body
 
@@ -185,14 +182,13 @@
                             enabled=str(en).lower(),
                             domain_id=domain_id)
         resp, body = self.patch('projects/%s' % project_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_project(self, project_id):
         """GET a Project."""
-        resp, body = self.get("projects/%s" % project_id, self.headers)
+        resp, body = self.get("projects/%s" % project_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -206,15 +202,13 @@
         post_body = Element("role",
                             xmlns=XMLNS,
                             name=name)
-        resp, body = self.post('roles',
-                               str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('roles', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_role(self, role_id):
         """GET a Role."""
-        resp, body = self.get('roles/%s' % str(role_id), self.headers)
+        resp, body = self.get('roles/%s' % str(role_id))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -224,21 +218,19 @@
                             xmlns=XMLNS,
                             name=name)
         resp, body = self.patch('roles/%s' % str(role_id),
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_role(self, role_id):
         """Delete a role."""
-        resp, body = self.delete('roles/%s' % str(role_id),
-                                 self.headers)
+        resp, body = self.delete('roles/%s' % str(role_id))
         return resp, body
 
     def assign_user_role(self, project_id, user_id, role_id):
         """Add roles to a user on a tenant."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '', self.headers)
+                              (project_id, user_id, role_id), '')
         return resp, body
 
     def create_domain(self, name, **kwargs):
@@ -250,20 +242,19 @@
                             name=name,
                             description=description,
                             enabled=str(en).lower())
-        resp, body = self.post('domains', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('domains', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_domains(self):
         """Get the list of domains."""
-        resp, body = self.get("domains", self.headers)
+        resp, body = self.get("domains")
         body = self._parse_domains(etree.fromstring(body))
         return resp, body
 
     def delete_domain(self, domain_id):
         """Delete a domain."""
-        resp, body = self.delete('domains/%s' % domain_id, self.headers)
+        resp, body = self.delete('domains/%s' % domain_id)
         return resp, body
 
     def update_domain(self, domain_id, **kwargs):
@@ -278,14 +269,13 @@
                             description=description,
                             enabled=str(en).lower())
         resp, body = self.patch('domains/%s' % domain_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_domain(self, domain_id):
         """Get Domain details."""
-        resp, body = self.get('domains/%s' % domain_id, self.headers)
+        resp, body = self.get('domains/%s' % domain_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -315,14 +305,13 @@
                             description=description,
                             domain_id=domain_id,
                             project_id=project_id)
-        resp, body = self.post('groups', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('groups', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_group(self, group_id):
         """Get group details."""
-        resp, body = self.get('groups/%s' % group_id, self.headers)
+        resp, body = self.get('groups/%s' % group_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -336,124 +325,118 @@
                             name=name,
                             description=description)
         resp, body = self.patch('groups/%s' % group_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_group(self, group_id):
         """Delete a group."""
-        resp, body = self.delete('groups/%s' % group_id, self.headers)
+        resp, body = self.delete('groups/%s' % group_id)
         return resp, body
 
     def add_group_user(self, group_id, user_id):
         """Add user into group."""
-        resp, body = self.put('groups/%s/users/%s' % (group_id, user_id),
-                              '', self.headers)
+        resp, body = self.put('groups/%s/users/%s' % (group_id, user_id), '')
         return resp, body
 
     def list_group_users(self, group_id):
         """List users in group."""
-        resp, body = self.get('groups/%s/users' % group_id, self.headers)
+        resp, body = self.get('groups/%s/users' % group_id)
         body = self._parse_group_users(etree.fromstring(body))
         return resp, body
 
     def delete_group_user(self, group_id, user_id):
         """Delete user in group."""
-        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id),
-                                 self.headers)
+        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id))
         return resp, body
 
     def assign_user_role_on_project(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '',
-                              self.headers)
+                              (project_id, user_id, role_id), '')
         return resp, body
 
     def assign_user_role_on_domain(self, domain_id, user_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/users/%s/roles/%s' %
-                              (domain_id, user_id, role_id), '',
-                              self.headers)
+                              (domain_id, user_id, role_id), '')
         return resp, body
 
     def list_user_roles_on_project(self, project_id, user_id):
         """list roles of a user on a project."""
         resp, body = self.get('projects/%s/users/%s/roles' %
-                              (project_id, user_id), self.headers)
+                              (project_id, user_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def list_user_roles_on_domain(self, domain_id, user_id):
         """list roles of a user on a domain."""
         resp, body = self.get('domains/%s/users/%s/roles' %
-                              (domain_id, user_id), self.headers)
+                              (domain_id, user_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def revoke_role_from_user_on_project(self, project_id, user_id, role_id):
         """Delete role of a user on a project."""
         resp, body = self.delete('projects/%s/users/%s/roles/%s' %
-                                 (project_id, user_id, role_id), self.headers)
+                                 (project_id, user_id, role_id))
         return resp, body
 
     def revoke_role_from_user_on_domain(self, domain_id, user_id, role_id):
         """Delete role of a user on a domain."""
         resp, body = self.delete('domains/%s/users/%s/roles/%s' %
-                                 (domain_id, user_id, role_id), self.headers)
+                                 (domain_id, user_id, role_id))
         return resp, body
 
     def assign_group_role_on_project(self, project_id, group_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/groups/%s/roles/%s' %
-                              (project_id, group_id, role_id), '',
-                              self.headers)
+                              (project_id, group_id, role_id), '')
         return resp, body
 
     def assign_group_role_on_domain(self, domain_id, group_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/groups/%s/roles/%s' %
-                              (domain_id, group_id, role_id), '',
-                              self.headers)
+                              (domain_id, group_id, role_id), '')
         return resp, body
 
     def list_group_roles_on_project(self, project_id, group_id):
         """list roles of a user on a project."""
         resp, body = self.get('projects/%s/groups/%s/roles' %
-                              (project_id, group_id), self.headers)
+                              (project_id, group_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def list_group_roles_on_domain(self, domain_id, group_id):
         """list roles of a user on a domain."""
         resp, body = self.get('domains/%s/groups/%s/roles' %
-                              (domain_id, group_id), self.headers)
+                              (domain_id, group_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def revoke_role_from_group_on_project(self, project_id, group_id, role_id):
         """Delete role of a user on a project."""
         resp, body = self.delete('projects/%s/groups/%s/roles/%s' %
-                                 (project_id, group_id, role_id), self.headers)
+                                 (project_id, group_id, role_id))
         return resp, body
 
     def revoke_role_from_group_on_domain(self, domain_id, group_id, role_id):
         """Delete role of a user on a domain."""
         resp, body = self.delete('domains/%s/groups/%s/roles/%s' %
-                                 (domain_id, group_id, role_id), self.headers)
+                                 (domain_id, group_id, role_id))
         return resp, body
 
 
-class V3TokenClientXML(RestClientXML):
+class V3TokenClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self):
         super(V3TokenClientXML, self).__init__(None)
         auth_url = CONF.identity.uri_v3
-        # If the v3 url is not set, get it from the v2 one
-        if auth_url is None:
-            auth_url = CONF.identity.uri.replace(urlparse.urlparse(
-                CONF.identity.uri).path, "/v3")
+        if not auth_url and CONF.identity_feature_enabled.api_v3:
+            raise exceptions.InvalidConfiguration('you must specify a v3 uri '
+                                                  'if using the v3 identity '
+                                                  'api')
         if 'auth/tokens' not in auth_url:
             auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
@@ -501,15 +484,16 @@
             scope.append(project)
             auth.append(scope)
 
-        resp, body = self.post(self.auth_url, headers=self.headers,
-                               body=str(Document(auth)))
+        resp, body = self.post(self.auth_url, body=str(Document(auth)))
         return resp, body
 
     def request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
-        # Send XML, accept JSON. XML response is not easily
-        # converted to the corresponding JSON one
-        headers['Accept'] = 'application/json'
+        if headers is None:
+            # Always accept 'json', for xml token client too.
+            # Because XML response is not easily
+            # converted to the corresponding JSON one
+            headers = self.get_headers(accept_type="json")
         self._log_request(method, url, headers, body)
         resp, resp_body = self.http_obj.request(url, method,
                                                 headers=headers, body=body)
diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py
index 429c6a4..c12018a 100644
--- a/tempest/services/identity/v3/xml/policy_client.py
+++ b/tempest/services/identity/v3/xml/policy_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 
 from tempest.common import http
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class PolicyClientXML(RestClientXML):
+class PolicyClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(PolicyClientXML, self).__init__(auth_provider)
@@ -59,21 +60,20 @@
     def create_policy(self, blob, type):
         """Creates a Policy."""
         create_policy = Element("policy", xmlns=XMLNS, blob=blob, type=type)
-        resp, body = self.post('policies', str(Document(create_policy)),
-                               self.headers)
+        resp, body = self.post('policies', str(Document(create_policy)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_policies(self):
         """Lists the policies."""
-        resp, body = self.get('policies', self.headers)
+        resp, body = self.get('policies')
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_policy(self, policy_id):
         """Lists out the given policy."""
         url = 'policies/%s' % policy_id
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -83,8 +83,7 @@
         type = kwargs.get('type')
         update_policy = Element("policy", xmlns=XMLNS, type=type)
         url = 'policies/%s' % policy_id
-        resp, body = self.patch(url, str(Document(update_policy)),
-                                self.headers)
+        resp, body = self.patch(url, str(Document(update_policy)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py
index df9b234..d5476c4 100644
--- a/tempest/services/identity/v3/xml/service_client.py
+++ b/tempest/services/identity/v3/xml/service_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -26,7 +26,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class ServiceClientXML(RestClientXML):
+class ServiceClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServiceClientXML, self).__init__(auth_provider)
@@ -57,14 +58,28 @@
                                  description=description,
                                  type=type)
         resp, body = self.patch('services/%s' % service_id,
-                                str(Document(update_service)),
-                                self.headers)
+                                str(Document(update_service)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_service(self, service_id):
         """Get Service."""
         url = 'services/%s' % service_id
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
+
+    def create_service(self, serv_type, name=None, description=None):
+        post_body = Element("service",
+                            xmlns=XMLNS,
+                            name=name,
+                            description=description,
+                            type=serv_type)
+        resp, body = self.post("services", str(Document(post_body)))
+        body = self._parse_body(etree.fromstring(body))
+        return resp, body
+
+    def delete_service(self, serv_id):
+        url = "services/" + serv_id
+        resp, body = self.delete(url)
+        return resp, body
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
index 7c36680..50403fb 100644
--- a/tempest/services/identity/xml/identity_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -12,58 +12,24 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
-
-import json
-
-from lxml import etree
-
-from tempest.common.rest_client import RestClientXML
 from tempest import config
-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 xml_to_json
+from tempest.services.compute.xml import common as xml
+from tempest.services.identity.json import identity_client
 
 CONF = config.CONF
 
 XMLNS = "http://docs.openstack.org/identity/api/v2.0"
 
 
-class IdentityClientXML(RestClientXML):
-
-    def __init__(self, auth_provider):
-        super(IdentityClientXML, self).__init__(auth_provider)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(xml_to_json(child))
-        return array
-
-    def _parse_body(self, body):
-        data = xml_to_json(body)
-        return data
-
-    def has_admin_extensions(self):
-        """
-        Returns True if the KSADM Admin Extensions are supported
-        False otherwise
-        """
-        if hasattr(self, '_has_admin_extensions'):
-            return self._has_admin_extensions
-        resp, body = self.list_roles()
-        self._has_admin_extensions = ('status' in resp and resp.status != 503)
-        return self._has_admin_extensions
+class IdentityClientXML(identity_client.IdentityClientJSON):
+    TYPE = "xml"
 
     def create_role(self, name):
         """Create a role."""
-        create_role = Element("role", xmlns=XMLNS, name=name)
-        resp, body = self.post('OS-KSADM/roles', str(Document(create_role)),
-                               self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
+        create_role = xml.Element("role", xmlns=XMLNS, name=name)
+        resp, body = self.post('OS-KSADM/roles',
+                               str(xml.Document(create_role)))
+        return resp, self._parse_resp(body)
 
     def create_tenant(self, name, **kwargs):
         """
@@ -73,70 +39,18 @@
         enabled <true|false>: Initial tenant status (default is true)
         """
         en = kwargs.get('enabled', 'true')
-        create_tenant = Element("tenant",
-                                xmlns=XMLNS,
-                                name=name,
-                                description=kwargs.get('description', ''),
-                                enabled=str(en).lower())
-        resp, body = self.post('tenants', str(Document(create_tenant)),
-                               self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_role(self, role_id):
-        """Delete a role."""
-        resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id),
-                                 self.headers)
-        return resp, body
-
-    def list_user_roles(self, tenant_id, user_id):
-        """Returns a list of roles assigned to a user for a tenant."""
-        url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
-        resp, body = self.get(url, self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def assign_user_role(self, tenant_id, user_id, role_id):
-        """Add roles to a user on a tenant."""
-        resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
-                              (tenant_id, user_id, role_id), '', self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def remove_user_role(self, tenant_id, user_id, role_id):
-        """Removes a role assignment for a user on a tenant."""
-        return self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
-                           (tenant_id, user_id, role_id), self.headers)
-
-    def delete_tenant(self, tenant_id):
-        """Delete a tenant."""
-        resp, body = self.delete('tenants/%s' % str(tenant_id), self.headers)
-        return resp, body
-
-    def get_tenant(self, tenant_id):
-        """Get tenant details."""
-        resp, body = self.get('tenants/%s' % str(tenant_id), self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_roles(self):
-        """Returns roles."""
-        resp, body = self.get('OS-KSADM/roles', self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
+        create_tenant = xml.Element("tenant",
+                                    xmlns=XMLNS,
+                                    name=name,
+                                    description=kwargs.get('description', ''),
+                                    enabled=str(en).lower())
+        resp, body = self.post('tenants', str(xml.Document(create_tenant)))
+        return resp, self._parse_resp(body)
 
     def list_tenants(self):
         """Returns tenants."""
-        resp, body = self.get('tenants', self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_tenant_by_name(self, tenant_name):
-        resp, tenants = self.list_tenants()
-        for tenant in tenants:
-            if tenant['name'] == tenant_name:
-                return tenant
-        raise exceptions.NotFound('No such tenant')
+        resp, body = self.get('tenants')
+        return resp, self._parse_resp(body)
 
     def update_tenant(self, tenant_id, **kwargs):
         """Updates a tenant."""
@@ -144,173 +58,69 @@
         name = kwargs.get('name', body['name'])
         desc = kwargs.get('description', body['description'])
         en = kwargs.get('enabled', body['enabled'])
-        update_tenant = Element("tenant",
-                                xmlns=XMLNS,
-                                id=tenant_id,
-                                name=name,
-                                description=desc,
-                                enabled=str(en).lower())
+        update_tenant = xml.Element("tenant",
+                                    xmlns=XMLNS,
+                                    id=tenant_id,
+                                    name=name,
+                                    description=desc,
+                                    enabled=str(en).lower())
 
         resp, body = self.post('tenants/%s' % tenant_id,
-                               str(Document(update_tenant)),
-                               self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
+                               str(xml.Document(update_tenant)))
+        return resp, self._parse_resp(body)
 
     def create_user(self, name, password, tenant_id, email, **kwargs):
         """Create a user."""
-        create_user = Element("user",
-                              xmlns=XMLNS,
-                              name=name,
-                              password=password,
-                              tenantId=tenant_id,
-                              email=email)
+        create_user = xml.Element("user",
+                                  xmlns=XMLNS,
+                                  name=name,
+                                  password=password,
+                                  tenantId=tenant_id,
+                                  email=email)
         if 'enabled' in kwargs:
             create_user.add_attr('enabled', str(kwargs['enabled']).lower())
 
-        resp, body = self.post('users', str(Document(create_user)),
-                               self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
+        resp, body = self.post('users', str(xml.Document(create_user)))
+        return resp, self._parse_resp(body)
 
     def update_user(self, user_id, **kwargs):
         """Updates a user."""
         if 'enabled' in kwargs:
             kwargs['enabled'] = str(kwargs['enabled']).lower()
-        update_user = Element("user", xmlns=XMLNS, **kwargs)
+        update_user = xml.Element("user", xmlns=XMLNS, **kwargs)
 
         resp, body = self.put('users/%s' % user_id,
-                              str(Document(update_user)),
-                              self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def get_user(self, user_id):
-        """GET a user."""
-        resp, body = self.get("users/%s" % user_id, self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_user(self, user_id):
-        """Delete a user."""
-        resp, body = self.delete("users/%s" % user_id, self.headers)
-        return resp, body
-
-    def get_users(self):
-        """Get the list of users."""
-        resp, body = self.get("users", self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
+                              str(xml.Document(update_user)))
+        return resp, self._parse_resp(body)
 
     def enable_disable_user(self, user_id, enabled):
         """Enables or disables a user."""
-        enable_user = Element("user", enabled=str(enabled).lower())
+        enable_user = xml.Element("user", enabled=str(enabled).lower())
         resp, body = self.put('users/%s/enabled' % user_id,
-                              str(Document(enable_user)), self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
+                              str(xml.Document(enable_user)))
+        return resp, self._parse_resp(body)
 
-    def delete_token(self, token_id):
-        """Delete a token."""
-        resp, body = self.delete("tokens/%s" % token_id, self.headers)
-        return resp, body
-
-    def list_users_for_tenant(self, tenant_id):
-        """List users for a Tenant."""
-        resp, body = self.get('/tenants/%s/users' % tenant_id, self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_user_by_username(self, tenant_id, username):
-        resp, users = self.list_users_for_tenant(tenant_id)
-        for user in users:
-            if user['name'] == username:
-                return user
-        raise exceptions.NotFound('No such user')
-
-    def create_service(self, name, type, **kwargs):
+    def create_service(self, name, service_type, **kwargs):
         """Create a service."""
         OS_KSADM = "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
-        create_service = Element("service",
-                                 xmlns=OS_KSADM,
-                                 name=name,
-                                 type=type,
-                                 description=kwargs.get('description'))
+        create_service = xml.Element("service",
+                                     xmlns=OS_KSADM,
+                                     name=name,
+                                     type=service_type,
+                                     description=kwargs.get('description'))
         resp, body = self.post('OS-KSADM/services',
-                               str(Document(create_service)),
-                               self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def list_services(self):
-        """Returns services."""
-        resp, body = self.get('OS-KSADM/services', self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, body
-
-    def get_service(self, service_id):
-        """Get Service."""
-        url = '/OS-KSADM/services/%s' % service_id
-        resp, body = self.get(url, self.headers)
-        body = self._parse_body(etree.fromstring(body))
-        return resp, body
-
-    def delete_service(self, service_id):
-        """Delete Service."""
-        url = '/OS-KSADM/services/%s' % service_id
-        return self.delete(url, self.headers)
+                               str(xml.Document(create_service)))
+        return resp, self._parse_resp(body)
 
 
-class TokenClientXML(RestClientXML):
-
-    def __init__(self):
-        super(TokenClientXML, self).__init__(None)
-        auth_url = CONF.identity.uri
-
-        # Normalize URI to ensure /tokens is in it.
-        if 'tokens' not in auth_url:
-            auth_url = auth_url.rstrip('/') + '/tokens'
-
-        self.auth_url = auth_url
+class TokenClientXML(identity_client.TokenClientJSON):
+    TYPE = "xml"
 
     def auth(self, user, password, tenant):
-        passwordCreds = Element("passwordCredentials",
-                                username=user,
-                                password=password)
-        auth = Element("auth", tenantName=tenant)
+        passwordCreds = xml.Element("passwordCredentials",
+                                    username=user,
+                                    password=password)
+        auth = xml.Element("auth", tenantName=tenant)
         auth.append(passwordCreds)
-        resp, body = self.post(self.auth_url, headers=self.headers,
-                               body=str(Document(auth)))
+        resp, body = self.post(self.auth_url, body=str(xml.Document(auth)))
         return resp, body['access']
-
-    def request(self, method, url, headers=None, body=None):
-        """A simple HTTP request interface."""
-        if headers is None:
-            headers = {}
-        # Send XML, accept JSON. XML response is not easily
-        # converted to the corresponding JSON one
-        headers['Accept'] = 'application/json'
-        self._log_request(method, url, headers, body)
-        resp, resp_body = self.http_obj.request(url, method,
-                                                headers=headers, body=body)
-        self._log_response(resp, resp_body)
-
-        if resp.status in [401, 403]:
-            resp_body = json.loads(resp_body)
-            raise exceptions.Unauthorized(resp_body['error']['message'])
-        elif resp.status not in [200, 201]:
-            raise exceptions.IdentityError(
-                'Unexpected status code {0}'.format(resp.status))
-
-        return resp, json.loads(resp_body)
-
-    def get_token(self, user, password, tenant, auth_data=False):
-        """
-        Returns (token id, token data) for supplied credentials
-        """
-        resp, body = self.auth(user, password, tenant)
-
-        if auth_data:
-            return body['token']['id'], body
-        else:
-            return body['token']['id']
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index bc9db38..932fa14 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -157,7 +157,7 @@
         return resp, body['image']
 
     def update_image(self, image_id, name=None, container_format=None,
-                     data=None):
+                     data=None, properties=None):
         params = {}
         headers = {}
         if name is not None:
@@ -166,6 +166,9 @@
         if container_format is not None:
             params['container_format'] = container_format
 
+        if properties is not None:
+            params['properties'] = properties
+
         headers.update(self._image_meta_to_headers(params))
 
         if data is not None:
@@ -190,7 +193,8 @@
         body = json.loads(body)
         return resp, body['images']
 
-    def image_list_detail(self, properties=dict(), **kwargs):
+    def image_list_detail(self, properties=dict(), changes_since=None,
+                          **kwargs):
         url = 'v1/images/detail'
 
         params = {}
@@ -199,6 +203,9 @@
 
         kwargs.update(params)
 
+        if changes_since is not None:
+            kwargs['changes-since'] = changes_since
+
         if len(kwargs) > 0:
             url += '?%s' % urllib.urlencode(kwargs)
 
@@ -241,7 +248,7 @@
         body = None
         if can_share:
             body = json.dumps({'member': {'can_share': True}})
-        resp, __ = self.put(url, body, self.headers)
+        resp, __ = self.put(url, body)
         return resp
 
     def delete_member(self, member_id, image_id):
@@ -252,7 +259,7 @@
     def replace_membership_list(self, image_id, member_list):
         url = 'v1/images/%s/members' % image_id
         body = json.dumps({'membership': member_list})
-        resp, data = self.put(url, body, self.headers)
+        resp, data = self.put(url, body)
         data = json.loads(data)
         return resp, data
 
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index b825519..58819d0 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -86,7 +86,7 @@
         data = json.dumps(params)
         self._validate_schema(data)
 
-        resp, body = self.post('v2/images', data, self.headers)
+        resp, body = self.post('v2/images', data)
         body = json.loads(body)
         return resp, body
 
@@ -132,7 +132,7 @@
 
     def add_image_tag(self, image_id, tag):
         url = 'v2/images/%s/tags/%s' % (image_id, tag)
-        resp, body = self.put(url, body=None, headers=self.headers)
+        resp, body = self.put(url, body=None)
         return resp, body
 
     def delete_image_tag(self, image_id, tag):
@@ -150,7 +150,7 @@
     def add_member(self, image_id, member_id):
         url = 'v2/images/%s/members' % image_id
         data = json.dumps({'member': member_id})
-        resp, body = self.post(url, data, self.headers)
+        resp, body = self.post(url, data)
         body = json.loads(body)
         self.expected_success(200, resp)
         return resp, body
@@ -159,7 +159,7 @@
         """Valid status are: ``pending``, ``accepted``,  ``rejected``."""
         url = 'v2/images/%s/members/%s' % (image_id, member_id)
         data = json.dumps({'status': status})
-        resp, body = self.put(url, data, self.headers)
+        resp, body = self.put(url, data)
         body = json.loads(body)
         self.expected_success(200, resp)
         return resp, body
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 1458c7b..81dbfbc 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -193,34 +193,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
-        post_body = {
-            "vip": {
-                "protocol": protocol,
-                "name": name,
-                "subnet_id": subnet_id,
-                "pool_id": pool_id,
-                "protocol_port": protocol_port
-            }
-        }
-        body = json.dumps(post_body)
-        uri = '%s/lb/vips' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_vip(self, vip_id, new_name):
-        put_body = {
-            "vip": {
-                "name": new_name,
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/lb/vips/%s' % (self.uri_prefix, vip_id)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def create_member(self, address, protocol_port, pool_id):
         post_body = {
             "member": {
@@ -247,33 +219,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_health_monitor(self, delay, max_retries, Type, timeout):
-        post_body = {
-            "health_monitor": {
-                "delay": delay,
-                "max_retries": max_retries,
-                "type": Type,
-                "timeout": timeout
-            }
-        }
-        body = json.dumps(post_body)
-        uri = '%s/lb/health_monitors' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_health_monitor(self, admin_state_up, uuid):
-        put_body = {
-            "health_monitor": {
-                "admin_state_up": admin_state_up
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/lb/health_monitors/%s' % (self.uri_prefix, uuid)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def associate_health_monitor_with_pool(self, health_monitor_id,
                                            pool_id):
         post_body = {
@@ -340,6 +285,19 @@
         body = json.loads(body)
         return resp, body
 
+    def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
+        uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
+
+    def show_lbaas_agent_hosting_pool(self, pool_id):
+        uri = ('%s/lb/pools/%s/loadbalancer-agent' %
+               (self.uri_prefix, pool_id))
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
+
     def list_routers_on_l3_agent(self, agent_id):
         uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
         resp, body = self.get(uri)
@@ -417,3 +375,9 @@
         resp, body = self.put(uri, body)
         body = json.loads(body)
         return resp, body
+
+    def list_lb_pool_stats(self, pool_id):
+        uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index 96b9b1d..f1bf548 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -27,7 +27,9 @@
     'health_monitors': 'lb',
     'members': 'lb',
     'vpnservices': 'vpn',
-    'ikepolicies': 'vpn'
+    'ikepolicies': 'vpn',
+    'metering_labels': 'metering',
+    'metering_label_rules': 'metering'
 }
 
 # The following list represents resource names that do not require
@@ -57,19 +59,15 @@
         raise NotImplementedError
 
     def post(self, uri, body, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.post(uri, body, headers)
 
     def put(self, uri, body, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.put(uri, body, headers)
 
     def get(self, uri, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.get(uri, headers)
 
     def delete(self, uri, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.delete(uri, headers)
 
     def deserialize_list(self, body):
@@ -115,9 +113,14 @@
         return _delete
 
     def _shower(self, resource_name):
-        def _show(resource_id):
+        def _show(resource_id, field_list=[]):
+            # field_list is a sequence of two-element tuples, with the
+            # first element being 'fields'. An example:
+            # [('fields', 'id'), ('fields', 'name')]
             plural = self.pluralize(resource_name)
             uri = '%s/%s' % (self.get_uri(plural), resource_id)
+            if field_list:
+                uri += '?' + urllib.urlencode(field_list)
             resp, body = self.get(uri)
             body = self.deserialize_single(body)
             return resp, body
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
index 720c842..25e6edb 100644
--- a/tempest/services/network/xml/network_client.py
+++ b/tempest/services/network/xml/network_client.py
@@ -13,32 +13,31 @@
 from lxml import etree
 import xml.etree.ElementTree as ET
 
-from tempest.common.rest_client import RestClientXML
-from tempest.services.compute.xml.common import deep_dict_to_xml
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import parse_array
-from tempest.services.compute.xml.common import xml_to_json
+from tempest.common import rest_client
+from tempest.services.compute.xml import common
 from tempest.services.network import network_client_base as client_base
 
 
 class NetworkClientXML(client_base.NetworkClientBase):
+    TYPE = "xml"
 
     # list of plurals used for xml serialization
     PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools',
-               'fixed_ips', 'extensions']
+               'fixed_ips', 'extensions', 'extra_dhcp_opts']
 
     def get_rest_client(self, auth_provider):
-        return RestClientXML(auth_provider)
+        rc = rest_client.RestClient(auth_provider)
+        rc.TYPE = self.TYPE
+        return rc
 
     def _parse_array(self, node):
         array = []
         for child in node.getchildren():
-            array.append(xml_to_json(child))
+            array.append(common.xml_to_json(child))
         return array
 
     def deserialize_list(self, body):
-        return parse_array(etree.fromstring(body), self.PLURALS)
+        return common.parse_array(etree.fromstring(body), self.PLURALS)
 
     def deserialize_single(self, body):
         return _root_tag_fetcher_and_xml_to_json_parse(body)
@@ -47,129 +46,91 @@
         #TODO(enikanorov): implement better json to xml conversion
         # expecting the dict with single key
         root = body.keys()[0]
-        post_body = Element(root)
+        post_body = common.Element(root)
         post_body.add_attr('xmlns:xsi',
                            'http://www.w3.org/2001/XMLSchema-instance')
         for name, attr in body[root].items():
             elt = self._get_element(name, attr)
             post_body.append(elt)
-        return str(Document(post_body))
+        return str(common.Document(post_body))
 
     def serialize_list(self, body, root_name=None, item_name=None):
         # expecting dict in form
         # body = {'resources': [res_dict1, res_dict2, ...]
-        post_body = Element(root_name)
+        post_body = common.Element(root_name)
         post_body.add_attr('xmlns:xsi',
                            'http://www.w3.org/2001/XMLSchema-instance')
         for item in body[body.keys()[0]]:
-            elt = Element(item_name)
+            elt = common.Element(item_name)
             for name, attr in item.items():
                 elt_content = self._get_element(name, attr)
                 elt.append(elt_content)
             post_body.append(elt)
-        return str(Document(post_body))
+        return str(common.Document(post_body))
 
     def _get_element(self, name, value):
         if value is None:
-            xml_elem = Element(name)
+            xml_elem = common.Element(name)
             xml_elem.add_attr("xsi:nil", "true")
             return xml_elem
+        elif isinstance(value, dict):
+            dict_element = common.Element(name)
+            for key, value in value.iteritems():
+                elem = self._get_element(key, value)
+                dict_element.append(elem)
+            return dict_element
+        elif isinstance(value, list):
+            list_element = common.Element(name)
+            for element in value:
+                elem = self._get_element(name[:-1], element)
+                list_element.append(elem)
+            return list_element
         else:
-            return Element(name, value)
+            return common.Element(name, value)
 
     def create_security_group(self, name):
         uri = '%s/security-groups' % (self.uri_prefix)
-        post_body = Element("security_group")
-        p2 = Element("name", name)
+        post_body = common.Element("security_group")
+        p2 = common.Element("name", name)
         post_body.append(p2)
-        resp, body = self.post(uri, str(Document(post_body)))
+        resp, body = self.post(uri, str(common.Document(post_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def create_security_group_rule(self, secgroup_id,
                                    direction='ingress', **kwargs):
         uri = '%s/security-group-rules' % (self.uri_prefix)
-        rule = Element("security_group_rule")
-        p1 = Element('security_group_id', secgroup_id)
-        p2 = Element('direction', direction)
+        rule = common.Element("security_group_rule")
+        p1 = common.Element('security_group_id', secgroup_id)
+        p2 = common.Element('direction', direction)
         rule.append(p1)
         rule.append(p2)
         for key, val in kwargs.items():
-            key = Element(key, val)
+            key = common.Element(key, val)
             rule.append(key)
-        resp, body = self.post(uri, str(Document(rule)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
-        uri = '%s/lb/vips' % (self.uri_prefix)
-        post_body = Element("vip")
-        p1 = Element("name", name)
-        p2 = Element("protocol", protocol)
-        p3 = Element("protocol_port", protocol_port)
-        p4 = Element("subnet_id", subnet_id)
-        p5 = Element("pool_id", pool_id)
-        post_body.append(p1)
-        post_body.append(p2)
-        post_body.append(p3)
-        post_body.append(p4)
-        post_body.append(p5)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_vip(self, vip_id, new_name):
-        uri = '%s/lb/vips/%s' % (self.uri_prefix, str(vip_id))
-        put_body = Element("vip")
-        p2 = Element("name", new_name)
-        put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
+        resp, body = self.post(uri, str(common.Document(rule)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def create_member(self, address, protocol_port, pool_id):
         uri = '%s/lb/members' % (self.uri_prefix)
-        post_body = Element("member")
-        p1 = Element("address", address)
-        p2 = Element("protocol_port", protocol_port)
-        p3 = Element("pool_id", pool_id)
+        post_body = common.Element("member")
+        p1 = common.Element("address", address)
+        p2 = common.Element("protocol_port", protocol_port)
+        p3 = common.Element("pool_id", pool_id)
         post_body.append(p1)
         post_body.append(p2)
         post_body.append(p3)
-        resp, body = self.post(uri, str(Document(post_body)))
+        resp, body = self.post(uri, str(common.Document(post_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_member(self, admin_state_up, member_id):
         uri = '%s/lb/members/%s' % (self.uri_prefix, str(member_id))
-        put_body = Element("member")
-        p2 = Element("admin_state_up", admin_state_up)
+        put_body = common.Element("member")
+        p2 = common.Element("admin_state_up", admin_state_up)
         put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_health_monitor(self, delay, max_retries, Type, timeout):
-        uri = '%s/lb/health_monitors' % (self.uri_prefix)
-        post_body = Element("health_monitor")
-        p1 = Element("delay", delay)
-        p2 = Element("max_retries", max_retries)
-        p3 = Element("type", Type)
-        p4 = Element("timeout", timeout)
-        post_body.append(p1)
-        post_body.append(p2)
-        post_body.append(p3)
-        post_body.append(p4)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_health_monitor(self, admin_state_up, uuid):
-        uri = '%s/lb/health_monitors/%s' % (self.uri_prefix, str(uuid))
-        put_body = Element("health_monitor")
-        p2 = Element("admin_state_up", admin_state_up)
-        put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
+        resp, body = self.put(uri, str(common.Document(put_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -177,10 +138,10 @@
                                            pool_id):
         uri = '%s/lb/pools/%s/health_monitors' % (self.uri_prefix,
                                                   pool_id)
-        post_body = Element("health_monitor")
-        p1 = Element("id", health_monitor_id,)
+        post_body = common.Element("health_monitor")
+        p1 = common.Element("id", health_monitor_id,)
         post_body.append(p1)
-        resp, body = self.post(uri, str(Document(post_body)))
+        resp, body = self.post(uri, str(common.Document(post_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -198,94 +159,109 @@
 
     def create_router(self, name, **kwargs):
         uri = '%s/routers' % (self.uri_prefix)
-        router = Element("router")
-        router.append(Element("name", name))
-        deep_dict_to_xml(router, kwargs)
-        resp, body = self.post(uri, str(Document(router)))
+        router = common.Element("router")
+        router.append(common.Element("name", name))
+        common.deep_dict_to_xml(router, kwargs)
+        resp, body = self.post(uri, str(common.Document(router)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_router(self, router_id, **kwargs):
         uri = '%s/routers/%s' % (self.uri_prefix, router_id)
-        router = Element("router")
+        router = common.Element("router")
         for element, content in kwargs.iteritems():
-            router.append(Element(element, content))
-        resp, body = self.put(uri, str(Document(router)))
+            router.append(common.Element(element, content))
+        resp, body = self.put(uri, str(common.Document(router)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def add_router_interface_with_subnet_id(self, router_id, subnet_id):
         uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
               router_id)
-        subnet = Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(Document(subnet)))
+        subnet = common.Element("subnet_id", subnet_id)
+        resp, body = self.put(uri, str(common.Document(subnet)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def add_router_interface_with_port_id(self, router_id, port_id):
         uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
               router_id)
-        port = Element("port_id", port_id)
-        resp, body = self.put(uri, str(Document(port)))
+        port = common.Element("port_id", port_id)
+        resp, body = self.put(uri, str(common.Document(port)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def remove_router_interface_with_subnet_id(self, router_id, subnet_id):
         uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
               router_id)
-        subnet = Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(Document(subnet)))
+        subnet = common.Element("subnet_id", subnet_id)
+        resp, body = self.put(uri, str(common.Document(subnet)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def remove_router_interface_with_port_id(self, router_id, port_id):
         uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
               router_id)
-        port = Element("port_id", port_id)
-        resp, body = self.put(uri, str(Document(port)))
+        port = common.Element("port_id", port_id)
+        resp, body = self.put(uri, str(common.Document(port)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def create_floating_ip(self, ext_network_id, **kwargs):
         uri = '%s/floatingips' % (self.uri_prefix)
-        floatingip = Element('floatingip')
-        floatingip.append(Element("floating_network_id", ext_network_id))
+        floatingip = common.Element('floatingip')
+        floatingip.append(common.Element("floating_network_id",
+                                         ext_network_id))
         for element, content in kwargs.iteritems():
-            floatingip.append(Element(element, content))
-        resp, body = self.post(uri, str(Document(floatingip)))
+            floatingip.append(common.Element(element, content))
+        resp, body = self.post(uri, str(common.Document(floatingip)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_floating_ip(self, floating_ip_id, **kwargs):
         uri = '%s/floatingips/%s' % (self.uri_prefix, floating_ip_id)
-        floatingip = Element('floatingip')
+        floatingip = common.Element('floatingip')
         floatingip.add_attr('xmlns:xsi',
                             'http://www.w3.org/2001/XMLSchema-instance')
         for element, content in kwargs.iteritems():
             if content is None:
-                xml_elem = Element(element)
+                xml_elem = common.Element(element)
                 xml_elem.add_attr("xsi:nil", "true")
                 floatingip.append(xml_elem)
             else:
-                floatingip.append(Element(element, content))
-        resp, body = self.put(uri, str(Document(floatingip)))
+                floatingip.append(common.Element(element, content))
+        resp, body = self.put(uri, str(common.Document(floatingip)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def list_router_interfaces(self, uuid):
         uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
         resp, body = self.get(uri)
-        ports = parse_array(etree.fromstring(body), self.PLURALS)
+        ports = common.parse_array(etree.fromstring(body), self.PLURALS)
         ports = {"ports": ports}
         return resp, ports
 
     def update_agent(self, agent_id, agent_info):
         uri = '%s/agents/%s' % (self.uri_prefix, agent_id)
-        agent = Element('agent')
+        agent = common.Element('agent')
         for (key, value) in agent_info.items():
-            p = Element(key, value)
+            p = common.Element(key, value)
             agent.append(p)
-        resp, body = self.put(uri, str(Document(agent)))
+        resp, body = self.put(uri, str(common.Document(agent)))
+        body = _root_tag_fetcher_and_xml_to_json_parse(body)
+        return resp, body
+
+    def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
+        uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
+        resp, body = self.get(uri)
+        pools = common.parse_array(etree.fromstring(body))
+        body = {'pools': pools}
+        return resp, body
+
+    def show_lbaas_agent_hosting_pool(self, pool_id):
+        uri = ('%s/lb/pools/%s/loadbalancer-agent' %
+               (self.uri_prefix, pool_id))
+        resp, body = self.get(uri)
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -304,14 +280,14 @@
     def list_dhcp_agent_hosting_network(self, network_id):
         uri = '%s/networks/%s/dhcp-agents' % (self.uri_prefix, network_id)
         resp, body = self.get(uri)
-        agents = parse_array(etree.fromstring(body))
+        agents = common.parse_array(etree.fromstring(body))
         body = {'agents': agents}
         return resp, body
 
     def list_networks_hosted_by_one_dhcp_agent(self, agent_id):
         uri = '%s/agents/%s/dhcp-networks' % (self.uri_prefix, agent_id)
         resp, body = self.get(uri)
-        networks = parse_array(etree.fromstring(body))
+        networks = common.parse_array(etree.fromstring(body))
         body = {'networks': networks}
         return resp, body
 
@@ -321,14 +297,20 @@
         resp, body = self.delete(uri)
         return resp, body
 
+    def list_lb_pool_stats(self, pool_id):
+        uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
+        resp, body = self.get(uri)
+        body = _root_tag_fetcher_and_xml_to_json_parse(body)
+        return resp, body
+
 
 def _root_tag_fetcher_and_xml_to_json_parse(xml_returned_body):
     body = ET.fromstring(xml_returned_body)
     root_tag = body.tag
     if root_tag.startswith("{"):
         ns, root_tag = root_tag.split("}", 1)
-    body = xml_to_json(etree.fromstring(xml_returned_body),
-                       NetworkClientXML.PLURALS)
+    body = common.xml_to_json(etree.fromstring(xml_returned_body),
+                              NetworkClientXML.PLURALS)
     nil = '{http://www.w3.org/2001/XMLSchema-instance}nil'
     for key, val in body.iteritems():
         if isinstance(val, dict):
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index e9208b7..efac5f5 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -58,7 +58,7 @@
                 url += 'bulk-delete&'
             url = '?%s%s' % (url, urllib.urlencode(params))
 
-        resp, body = self.delete(url, headers=None, body=data)
+        resp, body = self.delete(url, headers={}, body=data)
         return resp, body
 
     def list_account_metadata(self):
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index 95b428b..f224407 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -181,7 +181,7 @@
             url += '?'
             url += '&%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url)
+        resp, body = self.get(url, headers={})
         if params and params.get('format') == 'json':
             body = json.loads(body)
         elif params and params.get('format') == 'xml':
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index ca4f1c1..09e484e 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -32,7 +32,7 @@
     def create_object(self, container, object_name, data, params=None):
         """Create storage object."""
 
-        headers = dict(self.headers)
+        headers = self.get_headers()
         if not data:
             headers['content-length'] = '0'
         url = "%s/%s" % (str(container), str(object_name))
@@ -51,7 +51,7 @@
         url = "%s/%s" % (str(container), str(object_name))
         if params:
             url += '?%s' % urllib.urlencode(params)
-        resp, body = self.delete(url)
+        resp, body = self.delete(url, headers={})
         return resp, body
 
     def update_object_metadata(self, container, object_name, metadata,
@@ -131,7 +131,7 @@
     def create_object_segments(self, container, object_name, segment, data):
         """Creates object segments."""
         url = "{0}/{1}/{2}".format(container, object_name, segment)
-        resp, body = self.put(url, data, self.headers)
+        resp, body = self.put(url, data)
         return resp, body
 
 
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index b70b2e8..113003c 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -90,7 +90,7 @@
 
         # Password must be provided on stack create so that heat
         # can perform future operations on behalf of the user
-        headers = dict(self.headers)
+        headers = self.get_headers()
         headers['X-Auth-Key'] = self.password
         headers['X-Auth-User'] = self.user
         return headers, body
@@ -106,14 +106,14 @@
         """Suspend a stack."""
         url = 'stacks/%s/actions' % stack_identifier
         body = {'suspend': None}
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
 
     def resume_stack(self, stack_identifier):
         """Resume a stack."""
         url = 'stacks/%s/actions' % stack_identifier
         body = {'resume': None}
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
 
     def list_resources(self, stack_identifier):
@@ -232,7 +232,7 @@
     def _validate_template(self, post_body):
         """Returns the validation request result."""
         post_body = json.dumps(post_body)
-        resp, body = self.post('validate', post_body, self.headers)
+        resp, body = self.post('validate', post_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index 747d7c1..e666475 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -29,10 +29,6 @@
     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,
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
index 200c94a..610f07b 100644
--- a/tempest/services/telemetry/telemetry_client_base.py
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -38,7 +38,6 @@
     def __init__(self, auth_provider):
         self.rest_client = self.get_rest_client(auth_provider)
         self.rest_client.service = CONF.telemetry.catalog_type
-        self.headers = self.rest_client.headers
         self.version = '2'
         self.uri_prefix = "v%s" % self.version
 
@@ -69,12 +68,12 @@
 
     def post(self, uri, body):
         body = self.serialize(body)
-        resp, body = self.rest_client.post(uri, body, self.headers)
+        resp, body = self.rest_client.post(uri, body)
         body = self.deserialize(body)
         return resp, body
 
     def put(self, uri, body):
-        return self.rest_client.put(uri, body, self.headers)
+        return self.rest_client.put(uri, body)
 
     def get(self, uri):
         resp, body = self.rest_client.get(uri)
@@ -124,9 +123,13 @@
         return self.get(uri)
 
     def get_alarm(self, alarm_id):
-        uri = '%s/meter/%s' % (self.uri_prefix, alarm_id)
+        uri = '%s/alarms/%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)
+
+    def create_alarm(self, **kwargs):
+        uri = "%s/alarms" % self.uri_prefix
+        return self.post(uri, kwargs)
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
index f29fe22..165f29a 100644
--- a/tempest/services/telemetry/xml/telemetry_client.py
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -15,16 +15,19 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 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):
+    TYPE = "xml"
 
     def get_rest_client(self, auth_provider):
-        return RestClientXML(auth_provider)
+        rc = rest_client.RestClient(auth_provider)
+        rc.TYPE = self.TYPE
+        return rc
 
     def _parse_array(self, body):
         array = []
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index 653532e..0d50524 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -64,7 +64,7 @@
         }
 
         post_body = json.dumps({'volume_type': post_body})
-        resp, body = self.post('types', post_body, self.headers)
+        resp, body = self.post('types', post_body)
         body = json.loads(body)
         return resp, body['volume_type']
 
@@ -98,7 +98,7 @@
         """
         url = "types/%s/extra_specs" % str(vol_type_id)
         post_body = json.dumps({'extra_specs': extra_spec})
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -119,6 +119,6 @@
         url = "types/%s/extra_specs/%s" % (str(vol_type_id),
                                            str(extra_spec_name))
         put_body = json.dumps(extra_spec)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
new file mode 100644
index 0000000..baaf5a0
--- /dev/null
+++ b/tempest/services/volume/json/backups_client.py
@@ -0,0 +1,89 @@
+# 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.
+
+import json
+import time
+
+from tempest.common import rest_client
+from tempest import config
+from tempest import exceptions
+
+CONF = config.CONF
+
+
+class BackupsClientJSON(rest_client.RestClient):
+    """
+    Client class to send CRUD Volume backup API requests to a Cinder endpoint
+    """
+
+    def __init__(self, auth_provider):
+        super(BackupsClientJSON, self).__init__(auth_provider)
+        self.service = CONF.volume.catalog_type
+        self.build_interval = CONF.volume.build_interval
+        self.build_timeout = CONF.volume.build_timeout
+
+    def create_backup(self, volume_id, container=None, name=None,
+                      description=None):
+        """Creates a backup of volume."""
+        post_body = {'volume_id': volume_id}
+        if container:
+            post_body['container'] = container
+        if name:
+            post_body['name'] = name
+        if description:
+            post_body['description'] = description
+        post_body = json.dumps({'backup': post_body})
+        resp, body = self.post('backups', post_body)
+        body = json.loads(body)
+        return resp, body['backup']
+
+    def restore_backup(self, backup_id, volume_id=None):
+        """Restore volume from backup."""
+        post_body = {'volume_id': volume_id}
+        post_body = json.dumps({'restore': post_body})
+        resp, body = self.post('backups/%s/restore' % (backup_id), post_body)
+        body = json.loads(body)
+        return resp, body['restore']
+
+    def delete_backup(self, backup_id):
+        """Delete a backup of volume."""
+        resp, body = self.delete('backups/%s' % (str(backup_id)))
+        return resp, body
+
+    def get_backup(self, backup_id):
+        """Returns the details of a single backup."""
+        url = "backups/%s" % str(backup_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['backup']
+
+    def wait_for_backup_status(self, backup_id, status):
+        """Waits for a Backup to reach a given status."""
+        resp, body = self.get_backup(backup_id)
+        backup_status = body['status']
+        start = int(time.time())
+
+        while backup_status != status:
+            time.sleep(self.build_interval)
+            resp, body = self.get_backup(backup_id)
+            backup_status = body['status']
+            if backup_status == 'error':
+                raise exceptions.VolumeBackupException(backup_id=backup_id)
+
+            if int(time.time()) - start >= self.build_timeout:
+                message = ('Volume backup %s failed to reach %s status within '
+                           'the required time (%s s).' %
+                           (backup_id, status, self.build_timeout))
+                raise exceptions.TimeoutException(message)
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index 0a79469..ba33c49 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -72,15 +72,14 @@
         post_body = {'volume_id': volume_id}
         post_body.update(kwargs)
         post_body = json.dumps({'snapshot': post_body})
-        resp, body = self.post('snapshots', post_body, self.headers)
+        resp, body = self.post('snapshots', post_body)
         body = json.loads(body)
         return resp, body['snapshot']
 
     def update_snapshot(self, snapshot_id, **kwargs):
         """Updates a snapshot."""
         put_body = json.dumps({'snapshot': kwargs})
-        resp, body = self.put('snapshots/%s' % snapshot_id, put_body,
-                              self.headers)
+        resp, body = self.put('snapshots/%s' % snapshot_id, put_body)
         body = json.loads(body)
         return resp, body['snapshot']
 
@@ -135,8 +134,7 @@
     def reset_snapshot_status(self, snapshot_id, status):
         """Reset the specified snapshot's status."""
         post_body = json.dumps({'os-reset_status': {"status": status}})
-        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body,
-                               self.headers)
+        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body)
         return resp, body
 
     def update_snapshot_status(self, snapshot_id, status, progress):
@@ -147,21 +145,21 @@
         }
         post_body = json.dumps({'os-update_snapshot_status': post_body})
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def create_snapshot_metadata(self, snapshot_id, metadata):
         """Create metadata for the snapshot."""
         put_body = json.dumps({'metadata': metadata})
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.post(url, put_body, self.headers)
+        resp, body = self.post(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def get_snapshot_metadata(self, snapshot_id):
         """Get metadata of the snapshot."""
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -169,7 +167,7 @@
         """Update metadata for the snapshot."""
         put_body = json.dumps({'metadata': metadata})
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -177,19 +175,18 @@
         """Update metadata item for the snapshot."""
         put_body = json.dumps({'meta': meta_item})
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['meta']
 
     def delete_snapshot_metadata_item(self, snapshot_id, id):
         """Delete metadata item for the snapshot."""
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
 
     def force_delete_snapshot(self, snapshot_id):
         """Force Delete Snapshot."""
         post_body = json.dumps({'os-force_delete': {}})
-        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body,
-                               self.headers)
+        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body)
         return resp, body
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 0524212..2183c56 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -81,15 +81,14 @@
         post_body = {'size': size}
         post_body.update(kwargs)
         post_body = json.dumps({'volume': post_body})
-        resp, body = self.post('volumes', post_body, self.headers)
+        resp, body = self.post('volumes', post_body)
         body = json.loads(body)
         return resp, body['volume']
 
     def update_volume(self, volume_id, **kwargs):
         """Updates the Specified Volume."""
         put_body = json.dumps({'volume': kwargs})
-        resp, body = self.put('volumes/%s' % volume_id, put_body,
-                              self.headers)
+        resp, body = self.put('volumes/%s' % volume_id, put_body)
         body = json.loads(body)
         return resp, body['volume']
 
@@ -105,7 +104,7 @@
         }
         post_body = json.dumps({'os-volume_upload_image': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['os-volume_upload_image']
 
@@ -117,7 +116,7 @@
         }
         post_body = json.dumps({'os-attach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def detach_volume(self, volume_id):
@@ -125,7 +124,7 @@
         post_body = {}
         post_body = json.dumps({'os-detach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reserve_volume(self, volume_id):
@@ -133,7 +132,7 @@
         post_body = {}
         post_body = json.dumps({'os-reserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def unreserve_volume(self, volume_id):
@@ -141,7 +140,7 @@
         post_body = {}
         post_body = json.dumps({'os-unreserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def wait_for_volume_status(self, volume_id, status):
@@ -178,28 +177,25 @@
         }
         post_body = json.dumps({'os-extend': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reset_volume_status(self, volume_id, status):
         """Reset the Specified Volume's Status."""
         post_body = json.dumps({'os-reset_status': {"status": status}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_begin_detaching(self, volume_id):
         """Volume Begin Detaching."""
         post_body = json.dumps({'os-begin_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_roll_detaching(self, volume_id):
         """Volume Roll Detaching."""
         post_body = json.dumps({'os-roll_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def create_volume_transfer(self, vol_id, display_name=None):
@@ -210,16 +206,14 @@
         if display_name:
             post_body['name'] = display_name
         post_body = json.dumps({'transfer': post_body})
-        resp, body = self.post('os-volume-transfer',
-                               post_body,
-                               self.headers)
+        resp, body = self.post('os-volume-transfer', post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -243,7 +237,7 @@
         }
         url = 'os-volume-transfer/%s/accept' % transfer_id
         post_body = json.dumps({'accept': post_body})
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -254,28 +248,27 @@
         }
         post_body = json.dumps({'os-update_readonly_flag': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def force_delete_volume(self, volume_id):
         """Force Delete Volume."""
         post_body = json.dumps({'os-force_delete': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def create_volume_metadata(self, volume_id, metadata):
         """Create metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.post(url, put_body, self.headers)
+        resp, body = self.post(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -283,7 +276,7 @@
         """Update metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -291,12 +284,12 @@
         """Update metadata item for the volume."""
         put_body = json.dumps({'meta': meta_item})
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['meta']
 
     def delete_volume_metadata_item(self, volume_id, id):
         """Delete metadata item for the volume."""
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
diff --git a/tempest/services/volume/v2/__init__.py b/tempest/services/volume/v2/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/volume/v2/__init__.py
diff --git a/tempest/services/volume/v2/json/__init__.py b/tempest/services/volume/v2/json/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/volume/v2/json/__init__.py
diff --git a/tempest/services/volume/v2/json/volumes_client.py b/tempest/services/volume/v2/json/volumes_client.py
new file mode 100644
index 0000000..bd98402
--- /dev/null
+++ b/tempest/services/volume/v2/json/volumes_client.py
@@ -0,0 +1,296 @@
+# 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 json
+import time
+import urllib
+
+from tempest.common.rest_client import RestClient
+from tempest import config
+from tempest import exceptions
+
+CONF = config.CONF
+
+
+class VolumesV2ClientJSON(RestClient):
+    """
+    Client class to send CRUD Volume V2 API requests to a Cinder endpoint
+    """
+
+    def __init__(self, auth_provider):
+        super(VolumesV2ClientJSON, self).__init__(auth_provider)
+
+        self.api_version = "v2"
+        self.service = CONF.volume.catalog_type
+        self.build_interval = CONF.volume.build_interval
+        self.build_timeout = CONF.volume.build_timeout
+
+    def get_attachment_from_volume(self, volume):
+        """Return the element 'attachment' from input volumes."""
+        return volume['attachments'][0]
+
+    def list_volumes(self, params=None):
+        """List all the volumes created."""
+        url = 'volumes'
+        if params:
+                url += '?%s' % urllib.urlencode(params)
+
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['volumes']
+
+    def list_volumes_with_detail(self, params=None):
+        """List the details of all volumes."""
+        url = 'volumes/detail'
+        if params:
+                url += '?%s' % urllib.urlencode(params)
+
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['volumes']
+
+    def get_volume(self, volume_id):
+        """Returns the details of a single volume."""
+        url = "volumes/%s" % str(volume_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['volume']
+
+    def create_volume(self, size, **kwargs):
+        """
+        Creates a new Volume.
+        size(Required): Size of volume in GB.
+        Following optional keyword arguments are accepted:
+        name: Optional Volume Name.
+        metadata: A dictionary of values to be used as metadata.
+        volume_type: Optional Name of volume_type for the volume
+        snapshot_id: When specified the volume is created from this snapshot
+        imageRef: When specified the volume is created from this image
+        """
+        post_body = {'size': size}
+        post_body.update(kwargs)
+        post_body = json.dumps({'volume': post_body})
+        resp, body = self.post('volumes', post_body)
+        body = json.loads(body)
+        return resp, body['volume']
+
+    def update_volume(self, volume_id, **kwargs):
+        """Updates the Specified Volume."""
+        put_body = json.dumps({'volume': kwargs})
+        resp, body = self.put('volumes/%s' % volume_id, put_body)
+        body = json.loads(body)
+        return resp, body['volume']
+
+    def delete_volume(self, volume_id):
+        """Deletes the Specified Volume."""
+        return self.delete("volumes/%s" % str(volume_id))
+
+    def upload_volume(self, volume_id, image_name, disk_format):
+        """Uploads a volume in Glance."""
+        post_body = {
+            'image_name': image_name,
+            'disk_format': disk_format
+        }
+        post_body = json.dumps({'os-volume_upload_image': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        body = json.loads(body)
+        return resp, body['os-volume_upload_image']
+
+    def attach_volume(self, volume_id, instance_uuid, mountpoint):
+        """Attaches a volume to a given instance on a given mountpoint."""
+        post_body = {
+            'instance_uuid': instance_uuid,
+            'mountpoint': mountpoint,
+        }
+        post_body = json.dumps({'os-attach': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def detach_volume(self, volume_id):
+        """Detaches a volume from an instance."""
+        post_body = {}
+        post_body = json.dumps({'os-detach': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def reserve_volume(self, volume_id):
+        """Reserves a volume."""
+        post_body = {}
+        post_body = json.dumps({'os-reserve': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def unreserve_volume(self, volume_id):
+        """Restore a reserved volume ."""
+        post_body = {}
+        post_body = json.dumps({'os-unreserve': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def wait_for_volume_status(self, volume_id, status):
+        """Waits for a Volume to reach a given status."""
+        resp, body = self.get_volume(volume_id)
+        volume_name = body['name']
+        volume_status = body['status']
+        start = int(time.time())
+
+        while volume_status != status:
+            time.sleep(self.build_interval)
+            resp, body = self.get_volume(volume_id)
+            volume_status = body['status']
+            if volume_status == 'error':
+                raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
+
+            if int(time.time()) - start >= self.build_timeout:
+                message = ('Volume %s failed to reach %s status within '
+                           'the required time (%s s).' %
+                           (volume_name, status, self.build_timeout))
+                raise exceptions.TimeoutException(message)
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_volume(id)
+        except exceptions.NotFound:
+            return True
+        return False
+
+    def extend_volume(self, volume_id, extend_size):
+        """Extend a volume."""
+        post_body = {
+            'new_size': extend_size
+        }
+        post_body = json.dumps({'os-extend': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def reset_volume_status(self, volume_id, status):
+        """Reset the Specified Volume's Status."""
+        post_body = json.dumps({'os-reset_status': {"status": status}})
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
+        return resp, body
+
+    def volume_begin_detaching(self, volume_id):
+        """Volume Begin Detaching."""
+        post_body = json.dumps({'os-begin_detaching': {}})
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
+        return resp, body
+
+    def volume_roll_detaching(self, volume_id):
+        """Volume Roll Detaching."""
+        post_body = json.dumps({'os-roll_detaching': {}})
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
+        return resp, body
+
+    def create_volume_transfer(self, vol_id, name=None):
+        """Create a volume transfer."""
+        post_body = {
+            'volume_id': vol_id
+        }
+        if name:
+            post_body['name'] = name
+        post_body = json.dumps({'transfer': post_body})
+        resp, body = self.post('os-volume-transfer', post_body)
+        body = json.loads(body)
+        return resp, body['transfer']
+
+    def get_volume_transfer(self, transfer_id):
+        """Returns the details of a volume transfer."""
+        url = "os-volume-transfer/%s" % str(transfer_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['transfer']
+
+    def list_volume_transfers(self, params=None):
+        """List all the volume transfers created."""
+        url = 'os-volume-transfer'
+        if params:
+            url += '?%s' % urllib.urlencode(params)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['transfers']
+
+    def delete_volume_transfer(self, transfer_id):
+        """Delete a volume transfer."""
+        return self.delete("os-volume-transfer/%s" % str(transfer_id))
+
+    def accept_volume_transfer(self, transfer_id, transfer_auth_key):
+        """Accept a volume transfer."""
+        post_body = {
+            'auth_key': transfer_auth_key,
+        }
+        url = 'os-volume-transfer/%s/accept' % transfer_id
+        post_body = json.dumps({'accept': post_body})
+        resp, body = self.post(url, post_body)
+        body = json.loads(body)
+        return resp, body['transfer']
+
+    def update_volume_readonly(self, volume_id, readonly):
+        """Update the Specified Volume readonly."""
+        post_body = {
+            'readonly': readonly
+        }
+        post_body = json.dumps({'os-update_readonly_flag': post_body})
+        url = 'volumes/%s/action' % (volume_id)
+        resp, body = self.post(url, post_body)
+        return resp, body
+
+    def force_delete_volume(self, volume_id):
+        """Force Delete Volume."""
+        post_body = json.dumps({'os-force_delete': {}})
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
+        return resp, body
+
+    def create_volume_metadata(self, volume_id, metadata):
+        """Create metadata for the volume."""
+        put_body = json.dumps({'metadata': metadata})
+        url = "volumes/%s/metadata" % str(volume_id)
+        resp, body = self.post(url, put_body)
+        body = json.loads(body)
+        return resp, body['metadata']
+
+    def get_volume_metadata(self, volume_id):
+        """Get metadata of the volume."""
+        url = "volumes/%s/metadata" % str(volume_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['metadata']
+
+    def update_volume_metadata(self, volume_id, metadata):
+        """Update metadata for the volume."""
+        put_body = json.dumps({'metadata': metadata})
+        url = "volumes/%s/metadata" % str(volume_id)
+        resp, body = self.put(url, put_body)
+        body = json.loads(body)
+        return resp, body['metadata']
+
+    def update_volume_metadata_item(self, volume_id, id, meta_item):
+        """Update metadata item for the volume."""
+        put_body = json.dumps({'meta': meta_item})
+        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
+        resp, body = self.put(url, put_body)
+        body = json.loads(body)
+        return resp, body['meta']
+
+    def delete_volume_metadata_item(self, volume_id, id):
+        """Delete metadata item for the volume."""
+        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
+        resp, body = self.delete(url)
+        return resp, body
diff --git a/tempest/services/volume/v2/xml/__init__.py b/tempest/services/volume/v2/xml/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/volume/v2/xml/__init__.py
diff --git a/tempest/services/volume/v2/xml/volumes_client.py b/tempest/services/volume/v2/xml/volumes_client.py
new file mode 100644
index 0000000..bc57842
--- /dev/null
+++ b/tempest/services/volume/v2/xml/volumes_client.py
@@ -0,0 +1,409 @@
+# Copyright 2012 IBM Corp.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import time
+import urllib
+
+from lxml import etree
+
+from tempest.common import rest_client
+from tempest import config
+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
+from tempest.services.compute.xml.common import XMLNS_11
+
+CONF = config.CONF
+
+
+class VolumesV2ClientXML(rest_client.RestClient):
+    """
+    Client class to send CRUD Volume API requests to a Cinder endpoint
+    """
+    TYPE = "xml"
+
+    def __init__(self, auth_provider):
+        super(VolumesV2ClientXML, self).__init__(auth_provider)
+
+        self.api_version = "v2"
+        self.service = CONF.volume.catalog_type
+        self.build_interval = CONF.compute.build_interval
+        self.build_timeout = CONF.compute.build_timeout
+
+    def _parse_volume(self, body):
+        vol = dict((attr, body.get(attr)) for attr in body.keys())
+
+        for child in body.getchildren():
+            tag = child.tag
+            if tag.startswith("{"):
+                ns, tag = tag.split("}", 1)
+            if tag == 'metadata':
+                vol['metadata'] = dict((meta.get('key'),
+                                       meta.text) for meta in
+                                       child.getchildren())
+            else:
+                vol[tag] = xml_to_json(child)
+        return vol
+
+    def get_attachment_from_volume(self, volume):
+        """Return the element 'attachment' from input volumes."""
+        return volume['attachments']['attachment']
+
+    def _check_if_bootable(self, volume):
+        """
+        Check if the volume is bootable, also change the value
+        of 'bootable' from string to boolean.
+        """
+
+        # NOTE(jdg): Version 1 of Cinder API uses lc strings
+        # We should consider being explicit in this check to
+        # avoid introducing bugs like: LP #1227837
+
+        if volume['bootable'].lower() == 'true':
+            volume['bootable'] = True
+        elif volume['bootable'].lower() == 'false':
+            volume['bootable'] = False
+        else:
+            raise ValueError(
+                'bootable flag is supposed to be either True or False,'
+                'it is %s' % volume['bootable'])
+        return volume
+
+    def list_volumes(self, params=None):
+        """List all the volumes created."""
+        url = 'volumes'
+
+        if params:
+            url += '?%s' % urllib.urlencode(params)
+
+        resp, body = self.get(url)
+        body = etree.fromstring(body)
+        volumes = []
+        if body is not None:
+            volumes += [self._parse_volume(vol) for vol in list(body)]
+        return resp, volumes
+
+    def list_volumes_with_detail(self, params=None):
+        """List all the details of volumes."""
+        url = 'volumes/detail'
+
+        if params:
+            url += '?%s' % urllib.urlencode(params)
+
+        resp, body = self.get(url)
+        body = etree.fromstring(body)
+        volumes = []
+        if body is not None:
+            volumes += [self._parse_volume(vol) for vol in list(body)]
+        for v in volumes:
+            v = self._check_if_bootable(v)
+        return resp, volumes
+
+    def get_volume(self, volume_id):
+        """Returns the details of a single volume."""
+        url = "volumes/%s" % str(volume_id)
+        resp, body = self.get(url)
+        body = self._parse_volume(etree.fromstring(body))
+        body = self._check_if_bootable(body)
+        return resp, body
+
+    def create_volume(self, size, **kwargs):
+        """Creates a new Volume.
+
+        :param size: Size of volume in GB. (Required)
+        :param name: Optional Volume Name.
+        :param metadata: An optional dictionary of values for metadata.
+        :param volume_type: Optional Name of volume_type for the volume
+        :param snapshot_id: When specified the volume is created from
+                            this snapshot
+        :param imageRef: When specified the volume is created from this
+                         image
+        """
+        # NOTE(afazekas): it should use a volume namespace
+        volume = Element("volume", xmlns=XMLNS_11, size=size)
+
+        if 'metadata' in kwargs:
+            _metadata = Element('metadata')
+            volume.append(_metadata)
+            for key, value in kwargs['metadata'].items():
+                meta = Element('meta')
+                meta.add_attr('key', key)
+                meta.append(Text(value))
+                _metadata.append(meta)
+            attr_to_add = kwargs.copy()
+            del attr_to_add['metadata']
+        else:
+            attr_to_add = kwargs
+
+        for key, value in attr_to_add.items():
+            volume.add_attr(key, value)
+
+        resp, body = self.post('volumes', str(Document(volume)))
+        body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def update_volume(self, volume_id, **kwargs):
+        """Updates the Specified Volume."""
+        put_body = Element("volume", xmlns=XMLNS_11, **kwargs)
+
+        resp, body = self.put('volumes/%s' % volume_id,
+                              str(Document(put_body)))
+        body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def delete_volume(self, volume_id):
+        """Deletes the Specified Volume."""
+        return self.delete("volumes/%s" % str(volume_id))
+
+    def wait_for_volume_status(self, volume_id, status):
+        """Waits for a Volume to reach a given status."""
+        resp, body = self.get_volume(volume_id)
+        volume_status = body['status']
+        start = int(time.time())
+
+        while volume_status != status:
+            time.sleep(self.build_interval)
+            resp, body = self.get_volume(volume_id)
+            volume_status = body['status']
+            if volume_status == 'error':
+                raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
+
+            if int(time.time()) - start >= self.build_timeout:
+                message = 'Volume %s failed to reach %s status within '\
+                          'the required time (%s s).' % (volume_id,
+                                                         status,
+                                                         self.build_timeout)
+                raise exceptions.TimeoutException(message)
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_volume(id)
+        except exceptions.NotFound:
+            return True
+        return False
+
+    def attach_volume(self, volume_id, instance_uuid, mountpoint):
+        """Attaches a volume to a given instance on a given mountpoint."""
+        post_body = Element("os-attach",
+                            instance_uuid=instance_uuid,
+                            mountpoint=mountpoint
+                            )
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def detach_volume(self, volume_id):
+        """Detaches a volume from an instance."""
+        post_body = Element("os-detach")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def upload_volume(self, volume_id, image_name, disk_format):
+        """Uploads a volume in Glance."""
+        post_body = Element("os-volume_upload_image",
+                            image_name=image_name,
+                            disk_format=disk_format)
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        volume = xml_to_json(etree.fromstring(body))
+        return resp, volume
+
+    def extend_volume(self, volume_id, extend_size):
+        """Extend a volume."""
+        post_body = Element("os-extend",
+                            new_size=extend_size)
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def reset_volume_status(self, volume_id, status):
+        """Reset the Specified Volume's Status."""
+        post_body = Element("os-reset_status",
+                            status=status
+                            )
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def volume_begin_detaching(self, volume_id):
+        """Volume Begin Detaching."""
+        post_body = Element("os-begin_detaching")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def volume_roll_detaching(self, volume_id):
+        """Volume Roll Detaching."""
+        post_body = Element("os-roll_detaching")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def reserve_volume(self, volume_id):
+        """Reserves a volume."""
+        post_body = Element("os-reserve")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def unreserve_volume(self, volume_id):
+        """Restore a reserved volume ."""
+        post_body = Element("os-unreserve")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def create_volume_transfer(self, vol_id, name=None):
+        """Create a volume transfer."""
+        post_body = Element("transfer",
+                            volume_id=vol_id)
+        if name:
+            post_body.add_attr('name', name)
+        resp, body = self.post('os-volume-transfer',
+                               str(Document(post_body)))
+        volume = xml_to_json(etree.fromstring(body))
+        return resp, volume
+
+    def get_volume_transfer(self, transfer_id):
+        """Returns the details of a volume transfer."""
+        url = "os-volume-transfer/%s" % str(transfer_id)
+        resp, body = self.get(url)
+        volume = xml_to_json(etree.fromstring(body))
+        return resp, volume
+
+    def list_volume_transfers(self, params=None):
+        """List all the volume transfers created."""
+        url = 'os-volume-transfer'
+        if params:
+            url += '?%s' % urllib.urlencode(params)
+
+        resp, body = self.get(url)
+        body = etree.fromstring(body)
+        volumes = []
+        if body is not None:
+            volumes += [self._parse_volume_transfer(vol) for vol in list(body)]
+        return resp, volumes
+
+    def _parse_volume_transfer(self, body):
+        vol = dict((attr, body.get(attr)) for attr in body.keys())
+        for child in body.getchildren():
+            tag = child.tag
+            if tag.startswith("{"):
+                tag = tag.split("}", 1)
+            vol[tag] = xml_to_json(child)
+        return vol
+
+    def delete_volume_transfer(self, transfer_id):
+        """Delete a volume transfer."""
+        return self.delete("os-volume-transfer/%s" % str(transfer_id))
+
+    def accept_volume_transfer(self, transfer_id, transfer_auth_key):
+        """Accept a volume transfer."""
+        post_body = Element("accept", auth_key=transfer_auth_key)
+        url = 'os-volume-transfer/%s/accept' % transfer_id
+        resp, body = self.post(url, str(Document(post_body)))
+        volume = xml_to_json(etree.fromstring(body))
+        return resp, volume
+
+    def update_volume_readonly(self, volume_id, readonly):
+        """Update the Specified Volume readonly."""
+        post_body = Element("os-update_readonly_flag",
+                            readonly=readonly)
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def force_delete_volume(self, volume_id):
+        """Force Delete Volume."""
+        post_body = Element("os-force_delete")
+        url = 'volumes/%s/action' % str(volume_id)
+        resp, body = self.post(url, str(Document(post_body)))
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def _metadata_body(self, meta):
+        post_body = Element('metadata')
+        for k, v in meta.items():
+            data = Element('meta', key=k)
+            data.append(Text(v))
+            post_body.append(data)
+        return post_body
+
+    def _parse_key_value(self, node):
+        """Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
+        data = {}
+        for node in node.getchildren():
+            data[node.get('key')] = node.text
+        return data
+
+    def create_volume_metadata(self, volume_id, metadata):
+        """Create metadata for the volume."""
+        post_body = self._metadata_body(metadata)
+        resp, body = self.post('volumes/%s/metadata' % volume_id,
+                               str(Document(post_body)))
+        body = self._parse_key_value(etree.fromstring(body))
+        return resp, body
+
+    def get_volume_metadata(self, volume_id):
+        """Get metadata of the volume."""
+        url = "volumes/%s/metadata" % str(volume_id)
+        resp, body = self.get(url)
+        body = self._parse_key_value(etree.fromstring(body))
+        return resp, body
+
+    def update_volume_metadata(self, volume_id, metadata):
+        """Update metadata for the volume."""
+        put_body = self._metadata_body(metadata)
+        url = "volumes/%s/metadata" % str(volume_id)
+        resp, body = self.put(url, str(Document(put_body)))
+        body = self._parse_key_value(etree.fromstring(body))
+        return resp, body
+
+    def update_volume_metadata_item(self, volume_id, id, meta_item):
+        """Update metadata item for the volume."""
+        for k, v in meta_item.items():
+            put_body = Element('meta', key=k)
+            put_body.append(Text(v))
+        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
+        resp, body = self.put(url, str(Document(put_body)))
+        body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def delete_volume_metadata_item(self, volume_id, id):
+        """Delete metadata item for the volume."""
+        url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
+        return self.delete(url)
diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py
index 7278fd9..fb84c83 100644
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ b/tempest/services/volume/xml/admin/volume_hosts_client.py
@@ -1,4 +1,4 @@
-# Copyright 2013 Openstack Foundation.
+# Copyright 2013 OpenStack Foundation.
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -17,17 +17,18 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class VolumeHostsClientXML(RestClientXML):
+class VolumeHostsClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumeHostsClientXML, self).__init__(auth_provider)
@@ -67,6 +68,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 29ba431..77bafec 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -29,10 +29,11 @@
 CONF = config.CONF
 
 
-class VolumeTypesClientXML(RestClientXML):
+class VolumeTypesClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume Types API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumeTypesClientXML, self).__init__(auth_provider)
@@ -72,7 +73,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volume_types = []
         if body is not None:
@@ -83,7 +84,7 @@
     def get_volume_type(self, type_id):
         """Returns the details of a single volume_type."""
         url = "types/%s" % str(type_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume_type(body)
 
@@ -108,8 +109,7 @@
                 spec.append(Text(value))
                 _extra_specs.append(spec)
 
-        resp, body = self.post('types', str(Document(vol_type)),
-                               self.headers)
+        resp, body = self.post('types', str(Document(vol_type)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -124,7 +124,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         extra_specs = []
         if body is not None:
@@ -136,7 +136,7 @@
         """Returns the details of a single volume_type extra spec."""
         url = "types/%s/extra_specs/%s" % (str(vol_type_id),
                                            str(extra_spec_name))
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume_type_extra_specs(body)
 
@@ -160,8 +160,7 @@
         else:
             extra_specs = None
 
-        resp, body = self.post(url, str(Document(extra_specs)),
-                               self.headers)
+        resp, body = self.post(url, str(Document(extra_specs)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -190,8 +189,7 @@
                 spec.append(Text(value))
                 extra_specs.append(spec)
 
-        resp, body = self.put(url, str(Document(extra_specs)),
-                              self.headers)
+        resp, body = self.put(url, str(Document(extra_specs)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/volume/xml/backups_client.py b/tempest/services/volume/xml/backups_client.py
new file mode 100644
index 0000000..81caaee
--- /dev/null
+++ b/tempest/services/volume/xml/backups_client.py
@@ -0,0 +1,26 @@
+# 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.services.volume.json import backups_client
+
+
+class BackupsClientXML(backups_client.BackupsClientJSON):
+    """
+    Client class to send CRUD Volume Backup API requests to a Cinder endpoint
+    """
+    TYPE = "xml"
+
+    #TODO(gfidente): XML client isn't yet implemented because of bug 1270589
+    pass
diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py
index 21e1d04..1ea974f 100644
--- a/tempest/services/volume/xml/extensions_client.py
+++ b/tempest/services/volume/xml/extensions_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class ExtensionsClientXML(RestClientXML):
+class ExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ExtensionsClientXML, self).__init__(auth_provider)
@@ -36,6 +37,6 @@
 
     def list_extensions(self):
         url = 'extensions'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index 4f066a6..458001b 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
@@ -30,8 +30,9 @@
 LOG = logging.getLogger(__name__)
 
 
-class SnapshotsClientXML(RestClientXML):
+class SnapshotsClientXML(rest_client.RestClient):
     """Client class to send CRUD Volume API requests."""
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(SnapshotsClientXML, self).__init__(auth_provider)
@@ -47,7 +48,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         snapshots = []
         for snap in body:
@@ -61,7 +62,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         snapshots = []
         for snap in body:
@@ -71,7 +72,7 @@
     def get_snapshot(self, snapshot_id):
         """Returns the details of a single snapshot."""
         url = "snapshots/%s" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, xml_to_json(body)
 
@@ -86,8 +87,7 @@
         snapshot = Element("snapshot", xmlns=XMLNS_11, volume_id=volume_id)
         for key, value in kwargs.items():
             snapshot.add_attr(key, value)
-        resp, body = self.post('snapshots', str(Document(snapshot)),
-                               self.headers)
+        resp, body = self.post('snapshots', str(Document(snapshot)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -96,8 +96,7 @@
         put_body = Element("snapshot", xmlns=XMLNS_11, **kwargs)
 
         resp, body = self.put('snapshots/%s' % snapshot_id,
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -155,7 +154,7 @@
                             status=status
                             )
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -167,7 +166,7 @@
                             progress=progress
                             )
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -191,15 +190,14 @@
         """Create metadata for the snapshot."""
         post_body = self._metadata_body(metadata)
         resp, body = self.post('snapshots/%s/metadata' % snapshot_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_snapshot_metadata(self, snapshot_id):
         """Get metadata of the snapshot."""
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -207,7 +205,7 @@
         """Update metadata for the snapshot."""
         put_body = self._metadata_body(metadata)
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -217,7 +215,7 @@
             put_body = Element('meta', key=k)
             put_body.append(Text(v))
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -230,7 +228,7 @@
         """Force Delete Snapshot."""
         post_body = Element("os-force_delete")
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index deb56fd..aef1e3c 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -17,8 +17,9 @@
 import urllib
 
 from lxml import etree
+from xml.sax.saxutils import escape
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -30,10 +31,11 @@
 CONF = config.CONF
 
 
-class VolumesClientXML(RestClientXML):
+class VolumesClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumesClientXML, self).__init__(auth_provider)
@@ -87,7 +89,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -103,7 +105,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -115,7 +117,7 @@
     def get_volume(self, volume_id):
         """Returns the details of a single volume."""
         url = "volumes/%s" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_volume(etree.fromstring(body))
         body = self._check_if_bootable(body)
         return resp, body
@@ -151,8 +153,7 @@
         for key, value in attr_to_add.items():
             volume.add_attr(key, value)
 
-        resp, body = self.post('volumes', str(Document(volume)),
-                               self.headers)
+        resp, body = self.post('volumes', str(Document(volume)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -161,8 +162,7 @@
         put_body = Element("volume", xmlns=XMLNS_11, **kwargs)
 
         resp, body = self.put('volumes/%s' % volume_id,
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -204,7 +204,7 @@
                             mountpoint=mountpoint
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -213,7 +213,7 @@
         """Detaches a volume from an instance."""
         post_body = Element("os-detach")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -224,7 +224,7 @@
                             image_name=image_name,
                             disk_format=disk_format)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -233,7 +233,7 @@
         post_body = Element("os-extend",
                             new_size=extend_size)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -244,7 +244,7 @@
                             status=status
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -253,7 +253,7 @@
         """Volume Begin Detaching."""
         post_body = Element("os-begin_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -262,7 +262,7 @@
         """Volume Roll Detaching."""
         post_body = Element("os-roll_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -271,7 +271,7 @@
         """Reserves a volume."""
         post_body = Element("os-reserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -280,7 +280,7 @@
         """Restore a reserved volume ."""
         post_body = Element("os-unreserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -292,15 +292,14 @@
         if display_name:
             post_body.add_attr('name', display_name)
         resp, body = self.post('os-volume-transfer',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -310,7 +309,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -334,7 +333,7 @@
         """Accept a volume transfer."""
         post_body = Element("accept", auth_key=transfer_auth_key)
         url = 'os-volume-transfer/%s/accept' % transfer_id
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -343,7 +342,7 @@
         post_body = Element("os-update_readonly_flag",
                             readonly=readonly)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -352,7 +351,7 @@
         """Force Delete Volume."""
         post_body = Element("os-force_delete")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -361,7 +360,8 @@
         post_body = Element('metadata')
         for k, v in meta.items():
             data = Element('meta', key=k)
-            data.append(Text(v))
+            # Escape value to allow for special XML chars
+            data.append(Text(escape(v)))
             post_body.append(data)
         return post_body
 
@@ -376,15 +376,14 @@
         """Create metadata for the volume."""
         post_body = self._metadata_body(metadata)
         resp, body = self.post('volumes/%s/metadata' % volume_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -392,7 +391,7 @@
         """Update metadata for the volume."""
         put_body = self._metadata_body(metadata)
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -402,7 +401,7 @@
             put_body = Element('meta', key=k)
             put_body.append(Text(v))
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index d4689c4..3715636 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -220,7 +220,7 @@
     LOG.info("Run %d actions (%d failed)" %
              (sum_runs, sum_fails))
 
-    if not had_errors:
+    if not had_errors and CONF.stress.full_clean_stack:
         LOG.info("cleaning up")
         cleanup.cleanup()
     if had_errors:
diff --git a/tempest/stress/run_stress.py b/tempest/stress/run_stress.py
index 76320d0..c7c17c0 100755
--- a/tempest/stress/run_stress.py
+++ b/tempest/stress/run_stress.py
@@ -18,7 +18,7 @@
 import inspect
 import json
 import sys
-from testtools.testsuite import iterate_tests
+from testtools import testsuite
 try:
     from unittest import loader
 except ImportError:
@@ -38,7 +38,7 @@
     tests = []
     testloader = loader.TestLoader()
     list = testloader.discover(path)
-    for func in (iterate_tests(list)):
+    for func in (testsuite.iterate_tests(list)):
         attrs = []
         try:
             method_name = getattr(func, '_testMethodName')
@@ -87,8 +87,13 @@
             # NOTE(mkoderer): we just save the last result code
             if (step_result != 0):
                 result = step_result
+                if ns.stop:
+                    return result
     else:
-        driver.stress_openstack(tests, ns.duration, ns.number, ns.stop)
+        result = driver.stress_openstack(tests,
+                                         ns.duration,
+                                         ns.number,
+                                         ns.stop)
     return result
 
 
diff --git a/tempest/test.py b/tempest/test.py
index 5464c03..22aa3f2 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -17,6 +17,7 @@
 import functools
 import json
 import os
+import sys
 import time
 import urllib
 import uuid
@@ -70,16 +71,35 @@
     This decorator applies a testtools attr for each service that gets
     exercised by a test case.
     """
-    valid_service_list = ['compute', 'image', 'volume', 'orchestration',
-                          'network', 'identity', 'object_storage', 'dashboard']
+    service_list = {
+        'compute': CONF.service_available.nova,
+        'image': CONF.service_available.glance,
+        'volume': CONF.service_available.cinder,
+        'orchestration': CONF.service_available.heat,
+        # NOTE(mtreinish) nova-network will provide networking functionality
+        # if neutron isn't available, so always set to True.
+        'network': True,
+        'identity': True,
+        'object_storage': CONF.service_available.swift,
+        'dashboard': CONF.service_available.horizon,
+    }
 
     def decorator(f):
         for service in args:
-            if service not in valid_service_list:
+            if service not in service_list:
                 raise exceptions.InvalidServiceTag('%s is not a valid service'
                                                    % service)
         attr(type=list(args))(f)
-        return f
+
+        @functools.wraps(f)
+        def wrapper(self, *func_args, **func_kwargs):
+            for service in args:
+                if not service_list[service]:
+                    msg = 'Skipped because the %s service is not available' % (
+                        service)
+                    raise testtools.TestCase.skipException(msg)
+            return f(self, *func_args, **func_kwargs)
+        return wrapper
     return decorator
 
 
@@ -129,6 +149,8 @@
             else:
                 skip = True
             if "bug" in kwargs and skip is True:
+                if not kwargs['bug'].isdigit():
+                    raise ValueError('bug must be a valid bug number')
                 msg = "Skipped until Bug: %s is resolved." % kwargs["bug"]
                 raise testtools.TestCase.skipException(msg)
             return f(self, *func_args, **func_kwargs)
@@ -222,10 +244,23 @@
 
 atexit.register(validate_tearDownClass)
 
-
-class BaseTestCase(testtools.TestCase,
+if sys.version_info >= (2, 7):
+    class BaseDeps(testtools.TestCase,
                    testtools.testcase.WithAttributes,
                    testresources.ResourcedTestCase):
+        pass
+else:
+    # Define asserts for py26
+    import unittest2
+
+    class BaseDeps(testtools.TestCase,
+                   testtools.testcase.WithAttributes,
+                   testresources.ResourcedTestCase,
+                   unittest2.TestCase):
+        pass
+
+
+class BaseTestCase(BaseDeps):
 
     setUpClassCalled = False
     _service = None
@@ -277,7 +312,7 @@
     @classmethod
     def get_client_manager(cls, interface=None):
         """
-        Returns an Openstack client manager
+        Returns an OpenStack client manager
         """
         cls.isolated_creds = isolated_creds.IsolatedCreds(
             cls.__name__, network_resources=cls.network_resources)
@@ -405,11 +440,16 @@
         schema = description.get("json-schema", None)
         resources = description.get("resources", [])
         scenario_list = []
+        expected_result = None
         for resource in resources:
+            if isinstance(resource, dict):
+                expected_result = resource['expected_result']
+                resource = resource['name']
             LOG.debug("Add resource to test %s" % resource)
             scn_name = "inv_res_%s" % (resource)
             scenario_list.append((scn_name, {"resource": (resource,
-                                                          str(uuid.uuid4()))
+                                                          str(uuid.uuid4())),
+                                             "expected_result": expected_result
                                              }))
         if schema is not None:
             for invalid in generate_json.generate_invalid(schema):
@@ -460,16 +500,12 @@
             if schema:
                 valid = generate_json.generate_valid(schema)
             new_url, body = self._http_arguments(valid, url, method)
-            resp, resp_body = self.client.send_request(method, new_url,
-                                                       resources, body=body)
-            self._check_negative_response(resp.status, resp_body)
-            return
-
-        if hasattr(self, "schema"):
+        elif hasattr(self, "schema"):
             new_url, body = self._http_arguments(self.schema, url, method)
-            resp, resp_body = self.client.send_request(method, new_url,
-                                                       resources, body=body)
-            self._check_negative_response(resp.status, resp_body)
+
+        resp, resp_body = self.client.send_request(method, new_url,
+                                                   resources, body=body)
+        self._check_negative_response(resp.status, resp_body)
 
     def _http_arguments(self, json_dict, url, method):
         LOG.debug("dict: %s url: %s method: %s" % (json_dict, url, method))
@@ -510,6 +546,8 @@
         :param name: The name of the kind of resource such as "flavor", "role",
             etc.
         """
+        if isinstance(name, dict):
+            name = name['name']
         if hasattr(self, "resource") and self.resource[0] == name:
             LOG.debug("Return invalid resource (%s) value: %s" %
                       (self.resource[0], self.resource[1]))
diff --git a/tempest/tests/fake_config.py b/tempest/tests/fake_config.py
index a50aaeb..42237ca 100644
--- a/tempest/tests/fake_config.py
+++ b/tempest/tests/fake_config.py
@@ -22,5 +22,30 @@
     class fake_identity(object):
         disable_ssl_certificate_validation = True
 
+    class fake_default_feature_enabled(object):
+        api_extensions = ['all']
+
+    class fake_compute_feature_enabled(fake_default_feature_enabled):
+        api_v3_extensions = ['all']
+
+    class fake_object_storage_discoverable_apis(object):
+        discoverable_apis = ['all']
+
+    class fake_service_available(object):
+        nova = True
+        glance = True
+        cinder = True
+        heat = True
+        neutron = True
+        swift = True
+        horizon = True
+
+    compute_feature_enabled = fake_compute_feature_enabled()
+    volume_feature_enabled = fake_default_feature_enabled()
+    network_feature_enabled = fake_default_feature_enabled()
+    object_storage_feature_enabled = fake_object_storage_discoverable_apis()
+
+    service_available = fake_service_available()
+
     compute = fake_compute()
     identity = fake_identity()
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
new file mode 100644
index 0000000..88920dc
--- /dev/null
+++ b/tempest/tests/test_decorators.py
@@ -0,0 +1,238 @@
+# 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 testtools
+
+from tempest import exceptions
+from tempest.openstack.common.fixture import mockpatch
+from tempest import test
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class BaseDecoratorsTest(base.TestCase):
+    def setUp(self):
+        super(BaseDecoratorsTest, self).setUp()
+        self.stubs.Set(test, 'CONF', fake_config.FakeConfig)
+
+
+class TestAttrDecorator(BaseDecoratorsTest):
+    def _test_attr_helper(self, expected_attrs, **decorator_args):
+        @test.attr(**decorator_args)
+        def foo():
+            pass
+
+        # By our test.attr decorator the attribute __testtools_attrs will be
+        # set only for 'type' argument, so we test it first.
+        if 'type' in decorator_args:
+            # this is what testtools sets
+            self.assertEqual(getattr(foo, '__testtools_attrs'),
+                             set(expected_attrs))
+
+        # nose sets it anyway
+        for arg, value in decorator_args.items():
+            self.assertEqual(getattr(foo, arg), value)
+
+    def test_attr_without_type(self):
+        self._test_attr_helper(expected_attrs='baz', bar='baz')
+
+    def test_attr_decorator_with_smoke_type(self):
+        # smoke passed as type, so smoke and gate must have been set.
+        self._test_attr_helper(expected_attrs=['smoke', 'gate'], type='smoke')
+
+    def test_attr_decorator_with_list_type(self):
+        # if type is 'smoke' we'll get the original list of types plus 'gate'
+        self._test_attr_helper(expected_attrs=['smoke', 'foo', 'gate'],
+                               type=['smoke', 'foo'])
+
+    def test_attr_decorator_with_unknown_type(self):
+        self._test_attr_helper(expected_attrs=['foo'], type='foo')
+
+    def test_attr_decorator_with_duplicated_type(self):
+        self._test_attr_helper(expected_attrs=['foo'], type=['foo', 'foo'])
+
+
+class TestServicesDecorator(BaseDecoratorsTest):
+    def _test_services_helper(self, *decorator_args):
+        class TestFoo(test.BaseTestCase):
+            @test.services(*decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        self.assertEqual(set(decorator_args), getattr(t.test_bar,
+                                                      '__testtools_attrs'))
+        self.assertEqual(list(decorator_args), t.test_bar.type)
+        self.assertEqual(t.test_bar(), 0)
+
+    def test_services_decorator_with_single_service(self):
+        self._test_services_helper('compute')
+
+    def test_services_decorator_with_multiple_services(self):
+        self._test_services_helper('compute', 'network')
+
+    def test_services_decorator_with_duplicated_service(self):
+        self._test_services_helper('compute', 'compute')
+
+    def test_services_decorator_with_invalid_service(self):
+        self.assertRaises(exceptions.InvalidServiceTag,
+                          self._test_services_helper, 'compute',
+                          'bad_service')
+
+    def test_services_decorator_with_service_valid_and_unavailable(self):
+        self.useFixture(mockpatch.PatchObject(test.CONF.service_available,
+                                              'cinder', False))
+        self.assertRaises(testtools.TestCase.skipException,
+                          self._test_services_helper, 'compute',
+                          'volume')
+
+
+class TestStressDecorator(BaseDecoratorsTest):
+    def _test_stresstest_helper(self, expected_frequency='process',
+                                expected_inheritance=False,
+                                **decorator_args):
+        @test.stresstest(**decorator_args)
+        def foo():
+            pass
+        self.assertEqual(getattr(foo, 'st_class_setup_per'),
+                         expected_frequency)
+        self.assertEqual(getattr(foo, 'st_allow_inheritance'),
+                         expected_inheritance)
+        self.assertEqual(foo.type, 'stress')
+        self.assertEqual(set(['stress']), getattr(foo, '__testtools_attrs'))
+
+    def test_stresstest_decorator_default(self):
+        self._test_stresstest_helper()
+
+    def test_stresstest_decorator_class_setup_frequency(self):
+        self._test_stresstest_helper('process', class_setup_per='process')
+
+    def test_stresstest_decorator_class_setup_frequency_non_default(self):
+        self._test_stresstest_helper(expected_frequency='application',
+                                     class_setup_per='application')
+
+    def test_stresstest_decorator_set_frequency_and_inheritance(self):
+        self._test_stresstest_helper(expected_frequency='application',
+                                     expected_inheritance=True,
+                                     class_setup_per='application',
+                                     allow_inheritance=True)
+
+
+class TestSkipBecauseDecorator(BaseDecoratorsTest):
+    def _test_skip_because_helper(self, expected_to_skip=True,
+                                  **decorator_args):
+        class TestFoo(test.BaseTestCase):
+            _interface = 'json'
+
+            @test.skip_because(**decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        if expected_to_skip:
+            self.assertRaises(testtools.TestCase.skipException, t.test_bar)
+        else:
+            # assert that test_bar returned 0
+            self.assertEqual(TestFoo('test_bar').test_bar(), 0)
+
+    def test_skip_because_bug(self):
+        self._test_skip_because_helper(bug='12345')
+
+    def test_skip_because_bug_and_interface_match(self):
+        self._test_skip_because_helper(bug='12346', interface='json')
+
+    def test_skip_because_bug_interface_not_match(self):
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12347', interface='xml')
+
+    def test_skip_because_bug_and_condition_true(self):
+        self._test_skip_because_helper(bug='12348', condition=True)
+
+    def test_skip_because_bug_and_condition_false(self):
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12349', condition=False)
+
+    def test_skip_because_bug_condition_false_and_interface_match(self):
+        """
+        Assure that only condition will be evaluated if both parameters are
+        passed.
+        """
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12350', condition=False,
+                                       interface='json')
+
+    def test_skip_because_bug_condition_true_and_interface_not_match(self):
+        """
+        Assure that only condition will be evaluated if both parameters are
+        passed.
+        """
+        self._test_skip_because_helper(bug='12351', condition=True,
+                                       interface='xml')
+
+    def test_skip_because_bug_without_bug_never_skips(self):
+        """Never skip without a bug parameter."""
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       condition=True)
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       interface='json')
+
+    def test_skip_because_invalid_bug_number(self):
+        """Raise ValueError if with an invalid bug number"""
+        self.assertRaises(ValueError, self._test_skip_because_helper,
+                          bug='critical_bug')
+
+
+class TestRequiresExtDecorator(BaseDecoratorsTest):
+    def setUp(self):
+        super(TestRequiresExtDecorator, self).setUp()
+        self.fixture = self.useFixture(mockpatch.PatchObject(
+                                       test.CONF.compute_feature_enabled,
+                                       'api_extensions',
+                                       new=['enabled_ext', 'another_ext']))
+
+    def _test_requires_ext_helper(self, expected_to_skip=True,
+                                  **decorator_args):
+        class TestFoo(test.BaseTestCase):
+            @test.requires_ext(**decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        if expected_to_skip:
+            self.assertRaises(testtools.TestCase.skipException, t.test_bar)
+        else:
+            self.assertEqual(t.test_bar(), 0)
+
+    def test_requires_ext_decorator(self):
+        self._test_requires_ext_helper(expected_to_skip=False,
+                                       extension='enabled_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_disabled_ext(self):
+        self._test_requires_ext_helper(extension='disabled_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_with_all_ext_enabled(self):
+        # disable fixture so the default (all) is used.
+        self.fixture.cleanUp()
+        self._test_requires_ext_helper(expected_to_skip=False,
+                                       extension='random_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_bad_service(self):
+        self.assertRaises(KeyError,
+                          self._test_requires_ext_helper,
+                          extension='enabled_ext',
+                          service='bad_service')
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index ead112b..ba43daf 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -13,11 +13,13 @@
 #    under the License.
 
 import httplib2
+import json
 
 from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common.fixture import mockpatch
+from tempest.services.compute.xml import common as xml
 from tempest.tests import base
 from tempest.tests import fake_auth_provider
 from tempest.tests import fake_config
@@ -26,6 +28,8 @@
 
 class BaseRestClientTestClass(base.TestCase):
 
+    url = 'fake_endpoint'
+
     def _get_region(self):
         return 'fake region'
 
@@ -49,36 +53,33 @@
                                               '_error_checker'))
 
     def test_post(self):
-        __, return_dict = self.rest_client.post('fake_endpoint', {},
-                                                {})
+        __, return_dict = self.rest_client.post(self.url, {}, {})
         self.assertEqual('POST', return_dict['method'])
 
     def test_get(self):
-        __, return_dict = self.rest_client.get('fake_endpoint')
+        __, return_dict = self.rest_client.get(self.url)
         self.assertEqual('GET', return_dict['method'])
 
     def test_delete(self):
-        __, return_dict = self.rest_client.delete('fake_endpoint')
+        __, return_dict = self.rest_client.delete(self.url)
         self.assertEqual('DELETE', return_dict['method'])
 
     def test_patch(self):
-        __, return_dict = self.rest_client.patch('fake_endpoint', {},
-                                                 {})
+        __, return_dict = self.rest_client.patch(self.url, {}, {})
         self.assertEqual('PATCH', return_dict['method'])
 
     def test_put(self):
-        __, return_dict = self.rest_client.put('fake_endpoint', {},
-                                               {})
+        __, return_dict = self.rest_client.put(self.url, {}, {})
         self.assertEqual('PUT', return_dict['method'])
 
     def test_head(self):
         self.useFixture(mockpatch.PatchObject(self.rest_client,
                                               'response_checker'))
-        __, return_dict = self.rest_client.head('fake_endpoint')
+        __, return_dict = self.rest_client.head(self.url)
         self.assertEqual('HEAD', return_dict['method'])
 
     def test_copy(self):
-        __, return_dict = self.rest_client.copy('fake_endpoint')
+        __, return_dict = self.rest_client.copy(self.url)
         self.assertEqual('COPY', return_dict['method'])
 
 
@@ -89,4 +90,143 @@
 
     def test_post(self):
         self.assertRaises(exceptions.NotFound, self.rest_client.post,
-                          'fake_endpoint', {}, {})
+                          self.url, {}, {})
+
+
+class TestRestClientHeadersJSON(TestRestClientHTTPMethods):
+    TYPE = "json"
+
+    def _verify_headers(self, resp):
+        self.assertEqual(self.rest_client._get_type(), self.TYPE)
+        resp = dict((k.lower(), v) for k, v in resp.iteritems())
+        self.assertEqual(self.header_value, resp['accept'])
+        self.assertEqual(self.header_value, resp['content-type'])
+
+    def setUp(self):
+        super(TestRestClientHeadersJSON, self).setUp()
+        self.rest_client.TYPE = self.TYPE
+        self.header_value = 'application/%s' % self.rest_client._get_type()
+
+    def test_post(self):
+        resp, __ = self.rest_client.post(self.url, {})
+        self._verify_headers(resp)
+
+    def test_get(self):
+        resp, __ = self.rest_client.get(self.url)
+        self._verify_headers(resp)
+
+    def test_delete(self):
+        resp, __ = self.rest_client.delete(self.url)
+        self._verify_headers(resp)
+
+    def test_patch(self):
+        resp, __ = self.rest_client.patch(self.url, {})
+        self._verify_headers(resp)
+
+    def test_put(self):
+        resp, __ = self.rest_client.put(self.url, {})
+        self._verify_headers(resp)
+
+    def test_head(self):
+        self.useFixture(mockpatch.PatchObject(self.rest_client,
+                                              'response_checker'))
+        resp, __ = self.rest_client.head(self.url)
+        self._verify_headers(resp)
+
+    def test_copy(self):
+        resp, __ = self.rest_client.copy(self.url)
+        self._verify_headers(resp)
+
+
+class TestRestClientHeadersXML(TestRestClientHeadersJSON):
+    TYPE = "xml"
+
+    # These two tests are needed in one exemplar
+    def test_send_json_accept_xml(self):
+        resp, __ = self.rest_client.get(self.url,
+                                        self.rest_client.get_headers("xml",
+                                                                     "json"))
+        resp = dict((k.lower(), v) for k, v in resp.iteritems())
+        self.assertEqual("application/json", resp["content-type"])
+        self.assertEqual("application/xml", resp["accept"])
+
+    def test_send_xml_accept_json(self):
+        resp, __ = self.rest_client.get(self.url,
+                                        self.rest_client.get_headers("json",
+                                                                     "xml"))
+        resp = dict((k.lower(), v) for k, v in resp.iteritems())
+        self.assertEqual("application/json", resp["accept"])
+        self.assertEqual("application/xml", resp["content-type"])
+
+
+class TestRestClientParseRespXML(BaseRestClientTestClass):
+    TYPE = "xml"
+
+    keys = ["fake_key1", "fake_key2"]
+    values = ["fake_value1", "fake_value2"]
+    item_expected = {key: value for key, value in zip(keys, values)}
+    list_expected = {"body_list": [
+        {keys[0]: values[0]},
+        {keys[1]: values[1]},
+    ]}
+    dict_expected = {"body_dict": {
+        keys[0]: values[0],
+        keys[1]: values[1],
+    }}
+
+    def setUp(self):
+        self.fake_http = fake_http.fake_httplib2()
+        super(TestRestClientParseRespXML, self).setUp()
+        self.rest_client.TYPE = self.TYPE
+
+    def test_parse_resp_body_item(self):
+        body_item = xml.Element("item", **self.item_expected)
+        body = self.rest_client._parse_resp(str(xml.Document(body_item)))
+        self.assertEqual(self.item_expected, body)
+
+    def test_parse_resp_body_list(self):
+        self.rest_client.list_tags = ["fake_list", ]
+        body_list = xml.Element(self.rest_client.list_tags[0])
+        for i in range(2):
+            body_list.append(xml.Element("fake_item",
+                                         **self.list_expected["body_list"][i]))
+        body = self.rest_client._parse_resp(str(xml.Document(body_list)))
+        self.assertEqual(self.list_expected["body_list"], body)
+
+    def test_parse_resp_body_dict(self):
+        self.rest_client.dict_tags = ["fake_dict", ]
+        body_dict = xml.Element(self.rest_client.dict_tags[0])
+
+        for i in range(2):
+            body_dict.append(xml.Element("fake_item", xml.Text(self.values[i]),
+                                         key=self.keys[i]))
+
+        body = self.rest_client._parse_resp(str(xml.Document(body_dict)))
+        self.assertEqual(self.dict_expected["body_dict"], body)
+
+
+class TestRestClientParseRespJSON(TestRestClientParseRespXML):
+    TYPE = "json"
+
+    def test_parse_resp_body_item(self):
+        body = self.rest_client._parse_resp(json.dumps(self.item_expected))
+        self.assertEqual(self.item_expected, body)
+
+    def test_parse_resp_body_list(self):
+        body = self.rest_client._parse_resp(json.dumps(self.list_expected))
+        self.assertEqual(self.list_expected["body_list"], body)
+
+    def test_parse_resp_body_dict(self):
+        body = self.rest_client._parse_resp(json.dumps(self.dict_expected))
+        self.assertEqual(self.dict_expected["body_dict"], body)
+
+    def test_parse_resp_two_top_keys(self):
+        dict_two_keys = self.dict_expected.copy()
+        dict_two_keys.update({"second_key": ""})
+        body = self.rest_client._parse_resp(json.dumps(dict_two_keys))
+        self.assertEqual(dict_two_keys, body)
+
+    def test_parse_resp_one_top_key_without_list_or_dict(self):
+        data = {"one_top_key": "not_list_or_dict_value"}
+        body = self.rest_client._parse_resp(json.dumps(data))
+        self.assertEqual(data, body)
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index a6932bc..54861be 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -123,15 +123,6 @@
         _terminate_reservation(reservation_1, rcuk_1)
         _terminate_reservation(reservation_2, rcuk_2)
 
-        reservation_3, rcuk_3 = _run_instance('token_1')
-        self.assertIsNotNone(reservation_3)
-
-        # make sure we don't get the old reservation back
-        self.assertNotEqual(reservation_1.id, reservation_3.id)
-
-        # clean up
-        _terminate_reservation(reservation_3, rcuk_3)
-
     @attr(type='smoke')
     def test_run_stop_terminate_instance(self):
         # EC2 run, stop and terminate instance
@@ -278,7 +269,7 @@
         # TODO(afazekas): ping test. dependecy/permission ?
 
         self.assertVolumeStatusWait(volume, "available")
-        # NOTE(afazekas): it may be reports availble before it is available
+        # NOTE(afazekas): it may be reports available before it is available
 
         ssh = RemoteClient(address.public_ip,
                            CONF.compute.ssh_user,
diff --git a/test-requirements.txt b/test-requirements.txt
index 3fe2f27..8d64167 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,7 +3,7 @@
 docutils==0.9.1
 sphinx>=1.1.2,<1.2
 python-subunit>=0.0.18
-oslo.sphinx
+oslosphinx
 mox>=0.5.3
 mock>=1.0
 coverage>=3.6
diff --git a/tools/check_logs.py b/tools/check_logs.py
index f3204e3..15988a6 100755
--- a/tools/check_logs.py
+++ b/tools/check_logs.py
@@ -28,7 +28,7 @@
 is_neutron = os.environ.get('DEVSTACK_GATE_NEUTRON', "0") == "1"
 is_grenade = (os.environ.get('DEVSTACK_GATE_GRENADE', "0") == "1" or
               os.environ.get('DEVSTACK_GATE_GRENADE_FORWARD', "0") == "1")
-dump_all_errors = is_neutron
+dump_all_errors = True
 
 
 def process_files(file_specs, url_specs, whitelists):
@@ -69,6 +69,7 @@
                     print_log_name = False
                 if not whitelisted:
                     had_errors = True
+                    print("*** Not Whitelisted ***"),
                 print(line)
     return had_errors
 
diff --git a/tools/install_venv.py b/tools/install_venv.py
index e41ca43..96b8279 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -25,12 +25,12 @@
 
 def print_help(venv, root):
     help = """
-    Openstack development environment setup is complete.
+    OpenStack development environment setup is complete.
 
-    Openstack development uses virtualenv to track and manage Python
+    OpenStack development uses virtualenv to track and manage Python
     dependencies while in development and testing.
 
-    To activate the Openstack 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 %s/bin/activate
diff --git a/tools/tempest_auto_config.py b/tools/tempest_auto_config.py
index 9aeb077..5b8d05b 100644
--- a/tools/tempest_auto_config.py
+++ b/tools/tempest_auto_config.py
@@ -13,14 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 #
-# This script aims to configure an initial Openstack environment with all the
-# necessary configurations for tempest's run using nothing but Openstack's
+# This script aims to configure an initial OpenStack environment with all the
+# necessary configurations for tempest's run using nothing but OpenStack's
 # native API.
 # That includes, creating users, tenants, registering images (cirros),
 # configuring neutron and so on.
 #
 # ASSUMPTION: this script is run by an admin user as it is meant to configure
-# the Openstack environment prior to actual use.
+# the OpenStack environment prior to actual use.
 
 # Config
 import ConfigParser
@@ -32,7 +32,7 @@
 import glanceclient as glance_client
 import keystoneclient.v2_0.client as keystone_client
 
-# Import Openstack exceptions
+# Import OpenStack exceptions
 import glanceclient.exc as glance_exception
 import keystoneclient.exceptions as keystone_exception
 
@@ -88,7 +88,7 @@
 
     def get_image_client(self, version="1", *args, **kwargs):
         """
-        This method returns Openstack glance python client
+        This method returns OpenStack glance python client
         :param version: a string representing the version of the glance client
         to use.
         :param string endpoint: A user-supplied endpoint URL for the glance
@@ -333,7 +333,7 @@
     """
     Creates images for tempest's use and registers the environment variables
     IMAGE_ID and IMAGE_ID_ALT with registered images
-    :param image_client: Openstack python image client
+    :param image_client: OpenStack python image client
     :param config: a ConfigParser object representing the tempest config file
     :param config_section: the section name where the IMAGE ids are set
     :param download_url: the URL from which we should download the UEC tar
diff --git a/tools/verify_tempest_config.py b/tools/verify_tempest_config.py
index 29eed9d..4be812c 100755
--- a/tools/verify_tempest_config.py
+++ b/tools/verify_tempest_config.py
@@ -42,7 +42,12 @@
 def verify_nova_api_versions(os):
     # Check nova api versions - only get base URL without PATH
     os.servers_client.skip_path = True
-    __, body = RAW_HTTP.request(os.servers_client.base_url, 'GET')
+    # The nova base endpoint url includes the version but to get the versions
+    # list the unversioned endpoint is needed
+    v2_endpoint = os.servers_client.base_url
+    v2_endpoint_parts = v2_endpoint.split('/')
+    endpoint = v2_endpoint_parts[0] + '//' + v2_endpoint_parts[2]
+    __, body = RAW_HTTP.request(endpoint, 'GET')
     body = json.loads(body)
     # Restore full base_url
     os.servers_client.skip_path = False
diff --git a/tox.ini b/tox.ini
index 860c8ae..1580b14 100644
--- a/tox.ini
+++ b/tox.ini
@@ -37,6 +37,12 @@
 commands =
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
+[testenv:full-serial]
+# The regex below is used to select which tests to run and exclude the slow tag:
+# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
+commands =
+  bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
+
 [testenv:testr-full]
 commands =
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
