diff --git a/HACKING.rst b/HACKING.rst
index 3fa1ff5..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
 -----------------------
@@ -107,16 +108,36 @@
 
 Negative Tests
 --------------
-When adding negative tests to tempest there are 2 requirements. First the tests
-must be marked with a negative attribute. For example::
+Newly added negative tests should use the negative test framework. First step
+is to create an interface description in a json file under `etc/schemas`.
+These descriptions consists of two important sections for the test
+(one of those is mandatory):
 
-  @attr(type=negative)
-  def test_resource_no_uuid(self):
-    ...
+ - A resource (part of the URL of the request): Resources needed for a test
+ must be created in `setUpClass` and registered with `set_resource` e.g.:
+ `cls.set_resource("server", server['id'])`
 
-The second requirement is that all negative tests must be added to a negative
-test file. If such a file doesn't exist for the particular resource being
-tested a new test file should be added.
+ - A json schema: defines properties for a request.
+
+After that a test class must be added to automatically generate test scenarios
+out of the given interface description:
+
+    class SampeTestNegativeTestJSON(<your base class>, test.NegativeAutoTest):
+        _interface = 'json'
+        _service = 'compute'
+        _schema_file = 'compute/servers/get_console_output.json'
+        scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+Negative tests must be marked with a negative attribute::
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_console_output(self):
+        self.execute(self._schema_file)
+
+All negative tests should be added into a separate negative test file.
+If such a file doesn't exist for the particular resource being tested a new
+test file should be added. Old XML based negative tests can be kept but should
+be renamed to `_xml.py`.
 
 Test skips because of Known Bugs
 --------------------------------
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 2d3f4fd..c807f79 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -103,6 +103,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..a701572 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,8 +4,8 @@
 summary = OpenStack Integration Testing
 description-file =
     README.rst
-author = OpenStack QA
-author-email = openstack-qa@lists.openstack.org
+author = OpenStack
+author-email = openstack-dev@lists.openstack.org
 home-page = http://www.openstack.org/
 classifier =
     Intended Audience :: Information Technology
@@ -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..8a5f1a5 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,27 +90,34 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
-    def test_admin_delete_servers_of_others(self):
-        # Administrator can delete servers of others
-        _, server = self.create_test_server()
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-        self.servers_client.wait_for_server_termination(server['id'])
+    @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))
 
-    @attr(type='gate')
-    def test_delete_server_while_in_error_state(self):
-        # Delete a server while it's VM state is error
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.reset_state(server['id'], state='error')
-        self.assertEqual(202, resp.status)
-        # Verify server's state
-        resp, server = self.client.get_server(server['id'])
-        self.assertEqual(server['status'], 'ERROR')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
+    @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 +135,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 +147,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 +177,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..ec40ce0
--- /dev/null
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -0,0 +1,121 @@
+# 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 DeleteServersAdminTestJSON(base.BaseV2ComputeAdminTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersAdminTestJSON, cls).setUpClass()
+        cls.non_admin_client = cls.servers_client
+        cls.admin_client = cls.os_adm.servers_client
+
+    @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')
+        resp, body = self.admin_client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.non_admin_client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.non_admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_admin_delete_servers_of_others(self):
+        # Administrator can delete servers of others
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'])
+
+
+class DeleteServersTestXML(DeleteServersTestJSON):
+    _interface = 'xml'
+
+
+class DeleteServersAdminTestXML(DeleteServersAdminTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_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..b388b70 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -16,7 +16,6 @@
 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
@@ -29,10 +28,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,17 +46,33 @@
     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),
                          sorted(quota_set.keys()))
         self.assertEqual(quota_set['id'], self.demo_tenant_id)
 
+    @test.attr(type='smoke')
+    def test_get_quota_set_detail(self):
+        # Admin can get the detail of resource quota set for a tenant
+        expected_quota_set = self.default_quota_set | set(['id'])
+        expected_detail = {'reserved', 'limit', 'in_use'}
+        resp, quota_set = self.adm_client.get_quota_set_detail(
+            self.demo_tenant_id)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(sorted(expected_quota_set), sorted(quota_set.keys()))
+        self.assertEqual(quota_set['id'], self.demo_tenant_id)
+        for quota in quota_set:
+            if quota == 'id':
+                continue
+            self.assertEqual(sorted(expected_detail),
+                             sorted(quota_set[quota].keys()))
+
     @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,
@@ -97,56 +110,3 @@
         resp, quota_set = self.adm_client.get_quota_set(tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(quota_set['ram'], 5120)
-
-    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
-    # it can be moved into the setUpClass as well
-    @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)
-        default_vcpu_quota = quota_set['cores']
-        vcpu_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
-                                                           force=True,
-                                                           cores=vcpu_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        cores=default_vcpu_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @test.attr(type='gate')
-    def test_create_server_when_memory_quota_is_full(self):
-        # Disallow server creation when tenant's memory quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_mem_quota = quota_set['ram']
-        mem_quota = 0  # Set the quota to zero to conserve resources
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         ram=mem_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        ram=default_mem_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @test.attr(type='gate')
-    def test_update_quota_normal_user(self):
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.update_quota_set,
-                          self.demo_tenant_id,
-                          ram=0)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_server_when_instances_quota_is_full(self):
-        # Once instances quota limit is reached, disallow server creation
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_instances_quota = quota_set['instances']
-        instances_quota = 0  # Set quota to zero to disallow server creation
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         instances=instances_quota)
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        instances=default_instances_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
diff --git a/tempest/api/compute/v3/admin/test_quotas_negative.py b/tempest/api/compute/v3/admin/test_quotas_negative.py
new file mode 100644
index 0000000..c9f14f8
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_quotas_negative.py
@@ -0,0 +1,88 @@
+# Copyright 2013 OpenStack Foundation
+# 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 exceptions
+from tempest import test
+
+
+class QuotasAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
+    _interface = 'json'
+    force_tenant_isolation = True
+
+    @classmethod
+    def setUpClass(cls):
+        super(QuotasAdminNegativeV3Test, cls).setUpClass()
+        cls.client = cls.quotas_client
+        cls.adm_client = cls.quotas_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
+        cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
+            'tenantId')
+
+    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
+    # it can be moved into the setUpClass as well
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_cpu_quota_is_full(self):
+        # Disallow server creation when tenant's vcpu quota is full
+        resp, quota_set = self.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
+
+        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
+                                                           force=True,
+                                                           cores=vcpu_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        cores=default_vcpu_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_memory_quota_is_full(self):
+        # Disallow server creation when tenant's memory quota is full
+        resp, quota_set = self.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
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         ram=mem_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        ram=default_mem_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_quota_normal_user(self):
+        self.assertRaises(exceptions.Unauthorized,
+                          self.client.update_quota_set,
+                          self.demo_tenant_id,
+                          ram=0)
+
+    @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.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
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         instances=instances_quota)
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        instances=default_instances_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index ef9eedc..0dc3dbc 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,27 +75,34 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
-    def test_admin_delete_servers_of_others(self):
-        # Administrator can delete servers of others
-        _, server = self.create_test_server()
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-        self.servers_client.wait_for_server_termination(server['id'])
+    @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))
 
-    @attr(type='gate')
-    def test_delete_server_while_in_error_state(self):
-        # Delete a server while it's VM state is error
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.reset_state(server['id'], state='error')
-        self.assertEqual(202, resp.status)
-        # Verify server's state
-        resp, server = self.client.get_server(server['id'])
-        self.assertEqual(server['status'], 'ERROR')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
+    @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 +120,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 +132,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 +148,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..f53ab6e
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_delete_server.py
@@ -0,0 +1,113 @@
+# 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'])
+
+
+class DeleteServersAdminV3Test(base.BaseV3ComputeAdminTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersAdminV3Test, cls).setUpClass()
+        cls.non_admin_client = cls.servers_client
+        cls.admin_client = cls.servers_admin_client
+
+    @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')
+        resp, body = self.admin_client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.non_admin_client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.non_admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_admin_delete_servers_of_others(self):
+        # Administrator can delete servers of others
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'])
diff --git a/tempest/api/compute/v3/servers/test_instance_actions.py b/tempest/api/compute/v3/servers/test_instance_actions.py
index d536871..c4f6e14 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions.py
@@ -14,8 +14,7 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class InstanceActionsV3Test(base.BaseV3ComputeTest):
@@ -29,7 +28,7 @@
         cls.request_id = resp['x-compute-request-id']
         cls.server_id = server['id']
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_instance_actions(self):
         # List actions of the provided server
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -41,7 +40,7 @@
         self.assertTrue(any([i for i in body if i['action'] == 'create']))
         self.assertTrue(any([i for i in body if i['action'] == 'reboot']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_instance_action(self):
         # Get the action details of the provided server
         resp, body = self.client.get_instance_action(self.server_id,
@@ -49,15 +48,3 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(self.server_id, body['instance_uuid'])
         self.assertEqual('create', body['action'])
-
-    @attr(type=['negative', 'gate'])
-    def test_list_instance_actions_invalid_server(self):
-        # List actions of the invalid server id
-        self.assertRaises(exceptions.NotFound,
-                          self.client.list_instance_actions, 'server-999')
-
-    @attr(type=['negative', 'gate'])
-    def test_get_instance_action_invalid_request(self):
-        # Get the action details of the provided server with invalid request
-        self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
-                          self.server_id, '999')
diff --git a/tempest/api/compute/v3/servers/test_instance_actions_negative.py b/tempest/api/compute/v3/servers/test_instance_actions_negative.py
new file mode 100644
index 0000000..bd741e0
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_instance_actions_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 exceptions
+from tempest import test
+
+
+class InstanceActionsNegativeV3Test(base.BaseV3ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(InstanceActionsNegativeV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+        resp, server = cls.create_test_server(wait_until='ACTIVE')
+        cls.server_id = server['id']
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_instance_actions_invalid_server(self):
+        # List actions of the invalid server id
+        invalid_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.list_instance_actions, invalid_server_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_instance_action_invalid_request(self):
+        # Get the action details of the provided server with invalid request
+        invalid_request_id = 'req-' + data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
+                          self.server_id, invalid_request_id)
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..be03a03 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -16,179 +16,179 @@
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
-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')
+    @test.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')
+    @test.attr(type='gate')
     def test_project_create_with_description(self):
         # 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')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     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')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     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')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     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)
         self.assertEqual(p_name1, resp1_name)
         self.assertEqual(resp2_name, resp3_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_update_desc(self):
         # 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)
         self.assertEqual(p_desc, resp1_desc)
         self.assertEqual(resp2_desc, resp3_desc)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_update_enable(self):
         # 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)
         self.assertEqual('false', str(resp1_en).lower())
         self.assertEqual(resp2_en, resp3_en)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_user_to_project(self):
         #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'])
@@ -196,59 +196,6 @@
                          new_user_get['project_id'])
         self.assertEqual(u_email, new_user_get['email'])
 
-    @attr(type=['negative', 'gate'])
-    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)
-
-    @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)
-
-        self.assertRaises(
-            exceptions.Conflict, self.v3_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,
-            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,
-                          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,
-                          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)
-        self.assertRaises(
-            exceptions.Unauthorized, self.v3_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,
-                          'junk_Project_123456abc')
-
 
 class ProjectsTestXML(ProjectsTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
new file mode 100644
index 0000000..6b60d04
--- /dev/null
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -0,0 +1,80 @@
+# Copyright 2013 OpenStack, LLC
+# 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.identity import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest):
+    _interface = 'json'
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_projects_by_unauthorized_user(self):
+        # Non-admin user should not be able to list projects
+        self.assertRaises(exceptions.Unauthorized,
+                          self.non_admin_client.list_projects)
+
+    @test.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.client.create_project(project_name)
+        self.data.projects.append(project)
+
+        self.assertRaises(
+            exceptions.Conflict, self.client.create_project, project_name)
+
+    @test.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.non_admin_client.create_project,
+            project_name)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_project_with_empty_name(self):
+        # Project name should not be empty
+        self.assertRaises(exceptions.BadRequest, self.client.create_project,
+                          name='')
+
+    @test.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.client.create_project,
+                          project_name)
+
+    @test.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.client.create_project(project_name)
+        self.data.projects.append(project)
+        self.assertRaises(
+            exceptions.Unauthorized, self.non_admin_client.delete_project,
+            project['id'])
+
+    @test.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.client.delete_project,
+                          data_utils.rand_uuid_hex())
+
+
+class ProjectsNegativeTestXML(ProjectsNegativeTestJSON):
+    _interface = 'xml'
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/base_security_groups.py b/tempest/api/network/base_security_groups.py
index 38ae4ac..90be454 100644
--- a/tempest/api/network/base_security_groups.py
+++ b/tempest/api/network/base_security_groups.py
@@ -26,7 +26,7 @@
     def _create_security_group(self):
         # Create a security group
         name = data_utils.rand_name('secgroup-')
-        resp, group_create_body = self.client.create_security_group(name)
+        resp, group_create_body = self.client.create_security_group(name=name)
         self.assertEqual('201', resp['status'])
         self.addCleanup(self._delete_security_group,
                         group_create_body['security_group']['id'])
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..1d41cc9 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()
 
@@ -59,8 +66,9 @@
         protocols = ['tcp', 'udp', 'icmp']
         for protocol in protocols:
             resp, rule_create_body = self.client.create_security_group_rule(
-                group_create_body['security_group']['id'],
-                protocol=protocol
+                security_group_id=group_create_body['security_group']['id'],
+                protocol=protocol,
+                direction='ingress'
             )
             self.assertEqual('201', resp['status'])
             self.addCleanup(self._delete_security_group_rule,
@@ -80,7 +88,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,
@@ -92,7 +100,7 @@
         port_range_min = 77
         port_range_max = 77
         resp, rule_create_body = self.client.create_security_group_rule(
-            group_create_body['security_group']['id'],
+            security_group_id=group_create_body['security_group']['id'],
             direction=direction,
             protocol=protocol,
             port_range_min=port_range_min,
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index 98e109e..0b86398 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,18 +51,18 @@
                           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()
 
         #Create rule with bad protocol name
         pname = 'bad_protocol_name'
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_security_group_rule,
-                          group_create_body['security_group']['id'],
-                          protocol=pname)
+        self.assertRaises(
+            exceptions.BadRequest, self.client.create_security_group_rule,
+            security_group_id=group_create_body['security_group']['id'],
+            protocol=pname, direction='ingress')
 
-    @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()
 
@@ -65,29 +72,29 @@
                   (80, 65536, 'Invalid value for port 65536'),
                   (-16, 65536, 'Invalid value for port')]
         for pmin, pmax, msg in states:
-            ex = self.assertRaises(exceptions.BadRequest,
-                                   self.client.create_security_group_rule,
-                                   group_create_body['security_group']['id'],
-                                   protocol='tcp',
-                                   port_range_min=pmin,
-                                   port_range_max=pmax)
+            ex = self.assertRaises(
+                exceptions.BadRequest, self.client.create_security_group_rule,
+                security_group_id=group_create_body['security_group']['id'],
+                protocol='tcp', port_range_min=pmin, port_range_max=pmax,
+                direction='ingress')
             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'
         self.assertRaises(exceptions.Conflict,
                           self.client.create_security_group,
-                          name)
+                          name=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())
         self.assertRaises(exceptions.NotFound,
                           self.client.create_security_group_rule,
-                          non_existent_sg)
+                          security_group_id=non_existent_sg,
+                          direction='ingress')
 
 
 class NegativeSecGroupTestXML(NegativeSecGroupTest):
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index ef36c3d..45c895b 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):
@@ -130,7 +130,10 @@
                 objlist = container_client.list_all_container_objects(cont)
                 # delete every object in the container
                 for obj in objlist:
-                    object_client.delete_object(cont, obj['name'])
+                    try:
+                        object_client.delete_object(cont, obj['name'])
+                    except exceptions.NotFound:
+                        pass
                 container_client.delete_container(cont)
             except exceptions.NotFound:
                 pass
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/common/waiters.py b/tempest/common/waiters.py
index dbeba8f..8e6b9fb 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -42,7 +42,7 @@
     timeout = client.build_timeout + extra_timeout
     while True:
         # NOTE(afazekas): Now the BUILD status only reached
-        # between the UNKOWN->ACTIVE transition.
+        # between the UNKNOWN->ACTIVE transition.
         # TODO(afazekas): enumerate and validate the stable status set
         if status == 'BUILD' and server_status != 'UNKNOWN':
             return
diff --git a/tempest/config.py b/tempest/config.py
index d24ab34..4380608 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -15,6 +15,7 @@
 
 from __future__ import print_function
 
+import logging as std_logging
 import os
 
 from oslo.config import cfg
@@ -53,6 +54,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 +105,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 +199,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 +236,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 +297,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 +333,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 +373,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 +397,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 +426,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 +455,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 +500,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 +648,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 +664,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'),
@@ -812,6 +877,9 @@
             self.compute_admin.password = self.identity.admin_password
             self.compute_admin.tenant_name = self.identity.admin_tenant_name
 
+        if parse_conf:
+            cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
+
 
 class TempestConfigProxy(object):
     _config = None
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..56fdcc8 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()
 
@@ -461,6 +290,27 @@
             image = CONF.compute.image_ref
         if flavor is None:
             flavor = CONF.compute.flavor_ref
+
+        fixed_network_name = CONF.compute.fixed_network_name
+        if 'nics' not in create_kwargs and fixed_network_name:
+            networks = client.networks.list()
+            # If several networks found, set the NetID on which to connect the
+            # server to avoid the following error "Multiple possible networks
+            # found, use a Network ID to be more specific."
+            # See Tempest #1250866
+            if len(networks) > 1:
+                for network in networks:
+                    if network.label == fixed_network_name:
+                        create_kwargs['nics'] = [{'net-id': network.id}]
+                        break
+                # If we didn't find the network we were looking for :
+                else:
+                    msg = ("The network on which the NIC of the server must "
+                           "be connected can not be found : "
+                           "fixed_network_name=%s. Starting instance without "
+                           "specifying a network.") % fixed_network_name
+                    LOG.info(msg)
+
         LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
                   name, image, flavor)
         server = client.servers.create(name, image, flavor, **create_kwargs)
@@ -529,7 +379,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 +388,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 found. 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 +483,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 +554,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 +571,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 +933,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..5bcdacd 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -61,12 +61,8 @@
         super(TestLoadBalancerBasic, cls).setUpClass()
         cls.check_preconditions()
         cls.security_groups = {}
-        cls.networks = []
-        cls.subnets = []
         cls.servers_keypairs = {}
-        cls.pools = []
         cls.members = []
-        cls.vips = []
         cls.floating_ips = {}
         cls.port1 = 80
         cls.port2 = 88
@@ -80,21 +76,19 @@
         name = data_utils.rand_name("smoke_server-")
         keypair = self.create_keypair(name='keypair-%s' % name)
         security_groups = [self.security_groups[tenant_id].name]
-        nets = self.network_client.list_networks()
-        for net in nets['networks']:
-            if net['tenant_id'] == self.tenant_id:
-                self.networks.append(net)
-                create_kwargs = {
-                    'nics': [
-                        {'net-id': net['id']},
-                    ],
-                    'key_name': keypair.name,
-                    'security_groups': security_groups,
-                }
-                server = self.create_server(name=name,
-                                            create_kwargs=create_kwargs)
-                self.servers_keypairs[server] = keypair
-                break
+        net = self.list_networks(tenant_id=self.tenant_id)[0]
+        self.network = net_common.DeletableNetwork(client=self.network_client,
+                                                   **net['network'])
+        create_kwargs = {
+            'nics': [
+                {'net-id': self.network.id},
+            ],
+            'key_name': keypair.name,
+            'security_groups': security_groups,
+        }
+        server = self.create_server(name=name,
+                                    create_kwargs=create_kwargs)
+        self.servers_keypairs[server] = keypair
         self.assertTrue(self.servers_keypairs)
 
     def _start_servers(self):
@@ -105,7 +99,7 @@
         for server in self.servers_keypairs.keys():
             ssh_login = config.compute.image_ssh_user
             private_key = self.servers_keypairs[server].private_key
-            network_name = self.networks[0]['name']
+            network_name = self.network.name
 
             ip_address = server.networks[network_name][0]
             ssh_client = ssh.Client(ip_address, ssh_login,
@@ -138,17 +132,15 @@
 
     def _create_pool(self):
         """Create a pool with ROUND_ROBIN algorithm."""
-        subnets = self.network_client.list_subnets()
-        for subnet in subnets['subnets']:
-            if subnet['tenant_id'] == self.tenant_id:
-                self.subnets.append(subnet)
-                pool = super(TestLoadBalancerBasic, self)._create_pool(
-                    'ROUND_ROBIN',
-                    'HTTP',
-                    subnet['id'])
-                self.pools.append(pool)
-                break
-        self.assertTrue(self.pools)
+        # get tenant subnet and verify there's only one
+        subnet = self._list_subnets(tenant_id=self.tenant_id)[0]
+        self.subnet = net_common.DeletableSubnet(client=self.network_client,
+                                                 **subnet['subnet'])
+        self.pool = super(TestLoadBalancerBasic, self)._create_pool(
+            'ROUND_ROBIN',
+            'HTTP',
+            self.subnet.id)
+        self.assertTrue(self.pool)
 
     def _create_members(self, network_name, server_ids):
         """
@@ -161,7 +153,7 @@
         for server in servers:
             if server.id in server_ids:
                 ip = server.networks[network_name][0]
-                pool_id = self.pools[0]['id']
+                pool_id = self.pool.id
                 if len(set(server_ids)) == 1 or len(servers) == 1:
                     member1 = self._create_member(ip, self.port1, pool_id)
                     member2 = self._create_member(ip, self.port2, pool_id)
@@ -173,29 +165,27 @@
 
     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)
-        self.floating_ips.setdefault(vip['id'], [])
-        self.floating_ips[vip['id']].append(floating_ip)
+        port_id = vip.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)
 
     def _create_load_balancer(self):
         self._create_pool()
-        self._create_members(self.networks[0]['name'],
+        self._create_members(self.network.name,
                              [self.servers_keypairs.keys()[0].id])
-        subnet_id = self.subnets[0]['id']
-        pool_id = self.pools[0]['id']
-        vip = super(TestLoadBalancerBasic, self)._create_vip('HTTP', 80,
-                                                             subnet_id,
-                                                             pool_id)
-        self.vips.append(vip)
+        subnet_id = self.subnet.id
+        pool_id = self.pool.id
+        self.vip = super(TestLoadBalancerBasic, self)._create_vip('HTTP', 80,
+                                                                  subnet_id,
+                                                                  pool_id)
         self._status_timeout(NeutronRetriever(self.network_client,
                                               self.network_client.vip_path,
                                               net_common.DeletableVip),
-                             self.vips[0]['id'],
+                             self.vip.id,
                              expected_status='ACTIVE')
-        self._assign_floating_ip_to_vip(self.vips[0])
+        self._assign_floating_ip_to_vip(self.vip)
 
     def _check_load_balancing(self):
         """
@@ -205,9 +195,8 @@
            of the requests
         """
 
-        vip = self.vips[0]
-        floating_ip_vip = self.floating_ips[
-            vip['id']][0]['floating_ip_address']
+        vip = self.vip
+        floating_ip_vip = self.floating_ips[vip.id][0]['floating_ip_address']
         self._check_connection(floating_ip_vip)
         resp = []
         for count in range(10):
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..998a474 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -13,19 +13,21 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+import collections
 
 from tempest.common import debug
 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 attr
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
+Floating_IP_tuple = collections.namedtuple('Floating_IP_tuple',
+                                           ['floating_ip', 'server'])
+
 
 class TestNetworkBasicOps(manager.NetworkScenarioTest):
 
@@ -113,47 +115,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()
 
-    def _check_networks(self):
-        # Checks that we see the newly created network/subnet/router via
-        # checking the result of list_[networks,routers,subnets]
+        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]
+        """
+
         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,13 +179,8 @@
             'security_groups': security_groups,
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
-        self.servers[server] = keypair
-        return server
-
-    def _create_servers(self):
-        for i, network in enumerate(self.networks):
-            name = data_utils.rand_name('server-smoke-%d-' % i)
-            self._create_server(name, network)
+        self.addCleanup(self.cleanup_wrapper, server)
+        return dict(server=server, keypair=keypair)
 
     def _check_tenant_network_connectivity(self):
         if not CONF.network.tenant_networks_reachable:
@@ -179,7 +191,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,
@@ -194,7 +206,8 @@
         public_network_id = CONF.network.public_network_id
         for server in self.servers.keys():
             floating_ip = self._create_floating_ip(server, public_network_id)
-            self.floating_ips[floating_ip] = server
+            self.floating_ip_tuple = Floating_IP_tuple(floating_ip, server)
+            self.addCleanup(self.cleanup_wrapper, floating_ip)
 
     def _check_public_network_connectivity(self, should_connect=True,
                                            msg=None):
@@ -202,16 +215,16 @@
         # key-based authentication by cloud-init.
         ssh_login = CONF.compute.image_ssh_user
         LOG.debug('checking network connections')
+        floating_ip, server = self.floating_ip_tuple
+        ip_address = floating_ip.floating_ip_address
+        private_key = None
+        if should_connect:
+            private_key = self.servers[server].private_key
         try:
-            for floating_ip, server in self.floating_ips.iteritems():
-                ip_address = floating_ip.floating_ip_address
-                private_key = None
-                if should_connect:
-                    private_key = self.servers[server].private_key
-                self._check_vm_connectivity(ip_address,
-                                            ssh_login,
-                                            private_key,
-                                            should_connect=should_connect)
+            self._check_vm_connectivity(ip_address,
+                                        ssh_login,
+                                        private_key,
+                                        should_connect=should_connect)
         except Exception:
             ex_msg = 'Public network connectivity check failed'
             if msg:
@@ -222,28 +235,24 @@
             raise
 
     def _disassociate_floating_ips(self):
-        for floating_ip, server in self.floating_ips.iteritems():
-            self._disassociate_floating_ip(floating_ip)
-            self.floating_ips[floating_ip] = None
+        floating_ip, server = self.floating_ip_tuple
+        self._disassociate_floating_ip(floating_ip)
+        self.floating_ip_tuple = Floating_IP_tuple(
+            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
+        floating_ip, server = self.floating_ip_tuple
+        name = data_utils.rand_name('new_server-smoke-')
+        # create a new server for the floating ip
+        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_ip_tuple = Floating_IP_tuple(
+            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..a26e0cf 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,44 @@
         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 +193,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 +238,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 +254,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 +268,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 +295,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 +306,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 +327,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 +350,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 +386,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 +404,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 +416,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 +455,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..aa8bfaf 100644
--- a/tempest/services/compute/v3/json/quotas_client.py
+++ b/tempest/services/compute/v3/json/quotas_client.py
@@ -35,6 +35,14 @@
         body = json.loads(body)
         return resp, body['quota_set']
 
+    def get_quota_set_detail(self, tenant_id):
+        """Get the quota set detail for a tenant."""
+
+        url = 'os-quota-sets/%s/detail' % str(tenant_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['quota_set']
+
     def get_default_quota_set(self, tenant_id):
         """List the default quota set for a tenant."""
 
@@ -84,8 +92,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..366ccee 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -154,20 +154,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_security_group(self, name, **kwargs):
-        post_body = {
-            'security_group': {
-                'name': name,
-            }
-        }
-        for key, value in kwargs.iteritems():
-            post_body['security_group'][str(key)] = value
-        body = json.dumps(post_body)
-        uri = '%s/security-groups' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def update_floating_ip(self, floating_ip_id, **kwargs):
         post_body = {
             'floatingip': kwargs}
@@ -177,50 +163,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_security_group_rule(self, secgroup_id,
-                                   direction='ingress', **kwargs):
-        post_body = {
-            'security_group_rule': {
-                'direction': direction,
-                'security_group_id': secgroup_id
-            }
-        }
-        for key, value in kwargs.iteritems():
-            post_body['security_group_rule'][str(key)] = value
-        body = json.dumps(post_body)
-        uri = '%s/security-group-rules' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
-        post_body = {
-            "vip": {
-                "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 +189,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 +255,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 +345,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..97d514f 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,67 @@
         #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)
-
-    def create_security_group(self, name):
-        uri = '%s/security-groups' % (self.uri_prefix)
-        post_body = Element("security_group")
-        p2 = Element("name", name)
-        post_body.append(p2)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def 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.append(p1)
-        rule.append(p2)
-        for key, val in kwargs.items():
-            key = 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)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
+            return common.Element(name, value)
 
     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 +114,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 +135,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 +256,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 +273,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..41b0558 100644
--- a/tempest/tests/fake_config.py
+++ b/tempest/tests/fake_config.py
@@ -21,6 +21,34 @@
 
     class fake_identity(object):
         disable_ssl_certificate_validation = True
+        catalog_type = 'identity'
+        uri = 'http://fake_uri.com/auth'
+        uri_v3 = 'http://fake_uri_v3.com/auth'
+
+    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/fake_http.py b/tempest/tests/fake_http.py
index ac5f765..a09d5ba 100644
--- a/tempest/tests/fake_http.py
+++ b/tempest/tests/fake_http.py
@@ -17,7 +17,7 @@
 
 class fake_httplib2(object):
 
-    def __init__(self, return_type=None):
+    def __init__(self, return_type=None, *args, **kwargs):
         self.return_type = return_type
 
     def request(self, uri, method="GET", body=None, headers=None,
diff --git a/tempest/tests/fake_identity.py b/tempest/tests/fake_identity.py
new file mode 100644
index 0000000..ea2bd44
--- /dev/null
+++ b/tempest/tests/fake_identity.py
@@ -0,0 +1,156 @@
+# Copyright 2014 IBM Corp.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+import httplib2
+import json
+
+
+TOKEN = "fake_token"
+ALT_TOKEN = "alt_fake_token"
+
+# Fake Identity v2 constants
+COMPUTE_ENDPOINTS_V2 = {
+    "endpoints": [
+        {
+            "adminURL": "http://fake_url/api/admin",
+            "region": "NoMatchRegion",
+            "internalURL": "http://fake_url/api/internal",
+            "publicURL": "http://fake_url/api/public"
+        },
+        {
+            "adminURL": "http://fake_url/api/admin",
+            "region": "FakeRegion",
+            "internalURL": "http://fake_url/api/internal",
+            "publicURL": "http://fake_url/api/public"
+        },
+    ],
+    "type": "compute",
+    "name": "nova"
+}
+
+CATALOG_V2 = [COMPUTE_ENDPOINTS_V2, ]
+
+ALT_IDENTITY_V2_RESPONSE = {
+    "access": {
+        "token": {
+            "expires": "2020-01-01T00:00:10Z",
+            "id": ALT_TOKEN,
+            "tenant": {
+                "id": "fake_tenant_id"
+            },
+        },
+        "user": {
+            "id": "fake_user_id",
+        },
+        "serviceCatalog": CATALOG_V2,
+    },
+}
+
+IDENTITY_V2_RESPONSE = {
+    "access": {
+        "token": {
+            "expires": "2020-01-01T00:00:10Z",
+            "id": TOKEN,
+            "tenant": {
+                "id": "fake_tenant_id"
+            },
+        },
+        "user": {
+            "id": "fake_user_id",
+        },
+        "serviceCatalog": CATALOG_V2,
+    },
+}
+
+# Fake Identity V3 constants
+COMPUTE_ENDPOINTS_V3 = {
+    "endpoints": [
+        {
+            "id": "fake_service",
+            "interface": "public",
+            "region": "NoMatchRegion",
+            "url": "http://fake_url/v3"
+        },
+        {
+            "id": "another_fake_service",
+            "interface": "public",
+            "region": "FakeRegion",
+            "url": "http://fake_url/v3"
+        }
+    ],
+    "type": "compute",
+    "id": "fake_compute_endpoint"
+}
+
+CATALOG_V3 = [COMPUTE_ENDPOINTS_V3, ]
+
+IDENTITY_V3_RESPONSE = {
+    "token": {
+        "methods": [
+            "token",
+            "password"
+        ],
+        "expires_at": "2020-01-01T00:00:10.000123Z",
+        "project": {
+            "domain": {
+                "id": "fake_id",
+                "name": "fake"
+            },
+            "id": "project_id",
+            "name": "project_name"
+        },
+        "user": {
+            "domain": {
+                "id": "domain_id",
+                "name": "domain_name"
+            },
+            "id": "fake_user_id",
+            "name": "username"
+        },
+        "issued_at": "2013-05-29T16:55:21.468960Z",
+        "catalog": CATALOG_V3
+    }
+}
+
+ALT_IDENTITY_V3 = IDENTITY_V3_RESPONSE
+
+
+def _fake_v3_response(self, uri, method="GET", body=None, headers=None,
+                      redirections=5, connection_type=None):
+    fake_headers = {
+        "status": "201",
+        "x-subject-token": TOKEN
+    }
+    return (httplib2.Response(fake_headers),
+            json.dumps(IDENTITY_V3_RESPONSE))
+
+
+def _fake_v2_response(self, uri, method="GET", body=None, headers=None,
+                      redirections=5, connection_type=None):
+    return (httplib2.Response({"status": "200"}),
+            json.dumps(IDENTITY_V2_RESPONSE))
+
+
+def _fake_auth_failure_response():
+    # the response body isn't really used in this case, but lets send it anyway
+    # to have a safe check in some future change on the rest client.
+    body = {
+        "unauthorized": {
+            "message": "Unauthorized",
+            "code": "401"
+        }
+    }
+    return httplib2.Response({"status": "401"}), json.dumps(body)
diff --git a/tempest/tests/files/setup.cfg b/tempest/tests/files/setup.cfg
index 8639baa..f6f9f73 100644
--- a/tempest/tests/files/setup.cfg
+++ b/tempest/tests/files/setup.cfg
@@ -2,8 +2,8 @@
 name = tempest_unit_tests
 version = 1
 summary = Fake Project for testing wrapper scripts
-author = OpenStack QA
-author-email = openstack-qa@lists.openstack.org
+author = OpenStack
+author-email = openstack-dev@lists.openstack.org
 home-page = http://www.openstack.org/
 classifier =
     Intended Audience :: Information Technology
diff --git a/tempest/tests/test_auth.py b/tempest/tests/test_auth.py
new file mode 100644
index 0000000..5346052
--- /dev/null
+++ b/tempest/tests/test_auth.py
@@ -0,0 +1,210 @@
+# Copyright 2014 IBM Corp.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import copy
+
+from tempest import auth
+from tempest.common import http
+from tempest import config
+from tempest import exceptions
+from tempest.openstack.common.fixture import mockpatch
+from tempest.tests import base
+from tempest.tests import fake_config
+from tempest.tests import fake_http
+from tempest.tests import fake_identity
+
+
+class BaseAuthTestsSetUp(base.TestCase):
+    _auth_provider_class = None
+    credentials = {
+        'username': 'fake_user',
+        'password': 'fake_pwd',
+        'tenant_name': 'fake_tenant'
+    }
+
+    def _auth(self, credentials, **params):
+        """
+        returns auth method according to keystone
+        """
+        return self._auth_provider_class(credentials, **params)
+
+    def setUp(self):
+        super(BaseAuthTestsSetUp, self).setUp()
+        self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakeConfig)
+        self.fake_http = fake_http.fake_httplib2(return_type=200)
+        self.stubs.Set(http.ClosingHttp, 'request', self.fake_http.request)
+        self.auth_provider = self._auth(self.credentials)
+
+
+class TestBaseAuthProvider(BaseAuthTestsSetUp):
+    """
+    This tests auth.AuthProvider class which is base for the other so we
+    obviously don't test not implemented method or the ones which strongly
+    depends on them.
+    """
+    _auth_provider_class = auth.AuthProvider
+
+    def test_check_credentials_is_dict(self):
+        self.assertTrue(self.auth_provider.check_credentials({}))
+
+    def test_check_credentials_bad_type(self):
+        self.assertFalse(self.auth_provider.check_credentials([]))
+
+    def test_instantiate_with_bad_credentials_type(self):
+        """
+        Assure that credentials with bad type fail with TypeError
+        """
+        self.assertRaises(TypeError, self._auth, [])
+
+    def test_auth_data_property(self):
+        self.assertRaises(NotImplementedError, getattr, self.auth_provider,
+                          'auth_data')
+
+    def test_auth_data_property_when_cache_exists(self):
+        self.auth_provider.cache = 'foo'
+        self.useFixture(mockpatch.PatchObject(self.auth_provider,
+                                              'is_expired',
+                                              return_value=False))
+        self.assertEqual('foo', getattr(self.auth_provider, 'auth_data'))
+
+    def test_delete_auth_data_property_through_deleter(self):
+        self.auth_provider.cache = 'foo'
+        del self.auth_provider.auth_data
+        self.assertIsNone(self.auth_provider.cache)
+
+    def test_delete_auth_data_property_through_clear_auth(self):
+        self.auth_provider.cache = 'foo'
+        self.auth_provider.clear_auth()
+        self.assertIsNone(self.auth_provider.cache)
+
+    def test_set_and_reset_alt_auth_data(self):
+        self.auth_provider.set_alt_auth_data('foo', 'bar')
+        self.assertEqual(self.auth_provider.alt_part, 'foo')
+        self.assertEqual(self.auth_provider.alt_auth_data, 'bar')
+
+        self.auth_provider.reset_alt_auth_data()
+        self.assertIsNone(self.auth_provider.alt_part)
+        self.assertIsNone(self.auth_provider.alt_auth_data)
+
+
+class TestKeystoneV2AuthProvider(BaseAuthTestsSetUp):
+    _auth_provider_class = auth.KeystoneV2AuthProvider
+
+    def setUp(self):
+        super(TestKeystoneV2AuthProvider, self).setUp()
+        self.stubs.Set(http.ClosingHttp, 'request',
+                       fake_identity._fake_v2_response)
+        self.target_url = 'test_api'
+
+    def _get_fake_alt_identity(self):
+        return fake_identity.ALT_IDENTITY_V2_RESPONSE['access']
+
+    def _get_result_url_from_fake_identity(self):
+        return fake_identity.COMPUTE_ENDPOINTS_V2['endpoints'][1]['publicURL']
+
+    def _get_token_from_fake_identity(self):
+        return fake_identity.TOKEN
+
+    def _test_request_helper(self):
+        filters = {
+            'service': 'compute',
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+
+        url, headers, body = self.auth_provider.auth_request('GET',
+                                                             self.target_url,
+                                                             filters=filters)
+
+        result_url = self._get_result_url_from_fake_identity()
+        self.assertEqual(url, result_url + '/' + self.target_url)
+        self.assertEqual(self._get_token_from_fake_identity(),
+                         headers['X-Auth-Token'])
+        self.assertEqual(body, None)
+
+    def test_request(self):
+        self._test_request_helper()
+
+    def test_request_with_alt_auth(self):
+        self.auth_provider.set_alt_auth_data(
+            'body',
+            (fake_identity.ALT_TOKEN, self._get_fake_alt_identity()))
+        self._test_request_helper()
+        # Assert alt auth data is clear after it
+        self.assertIsNone(self.auth_provider.alt_part)
+        self.assertIsNone(self.auth_provider.alt_auth_data)
+
+    def test_request_with_bad_service(self):
+        filters = {
+            'service': 'BAD_SERVICE',
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+        self.assertRaises(exceptions.EndpointNotFound,
+                          self.auth_provider.auth_request, 'GET',
+                          'http://fakeurl.com/fake_api', filters=filters)
+
+    def test_request_without_service(self):
+        filters = {
+            'service': None,
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+        self.assertRaises(exceptions.EndpointNotFound,
+                          self.auth_provider.auth_request, 'GET',
+                          'http://fakeurl.com/fake_api', filters=filters)
+
+    def test_check_credentials_missing_attribute(self):
+        for attr in ['username', 'password']:
+            cred = copy.copy(self.credentials)
+            del cred[attr]
+            self.assertFalse(self.auth_provider.check_credentials(cred))
+
+    def test_check_credentials_not_scoped_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['tenant_name']
+        self.assertTrue(self.auth_provider.check_credentials(cred,
+                                                             scoped=False))
+
+    def test_check_credentials_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['tenant_name']
+        self.assertFalse(self.auth_provider.check_credentials(cred))
+
+
+class TestKeystoneV3AuthProvider(TestKeystoneV2AuthProvider):
+    _auth_provider_class = auth.KeystoneV3AuthProvider
+    credentials = {
+        'username': 'fake_user',
+        'password': 'fake_pwd',
+        'tenant_name': 'fake_tenant',
+        'domain_name': 'fake_domain_name',
+    }
+
+    def setUp(self):
+        super(TestKeystoneV3AuthProvider, self).setUp()
+        self.stubs.Set(http.ClosingHttp, 'request',
+                       fake_identity._fake_v3_response)
+
+    def _get_fake_alt_identity(self):
+        return fake_identity.ALT_IDENTITY_V3['token']
+
+    def _get_result_url_from_fake_identity(self):
+        return fake_identity.COMPUTE_ENDPOINTS_V3['endpoints'][1]['url']
+
+    def test_check_credentials_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['domain_name']
+        self.assertFalse(self.auth_provider.check_credentials(cred))
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
