diff --git a/etc/schemas/compute/flavors/flavor_details.json b/etc/schemas/compute/flavors/flavor_details.json
new file mode 100644
index 0000000..c16075c
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavor_details.json
@@ -0,0 +1,8 @@
+{
+    "name": "get-flavor-details",
+    "http-method": "GET",
+    "url": "flavors/%s",
+    "resources": [
+        {"name": "flavor", "expected_result": 404}
+    ]
+}
diff --git a/etc/schemas/compute/flavors/flavors_list.json b/etc/schemas/compute/flavors/flavors_list.json
new file mode 100644
index 0000000..eb8383b
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavors_list.json
@@ -0,0 +1,24 @@
+{
+    "name": "list-flavors-with-detail",
+    "http-method": "GET",
+    "url": "flavors/detail",
+    "json-schema": {
+        "type": "object",
+        "properties": {
+            "minRam": {
+                "type": "integer",
+                "results": {
+                    "gen_none": 400,
+                    "gen_string": 400
+                }
+            },
+            "minDisk": {
+                "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
new file mode 100644
index 0000000..8d974ba
--- /dev/null
+++ b/etc/schemas/compute/servers/get_console_output.json
@@ -0,0 +1,23 @@
+{
+    "name": "get-console-output",
+    "http-method": "POST",
+    "url": "servers/%s/action",
+    "resources": [
+        {"name":"server", "expected_result": 404}
+    ],
+    "json-schema": {
+        "type": "object",
+        "properties": {
+            "os-getConsoleOutput": {
+                "type": "object",
+                "properties": {
+                    "length": {
+                        "type": ["integer", "string"],
+                        "minimum": 0
+                    }
+                }
+            }
+        },
+        "additionalProperties": false
+    }
+}
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index f7f74b8..fe4959b 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -397,6 +397,10 @@
 # (string value)
 #uri_v3=<None>
 
+# Identity API version to be used for authentication for API
+# tests. (string value)
+#auth_version=v2
+
 # The identity region name to use. Also used as the other
 # services' region name unless they are set explicitly. If no
 # such region is found in the service catalog, the first found
@@ -494,7 +498,7 @@
 
 # Matching flavors become parameters for scenario tests
 # (string value)
-#flavor_regex=^m1.(micro|nano|tiny)$
+#flavor_regex=^m1.nano$
 
 # SSH verification in tests is skippedfor matching images
 # (string value)
@@ -748,6 +752,11 @@
 # value)
 #default_thread_number_per_action=4
 
+# Prevent the cleaning (tearDownClass()) between each stress
+# test run if an exception occurs during this run. (boolean
+# value)
+#leave_dirty_stack=false
+
 
 [telemetry]
 
diff --git a/requirements.txt b/requirements.txt
index 3b3e1fa..8c0f872 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,22 +1,22 @@
 pbr>=0.5.21,<1.0
 anyjson>=0.3.3
 nose
-httplib2
-jsonschema>=1.3.0,!=1.4.0
-testtools>=0.9.32
+httplib2>=0.7.5
+jsonschema>=2.0.0,<3.0.0
+testtools>=0.9.34
 lxml>=2.3
 boto>=2.12.0,!=2.13.0
-paramiko>=1.8.0
+paramiko>=1.9.0
 netaddr>=0.7.6
 python-glanceclient>=0.9.0
-python-keystoneclient>=0.4.1
+python-keystoneclient>=0.4.2
 python-novaclient>=2.15.0
-python-neutronclient>=2.3.0,<3
+python-neutronclient>=2.3.3,<3
 python-cinderclient>=1.0.6
 python-heatclient>=0.2.3
 python-swiftclient>=1.5
 testresources>=0.2.4
-keyring>=1.6.1,<2.0
+keyring>=1.6.1,<2.0,>=2.1
 testrepository>=0.0.17
 oslo.config>=1.2.0
 six>=1.4.1
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 98d2550..08d8a0d 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -44,7 +44,7 @@
     def test_aggregate_create_delete(self):
         # Create and delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(None, aggregate['availability_zone'])
@@ -58,7 +58,8 @@
         # Create and delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.assertEqual(200, resp.status)
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(az_name, aggregate['availability_zone'])
@@ -71,7 +72,7 @@
     def test_aggregate_create_verify_entry_in_list(self):
         # Create an aggregate and ensure it is listed.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, aggregates = self.client.list_aggregates()
@@ -84,7 +85,7 @@
     def test_aggregate_create_update_metadata_get_details(self):
         # Create an aggregate and ensure its details are returned.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, body = self.client.get_aggregate(aggregate['id'])
@@ -110,7 +111,8 @@
         # Update an aggregate and ensure properties are updated correctly
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertEqual(200, resp.status)
@@ -141,7 +143,7 @@
         # Add an host to the given aggregate and remove.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, body = self.client.add_host(aggregate['id'], self.host)
@@ -163,7 +165,7 @@
         # Add an host to the given aggregate and list.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
@@ -181,7 +183,7 @@
         # Add an host to the given aggregate and get details.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
@@ -197,7 +199,8 @@
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 5107d8e..7d92532 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -47,14 +47,14 @@
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         self.assertRaises(exceptions.Unauthorized,
                           self.user_client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @attr(type=['negative', 'gate'])
     def test_aggregate_create_aggregate_name_length_less_than_1(self):
         # the length of aggregate name should >= 1 and <=255
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_aggregate,
-                          '')
+                          name='')
 
     @attr(type=['negative', 'gate'])
     def test_aggregate_create_aggregate_name_length_exceeds_255(self):
@@ -62,25 +62,25 @@
         aggregate_name = 'a' * 256
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @attr(type=['negative', 'gate'])
     def test_aggregate_create_with_existent_aggregate_name(self):
         # creating an aggregate with existent aggregate name is forbidden
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertRaises(exceptions.Conflict,
                           self.client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @attr(type=['negative', 'gate'])
     def test_aggregate_delete_as_user(self):
         # Regular user is not allowed to delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -98,7 +98,7 @@
     def test_aggregate_get_details_as_user(self):
         # Regular user is not allowed to get aggregate details.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -129,7 +129,7 @@
                 break
 
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertRaises(exceptions.NotFound, self.client.add_host,
@@ -139,7 +139,7 @@
     def test_aggregate_add_host_as_user(self):
         # Regular user is not allowed to add a host to an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -151,7 +151,7 @@
     def test_aggregate_add_existent_host(self):
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -167,7 +167,7 @@
         # Regular user is not allowed to remove a host from an aggregate.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         resp, body = self.client.add_host(aggregate['id'], self.host)
@@ -182,7 +182,7 @@
     def test_aggregate_remove_nonexistent_host(self):
         non_exist_host = data_utils.rand_name('nonexist_host_')
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(200, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 441c87d..fd069e7 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -161,6 +161,18 @@
                 return
             time.sleep(self.build_interval)
 
+    @staticmethod
+    def _delete_volume(volumes_client, volume_id):
+        """Deletes the given volume and waits for it to be gone."""
+        try:
+            resp, _ = volumes_client.delete_volume(volume_id)
+            # TODO(mriedem): We should move the wait_for_resource_deletion
+            # into the delete_volume method as a convenience to the caller.
+            volumes_client.wait_for_resource_deletion(volume_id)
+        except exceptions.NotFound:
+            LOG.warn("Unable to delete volume '%s' since it was not found. "
+                     "Maybe it was already deleted?" % volume_id)
+
 
 class BaseV2ComputeTest(BaseComputeTest):
 
@@ -188,7 +200,6 @@
         cls.instance_usages_audit_log_client = \
             cls.os.instance_usages_audit_log_client
         cls.hypervisor_client = cls.os.hypervisor_client
-        cls.servers_client_v3_auth = cls.os.servers_client_v3_auth
         cls.certificates_client = cls.os.certificates_client
 
     @classmethod
@@ -229,6 +240,11 @@
         cls.password = server['adminPass']
         return server['id']
 
+    @classmethod
+    def delete_volume(cls, volume_id):
+        """Deletes the given volume and waits for it to be gone."""
+        cls._delete_volume(cls.volumes_extensions_client, volume_id)
+
 
 class BaseV2ComputeAdminTest(BaseV2ComputeTest):
     """Base test case class for Compute Admin V2 API tests."""
@@ -325,6 +341,11 @@
         cls.password = server['admin_password']
         return server['id']
 
+    @classmethod
+    def delete_volume(cls, volume_id):
+        """Deletes the given volume and waits for it to be gone."""
+        cls._delete_volume(cls.volumes_client, volume_id)
+
 
 class BaseV3ComputeAdminTest(BaseV3ComputeTest):
     """Base test case class for all Compute Admin API V3 tests."""
diff --git a/tempest/api/compute/flavors/test_flavors_negative.py b/tempest/api/compute/flavors/test_flavors_negative.py
index 7474996..8ac6182 100644
--- a/tempest/api/compute/flavors/test_flavors_negative.py
+++ b/tempest/api/compute/flavors/test_flavors_negative.py
@@ -13,40 +13,42 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import uuid
+import testscenarios
 
 from tempest.api.compute import base
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
-class FlavorsNegativeTestJSON(base.BaseV2ComputeTest):
+load_tests = testscenarios.load_tests_apply_scenarios
+
+
+class FlavorsListNegativeTestJSON(base.BaseV2ComputeTest,
+                                  test.NegativeAutoTest):
     _interface = 'json'
+    _service = 'compute'
+    _schema_file = 'compute/flavors/flavors_list.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 FlavorDetailsNegativeTestJSON(base.BaseV2ComputeTest,
+                                    test.NegativeAutoTest):
+    _interface = 'json'
+    _service = 'compute'
+    _schema_file = 'compute/flavors/flavor_details.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
 
     @classmethod
     def setUpClass(cls):
-        super(FlavorsNegativeTestJSON, cls).setUpClass()
-        cls.client = cls.flavors_client
+        super(FlavorDetailsNegativeTestJSON, cls).setUpClass()
+        cls.set_resource("flavor", cls.flavor_ref)
 
-    @attr(type=['negative', 'gate'])
-    def test_invalid_minRam_filter(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.list_flavors_with_detail,
-                          {'minRam': 'invalid'})
-
-    @attr(type=['negative', 'gate'])
-    def test_invalid_minDisk_filter(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.list_flavors_with_detail,
-                          {'minDisk': 'invalid'})
-
-    @attr(type=['negative', 'gate'])
-    def test_non_existent_flavor_id(self):
+    @test.attr(type=['negative', 'gate'])
+    def test_get_flavor_details(self):
         # flavor details are not returned for non-existent flavors
-        nonexistent_flavor_id = str(uuid.uuid4())
-        self.assertRaises(exceptions.NotFound, self.client.get_flavor_details,
-                          nonexistent_flavor_id)
-
-
-class FlavorsNegativeTestXML(FlavorsNegativeTestJSON):
-    _interface = 'xml'
+        self.execute(self._schema_file)
diff --git a/tempest/api/compute/flavors/test_flavors_negative_xml.py b/tempest/api/compute/flavors/test_flavors_negative_xml.py
new file mode 100644
index 0000000..c93c7c9
--- /dev/null
+++ b/tempest/api/compute/flavors/test_flavors_negative_xml.py
@@ -0,0 +1,48 @@
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import uuid
+
+from tempest.api.compute import base
+from tempest import exceptions
+from tempest.test import attr
+
+
+class FlavorsNegativeTestXML(base.BaseV2ComputeTest):
+    _interface = 'xml'
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsNegativeTestXML, cls).setUpClass()
+        cls.client = cls.flavors_client
+
+    @attr(type=['negative', 'gate'])
+    def test_invalid_minRam_filter(self):
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.list_flavors_with_detail,
+                          {'minRam': 'invalid'})
+
+    @attr(type=['negative', 'gate'])
+    def test_invalid_minDisk_filter(self):
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.list_flavors_with_detail,
+                          {'minDisk': 'invalid'})
+
+    @attr(type=['negative', 'gate'])
+    def test_non_existent_flavor_id(self):
+        # flavor details are not returned for non-existent flavors
+        nonexistent_flavor_id = str(uuid.uuid4())
+        self.assertRaises(exceptions.NotFound, self.client.get_flavor_details,
+                          nonexistent_flavor_id)
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 89a2f75..4115d65 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -15,8 +15,11 @@
 
 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 ImagesMetadataTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
@@ -24,7 +27,7 @@
     @classmethod
     def setUpClass(cls):
         super(ImagesMetadataTestJSON, cls).setUpClass()
-        if not cls.config.service_available.glance:
+        if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
 
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 15b3faa..15b7b9e 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -143,6 +143,22 @@
         # 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')
+    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')
+    def test_list_servers_filter_by_exceed_limit(self):
+        # Verify only the expected number of servers are returned
+        params = {'limit': 100000}
+        resp, servers = self.client.list_servers(params)
+        resp, all_servers = self.client.list_servers()
+        self.assertEqual(len([x for x in all_servers['servers'] if 'id' in x]),
+                         len([x for x in servers['servers'] if 'id' in x]))
+
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
     @attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index d12f91c..e52ea4a 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2012 OpenStack Foundation
 # All Rights Reserved.
 #
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 45fe5ac..0bf604c 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -24,6 +24,7 @@
 
     @classmethod
     def setUpClass(cls):
+        cls.set_network_resources(network=True, subnet=True, router=True)
         super(ServerRescueTestJSON, cls).setUpClass()
         cls.device = 'vdf'
 
@@ -41,20 +42,10 @@
         cls.sg_id = cls.sg['id']
 
         # Create a volume and wait for it to become ready for attach
-        resp, cls.volume_to_attach = \
-            cls.volumes_extensions_client.create_volume(1,
-                                                        display_name=
-                                                        'test_attach')
+        resp, cls.volume = cls.volumes_extensions_client.create_volume(
+            1, display_name=data_utils.rand_name(cls.__name__ + '_volume'))
         cls.volumes_extensions_client.wait_for_volume_status(
-            cls.volume_to_attach['id'], 'available')
-
-        # Create a volume and wait for it to become ready for attach
-        resp, cls.volume_to_detach = \
-            cls.volumes_extensions_client.create_volume(1,
-                                                        display_name=
-                                                        'test_detach')
-        cls.volumes_extensions_client.wait_for_volume_status(
-            cls.volume_to_detach['id'], 'available')
+            cls.volume['id'], 'available')
 
         # Server for positive tests
         resp, server = cls.create_test_server(wait_until='BUILD')
@@ -78,9 +69,7 @@
     def tearDownClass(cls):
         # Deleting the floating IP which is created in this method
         cls.floating_ips_client.delete_floating_ip(cls.floating_ip_id)
-        client = cls.volumes_extensions_client
-        client.delete_volume(str(cls.volume_to_attach['id']).strip())
-        client.delete_volume(str(cls.volume_to_detach['id']).strip())
+        cls.delete_volume(cls.volume['id'])
         resp, cls.sg = cls.security_groups_client.delete_security_group(
             cls.sg_id)
         super(ServerRescueTestJSON, cls).tearDownClass()
@@ -93,9 +82,6 @@
         self.volumes_extensions_client.wait_for_volume_status(volume_id,
                                                               'available')
 
-    def _delete(self, volume_id):
-        self.volumes_extensions_client.delete_volume(volume_id)
-
     def _unrescue(self, server_id):
         resp, body = self.servers_client.unrescue_server(server_id)
         self.assertEqual(202, resp.status)
@@ -159,32 +145,31 @@
         self.assertRaises(exceptions.Conflict,
                           self.servers_client.attach_volume,
                           self.server_id,
-                          self.volume_to_attach['id'],
+                          self.volume['id'],
                           device='/dev/%s' % self.device)
 
     @attr(type=['negative', 'gate'])
     def test_rescued_vm_detach_volume(self):
         # Attach the volume to the server
         self.servers_client.attach_volume(self.server_id,
-                                          self.volume_to_detach['id'],
+                                          self.volume['id'],
                                           device='/dev/%s' % self.device)
         self.volumes_extensions_client.wait_for_volume_status(
-            self.volume_to_detach['id'], 'in-use')
+            self.volume['id'], 'in-use')
 
         # Rescue the server
         self.servers_client.rescue_server(self.server_id,
                                           adminPass=self.password)
         self.servers_client.wait_for_server_status(self.server_id, 'RESCUE')
         # addCleanup is a LIFO queue
-        self.addCleanup(self._detach, self.server_id,
-                        self.volume_to_detach['id'])
+        self.addCleanup(self._detach, self.server_id, self.volume['id'])
         self.addCleanup(self._unrescue, self.server_id)
 
         # Detach the volume from the server expecting failure
         self.assertRaises(exceptions.Conflict,
                           self.servers_client.detach_volume,
                           self.server_id,
-                          self.volume_to_detach['id'])
+                          self.volume['id'])
 
     @attr(type='gate')
     def test_rescued_vm_associate_dissociate_floating_ip(self):
@@ -212,6 +197,7 @@
         self.servers_client.rescue_server(
             self.server_id, adminPass=self.password)
         self.servers_client.wait_for_server_status(self.server_id, 'RESCUE')
+        self.addCleanup(self._unrescue, self.server_id)
 
         # Add Security group
         resp, body = self.servers_client.add_security_group(self.server_id,
@@ -223,11 +209,6 @@
                                                                self.sg_name)
         self.assertEqual(202, resp.status)
 
-        # Unrescue the server
-        resp, body = self.servers_client.unrescue_server(self.server_id)
-        self.assertEqual(202, resp.status)
-        self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
-
 
 class ServerRescueTestXML(ServerRescueTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_servers_negative_new.py b/tempest/api/compute/servers/test_servers_negative_new.py
new file mode 100644
index 0000000..2b2fcf1
--- /dev/null
+++ b/tempest/api/compute/servers/test_servers_negative_new.py
@@ -0,0 +1,41 @@
+# Copyright 2014 Red Hat, Inc & Deutsche Telekom AG
+# 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 GetConsoleOutputNegativeTestJSON(base.BaseV2ComputeTest,
+                                       test.NegativeAutoTest):
+    _interface = 'json'
+    _service = 'compute'
+    _schema_file = 'compute/servers/get_console_output.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+    @classmethod
+    def setUpClass(cls):
+        super(GetConsoleOutputNegativeTestJSON, cls).setUpClass()
+        _resp, server = cls.create_test_server()
+        cls.set_resource("server", server['id'])
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_console_output(self):
+        self.execute(self._schema_file)
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 4774fec..ed72061 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -57,7 +57,6 @@
         cls.alt_keypairs_client = cls.alt_manager.keypairs_client
         cls.alt_security_client = cls.alt_manager.security_groups_client
 
-        cls.alt_security_client._set_auth()
         resp, server = cls.create_test_server(wait_until='ACTIVE')
         resp, cls.server = cls.client.get_server(server['id'])
 
@@ -174,16 +173,14 @@
     def test_create_server_fails_when_tenant_incorrect(self):
         # A create server request should fail if the tenant id does not match
         # the current user
-        saved_base_url = self.alt_client.base_url
-        try:
-            # Change the base URL to impersonate another user
-            self.alt_client.base_url = self.client.base_url
-            self.assertRaises(exceptions.BadRequest,
-                              self.alt_client.create_server, 'test',
-                              self.image['id'], self.flavor_ref)
-        finally:
-            # Reset the base_url...
-            self.alt_client.base_url = saved_base_url
+        # Change the base URL to impersonate another user
+        self.alt_client.auth_provider.set_alt_auth_data(
+            request_part='url',
+            auth_data=self.client.auth_provider.auth_data
+        )
+        self.assertRaises(exceptions.BadRequest,
+                          self.alt_client.create_server, 'test',
+                          self.image['id'], self.flavor_ref)
 
     @attr(type='gate')
     def test_create_keypair_in_analt_user_tenant(self):
@@ -191,18 +188,18 @@
         # the current user
         # POST keypair with other user tenant
         k_name = data_utils.rand_name('keypair-')
-        self.alt_keypairs_client._set_auth()
-        self.saved_base_url = self.alt_keypairs_client.base_url
         try:
             # Change the base URL to impersonate another user
-            self.alt_keypairs_client.base_url = self.keypairs_client.base_url
+            self.alt_keypairs_client.auth_provider.set_alt_auth_data(
+                request_part='url',
+                auth_data=self.keypairs_client.auth_provider.auth_data
+            )
             resp = {}
             resp['status'] = None
             self.assertRaises(exceptions.BadRequest,
                               self.alt_keypairs_client.create_keypair, k_name)
         finally:
-            # Reset the base_url...
-            self.alt_keypairs_client.base_url = self.saved_base_url
+            # Next request the base_url is back to normal
             if (resp['status'] is not None):
                 resp, _ = self.alt_keypairs_client.delete_keypair(k_name)
                 LOG.error("Create keypair request should not happen "
@@ -242,18 +239,19 @@
         # POST security group with other user tenant
         s_name = data_utils.rand_name('security-')
         s_description = data_utils.rand_name('security')
-        self.saved_base_url = self.alt_security_client.base_url
         try:
             # Change the base URL to impersonate another user
-            self.alt_security_client.base_url = self.security_client.base_url
+            self.alt_security_client.auth_provider.set_alt_auth_data(
+                request_part='url',
+                auth_data=self.security_client.auth_provider.auth_data
+            )
             resp = {}
             resp['status'] = None
             self.assertRaises(exceptions.BadRequest,
                               self.alt_security_client.create_security_group,
                               s_name, s_description)
         finally:
-            # Reset the base_url...
-            self.alt_security_client.base_url = self.saved_base_url
+            # Next request the base_url is back to normal
             if resp['status'] is not None:
                 self.alt_security_client.delete_security_group(resp['id'])
                 LOG.error("Create Security Group request should not happen if"
@@ -282,10 +280,12 @@
         ip_protocol = 'icmp'
         from_port = -1
         to_port = -1
-        self.saved_base_url = self.alt_security_client.base_url
         try:
             # Change the base URL to impersonate another user
-            self.alt_security_client.base_url = self.security_client.base_url
+            self.alt_security_client.auth_provider.set_alt_auth_data(
+                request_part='url',
+                auth_data=self.security_client.auth_provider.auth_data
+            )
             resp = {}
             resp['status'] = None
             self.assertRaises(exceptions.BadRequest,
@@ -294,8 +294,7 @@
                               parent_group_id, ip_protocol, from_port,
                               to_port)
         finally:
-            # Reset the base_url...
-            self.alt_security_client.base_url = self.saved_base_url
+            # Next request the base_url is back to normal
             if resp['status'] is not None:
                 self.alt_security_client.delete_security_group_rule(resp['id'])
                 LOG.error("Create security group rule request should not "
diff --git a/tempest/api/compute/v3/admin/test_aggregates.py b/tempest/api/compute/v3/admin/test_aggregates.py
index 956eddd..b8b478d 100644
--- a/tempest/api/compute/v3/admin/test_aggregates.py
+++ b/tempest/api/compute/v3/admin/test_aggregates.py
@@ -19,7 +19,7 @@
 from tempest import test
 
 
-class AggregatesAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class AggregatesAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Aggregates API that require admin privileges
@@ -30,7 +30,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(AggregatesAdminV3TestJSON, cls).setUpClass()
+        super(AggregatesAdminV3Test, cls).setUpClass()
         cls.client = cls.aggregates_admin_client
         cls.user_client = cls.aggregates_client
         cls.aggregate_name_prefix = 'test_aggregate_'
@@ -45,7 +45,7 @@
     def test_aggregate_create_delete(self):
         # Create and delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(None, aggregate['availability_zone'])
@@ -59,7 +59,8 @@
         # Create and delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.assertEqual(201, resp.status)
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(az_name, aggregate['availability_zone'])
@@ -72,7 +73,7 @@
     def test_aggregate_create_verify_entry_in_list(self):
         # Create an aggregate and ensure it is listed.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, aggregates = self.client.list_aggregates()
@@ -85,7 +86,7 @@
     def test_aggregate_create_update_metadata_get_details(self):
         # Create an aggregate and ensure its details are returned.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, body = self.client.get_aggregate(aggregate['id'])
@@ -112,7 +113,8 @@
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertEqual(201, resp.status)
@@ -143,7 +145,7 @@
         # Add an host to the given aggregate and remove.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         resp, body = self.client.add_host(aggregate['id'], self.host)
@@ -165,7 +167,7 @@
         # Add an host to the given aggregate and list.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
@@ -183,7 +185,7 @@
         # Add an host to the given aggregate and get details.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
@@ -199,7 +201,8 @@
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         az_name = data_utils.rand_name(self.az_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        resp, aggregate = self.client.create_aggregate(
+            name=aggregate_name, availability_zone=az_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         self.client.add_host(aggregate['id'], self.host)
         self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
diff --git a/tempest/api/compute/v3/admin/test_aggregates_negative.py b/tempest/api/compute/v3/admin/test_aggregates_negative.py
index da3568a..5700460 100644
--- a/tempest/api/compute/v3/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/v3/admin/test_aggregates_negative.py
@@ -20,7 +20,7 @@
 from tempest import test
 
 
-class AggregatesAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class AggregatesAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Aggregates API that require admin privileges
@@ -30,7 +30,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(AggregatesAdminNegativeV3TestJSON, cls).setUpClass()
+        super(AggregatesAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.aggregates_admin_client
         cls.user_client = cls.aggregates_client
         cls.aggregate_name_prefix = 'test_aggregate_'
@@ -47,14 +47,14 @@
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
         self.assertRaises(exceptions.Unauthorized,
                           self.user_client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @test.attr(type=['negative', 'gate'])
     def test_aggregate_create_aggregate_name_length_less_than_1(self):
         # the length of aggregate name should >= 1 and <=255
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_aggregate,
-                          '')
+                          name='')
 
     @test.attr(type=['negative', 'gate'])
     def test_aggregate_create_aggregate_name_length_exceeds_255(self):
@@ -62,25 +62,25 @@
         aggregate_name = 'a' * 256
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @test.attr(type=['negative', 'gate'])
     def test_aggregate_create_with_existent_aggregate_name(self):
         # creating an aggregate with existent aggregate name is forbidden
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertRaises(exceptions.Conflict,
                           self.client.create_aggregate,
-                          aggregate_name)
+                          name=aggregate_name)
 
     @test.attr(type=['negative', 'gate'])
     def test_aggregate_delete_as_user(self):
         # Regular user is not allowed to delete an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -98,7 +98,7 @@
     def test_aggregate_get_details_as_user(self):
         # Regular user is not allowed to get aggregate details.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -129,7 +129,7 @@
                 break
 
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
         self.assertRaises(exceptions.NotFound, self.client.add_host,
@@ -139,7 +139,7 @@
     def test_aggregate_add_host_as_user(self):
         # Regular user is not allowed to add a host to an aggregate.
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -151,7 +151,7 @@
     def test_aggregate_add_existent_host(self):
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
@@ -167,7 +167,7 @@
         # Regular user is not allowed to remove a host from an aggregate.
         self.useFixture(fixtures.LockFixture('availability_zone'))
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
         resp, body = self.client.add_host(aggregate['id'], self.host)
@@ -182,7 +182,7 @@
     def test_aggregate_remove_nonexistent_host(self):
         non_exist_host = data_utils.rand_name('nonexist_host_')
         aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
-        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        resp, aggregate = self.client.create_aggregate(name=aggregate_name)
         self.assertEqual(201, resp.status)
         self.addCleanup(self.client.delete_aggregate, aggregate['id'])
 
diff --git a/tempest/api/compute/v3/admin/test_availability_zone.py b/tempest/api/compute/v3/admin/test_availability_zone.py
index 5ced2b1..57ac869 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone.py
@@ -17,7 +17,7 @@
 from tempest.test import attr
 
 
-class AZAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class AZAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Availability Zone API List
@@ -27,7 +27,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(AZAdminV3TestJSON, cls).setUpClass()
+        super(AZAdminV3Test, cls).setUpClass()
         cls.client = cls.availability_zone_admin_client
         cls.non_adm_client = cls.availability_zone_client
 
diff --git a/tempest/api/compute/v3/admin/test_availability_zone_negative.py b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
index 60cd1d6..180f298 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class AZAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class AZAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Availability Zone API List
@@ -28,7 +28,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(AZAdminNegativeV3TestJSON, cls).setUpClass()
+        super(AZAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.availability_zone_admin_client
         cls.non_adm_client = cls.availability_zone_client
 
diff --git a/tempest/api/compute/v3/admin/test_flavors_access.py b/tempest/api/compute/v3/admin/test_flavors_access.py
index d668640..43dc726 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class FlavorsAccessV3TestJSON(base.BaseV3ComputeAdminTest):
+class FlavorsAccessV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Flavor Access API extension.
@@ -29,7 +29,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(FlavorsAccessV3TestJSON, cls).setUpClass()
+        super(FlavorsAccessV3Test, cls).setUpClass()
 
         cls.client = cls.flavors_admin_client
         admin_client = cls._get_identity_admin_client()
@@ -44,6 +44,7 @@
         cls.vcpus = 1
         cls.disk = 10
 
+    @test.skip_because(bug='1265416')
     @test.attr(type='gate')
     def test_flavor_access_list_with_private_flavor(self):
         # Test to list flavor access successfully by querying private flavor
@@ -63,6 +64,7 @@
         self.assertEqual(str(new_flavor_id), str(first_flavor['flavor_id']))
         self.assertEqual(self.adm_tenant_id, first_flavor['tenant_id'])
 
+    @test.skip_because(bug='1265416')
     @test.attr(type='gate')
     def test_flavor_access_add_remove(self):
         # Test to add and remove flavor access to a given tenant.
diff --git a/tempest/api/compute/v3/admin/test_flavors_access_negative.py b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
index 8595b2c..6a2e826 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
@@ -21,7 +21,7 @@
 from tempest import test
 
 
-class FlavorsAccessNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class FlavorsAccessNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Flavor Access API extension.
@@ -32,7 +32,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(FlavorsAccessNegativeV3TestJSON, cls).setUpClass()
+        super(FlavorsAccessNegativeV3Test, cls).setUpClass()
 
         cls.client = cls.flavors_admin_client
         admin_client = cls._get_identity_admin_client()
@@ -63,6 +63,7 @@
                           self.client.list_flavor_access,
                           new_flavor_id)
 
+    @test.skip_because(bug='1265416')
     @test.attr(type=['negative', 'gate'])
     def test_flavor_non_admin_add(self):
         # Test to add flavor access as a user without admin privileges.
@@ -79,6 +80,7 @@
                           new_flavor['id'],
                           self.tenant_id)
 
+    @test.skip_because(bug='1265416')
     @test.attr(type=['negative', 'gate'])
     def test_flavor_non_admin_remove(self):
         # Test to remove flavor access as a user without admin privileges.
@@ -99,6 +101,7 @@
                           new_flavor['id'],
                           self.tenant_id)
 
+    @test.skip_because(bug='1265416')
     @test.attr(type=['negative', 'gate'])
     def test_add_flavor_access_duplicate(self):
         # Create a new flavor.
@@ -123,6 +126,7 @@
                           new_flavor['id'],
                           self.tenant_id)
 
+    @test.skip_because(bug='1265416')
     @test.attr(type=['negative', 'gate'])
     def test_remove_flavor_access_not_found(self):
         # Create a new flavor.
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
index 0363fcb..4d22027 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class FlavorsExtraSpecsV3TestJSON(base.BaseV3ComputeAdminTest):
+class FlavorsExtraSpecsV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Flavor Extra Spec API extension.
@@ -30,7 +30,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(FlavorsExtraSpecsV3TestJSON, cls).setUpClass()
+        super(FlavorsExtraSpecsV3Test, cls).setUpClass()
 
         cls.client = cls.flavors_admin_client
         flavor_name = data_utils.rand_name('test_flavor')
@@ -53,7 +53,7 @@
     def tearDownClass(cls):
         resp, body = cls.client.delete_flavor(cls.flavor['id'])
         cls.client.wait_for_resource_deletion(cls.flavor['id'])
-        super(FlavorsExtraSpecsV3TestJSON, cls).tearDownClass()
+        super(FlavorsExtraSpecsV3Test, cls).tearDownClass()
 
     @test.attr(type='gate')
     def test_flavor_set_get_update_show_unset_keys(self):
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
index 0f300a1..98e6e3d 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
@@ -20,7 +20,7 @@
 from tempest import test
 
 
-class FlavorsExtraSpecsNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class FlavorsExtraSpecsNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Negative Tests Flavor Extra Spec API extension.
@@ -31,7 +31,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(FlavorsExtraSpecsNegativeV3TestJSON, cls).setUpClass()
+        super(FlavorsExtraSpecsNegativeV3Test, cls).setUpClass()
 
         cls.client = cls.flavors_admin_client
         flavor_name = data_utils.rand_name('test_flavor')
@@ -54,7 +54,7 @@
     def tearDownClass(cls):
         resp, body = cls.client.delete_flavor(cls.flavor['id'])
         cls.client.wait_for_resource_deletion(cls.flavor['id'])
-        super(FlavorsExtraSpecsNegativeV3TestJSON, cls).tearDownClass()
+        super(FlavorsExtraSpecsNegativeV3Test, cls).tearDownClass()
 
     @test.attr(type=['negative', 'gate'])
     def test_flavor_non_admin_set_keys(self):
diff --git a/tempest/api/compute/v3/admin/test_hosts.py b/tempest/api/compute/v3/admin/test_hosts.py
index 8199ee8..2c9369f 100644
--- a/tempest/api/compute/v3/admin/test_hosts.py
+++ b/tempest/api/compute/v3/admin/test_hosts.py
@@ -17,7 +17,7 @@
 from tempest import test
 
 
-class HostsAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class HostsAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests hosts API using admin privileges.
@@ -27,7 +27,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(HostsAdminV3TestJSON, cls).setUpClass()
+        super(HostsAdminV3Test, cls).setUpClass()
         cls.client = cls.hosts_admin_client
 
     @test.attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_hosts_negative.py b/tempest/api/compute/v3/admin/test_hosts_negative.py
index aa50618..ac5d7de 100644
--- a/tempest/api/compute/v3/admin/test_hosts_negative.py
+++ b/tempest/api/compute/v3/admin/test_hosts_negative.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class HostsAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class HostsAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests hosts API using admin privileges.
@@ -28,7 +28,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(HostsAdminNegativeV3TestJSON, cls).setUpClass()
+        super(HostsAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.hosts_admin_client
         cls.non_admin_client = cls.hosts_client
 
diff --git a/tempest/api/compute/v3/admin/test_hypervisor.py b/tempest/api/compute/v3/admin/test_hypervisor.py
index 8bd4abb..0f96bba 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor.py
@@ -17,7 +17,7 @@
 from tempest.test import attr
 
 
-class HypervisorAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class HypervisorAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Hypervisors API that require admin privileges
@@ -27,7 +27,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(HypervisorAdminV3TestJSON, cls).setUpClass()
+        super(HypervisorAdminV3Test, cls).setUpClass()
         cls.client = cls.hypervisor_admin_client
 
     def _list_hypervisors(self):
diff --git a/tempest/api/compute/v3/admin/test_hypervisor_negative.py b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
index 63e8cae..aee354a 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class HypervisorAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class HypervisorAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Hypervisors API that require admin privileges
@@ -31,7 +31,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(HypervisorAdminNegativeV3TestJSON, cls).setUpClass()
+        super(HypervisorAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.hypervisor_admin_client
         cls.non_adm_client = cls.hypervisor_client
 
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
index 9651338..a86b7f5 100644
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
@@ -20,13 +20,13 @@
 from tempest import test
 
 
-class InstanceUsageAuditLogV3TestJSON(base.BaseV3ComputeAdminTest):
+class InstanceUsageAuditLogV3Test(base.BaseV3ComputeAdminTest):
 
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(InstanceUsageAuditLogV3TestJSON, cls).setUpClass()
+        super(InstanceUsageAuditLogV3Test, cls).setUpClass()
         cls.adm_client = cls.instance_usages_audit_log_admin_client
 
     @test.attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
index 8ed1a98..0438825 100644
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
@@ -18,13 +18,13 @@
 from tempest import test
 
 
-class InstanceUsageLogNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class InstanceUsageLogNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(InstanceUsageLogNegativeV3TestJSON, cls).setUpClass()
+        super(InstanceUsageLogNegativeV3Test, cls).setUpClass()
         cls.adm_client = cls.instance_usages_audit_log_admin_client
 
     @test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/v3/admin/test_quotas.py b/tempest/api/compute/v3/admin/test_quotas.py
index ad3519d..ccb9d8e 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -22,13 +22,13 @@
 CONF = config.CONF
 
 
-class QuotasAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class QuotasAdminV3Test(base.BaseV3ComputeAdminTest):
     _interface = 'json'
     force_tenant_isolation = True
 
     @classmethod
     def setUpClass(cls):
-        super(QuotasAdminV3TestJSON, cls).setUpClass()
+        super(QuotasAdminV3Test, cls).setUpClass()
         cls.auth_url = CONF.identity.uri
         cls.client = cls.quotas_client
         cls.adm_client = cls.quotas_admin_client
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index a8e1a0a..ef9eedc 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -20,7 +20,7 @@
 from tempest.test import skip_because
 
 
-class ServersAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class ServersAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Servers API using admin privileges
@@ -30,7 +30,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServersAdminV3TestJSON, cls).setUpClass()
+        super(ServersAdminV3Test, cls).setUpClass()
         cls.client = cls.servers_admin_client
         cls.non_admin_client = cls.servers_client
         cls.flavors_client = cls.flavors_admin_client
diff --git a/tempest/api/compute/v3/admin/test_servers_negative.py b/tempest/api/compute/v3/admin/test_servers_negative.py
index a86bdfc..a6a5736 100644
--- a/tempest/api/compute/v3/admin/test_servers_negative.py
+++ b/tempest/api/compute/v3/admin/test_servers_negative.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServersAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class ServersAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Servers API using admin privileges
@@ -30,7 +30,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServersAdminNegativeV3TestJSON, cls).setUpClass()
+        super(ServersAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.servers_admin_client
         cls.non_adm_client = cls.servers_client
         cls.flavors_client = cls.flavors_admin_client
diff --git a/tempest/api/compute/v3/admin/test_services.py b/tempest/api/compute/v3/admin/test_services.py
index 9e55e78..8d6e549 100644
--- a/tempest/api/compute/v3/admin/test_services.py
+++ b/tempest/api/compute/v3/admin/test_services.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class ServicesAdminV3TestJSON(base.BaseV3ComputeAdminTest):
+class ServicesAdminV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Services API. List and Enable/Disable require admin privileges.
@@ -28,7 +28,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServicesAdminV3TestJSON, cls).setUpClass()
+        super(ServicesAdminV3Test, cls).setUpClass()
         cls.client = cls.services_admin_client
 
     @attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_services_negative.py b/tempest/api/compute/v3/admin/test_services_negative.py
index 1382347..c270842 100644
--- a/tempest/api/compute/v3/admin/test_services_negative.py
+++ b/tempest/api/compute/v3/admin/test_services_negative.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class ServicesAdminNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class ServicesAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     """
     Tests Services API. List and Enable/Disable require admin privileges.
@@ -29,7 +29,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServicesAdminNegativeV3TestJSON, cls).setUpClass()
+        super(ServicesAdminNegativeV3Test, cls).setUpClass()
         cls.client = cls.services_admin_client
         cls.non_admin_client = cls.services_client
 
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
index 7ee835b..e16332f 100644
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
@@ -21,13 +21,13 @@
 import time
 
 
-class TenantUsagesV3TestJSON(base.BaseV3ComputeAdminTest):
+class TenantUsagesV3Test(base.BaseV3ComputeAdminTest):
 
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(TenantUsagesV3TestJSON, cls).setUpClass()
+        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()
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
index 00068dc..17849c5 100644
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
@@ -21,13 +21,13 @@
 from tempest.test import attr
 
 
-class TenantUsagesNegativeV3TestJSON(base.BaseV3ComputeAdminTest):
+class TenantUsagesNegativeV3Test(base.BaseV3ComputeAdminTest):
 
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(TenantUsagesNegativeV3TestJSON, cls).setUpClass()
+        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()
diff --git a/tempest/api/compute/v3/certificates/test_certificates.py b/tempest/api/compute/v3/certificates/test_certificates.py
index b24f4d8..5c980c0 100644
--- a/tempest/api/compute/v3/certificates/test_certificates.py
+++ b/tempest/api/compute/v3/certificates/test_certificates.py
@@ -17,7 +17,7 @@
 from tempest.test import attr
 
 
-class CertificatesV3TestJSON(base.BaseV3ComputeTest):
+class CertificatesV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/compute/v3/images/test_image_metadata.py b/tempest/api/compute/v3/images/test_image_metadata.py
index e9ca04a..cd4e5e7 100644
--- a/tempest/api/compute/v3/images/test_image_metadata.py
+++ b/tempest/api/compute/v3/images/test_image_metadata.py
@@ -21,12 +21,12 @@
 CONF = config.CONF
 
 
-class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
+class ImagesMetadataTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesMetadataTestJSON, cls).setUpClass()
+        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)
@@ -47,10 +47,10 @@
     @classmethod
     def tearDownClass(cls):
         cls.client.delete_image(cls.image_id)
-        super(ImagesMetadataTestJSON, cls).tearDownClass()
+        super(ImagesMetadataTest, cls).tearDownClass()
 
     def setUp(self):
-        super(ImagesMetadataTestJSON, self).setUp()
+        super(ImagesMetadataTest, self).setUp()
         meta = {'key1': 'value1', 'key2': 'value2'}
         resp, _ = self.client.set_image_metadata(self.image_id, meta)
         self.assertEqual(resp.status, 200)
diff --git a/tempest/api/compute/v3/images/test_image_metadata_negative.py b/tempest/api/compute/v3/images/test_image_metadata_negative.py
index 6e7cc8f..e76af2c 100644
--- a/tempest/api/compute/v3/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/v3/images/test_image_metadata_negative.py
@@ -19,12 +19,12 @@
 from tempest.test import attr
 
 
-class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
+class ImagesMetadataTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesMetadataTestJSON, cls).setUpClass()
+        super(ImagesMetadataTest, cls).setUpClass()
         cls.client = cls.images_client
 
     @attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/v3/images/test_images.py b/tempest/api/compute/v3/images/test_images.py
index 4ef6f25..bbb84fb 100644
--- a/tempest/api/compute/v3/images/test_images.py
+++ b/tempest/api/compute/v3/images/test_images.py
@@ -22,12 +22,12 @@
 CONF = config.CONF
 
 
-class ImagesV3TestJSON(base.BaseV3ComputeTest):
+class ImagesV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesV3TestJSON, cls).setUpClass()
+        super(ImagesV3Test, cls).setUpClass()
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/v3/images/test_images_oneserver.py b/tempest/api/compute/v3/images/test_images_oneserver.py
index 992d158..18772df 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver.py
@@ -26,7 +26,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
+class ImagesOneServerTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     def tearDown(self):
@@ -34,12 +34,12 @@
         for image_id in self.image_ids:
             self.client.delete_image(image_id)
             self.image_ids.remove(image_id)
-        super(ImagesOneServerTestJSON, self).tearDown()
+        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(ImagesOneServerTestJSON, self).setUp()
+        super(ImagesOneServerTest, 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 +53,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerTestJSON, cls).setUpClass()
+        super(ImagesOneServerTest, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
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 3404823..bc276d1 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
@@ -28,7 +28,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
+class ImagesOneServerNegativeTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     def tearDown(self):
@@ -36,12 +36,12 @@
         for image_id in self.image_ids:
             self.client.delete_image(image_id)
             self.image_ids.remove(image_id)
-        super(ImagesOneServerNegativeTestJSON, self).tearDown()
+        super(ImagesOneServerNegativeTest, 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(ImagesOneServerNegativeTestJSON, self).setUp()
+        super(ImagesOneServerNegativeTest, 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 +58,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerNegativeTestJSON, cls).setUpClass()
+        super(ImagesOneServerNegativeTest, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
diff --git a/tempest/api/compute/v3/images/test_list_image_filters.py b/tempest/api/compute/v3/images/test_list_image_filters.py
index 82b9625..457ca53 100644
--- a/tempest/api/compute/v3/images/test_list_image_filters.py
+++ b/tempest/api/compute/v3/images/test_list_image_filters.py
@@ -24,12 +24,12 @@
 LOG = logging.getLogger(__name__)
 
 
-class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
+class ListImageFiltersTest(base.BaseV2ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ListImageFiltersTestJSON, cls).setUpClass()
+        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)
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs.py b/tempest/api/compute/v3/keypairs/test_keypairs.py
index 4aef8b1..8eef811 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs.py
@@ -18,12 +18,12 @@
 from tempest import test
 
 
-class KeyPairsV3TestJSON(base.BaseV3ComputeTest):
+class KeyPairsV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(KeyPairsV3TestJSON, cls).setUpClass()
+        super(KeyPairsV3Test, cls).setUpClass()
         cls.client = cls.keypairs_client
 
     def _delete_keypair(self, keypair_name):
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
index 87f62b7..ae22ccc 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
@@ -20,12 +20,12 @@
 from tempest import test
 
 
-class KeyPairsNegativeV3TestJSON(base.BaseV3ComputeTest):
+class KeyPairsNegativeV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(KeyPairsNegativeV3TestJSON, cls).setUpClass()
+        super(KeyPairsNegativeV3Test, cls).setUpClass()
         cls.client = cls.keypairs_client
 
     def _create_keypair(self, keypair_name, pub_key=None):
diff --git a/tempest/api/compute/v3/servers/test_attach_interfaces.py b/tempest/api/compute/v3/servers/test_attach_interfaces.py
index 634d06f..272cb53 100644
--- a/tempest/api/compute/v3/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/v3/servers/test_attach_interfaces.py
@@ -23,7 +23,7 @@
 CONF = config.CONF
 
 
-class AttachInterfacesV3TestJSON(base.BaseV3ComputeTest):
+class AttachInterfacesV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
@@ -32,7 +32,7 @@
             raise cls.skipException("Neutron is required")
         # This test class requires network and subnet
         cls.set_network_resources(network=True, subnet=True)
-        super(AttachInterfacesV3TestJSON, cls).setUpClass()
+        super(AttachInterfacesV3Test, cls).setUpClass()
         cls.client = cls.interfaces_client
 
     def _check_interface(self, iface, port_id=None, network_id=None,
diff --git a/tempest/api/compute/v3/servers/test_attach_volume.py b/tempest/api/compute/v3/servers/test_attach_volume.py
index 6ae74ff..d693be5 100644
--- a/tempest/api/compute/v3/servers/test_attach_volume.py
+++ b/tempest/api/compute/v3/servers/test_attach_volume.py
@@ -23,19 +23,19 @@
 CONF = config.CONF
 
 
-class AttachVolumeV3TestJSON(base.BaseV3ComputeTest):
+class AttachVolumeV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
     run_ssh = CONF.compute.run_ssh
 
     def __init__(self, *args, **kwargs):
-        super(AttachVolumeV3TestJSON, self).__init__(*args, **kwargs)
+        super(AttachVolumeV3Test, self).__init__(*args, **kwargs)
         self.server = None
         self.volume = None
         self.attached = False
 
     @classmethod
     def setUpClass(cls):
-        super(AttachVolumeV3TestJSON, cls).setUpClass()
+        super(AttachVolumeV3Test, cls).setUpClass()
         cls.device = CONF.compute.volume_device_name
         if not CONF.service_available.cinder:
             skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
diff --git a/tempest/api/compute/v3/servers/test_create_server.py b/tempest/api/compute/v3/servers/test_create_server.py
index cb02894..7a4c877 100644
--- a/tempest/api/compute/v3/servers/test_create_server.py
+++ b/tempest/api/compute/v3/servers/test_create_server.py
@@ -27,14 +27,14 @@
 CONF = config.CONF
 
 
-class ServersV3TestJSON(base.BaseV3ComputeTest):
+class ServersV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
     run_ssh = CONF.compute.run_ssh
     disk_config = 'AUTO'
 
     @classmethod
     def setUpClass(cls):
-        super(ServersV3TestJSON, cls).setUpClass()
+        super(ServersV3Test, cls).setUpClass()
         cls.meta = {'hello': 'world'}
         cls.accessIPv4 = '1.1.1.1'
         cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
@@ -115,14 +115,14 @@
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
 
-class ServersWithSpecificFlavorV3TestJSON(base.BaseV3ComputeAdminTest):
+class ServersWithSpecificFlavorV3Test(base.BaseV3ComputeAdminTest):
     _interface = 'json'
     run_ssh = CONF.compute.run_ssh
     disk_config = 'AUTO'
 
     @classmethod
     def setUpClass(cls):
-        super(ServersWithSpecificFlavorV3TestJSON, cls).setUpClass()
+        super(ServersWithSpecificFlavorV3Test, cls).setUpClass()
         cls.meta = {'hello': 'world'}
         cls.accessIPv4 = '1.1.1.1'
         cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
@@ -213,7 +213,7 @@
         self.assertEqual(partition_num + 1, linux_client.get_partitions())
 
 
-class ServersV3TestManualDisk(ServersV3TestJSON):
+class ServersV3TestManualDisk(ServersV3Test):
     disk_config = 'MANUAL'
 
     @classmethod
diff --git a/tempest/api/compute/v3/servers/test_instance_actions.py b/tempest/api/compute/v3/servers/test_instance_actions.py
index dd5dd30..d536871 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions.py
@@ -18,12 +18,12 @@
 from tempest.test import attr
 
 
-class InstanceActionsV3TestJSON(base.BaseV3ComputeTest):
+class InstanceActionsV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(InstanceActionsV3TestJSON, cls).setUpClass()
+        super(InstanceActionsV3Test, cls).setUpClass()
         cls.client = cls.servers_client
         resp, server = cls.create_test_server(wait_until='ACTIVE')
         cls.request_id = resp['x-compute-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 533a2c2..9082eda 100644
--- a/tempest/api/compute/v3/servers/test_list_server_filters.py
+++ b/tempest/api/compute/v3/servers/test_list_server_filters.py
@@ -24,12 +24,12 @@
 CONF = config.CONF
 
 
-class ListServerFiltersV3TestJSON(base.BaseV3ComputeTest):
+class ListServerFiltersV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ListServerFiltersV3TestJSON, cls).setUpClass()
+        super(ListServerFiltersV3Test, cls).setUpClass()
         cls.client = cls.servers_client
 
         # Check to see if the alternate image ref actually exists...
@@ -125,6 +125,22 @@
         resp, servers = self.client.list_servers(params)
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
+    @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')
+    def test_list_servers_filter_by_exceed_limit(self):
+        # Verify only the expected number of servers are returned
+        params = {'limit': 100000}
+        resp, servers = self.client.list_servers(params)
+        resp, all_servers = self.client.list_servers()
+        self.assertEqual(len([x for x in all_servers['servers'] if 'id' in x]),
+                         len([x for x in servers['servers'] if 'id' in x]))
+
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
     @attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
diff --git a/tempest/api/compute/v3/servers/test_list_servers_negative.py b/tempest/api/compute/v3/servers/test_list_servers_negative.py
index 23f2bda..09e1bb6 100644
--- a/tempest/api/compute/v3/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_list_servers_negative.py
@@ -20,13 +20,13 @@
 from tempest.test import attr
 
 
-class ListServersNegativeV3TestJSON(base.BaseV3ComputeTest):
+class ListServersNegativeV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
     force_tenant_isolation = True
 
     @classmethod
     def setUpClass(cls):
-        super(ListServersNegativeV3TestJSON, cls).setUpClass()
+        super(ListServersNegativeV3Test, cls).setUpClass()
         cls.client = cls.servers_client
 
         # The following servers are created for use
diff --git a/tempest/api/compute/v3/servers/test_multiple_create.py b/tempest/api/compute/v3/servers/test_multiple_create.py
index 429a8ba..f1ae5f8 100644
--- a/tempest/api/compute/v3/servers/test_multiple_create.py
+++ b/tempest/api/compute/v3/servers/test_multiple_create.py
@@ -19,7 +19,7 @@
 from tempest import test
 
 
-class MultipleCreateV3TestJSON(base.BaseV3ComputeTest):
+class MultipleCreateV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
     _name = 'multiple-create-test'
 
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index b8dc85b..0dae796 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -28,7 +28,7 @@
 CONF = config.CONF
 
 
-class ServerActionsV3TestJSON(base.BaseV3ComputeTest):
+class ServerActionsV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
     resize_available = CONF.compute_feature_enabled.resize
     run_ssh = CONF.compute.run_ssh
@@ -36,7 +36,7 @@
     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(ServerActionsV3TestJSON, self).setUp()
+        super(ServerActionsV3Test, self).setUp()
         # Check if the server is in a clean state after test
         try:
             self.client.wait_for_server_status(self.server_id, 'ACTIVE')
@@ -46,7 +46,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServerActionsV3TestJSON, cls).setUpClass()
+        super(ServerActionsV3Test, cls).setUpClass()
         cls.client = cls.servers_client
         cls.server_id = cls.rebuild_server(None)
 
diff --git a/tempest/api/compute/v3/servers/test_server_metadata.py b/tempest/api/compute/v3/servers/test_server_metadata.py
index 1758b0b..13c82dd 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata.py
@@ -14,16 +14,15 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
-class ServerMetadataV3TestJSON(base.BaseV3ComputeTest):
+class ServerMetadataV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ServerMetadataV3TestJSON, cls).setUpClass()
+        super(ServerMetadataV3Test, cls).setUpClass()
         cls.client = cls.servers_client
         cls.quotas = cls.quotas_client
         cls.admin_client = cls._get_identity_admin_client()
@@ -35,12 +34,12 @@
         cls.server_id = server['id']
 
     def setUp(self):
-        super(ServerMetadataV3TestJSON, self).setUp()
+        super(ServerMetadataV3Test, self).setUp()
         meta = {'key1': 'value1', 'key2': 'value2'}
         resp, _ = self.client.set_server_metadata(self.server_id, meta)
         self.assertEqual(resp.status, 200)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_server_metadata(self):
         # All metadata key/value pairs for a server should be returned
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
@@ -50,7 +49,7 @@
         expected = {'key1': 'value1', 'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_set_server_metadata(self):
         # The server's metadata should be replaced with the provided values
         # Create a new set of metadata for the server
@@ -64,22 +63,7 @@
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
         self.assertEqual(resp_metadata, req_metadata)
 
-    @attr(type='gate')
-    def test_server_create_metadata_key_too_long(self):
-        # Attempt to start a server with a meta-data key that is > 255
-        # characters
-
-        # Try a few values
-        for sz in [256, 257, 511, 1023]:
-            key = "k" * sz
-            meta = {key: 'data1'}
-            self.assertRaises(exceptions.OverLimit,
-                              self.create_test_server,
-                              meta=meta)
-
-        # no teardown - all creates should fail
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_server_metadata(self):
         # The server's metadata values should be updated to the
         # provided values
@@ -93,7 +77,7 @@
         expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_metadata_empty_body(self):
         # The original metadata should not be lost if empty metadata body is
         # passed
@@ -103,14 +87,14 @@
         expected = {'key1': 'value1', 'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_server_metadata_item(self):
         # The value for a specific metadata key should be returned
         resp, meta = self.client.get_server_metadata_item(self.server_id,
                                                           'key2')
         self.assertEqual('value2', meta['key2'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_set_server_metadata_item(self):
         # The item's value should be updated to the provided value
         # Update the metadata value
@@ -124,7 +108,7 @@
         expected = {'key1': 'value1', 'key2': 'value2', 'nova': 'alt'}
         self.assertEqual(expected, resp_metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_server_metadata_item(self):
         # The metadata value/key pair should be deleted from the server
         resp, meta = self.client.delete_server_metadata_item(self.server_id,
@@ -135,77 +119,3 @@
         resp, resp_metadata = self.client.list_server_metadata(self.server_id)
         expected = {'key2': 'value2'}
         self.assertEqual(expected, resp_metadata)
-
-    @attr(type=['negative', 'gate'])
-    def test_server_metadata_negative(self):
-        # Blank key should trigger an error.
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.create_test_server,
-                          meta=meta)
-
-        # GET on a non-existent server should not succeed
-        self.assertRaises(exceptions.NotFound,
-                          self.client.get_server_metadata_item, 999, 'test2')
-
-        # List metadata on a non-existent server should not succeed
-        self.assertRaises(exceptions.NotFound,
-                          self.client.list_server_metadata, 999)
-
-        # Raise BadRequest if key in uri does not match
-        # the key passed in body.
-        meta = {'testkey': 'testvalue'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata_item,
-                          self.server_id, 'key', meta)
-
-        # Set metadata on a non-existent server should not succeed
-        meta = {'meta1': 'data1'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.set_server_metadata, 999, meta)
-
-        # An update should not happen for a non-existent image
-        meta = {'key1': 'value1', 'key2': 'value2'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.update_server_metadata, 999, meta)
-
-        # Blank key should trigger an error
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.update_server_metadata,
-                          self.server_id, meta=meta)
-
-        # Should not be able to delete metadata item from a non-existent server
-        self.assertRaises(exceptions.NotFound,
-                          self.client.delete_server_metadata_item, 999, 'd')
-
-        # Raise a 413 OverLimit exception while exceeding metadata items limit
-        # for tenant.
-        _, quota_set = self.quotas.get_quota_set(self.tenant_id)
-        quota_metadata = quota_set['metadata_items']
-        req_metadata = {}
-        for num in range(1, quota_metadata + 2):
-            req_metadata['key' + str(num)] = 'val' + str(num)
-        self.assertRaises(exceptions.OverLimit,
-                          self.client.set_server_metadata,
-                          self.server_id, req_metadata)
-
-        # Raise a 413 OverLimit exception while exceeding metadata items limit
-        # for tenant (update).
-        self.assertRaises(exceptions.OverLimit,
-                          self.client.update_server_metadata,
-                          self.server_id, req_metadata)
-
-        # Raise a bad request error for blank key.
-        # set_server_metadata will replace all metadata with new value
-        meta = {'': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata,
-                          self.server_id, meta=meta)
-
-        # Raise a bad request error for a missing metadata field
-        # set_server_metadata will replace all metadata with new value
-        meta = {'meta1': 'data1'}
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.set_server_metadata,
-                          self.server_id, meta=meta, no_metadata_field=True)
diff --git a/tempest/api/compute/v3/servers/test_server_metadata_negative.py b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
new file mode 100644
index 0000000..ce6c340
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
@@ -0,0 +1,159 @@
+# 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 ServerMetadataV3NegativeTest(base.BaseV3ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(ServerMetadataV3NegativeTest, cls).setUpClass()
+        cls.client = cls.servers_client
+        cls.quotas = cls.quotas_client
+        cls.admin_client = cls._get_identity_admin_client()
+        resp, tenants = cls.admin_client.list_tenants()
+        cls.tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
+                         cls.client.tenant_name][0]
+        resp, server = cls.create_test_server(meta={}, wait_until='ACTIVE')
+
+        cls.server_id = server['id']
+
+    @test.skip_because(bug="1273948")
+    @test.attr(type=['gate', 'negative'])
+    def test_server_create_metadata_key_too_long(self):
+        # Attempt to start a server with a meta-data key that is > 255
+        # characters
+
+        # Tryset_server_metadata_item a few values
+        for sz in [256, 257, 511, 1023]:
+            key = "k" * sz
+            meta = {key: 'data1'}
+            self.assertRaises(exceptions.BadRequest,
+                              self.create_test_server,
+                              meta=meta)
+
+        # no teardown - all creates should fail
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_metadata_blank_key(self):
+        # Blank key should trigger an error.
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.create_test_server,
+                          meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_server_metadata_non_existent_server(self):
+        # GET on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.get_server_metadata_item,
+                          non_existent_server_id,
+                          'test2')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_server_metadata_non_existent_server(self):
+        # List metadata on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.list_server_metadata,
+                          non_existent_server_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_wrong_key_passed_in_body(self):
+        # Raise BadRequest if key in uri does not match
+        # the key passed in body.
+        meta = {'testkey': 'testvalue'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.set_server_metadata_item,
+                          self.server_id, 'key', meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_metadata_non_existent_server(self):
+        # Set metadata on a non-existent server should not succeed
+        non_existent_server_id = data_utils.rand_uuid()
+        meta = {'meta1': 'data1'}
+        self.assertRaises(exceptions.NotFound,
+                          self.client.set_server_metadata,
+                          non_existent_server_id,
+                          meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_metadata_non_existent_server(self):
+        # An update should not happen for a non-existent server
+        non_existent_server_id = data_utils.rand_uuid()
+        meta = {'key1': 'value1', 'key2': 'value2'}
+        self.assertRaises(exceptions.NotFound,
+                          self.client.update_server_metadata,
+                          non_existent_server_id,
+                          meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_metadata_with_blank_key(self):
+        # Blank key should trigger an error
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.update_server_metadata,
+                          self.server_id, meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_metadata_non_existent_server(self):
+        # Should not be able to delete metadata item from a non-existent server
+        non_existent_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.delete_server_metadata_item,
+                          non_existent_server_id,
+                          'd')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_metadata_items_limit(self):
+        # Raise a 413 OverLimit exception while exceeding metadata items limit
+        # for tenant.
+        _, quota_set = self.quotas.get_quota_set(self.tenant_id)
+        quota_metadata = quota_set['metadata_items']
+        req_metadata = {}
+        for num in range(1, quota_metadata + 2):
+            req_metadata['key' + str(num)] = 'val' + str(num)
+        self.assertRaises(exceptions.OverLimit,
+                          self.client.set_server_metadata,
+                          self.server_id, req_metadata)
+
+        # Raise a 413 OverLimit exception while exceeding metadata items limit
+        # for tenant (update).
+        self.assertRaises(exceptions.OverLimit,
+                          self.client.update_server_metadata,
+                          self.server_id, req_metadata)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_server_metadata_blank_key(self):
+        # Raise a bad request error for blank key.
+        # set_server_metadata will replace all metadata with new value
+        meta = {'': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.set_server_metadata,
+                          self.server_id, meta=meta)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_set_server_metadata_missing_metadata(self):
+        # Raise a bad request error for a missing metadata field
+        # set_server_metadata will replace all metadata with new value
+        meta = {'meta1': 'data1'}
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.set_server_metadata,
+                          self.server_id, meta=meta, no_metadata_field=True)
diff --git a/tempest/api/compute/v3/servers/test_server_rescue.py b/tempest/api/compute/v3/servers/test_server_rescue.py
index 99e8f68..fa7def0 100644
--- a/tempest/api/compute/v3/servers/test_server_rescue.py
+++ b/tempest/api/compute/v3/servers/test_server_rescue.py
@@ -14,33 +14,24 @@
 #    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 ServerRescueV3TestJSON(base.BaseV3ComputeTest):
+class ServerRescueV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ServerRescueV3TestJSON, cls).setUpClass()
+        super(ServerRescueV3Test, cls).setUpClass()
         cls.device = 'vdf'
 
         # Create a volume and wait for it to become ready for attach
-        resp, cls.volume_to_attach = \
-            cls.volumes_client.create_volume(1,
-                                             display_name=
-                                             'test_attach')
+        resp, cls.volume = cls.volumes_client.create_volume(
+            1, display_name=data_utils.rand_name(cls.__name__ + '_volume'))
         cls.volumes_client.wait_for_volume_status(
-            cls.volume_to_attach['id'], 'available')
-
-        # Create a volume and wait for it to become ready for attach
-        resp, cls.volume_to_detach = \
-            cls.volumes_client.create_volume(1,
-                                             display_name=
-                                             'test_detach')
-        cls.volumes_client.wait_for_volume_status(
-            cls.volume_to_detach['id'], 'available')
+            cls.volume['id'], 'available')
 
         # Server for positive tests
         resp, server = cls.create_test_server(wait_until='BUILD')
@@ -58,26 +49,21 @@
         cls.servers_client.wait_for_server_status(cls.rescue_id, 'RESCUE')
 
     def setUp(self):
-        super(ServerRescueV3TestJSON, self).setUp()
+        super(ServerRescueV3Test, self).setUp()
 
     @classmethod
     def tearDownClass(cls):
-        client = cls.volumes_client
-        client.delete_volume(str(cls.volume_to_attach['id']).strip())
-        client.delete_volume(str(cls.volume_to_detach['id']).strip())
-        super(ServerRescueV3TestJSON, cls).tearDownClass()
+        cls.delete_volume(cls.volume['id'])
+        super(ServerRescueV3Test, cls).tearDownClass()
 
     def tearDown(self):
-        super(ServerRescueV3TestJSON, self).tearDown()
+        super(ServerRescueV3Test, self).tearDown()
 
     def _detach(self, server_id, volume_id):
         self.servers_client.detach_volume(server_id, volume_id)
         self.volumes_client.wait_for_volume_status(volume_id,
                                                    'available')
 
-    def _delete(self, volume_id):
-        self.volumes_client.delete_volume(volume_id)
-
     def _unrescue(self, server_id):
         resp, body = self.servers_client.unrescue_server(server_id)
         self.assertEqual(202, resp.status)
@@ -141,29 +127,27 @@
         self.assertRaises(exceptions.Conflict,
                           self.servers_client.attach_volume,
                           self.server_id,
-                          self.volume_to_attach['id'],
+                          self.volume['id'],
                           device='/dev/%s' % self.device)
 
     @attr(type=['negative', 'gate'])
     def test_rescued_vm_detach_volume(self):
         # Attach the volume to the server
         self.servers_client.attach_volume(self.server_id,
-                                          self.volume_to_detach['id'],
+                                          self.volume['id'],
                                           device='/dev/%s' % self.device)
-        self.volumes_client.wait_for_volume_status(
-            self.volume_to_detach['id'], 'in-use')
+        self.volumes_client.wait_for_volume_status(self.volume['id'], 'in-use')
 
         # Rescue the server
         self.servers_client.rescue_server(self.server_id,
                                           admin_password=self.password)
         self.servers_client.wait_for_server_status(self.server_id, 'RESCUE')
         # addCleanup is a LIFO queue
-        self.addCleanup(self._detach, self.server_id,
-                        self.volume_to_detach['id'])
+        self.addCleanup(self._detach, self.server_id, self.volume['id'])
         self.addCleanup(self._unrescue, self.server_id)
 
         # Detach the volume from the server expecting failure
         self.assertRaises(exceptions.Conflict,
                           self.servers_client.detach_volume,
                           self.server_id,
-                          self.volume_to_detach['id'])
+                          self.volume['id'])
diff --git a/tempest/api/compute/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index c476b78..dc64c40 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -18,17 +18,17 @@
 from tempest import test
 
 
-class ServersV3TestJSON(base.BaseV3ComputeTest):
+class ServersV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(ServersV3TestJSON, cls).setUpClass()
+        super(ServersV3Test, cls).setUpClass()
         cls.client = cls.servers_client
 
     def tearDown(self):
         self.clear_servers()
-        super(ServersV3TestJSON, self).tearDown()
+        super(ServersV3Test, self).tearDown()
 
     @test.attr(type='gate')
     def test_create_server_with_admin_password(self):
diff --git a/tempest/api/compute/v3/servers/test_servers_negative.py b/tempest/api/compute/v3/servers/test_servers_negative.py
index 191701e..12e0ad8 100644
--- a/tempest/api/compute/v3/servers/test_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_servers_negative.py
@@ -26,11 +26,11 @@
 CONF = config.CONF
 
 
-class ServersNegativeV3TestJSON(base.BaseV3ComputeTest):
+class ServersNegativeV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     def setUp(self):
-        super(ServersNegativeV3TestJSON, self).setUp()
+        super(ServersNegativeV3Test, self).setUp()
         try:
             self.client.wait_for_server_status(self.server_id, 'ACTIVE')
         except Exception:
@@ -38,7 +38,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ServersNegativeV3TestJSON, cls).setUpClass()
+        super(ServersNegativeV3Test, cls).setUpClass()
         cls.client = cls.servers_client
         cls.alt_os = clients.AltManager()
         cls.alt_client = cls.alt_os.servers_v3_client
@@ -191,12 +191,13 @@
                           self.create_test_server,
                           key_name=key_name)
 
+    @test.skip_because(bug="1273948")
     @test.attr(type=['negative', 'gate'])
     def test_create_server_metadata_exceeds_length_limit(self):
         # Pass really long metadata while creating a server
 
         metadata = {'a': 'b' * 260}
-        self.assertRaises(exceptions.OverLimit,
+        self.assertRaises(exceptions.BadRequest,
                           self.create_test_server,
                           meta=metadata)
 
diff --git a/tempest/api/compute/v3/test_extensions.py b/tempest/api/compute/v3/test_extensions.py
index 775d70a..09f5ab4 100644
--- a/tempest/api/compute/v3/test_extensions.py
+++ b/tempest/api/compute/v3/test_extensions.py
@@ -24,7 +24,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class ExtensionsV3TestJSON(base.BaseV3ComputeTest):
+class ExtensionsV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @test.attr(type='gate')
diff --git a/tempest/api/compute/v3/test_live_block_migration.py b/tempest/api/compute/v3/test_live_block_migration.py
index c881206..144cadb 100644
--- a/tempest/api/compute/v3/test_live_block_migration.py
+++ b/tempest/api/compute/v3/test_live_block_migration.py
@@ -26,13 +26,13 @@
 CONF = config.CONF
 
 
-class LiveBlockMigrationV3TestJSON(base.BaseV3ComputeAdminTest):
+class LiveBlockMigrationV3Test(base.BaseV3ComputeAdminTest):
     _host_key = 'os-extended-server-attributes:host'
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(LiveBlockMigrationV3TestJSON, cls).setUpClass()
+        super(LiveBlockMigrationV3Test, cls).setUpClass()
 
         cls.admin_hosts_client = cls.hosts_admin_client
         cls.admin_servers_client = cls.servers_admin_client
@@ -161,4 +161,4 @@
         for server_id in cls.created_server_ids:
             cls.servers_client.delete_server(server_id)
 
-        super(LiveBlockMigrationV3TestJSON, cls).tearDownClass()
+        super(LiveBlockMigrationV3Test, cls).tearDownClass()
diff --git a/tempest/api/compute/v3/test_quotas.py b/tempest/api/compute/v3/test_quotas.py
index 1cbfa2b..33b90ff 100644
--- a/tempest/api/compute/v3/test_quotas.py
+++ b/tempest/api/compute/v3/test_quotas.py
@@ -17,12 +17,12 @@
 from tempest import test
 
 
-class QuotasV3TestJSON(base.BaseV3ComputeTest):
+class QuotasV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
-        super(QuotasV3TestJSON, cls).setUpClass()
+        super(QuotasV3Test, cls).setUpClass()
         cls.client = cls.quotas_client
         cls.admin_client = cls._get_identity_admin_client()
         resp, tenants = cls.admin_client.list_tenants()
diff --git a/tempest/api/compute/v3/test_version.py b/tempest/api/compute/v3/test_version.py
index 6fbe794..9161d4d 100644
--- a/tempest/api/compute/v3/test_version.py
+++ b/tempest/api/compute/v3/test_version.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class VersionV3TestJSON(base.BaseV3ComputeTest):
+class VersionV3Test(base.BaseV3ComputeTest):
     _interface = 'json'
 
     @test.attr(type='gate')
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index b5a4802..bcab891 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -15,9 +15,12 @@
 
 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
 
+CONF = config.CONF
+
 
 class VolumesGetTestJSON(base.BaseV2ComputeTest):
 
@@ -27,7 +30,7 @@
     def setUpClass(cls):
         super(VolumesGetTestJSON, cls).setUpClass()
         cls.client = cls.volumes_extensions_client
-        if not cls.config.service_available.cinder:
+        if not CONF.service_available.cinder:
             skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
 
@@ -41,7 +44,7 @@
         resp, volume = self.client.create_volume(size=1,
                                                  display_name=v_name,
                                                  metadata=metadata)
-        self.addCleanup(self._delete_volume, volume)
+        self.addCleanup(self.delete_volume, volume['id'])
         self.assertEqual(200, resp.status)
         self.assertIn('id', volume)
         self.assertIn('displayName', volume)
@@ -69,16 +72,6 @@
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
 
-    def _delete_volume(self, volume):
-        # Delete the Volume created in this method
-        try:
-            resp, _ = self.client.delete_volume(volume['id'])
-            self.assertEqual(202, resp.status)
-            # Checking if the deleted Volume still exists
-            self.client.wait_for_resource_deletion(volume['id'])
-        except KeyError:
-            return
-
 
 class VolumesGetTestXML(VolumesGetTestJSON):
     _interface = "xml"
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index bec2ef4..48b1b7e 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -62,7 +62,7 @@
                     # too small. So, here, we clean up whatever we did manage
                     # to create and raise a SkipTest
                     for volume in cls.volume_list:
-                        cls.client.delete_volume(volume)
+                        cls.delete_volume(volume['id'])
                     msg = ("Failed to create ALL necessary volumes to run "
                            "test. This typically means that the backing file "
                            "size of the nova-volumes group is too small to "
@@ -74,8 +74,7 @@
     def tearDownClass(cls):
         # Delete the created Volumes
         for volume in cls.volume_list:
-            resp, _ = cls.client.delete_volume(volume['id'])
-            cls.client.wait_for_resource_deletion(volume['id'])
+            cls.delete_volume(volume['id'])
         super(VolumesTestJSON, cls).tearDownClass()
 
     @attr(type='gate')
diff --git a/tempest/api/data_processing/test_plugins.py b/tempest/api/data_processing/test_plugins.py
new file mode 100644
index 0000000..3b941d8
--- /dev/null
+++ b/tempest/api/data_processing/test_plugins.py
@@ -0,0 +1,58 @@
+# Copyright (c) 2013 Mirantis Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from tempest.api.data_processing import base as dp_base
+from tempest.test import attr
+
+
+class PluginsTest(dp_base.BaseDataProcessingTest):
+    def _list_all_plugin_names(self):
+        """Returns all enabled plugin names.
+
+        It ensures response status and main plugins availability.
+        """
+        resp, plugins = self.client.list_plugins()
+
+        self.assertEqual(200, resp.status)
+
+        plugins_names = list([plugin['name'] for plugin in plugins])
+        self.assertIn('vanilla', plugins_names)
+        self.assertIn('hdp', plugins_names)
+
+        return plugins_names
+
+    @attr(type='smoke')
+    def test_plugin_list(self):
+        self._list_all_plugin_names()
+
+    @attr(type='smoke')
+    def test_plugin_get(self):
+        for plugin_name in self._list_all_plugin_names():
+            resp, plugin = self.client.get_plugin(plugin_name)
+
+            self.assertEqual(200, resp.status)
+            self.assertEqual(plugin_name, plugin['name'])
+
+            for plugin_version in plugin['versions']:
+                resp, detailed_plugin = self.client.get_plugin(plugin_name,
+                                                               plugin_version)
+
+                self.assertEqual(200, resp.status)
+                self.assertEqual(plugin_name, detailed_plugin['name'])
+
+                # check that required image tags contains name and version
+                image_tags = detailed_plugin['required_image_tags']
+                self.assertIn(plugin_name, image_tags)
+                self.assertIn(plugin_version, image_tags)
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index e316dc7..e5c04de 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -41,10 +41,10 @@
     @attr(type=['negative', 'gate'])
     def test_list_roles_request_without_token(self):
         # Request to list roles without a valid token should fail
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.list_roles)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_role_create_blank_name(self):
@@ -61,12 +61,12 @@
     @attr(type=['negative', 'gate'])
     def test_create_role_request_without_token(self):
         # Request to create role without a valid token should fail
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         role_name = data_utils.rand_name(name='role-')
         self.assertRaises(exceptions.Unauthorized,
                           self.client.create_role, role_name)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_role_create_duplicate(self):
@@ -99,12 +99,12 @@
         self.assertEqual(200, resp.status)
         self.data.roles.append(body)
         role_id = body.get('id')
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
                           self.client.delete_role,
                           role_id)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_delete_role_non_existent(self):
@@ -126,12 +126,12 @@
     def test_assign_user_role_request_without_token(self):
         # Request to assign a role to a user without a valid token
         (user, tenant, role) = self._get_role_params()
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
                           self.client.assign_user_role, tenant['id'],
                           user['id'], role['id'])
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_assign_user_role_for_non_existent_role(self):
@@ -176,12 +176,12 @@
         resp, user_role = self.client.assign_user_role(tenant['id'],
                                                        user['id'],
                                                        role['id'])
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
                           self.client.remove_user_role, tenant['id'],
                           user['id'], role['id'])
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_remove_user_role_non_existent_role(self):
@@ -219,14 +219,14 @@
     def test_list_user_roles_request_without_token(self):
         # Request to list user's roles without a valid token should fail
         (user, tenant, role) = self._get_role_params()
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         try:
             self.assertRaises(exceptions.Unauthorized,
                               self.client.list_user_roles, tenant['id'],
                               user['id'])
         finally:
-            self.client.clear_auth()
+            self.client.auth_provider.clear_auth()
 
 
 class RolesTestXML(RolesNegativeTestJSON):
diff --git a/tempest/api/identity/admin/test_tenant_negative.py b/tempest/api/identity/admin/test_tenant_negative.py
index a4d9d97..e9eddc8 100644
--- a/tempest/api/identity/admin/test_tenant_negative.py
+++ b/tempest/api/identity/admin/test_tenant_negative.py
@@ -33,10 +33,10 @@
     @attr(type=['negative', 'gate'])
     def test_list_tenant_request_without_token(self):
         # Request to list tenants without a valid token should fail
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.list_tenants)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_tenant_delete_by_unauthorized_user(self):
@@ -55,11 +55,11 @@
         resp, tenant = self.client.create_tenant(tenant_name)
         self.assertEqual(200, resp.status)
         self.data.tenants.append(tenant)
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.delete_tenant,
                           tenant['id'])
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_delete_non_existent_tenant(self):
@@ -93,11 +93,11 @@
     def test_create_tenant_request_without_token(self):
         # Create tenant request without a token should not be authorized
         tenant_name = data_utils.rand_name(name='tenant-')
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.create_tenant,
                           tenant_name)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_create_tenant_with_empty_name(self):
@@ -135,11 +135,11 @@
         resp, tenant = self.client.create_tenant(tenant_name)
         self.assertEqual(200, resp.status)
         self.data.tenants.append(tenant)
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.update_tenant,
                           tenant['id'])
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
 
 class TenantsNegativeTestXML(TenantsNegativeTestJSON):
diff --git a/tempest/api/identity/admin/test_tokens.py b/tempest/api/identity/admin/test_tokens.py
index cfe17fb..620e293 100644
--- a/tempest/api/identity/admin/test_tokens.py
+++ b/tempest/api/identity/admin/test_tokens.py
@@ -13,8 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
 from tempest.test import attr
@@ -42,12 +40,11 @@
         rsp, body = self.token_client.auth(user_name,
                                            user_password,
                                            tenant['name'])
-        access_data = json.loads(body)['access']
         self.assertEqual(rsp['status'], '200')
-        self.assertEqual(access_data['token']['tenant']['name'],
+        self.assertEqual(body['token']['tenant']['name'],
                          tenant['name'])
         # then delete the token
-        token_id = access_data['token']['id']
+        token_id = body['token']['id']
         resp, body = self.client.delete_token(token_id)
         self.assertEqual(resp['status'], '204')
 
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index 14222fb..39ef947 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -115,7 +115,7 @@
         self.token_client.auth(self.data.test_user, self.data.test_password,
                                self.data.test_tenant)
         # Get the token of the current client
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         # Delete the token from database
         self.client.delete_token(token)
         # Re-auth
@@ -123,7 +123,7 @@
                                             self.data.test_password,
                                             self.data.test_tenant)
         self.assertEqual('200', resp['status'])
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type='smoke')
     def test_get_users(self):
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index ba7af09..060f24a 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -75,7 +75,7 @@
         # Request to create a user without a valid token should fail
         self.data.setup_test_tenant()
         # Get the token of the current client
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         # Delete the token from database
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.create_user,
@@ -83,7 +83,7 @@
                           self.data.tenant['id'], self.alt_email)
 
         # Unset the token to allow further tests to generate a new token
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_create_user_with_enabled_non_bool(self):
@@ -108,14 +108,14 @@
         # Request to update a user without a valid token should fail
 
         # Get the token of the current client
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         # Delete the token from database
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.update_user,
                           self.alt_user)
 
         # Unset the token to allow further tests to generate a new token
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_update_user_by_unauthorized_user(self):
@@ -143,14 +143,14 @@
         # Request to delete a user without a valid token should fail
 
         # Get the token of the current client
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         # Delete the token from database
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.delete_user,
                           self.alt_user)
 
         # Unset the token to allow further tests to generate a new token
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_authentication_for_disabled_user(self):
@@ -207,10 +207,10 @@
     @attr(type=['negative', 'gate'])
     def test_get_users_request_without_token(self):
         # Request to get list of users without a valid token should fail
-        token = self.client.get_auth()
+        token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized, self.client.get_users)
-        self.client.clear_auth()
+        self.client.auth_provider.clear_auth()
 
     @attr(type=['negative', 'gate'])
     def test_list_users_with_invalid_tenant(self):
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 37b848c..e439238 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -106,7 +106,7 @@
             cls.os_alt = clients.AltManager()
             identity_client = cls._get_identity_admin_client()
             cls.alt_tenant_id = identity_client.get_tenant_by_name(
-                cls.os_alt.tenant_name)['id']
+                cls.os_alt.credentials['tenant_name'])['id']
 
         cls.alt_img_cli = cls.os_alt.image_client
 
@@ -147,7 +147,7 @@
             cls.alt_tenant_id = cls.isolated_creds.get_alt_tenant()['id']
         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()
             cls.alt_tenant_id = identity_client.get_tenant_by_name(
                 alt_tenant_name)['id']
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 3c8d95e..d8b79ca 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -16,8 +16,11 @@
 import cStringIO as StringIO
 
 from tempest.api.image import base
+from tempest import config
 from tempest.test import attr
 
+CONF = config.CONF
+
 
 class CreateRegisterImagesTest(base.BaseV1ImageTest):
     """Here we test the registration and creation of images."""
@@ -68,7 +71,7 @@
         resp, body = self.create_image(name='New Http Image',
                                        container_format='bare',
                                        disk_format='raw', is_public=True,
-                                       copy_from=self.config.images.http_image)
+                                       copy_from=CONF.image.http_image)
         self.assertIn('id', body)
         image_id = body.get('id')
         self.assertEqual('New Http Image', body.get('name'))
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index bfb7b48..7c02787 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -17,7 +17,7 @@
 from tempest import test
 
 
-class L3AgentSchedulerJSON(base.BaseAdminNetworkTest):
+class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest):
     _interface = 'json'
 
     """
@@ -33,7 +33,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(L3AgentSchedulerJSON, cls).setUpClass()
+        super(L3AgentSchedulerTestJSON, cls).setUpClass()
         if not test.is_extension_enabled('l3_agent_scheduler', 'network'):
             msg = "L3 Agent Scheduler Extension not enabled."
             raise cls.skipException(msg)
@@ -61,5 +61,5 @@
         self.assertEqual(204, resp.status)
 
 
-class L3AgentSchedulerXML(L3AgentSchedulerJSON):
+class L3AgentSchedulerTestXML(L3AgentSchedulerTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 1c2c4b0..b129786 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -49,6 +49,8 @@
         neutron as True
     """
 
+    force_tenant_isolation = False
+
     @classmethod
     def setUpClass(cls):
         # Create no network resources for these test.
@@ -57,6 +59,10 @@
         os = clients.Manager(interface=cls._interface)
         if not CONF.service_available.neutron:
             raise cls.skipException("Neutron support is required")
+
+        os = cls.get_client_manager()
+
+        cls.network_cfg = CONF.network
         cls.client = os.network_client
         cls.networks = []
         cls.subnets = []
@@ -110,6 +116,7 @@
         # Clean up networks
         for network in cls.networks:
             cls.client.delete_network(network['id'])
+        cls.clear_isolated_creds()
         super(BaseNetworkTest, cls).tearDownClass()
 
     @classmethod
@@ -269,5 +276,14 @@
             msg = ("Missing Administrative Network API credentials "
                    "in configuration.")
             raise cls.skipException(msg)
-        cls.admin_manager = clients.AdminManager(interface=cls._interface)
-        cls.admin_client = cls.admin_manager.network_client
+        if (CONF.compute.allow_tenant_isolation or
+            cls.force_tenant_isolation is True):
+            creds = cls.isolated_creds.get_admin_creds()
+            admin_username, admin_tenant_name, admin_password = creds
+            cls.os_adm = clients.Manager(username=admin_username,
+                                         password=admin_password,
+                                         tenant_name=admin_tenant_name,
+                                         interface=cls._interface)
+        else:
+            cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
+        cls.admin_client = cls.os_adm.network_client
diff --git a/tempest/api/network/common.py b/tempest/api/network/common.py
index 0ce1769..d68ff1a 100644
--- a/tempest/api/network/common.py
+++ b/tempest/api/network/common.py
@@ -126,3 +126,21 @@
 
     def delete(self):
         self.client.delete_security_group_rule(self.id)
+
+
+class DeletablePool(DeletableResource):
+
+    def delete(self):
+        self.client.delete_pool(self.id)
+
+
+class DeletableMember(DeletableResource):
+
+    def delete(self):
+        self.client.delete_member(self.id)
+
+
+class DeletableVip(DeletableResource):
+
+    def delete(self):
+        self.client.delete_vip(self.id)
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index 65eebf2..d5f2b5b 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class LoadBalancerJSON(base.BaseNetworkTest):
+class LoadBalancerTestJSON(base.BaseNetworkTest):
     _interface = 'json'
 
     """
@@ -39,7 +39,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(LoadBalancerJSON, cls).setUpClass()
+        super(LoadBalancerTestJSON, cls).setUpClass()
         if not test.is_extension_enabled('lbaas', 'network'):
             msg = "lbaas extension not enabled."
             raise cls.skipException(msg)
@@ -210,5 +210,5 @@
         self.assertEqual('204', resp['status'])
 
 
-class LoadBalancerXML(LoadBalancerJSON):
+class LoadBalancerTestXML(LoadBalancerTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index 3aa765c..aee2a44 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -239,7 +239,7 @@
     _interface = 'xml'
 
 
-class BulkNetworkOpsJSON(base.BaseNetworkTest):
+class BulkNetworkOpsTestJSON(base.BaseNetworkTest):
     _interface = 'json'
 
     """
@@ -263,7 +263,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(BulkNetworkOpsJSON, cls).setUpClass()
+        super(BulkNetworkOpsTestJSON, cls).setUpClass()
         cls.network1 = cls.create_network()
         cls.network2 = cls.create_network()
 
@@ -390,5 +390,5 @@
             self.assertIn(n['id'], ports_list)
 
 
-class BulkNetworkOpsXML(BulkNetworkOpsJSON):
+class BulkNetworkOpsTestXML(BulkNetworkOpsTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
index 64b8a41..78bc80a 100644
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ b/tempest/api/network/test_vpnaas_extensions.py
@@ -38,10 +38,10 @@
 
     @classmethod
     def setUpClass(cls):
-        super(VPNaaSJSON, cls).setUpClass()
         if not test.is_extension_enabled('vpnaas', 'network'):
             msg = "vpnaas extension not enabled."
             raise cls.skipException(msg)
+        super(VPNaaSJSON, cls).setUpClass()
         cls.network = cls.create_network()
         cls.subnet = cls.create_subnet(cls.network)
         cls.router = cls.create_router(
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index 0eedea1..ef36c3d 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -74,6 +74,15 @@
         cls.container_client_alt = cls.os_alt.container_client
         cls.identity_client_alt = cls.os_alt.identity_client
 
+        # Make sure we get fresh auth data after assigning swift role
+        cls.object_client.auth_provider.clear_auth()
+        cls.container_client.auth_provider.clear_auth()
+        cls.account_client.auth_provider.clear_auth()
+        cls.custom_object_client.auth_provider.clear_auth()
+        cls.custom_account_client.auth_provider.clear_auth()
+        cls.object_client_alt.auth_provider.clear_auth()
+        cls.container_client_alt.auth_provider.clear_auth()
+
         cls.data = DataGenerator(cls.identity_admin_client)
 
     @classmethod
diff --git a/tempest/api/object_storage/test_account_bulk.py b/tempest/api/object_storage/test_account_bulk.py
new file mode 100644
index 0000000..5fde76a
--- /dev/null
+++ b/tempest/api/object_storage/test_account_bulk.py
@@ -0,0 +1,136 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 NTT Corporation
+#
+#    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 tarfile
+import tempfile
+
+from tempest.api.object_storage import base
+from tempest.common import custom_matchers
+from tempest import test
+
+
+class BulkTest(base.BaseObjectTest):
+
+    def setUp(self):
+        super(BulkTest, self).setUp()
+        self.containers = []
+
+    def tearDown(self):
+        self.delete_containers(self.containers)
+        super(BulkTest, self).tearDown()
+
+    def _create_archive(self):
+        # Create an archived file for bulk upload testing.
+        # Directory and files contained in the directory correspond to
+        # container and subsidiary objects.
+        tmp_dir = tempfile.mkdtemp()
+        tmp_file = tempfile.mkstemp(dir=tmp_dir)
+
+        # Extract a container name and an object name
+        container_name = tmp_dir.split("/")[-1]
+        object_name = tmp_file[1].split("/")[-1]
+
+        # Create tar file
+        tarpath = tempfile.NamedTemporaryFile(suffix=".tar")
+        tar = tarfile.open(None, 'w', tarpath)
+        tar.add(tmp_dir, arcname=container_name)
+        tar.close()
+        tarpath.flush()
+
+        return tarpath.name, container_name, object_name
+
+    @test.attr(type='gate')
+    def test_extract_archive(self):
+        # Test bulk operation of file upload with an archived file
+        filepath, container_name, object_name = self._create_archive()
+
+        params = {'extract-archive': 'tar'}
+        with open(filepath) as fh:
+            mydata = fh.read()
+            resp, body = self.account_client.create_account(data=mydata,
+                                                            params=params)
+
+        self.containers.append(container_name)
+
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
+
+        # When uploading an archived file with the bulk operation, the response
+        # does not contain 'content-length' header. This is the special case,
+        # therefore the existence of response headers is checked without
+        # custom matcher.
+        self.assertIn('transfer-encoding', resp)
+        self.assertIn('content-type', resp)
+        self.assertIn('x-trans-id', resp)
+        self.assertIn('date', resp)
+
+        # Check only the format of common headers with custom matcher
+        self.assertThat(resp, custom_matchers.AreAllWellFormatted())
+
+        param = {'format': 'json'}
+        resp, body = self.account_client.list_account_containers(param)
+
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Account', 'GET')
+
+        self.assertIn(container_name, [b['name'] for b in body])
+
+        param = {'format': 'json'}
+        resp, contents_list = self.container_client.list_container_contents(
+            container_name, param)
+
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+
+        self.assertIn(object_name, [c['name'] for c in contents_list])
+
+    @test.attr(type='gate')
+    def test_bulk_delete(self):
+        # Test bulk operation of deleting multiple files
+        filepath, container_name, object_name = self._create_archive()
+
+        params = {'extract-archive': 'tar'}
+        with open(filepath) as fh:
+            mydata = fh.read()
+            resp, body = self.account_client.create_account(data=mydata,
+                                                            params=params)
+
+        data = '%s/%s\n%s' % (container_name, object_name, container_name)
+        params = {'bulk-delete': ''}
+        resp, body = self.account_client.delete_account(data=data,
+                                                        params=params)
+
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
+
+        # When deleting multiple files using the bulk operation, the response
+        # does not contain 'content-length' header. This is the special case,
+        # therefore the existence of response headers is checked without
+        # custom matcher.
+        self.assertIn('transfer-encoding', resp)
+        self.assertIn('content-type', resp)
+        self.assertIn('x-trans-id', resp)
+        self.assertIn('date', resp)
+
+        # Check only the format of common headers with custom matcher
+        self.assertThat(resp, custom_matchers.AreAllWellFormatted())
+
+        # Check if a container is deleted
+        param = {'format': 'txt'}
+        resp, body = self.account_client.list_account_containers(param)
+
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Account', 'GET')
+
+        self.assertNotIn(container_name, body)
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index cacc66e..788292d 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -62,26 +62,34 @@
             reseller_user_id,
             reseller_role_id)
 
-        # Retrieve a ResellerAdmin auth token and use it to set a quota
+        # Retrieve a ResellerAdmin auth data and use it to set a quota
         # on the client's account
-        cls.reselleradmin_token = cls.token_client.get_token(
-            cls.data.test_user,
-            cls.data.test_password,
-            cls.data.test_tenant)
+        cls.reselleradmin_auth_data = \
+            cls.os_reselleradmin.get_auth_provider().auth_data
 
     def setUp(self):
         super(AccountQuotasTest, self).setUp()
 
+        # Set the reselleradmin auth in headers for next custom_account_client
+        # request
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.reselleradmin_auth_data
+        )
         # Set a quota of 20 bytes on the user's account before each test
-        headers = {"X-Auth-Token": self.reselleradmin_token,
-                   "X-Account-Meta-Quota-Bytes": "20"}
+        headers = {"X-Account-Meta-Quota-Bytes": "20"}
 
         self.os.custom_account_client.request("POST", "", headers, "")
 
     def tearDown(self):
+        # Set the reselleradmin auth in headers for next custom_account_client
+        # request
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.reselleradmin_auth_data
+        )
         # remove the quota from the container
-        headers = {"X-Auth-Token": self.reselleradmin_token,
-                   "X-Remove-Account-Meta-Quota-Bytes": "x"}
+        headers = {"X-Remove-Account-Meta-Quota-Bytes": "x"}
 
         self.os.custom_account_client.request("POST", "", headers, "")
         super(AccountQuotasTest, self).tearDown()
@@ -118,8 +126,11 @@
         """
         for quota in ("25", "", "20"):
 
-            headers = {"X-Auth-Token": self.reselleradmin_token,
-                       "X-Account-Meta-Quota-Bytes": quota}
+            self.custom_account_client.auth_provider.set_alt_auth_data(
+                request_part='headers',
+                auth_data=self.reselleradmin_auth_data
+            )
+            headers = {"X-Account-Meta-Quota-Bytes": quota}
 
             resp, _ = self.os.custom_account_client.request("POST", "",
                                                             headers, "")
diff --git a/tempest/api/object_storage/test_account_quotas_negative.py b/tempest/api/object_storage/test_account_quotas_negative.py
index e35cd17..cab307d 100644
--- a/tempest/api/object_storage/test_account_quotas_negative.py
+++ b/tempest/api/object_storage/test_account_quotas_negative.py
@@ -62,26 +62,33 @@
             reseller_user_id,
             reseller_role_id)
 
-        # Retrieve a ResellerAdmin auth token and use it to set a quota
+        # Retrieve a ResellerAdmin auth data and use it to set a quota
         # on the client's account
-        cls.reselleradmin_token = cls.token_client.get_token(
-            cls.data.test_user,
-            cls.data.test_password,
-            cls.data.test_tenant)
+        cls.reselleradmin_auth_data = \
+            cls.os_reselleradmin.get_auth_provider().auth_data
 
     def setUp(self):
         super(AccountQuotasNegativeTest, self).setUp()
-
+        # Set the reselleradmin auth in headers for next custom_account_client
+        # request
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.reselleradmin_auth_data
+        )
         # Set a quota of 20 bytes on the user's account before each test
-        headers = {"X-Auth-Token": self.reselleradmin_token,
-                   "X-Account-Meta-Quota-Bytes": "20"}
+        headers = {"X-Account-Meta-Quota-Bytes": "20"}
 
         self.os.custom_account_client.request("POST", "", headers, "")
 
     def tearDown(self):
+        # Set the reselleradmin auth in headers for next custom_account_client
+        # request
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.reselleradmin_auth_data
+        )
         # remove the quota from the container
-        headers = {"X-Auth-Token": self.reselleradmin_token,
-                   "X-Remove-Account-Meta-Quota-Bytes": "x"}
+        headers = {"X-Remove-Account-Meta-Quota-Bytes": "x"}
 
         self.os.custom_account_client.request("POST", "", headers, "")
         super(AccountQuotasNegativeTest, self).tearDown()
diff --git a/tempest/api/object_storage/test_account_services_negative.py b/tempest/api/object_storage/test_account_services_negative.py
index c8f8096..ea93aa3 100644
--- a/tempest/api/object_storage/test_account_services_negative.py
+++ b/tempest/api/object_storage/test_account_services_negative.py
@@ -15,6 +15,7 @@
 #    under the License.
 
 from tempest.api.object_storage import base
+from tempest import clients
 from tempest import exceptions
 from tempest.test import attr
 
@@ -27,18 +28,26 @@
 
         # create user
         self.data.setup_test_user()
-        self.token_client.auth(self.data.test_user,
-                               self.data.test_password,
-                               self.data.test_tenant)
-        new_token = \
-            self.token_client.get_token(self.data.test_user,
-                                        self.data.test_password,
-                                        self.data.test_tenant)
-        custom_headers = {'X-Auth-Token': new_token}
+        test_os = clients.Manager(self.data.test_user,
+                                  self.data.test_password,
+                                  self.data.test_tenant)
+        test_auth_provider = test_os.get_auth_provider()
+        # Get auth for the test user
+        test_auth_provider.auth_data
+
+        # Get fresh auth for test user and set it to next auth request for
+        # custom_account_client
+        delattr(test_auth_provider, 'auth_data')
+        test_auth_new_data = test_auth_provider.auth_data
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=test_auth_new_data
+        )
+
         params = {'format': 'json'}
         # list containers with non-authorized user token
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_account_client.list_account_containers,
-                          params=params, metadata=custom_headers)
+                          params=params)
         # delete the user which was created
         self.data.teardown_all()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index 0733524..aae6b4d 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -14,6 +14,7 @@
 #    under the License.
 
 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
@@ -24,10 +25,10 @@
     def setUpClass(cls):
         super(ObjectTestACLs, cls).setUpClass()
         cls.data.setup_test_user()
-        cls.new_token = cls.token_client.get_token(cls.data.test_user,
-                                                   cls.data.test_password,
-                                                   cls.data.test_tenant)
-        cls.custom_headers = {'X-Auth-Token': cls.new_token}
+        test_os = clients.Manager(cls.data.test_user,
+                                  cls.data.test_password,
+                                  cls.data.test_tenant)
+        cls.test_auth_data = test_os.get_auth_provider().auth_data
 
     @classmethod
     def tearDownClass(cls):
@@ -61,9 +62,12 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
         # Trying to read the object with rights
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         resp, _ = self.custom_object_client.get_object(
-            self.container_name, object_name,
-            metadata=self.custom_headers)
+            self.container_name, object_name)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
@@ -79,10 +83,13 @@
         self.assertIn(int(resp_meta['status']), 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(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         object_name = data_utils.rand_name(name='Object')
         resp, _ = self.custom_object_client.create_object(
             self.container_name,
-            object_name, 'data',
-            metadata=self.custom_headers)
+            object_name, 'data')
         self.assertIn(int(resp['status']), 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 f8f29de..1dc9bb5 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -15,6 +15,7 @@
 #    under the License.
 
 from tempest.api.object_storage import base
+from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import exceptions
 from tempest.test import attr
@@ -26,10 +27,10 @@
     def setUpClass(cls):
         super(ObjectACLsNegativeTest, cls).setUpClass()
         cls.data.setup_test_user()
-        cls.new_token = cls.token_client.get_token(cls.data.test_user,
-                                                   cls.data.test_password,
-                                                   cls.data.test_tenant)
-        cls.custom_headers = {'X-Auth-Token': cls.new_token}
+        test_os = clients.Manager(cls.data.test_user,
+                                  cls.data.test_password,
+                                  cls.data.test_tenant)
+        cls.test_auth_data = test_os.get_auth_provider().auth_data
 
     @classmethod
     def tearDownClass(cls):
@@ -50,6 +51,10 @@
         # trying to create object with empty headers
         # X-Auth-Token is not provided
         object_name = data_utils.rand_name(name='Object')
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
@@ -62,6 +67,10 @@
                                                    object_name, 'data')
         # trying to delete object with empty headers
         # X-Auth-Token is not provided
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
@@ -72,10 +81,13 @@
         # User provided token is forbidden. ACL are not set
         object_name = data_utils.rand_name(name='Object')
         # trying to create object with non-authorized user
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.create_object,
-                          self.container_name, object_name, 'data',
-                          metadata=self.custom_headers)
+                          self.container_name, object_name, 'data')
 
     @attr(type=['negative', 'gate'])
     def test_read_object_with_non_authorized_user(self):
@@ -87,10 +99,13 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
         # trying to get object with non authorized user token
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.get_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
+                          self.container_name, object_name)
 
     @attr(type=['negative', 'gate'])
     def test_delete_object_with_non_authorized_user(self):
@@ -102,10 +117,13 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
         # trying to delete object with non-authorized user token
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.delete_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
+                          self.container_name, object_name)
 
     @attr(type=['negative', 'smoke'])
     def test_read_object_without_rights(self):
@@ -124,10 +142,13 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
         # Trying to read the object without rights
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.get_object,
-                          self.container_name, object_name,
-                          metadata=self.custom_headers)
+                          self.container_name, object_name)
 
     @attr(type=['negative', 'smoke'])
     def test_write_object_without_rights(self):
@@ -140,12 +161,15 @@
         self.assertIn(int(resp_meta['status']), 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(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         object_name = data_utils.rand_name(name='Object')
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.create_object,
                           self.container_name,
-                          object_name, 'data',
-                          metadata=self.custom_headers)
+                          object_name, 'data')
 
     @attr(type=['negative', 'smoke'])
     def test_write_object_without_write_rights(self):
@@ -160,12 +184,15 @@
         self.assertIn(int(resp_meta['status']), 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(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         object_name = data_utils.rand_name(name='Object')
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.create_object,
                           self.container_name,
-                          object_name, 'data',
-                          metadata=self.custom_headers)
+                          object_name, 'data')
 
     @attr(type=['negative', 'smoke'])
     def test_delete_object_without_write_rights(self):
@@ -186,8 +213,11 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
         # Trying to delete the object without write rights
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=self.test_auth_data
+        )
         self.assertRaises(exceptions.Unauthorized,
                           self.custom_object_client.delete_object,
                           self.container_name,
-                          object_name,
-                          metadata=self.custom_headers)
+                          object_name)
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 18199ef..84cc91e 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -20,15 +20,32 @@
 
 
 class ContainerTest(base.BaseObjectTest):
-    @classmethod
-    def setUpClass(cls):
-        super(ContainerTest, cls).setUpClass()
-        cls.containers = []
+    def setUp(self):
+        super(ContainerTest, self).setUp()
+        self.containers = []
 
-    @classmethod
-    def tearDownClass(cls):
-        cls.delete_containers(cls.containers)
-        super(ContainerTest, cls).tearDownClass()
+    def tearDown(self):
+        self.delete_containers(self.containers)
+        super(ContainerTest, self).tearDown()
+
+    def _create_container(self):
+        # setup container
+        container_name = data_utils.rand_name(name='TestContainer')
+        self.container_client.create_container(container_name)
+        self.containers.append(container_name)
+
+        return container_name
+
+    def _create_object(self, container_name, object_name=None):
+        # setup object
+        if object_name is None:
+            object_name = data_utils.rand_name(name='TestObject')
+        data = data_utils.arbitrary_string()
+        self.object_client.create_object(container_name,
+                                         object_name,
+                                         data)
+
+        return object_name
 
     @attr(type='smoke')
     def test_create_container(self):
@@ -39,12 +56,97 @@
         self.assertHeaders(resp, 'Container', 'PUT')
 
     @attr(type='smoke')
+    def test_create_container_overwrite(self):
+        # overwrite container with the same name
+        container_name = data_utils.rand_name(name='TestContainer')
+        self.container_client.create_container(container_name)
+        self.containers.append(container_name)
+
+        resp, _ = self.container_client.create_container(container_name)
+        self.assertIn(resp['status'], ('202', '201'))
+        self.assertHeaders(resp, 'Container', 'PUT')
+
+    @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')
+        metadata = {'test-container-meta': ''}
+        resp, _ = self.container_client.create_container(
+            container_name,
+            metadata=metadata)
+        self.containers.append(container_name)
+        self.assertIn(resp['status'], ('201', '202'))
+        self.assertHeaders(resp, 'Container', 'PUT')
+
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        # if the value of metadata is blank, metadata is not registered
+        # in the server
+        self.assertNotIn('x-container-meta-test-container-meta', resp)
+
+    @attr(type='smoke')
+    def test_create_container_with_metadata_value(self):
+        # create container with metadata value
+        container_name = data_utils.rand_name(name='TestContainer')
+
+        metadata = {'test-container-meta': 'Meta1'}
+        resp, _ = self.container_client.create_container(
+            container_name,
+            metadata=metadata)
+        self.containers.append(container_name)
+        self.assertIn(resp['status'], ('201', '202'))
+        self.assertHeaders(resp, 'Container', 'PUT')
+
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        self.assertIn('x-container-meta-test-container-meta', resp)
+        self.assertEqual(resp['x-container-meta-test-container-meta'],
+                         metadata['test-container-meta'])
+
+    @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')
+        metadata_1 = {'test-container-meta': 'Meta1'}
+        self.container_client.create_container(
+            container_name,
+            metadata=metadata_1)
+        self.containers.append(container_name)
+
+        metadata_2 = {'test-container-meta': ''}
+        resp, _ = self.container_client.create_container(
+            container_name,
+            remove_metadata=metadata_2)
+        self.assertIn(resp['status'], ('201', '202'))
+        self.assertHeaders(resp, 'Container', 'PUT')
+
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        self.assertNotIn('x-container-meta-test-container-meta', resp)
+
+    @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')
+        metadata = {'test-container-meta': 'Meta1'}
+        self.container_client.create_container(container_name,
+                                               metadata=metadata)
+        self.containers.append(container_name)
+
+        resp, _ = self.container_client.create_container(
+            container_name,
+            remove_metadata=metadata)
+        self.assertIn(resp['status'], ('201', '202'))
+        self.assertHeaders(resp, 'Container', 'PUT')
+
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        self.assertNotIn('x-container-meta-test-container-meta', resp)
+
+    @attr(type='smoke')
     def test_delete_container(self):
         # create a container
-        container_name = data_utils.rand_name(name='TestContainer')
-        resp, _ = self.container_client.create_container(container_name)
-        self.assertHeaders(resp, 'Container', 'PUT')
-        self.containers.append(container_name)
+        container_name = self._create_container()
         # delete container
         resp, _ = self.container_client.delete_container(container_name)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
@@ -53,82 +155,280 @@
         self.containers.remove(container_name)
 
     @attr(type='smoke')
-    def test_list_container_contents_json(self):
-        # add metadata to an object
-
-        # create a container
-        container_name = data_utils.rand_name(name='TestContainer')
-        resp, _ = self.container_client.create_container(container_name)
-        self.assertHeaders(resp, 'Container', 'PUT')
-        self.containers.append(container_name)
-        # create object
-        object_name = data_utils.rand_name(name='TestObject')
-        data = data_utils.arbitrary_string()
-        resp, _ = self.object_client.create_object(container_name,
-                                                   object_name, data)
-        self.assertHeaders(resp, 'Object', 'PUT')
-        # set object metadata
-        meta_key = data_utils.rand_name(name='Meta-Test-')
-        meta_value = data_utils.rand_name(name='MetaValue-')
-        orig_metadata = {meta_key: meta_value}
-        resp, _ = self.object_client.update_object_metadata(container_name,
-                                                            object_name,
-                                                            orig_metadata)
-        self.assertHeaders(resp, 'Object', 'POST')
+    def test_list_container_contents(self):
         # get container contents list
+        container_name = self._create_container()
+        object_name = self._create_object(container_name)
+
+        resp, object_list = self.container_client.list_container_contents(
+            container_name)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @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.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual('', object_list.strip('\n'))
+
+    @attr(type='smoke')
+    def test_list_container_contents_with_delimiter(self):
+        # get container contents list using delimiter param
+        container_name = self._create_container()
+        object_name = data_utils.rand_name(name='TestObject/')
+        self._create_object(container_name, object_name)
+
+        params = {'delimiter': '/'}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name.split('/')[0], object_list.strip('/\n'))
+
+    @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()
+        object_name = self._create_object(container_name)
+
+        params = {'end_marker': 'ZzzzObject1234567890'}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @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()
+        self._create_object(container_name)
+
         params = {'format': 'json'}
-        resp, object_list = \
-            self.container_client.\
-            list_container_contents(container_name, params=params)
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
-
-        object_names = [obj['name'] for obj in object_list]
-        self.assertIn(object_name, object_names)
+        self.assertTrue([c['name'] for c in object_list])
+        self.assertTrue([c['hash'] for c in object_list])
+        self.assertTrue([c['bytes'] for c in object_list])
+        self.assertTrue([c['content_type'] for c in object_list])
+        self.assertTrue([c['last_modified'] for c in object_list])
 
     @attr(type='smoke')
-    def test_container_metadata(self):
-        # update/retrieve/delete container metadata
+    def test_list_container_contents_with_format_xml(self):
+        # get container contents list using format_xml param
+        container_name = self._create_container()
+        self._create_object(container_name)
 
-        # create a container
-        container_name = data_utils.rand_name(name='TestContainer')
-        resp, _ = self.container_client.create_container(container_name)
-        self.assertHeaders(resp, 'Container', 'PUT')
-        self.containers.append(container_name)
-        # update container metadata
-        metadata = {'name': 'Pictures',
-                    'description': 'Travel'
-                    }
-        resp, _ = \
-            self.container_client.update_container_metadata(container_name,
-                                                            metadata=metadata)
+        params = {'format': 'xml'}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp, 'Container', 'POST')
+        self.assertHeaders(resp, 'Container', 'GET')
 
-        # list container metadata
+        self.assertIsNotNone(object_list)
+        self.assertEqual(object_list.tag, 'container')
+        self.assertTrue('name' in object_list.keys())
+        self.assertEqual(object_list.find(".//object").tag, 'object')
+        self.assertEqual(object_list.find(".//name").tag, 'name')
+        self.assertEqual(object_list.find(".//hash").tag, 'hash')
+        self.assertEqual(object_list.find(".//bytes").tag, 'bytes')
+        self.assertEqual(object_list.find(".//content_type").tag,
+                         'content_type')
+        self.assertEqual(object_list.find(".//last_modified").tag,
+                         'last_modified')
+
+    @attr(type='smoke')
+    def test_list_container_contents_with_limit(self):
+        # get container contents list using limit param
+        container_name = self._create_container()
+        object_name = self._create_object(container_name)
+
+        params = {'limit': data_utils.rand_int_id(1, 10000)}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @attr(type='smoke')
+    def test_list_container_contents_with_marker(self):
+        # get container contents list using marker param
+        container_name = self._create_container()
+        object_name = self._create_object(container_name)
+
+        params = {'marker': 'AaaaObject1234567890'}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @attr(type='smoke')
+    def test_list_container_contents_with_path(self):
+        # get container contents list using path param
+        container_name = self._create_container()
+        object_name = data_utils.rand_name(name='Swift/TestObject')
+        self._create_object(container_name, object_name)
+
+        params = {'path': 'Swift'}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @attr(type='smoke')
+    def test_list_container_contents_with_prefix(self):
+        # get container contents list using prefix param
+        container_name = self._create_container()
+        object_name = self._create_object(container_name)
+
+        prefix_key = object_name[0:8]
+        params = {'prefix': prefix_key}
+        resp, object_list = self.container_client.list_container_contents(
+            container_name,
+            params=params)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'GET')
+        self.assertEqual(object_name, object_list.strip('\n'))
+
+    @attr(type='smoke')
+    def test_list_container_metadata(self):
+        # List container metadata
+        container_name = self._create_container()
+
+        metadata = {'name': 'Pictures'}
+        self.container_client.update_container_metadata(
+            container_name,
+            metadata=metadata)
+
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
-
         self.assertIn('x-container-meta-name', resp)
-        self.assertIn('x-container-meta-description', resp)
-        self.assertEqual(resp['x-container-meta-name'], 'Pictures')
-        self.assertEqual(resp['x-container-meta-description'], 'Travel')
+        self.assertEqual(resp['x-container-meta-name'], metadata['name'])
 
-        # delete container metadata
-        resp, _ = self.container_client.delete_container_metadata(
+    @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.assertHeaders(resp, 'Container', 'HEAD')
+        self.assertNotIn('x-container-meta-', str(resp))
+
+    @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')
+        metadata_1 = {'test-container-meta1': 'Meta1'}
+        self.container_client.create_container(container_name,
+                                               metadata=metadata_1)
+        self.containers.append(container_name)
+
+        metadata_2 = {'test-container-meta2': 'Meta2'}
+        resp, _ = self.container_client.update_container_metadata(
             container_name,
-            metadata=metadata.keys())
+            metadata=metadata_2,
+            remove_metadata=metadata_1)
         self.assertIn(int(resp['status']), HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
-        # check if the metadata are no longer there
-        resp, _ = self.container_client.list_container_metadata(container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
-        self.assertHeaders(resp, 'Container', 'HEAD')
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        self.assertNotIn('x-container-meta-test-container-meta1', resp)
+        self.assertIn('x-container-meta-test-container-meta2', resp)
+        self.assertEqual(resp['x-container-meta-test-container-meta2'],
+                         metadata_2['test-container-meta2'])
 
-        self.assertNotIn('x-container-meta-name', resp)
-        self.assertNotIn('x-container-meta-description', resp)
+    @attr(type='smoke')
+    def test_update_container_metadata_with_create_metadata(self):
+        # update container metadata using add metadata
+        container_name = self._create_container()
+
+        metadata = {'test-container-meta1': 'Meta1'}
+        resp, _ = self.container_client.update_container_metadata(
+            container_name,
+            metadata=metadata)
+        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertHeaders(resp, 'Container', 'POST')
+
+        resp, _ = self.container_client.list_container_metadata(
+            container_name)
+        self.assertIn('x-container-meta-test-container-meta1', resp)
+        self.assertEqual(resp['x-container-meta-test-container-meta1'],
+                         metadata['test-container-meta1'])
+
+    @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')
+        metadata = {'test-container-meta1': 'Meta1'}
+        self.container_client.create_container(container_name,
+                                               metadata=metadata)
+        self.containers.append(container_name)
+
+        resp, _ = self.container_client.delete_container_metadata(
+            container_name,
+            metadata=metadata)
+        self.assertIn(int(resp['status']), 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')
+    def test_update_container_metadata_with_create_matadata_key(self):
+        # update container metadata with a blenk value of metadata
+        container_name = self._create_container()
+
+        metadata = {'test-container-meta1': ''}
+        resp, _ = self.container_client.update_container_metadata(
+            container_name,
+            metadata=metadata)
+        self.assertIn(int(resp['status']), 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')
+    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')
+        metadata = {'test-container-meta1': 'Meta1'}
+        self.container_client.create_container(container_name,
+                                               metadata=metadata)
+        self.containers.append(container_name)
+
+        metadata = {'test-container-meta1': ''}
+        resp, _ = self.container_client.delete_container_metadata(
+            container_name,
+            metadata=metadata)
+        self.assertIn(int(resp['status']), 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)
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 9f9abd8..197e7fa 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -56,6 +56,12 @@
         self.container_client.update_container_metadata(
             self.container_name, metadata=headers)
 
+        # Maintain original headers, no auth added
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
+
         # test GET on http://account_url/container_name
         # we should retrieve the self.object_name file
         resp, body = self.custom_account_client.request("GET",
@@ -112,6 +118,12 @@
         self.container_client.update_container_metadata(
             self.container_name, metadata=headers)
 
+        # Maintain original headers, no auth added
+        self.custom_account_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
+
         # test GET on http://account_url/container_name
         # we should retrieve a listing of objects
         resp, body = self.custom_account_client.request("GET",
@@ -136,6 +148,12 @@
                                          object_name_404,
                                          object_data_404)
 
+        # Do not set auth in HTTP headers for next request
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
+
         # Request non-existing object
         resp, body = self.custom_object_client.get_object(self.container_name,
                                                           "notexisting")
diff --git a/tempest/api/object_storage/test_crossdomain.py b/tempest/api/object_storage/test_crossdomain.py
index 71e123c..4f399b4 100644
--- a/tempest/api/object_storage/test_crossdomain.py
+++ b/tempest/api/object_storage/test_crossdomain.py
@@ -50,13 +50,12 @@
         super(CrossdomainTest, self).setUp()
 
         client = self.os_test_user.account_client
-        client._set_auth()
         # Turning http://.../v1/foobar into http://.../
-        client.base_url = "/".join(client.base_url.split("/")[:-2])
+        client.skip_path()
 
     def tearDown(self):
         # clear the base_url for subsequent requests
-        self.os_test_user.account_client.base_url = None
+        self.os_test_user.account_client.reset_path()
 
         super(CrossdomainTest, self).tearDown()
 
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index 78bff03..35aee2a 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -29,10 +29,8 @@
 
     def setUp(self):
         super(HealthcheckTest, self).setUp()
-        self.account_client._set_auth()
         # Turning http://.../v1/foobar into http://.../
-        self.account_client.base_url = "/".join(
-            self.account_client.base_url.split("/")[:-2])
+        self.account_client.skip_path()
 
     @attr('gate')
     def test_get_healthcheck(self):
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index bca9b93..6f349b6 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -357,8 +357,12 @@
         self.assertEqual(resp_meta['x-container-read'], '.r:*,.rlistings')
 
         # trying to get object with empty headers as it is public readable
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=None
+        )
         resp, body = self.custom_object_client.get_object(
-            self.container_name, object_name, metadata={})
+            self.container_name, object_name)
         self.assertHeaders(resp, 'Object', 'GET')
 
         self.assertEqual(body, data)
@@ -393,12 +397,14 @@
         self.assertEqual(resp['x-container-read'], '.r:*,.rlistings')
 
         # get auth token of alternative user
-        token = self.identity_client_alt.get_auth()
-        headers = {'X-Auth-Token': token}
+        alt_auth_data = self.identity_client_alt.auth_provider.auth_data
+        self.custom_object_client.auth_provider.set_alt_auth_data(
+            request_part='headers',
+            auth_data=alt_auth_data
+        )
         # access object using alternate user creds
         resp, body = self.custom_object_client.get_object(
-            self.container_name, object_name,
-            metadata=headers)
+            self.container_name, object_name)
         self.assertHeaders(resp, 'Object', 'GET')
 
         self.assertEqual(body, data)
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index 96e0264..b0c878b 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -14,8 +14,6 @@
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.services.volume.json.admin import volume_types_client
-from tempest.services.volume.json import volumes_client
 from tempest.test import attr
 
 CONF = config.CONF
@@ -36,22 +34,7 @@
         cls.backend1_name = CONF.volume.backend1_name
         cls.backend2_name = CONF.volume.backend2_name
 
-        adm_user = CONF.identity.admin_username
-        adm_pass = CONF.identity.admin_password
-        adm_tenant = CONF.identity.admin_tenant_name
-        auth_url = CONF.identity.uri
-
-        cls.volume_client = volumes_client.VolumesClientJSON(CONF,
-                                                             adm_user,
-                                                             adm_pass,
-                                                             auth_url,
-                                                             adm_tenant)
-        cls.type_client = volume_types_client.VolumeTypesClientJSON(CONF,
-                                                                    adm_user,
-                                                                    adm_pass,
-                                                                    auth_url,
-                                                                    adm_tenant)
-
+        cls.volume_client = cls.os_adm.volumes_client
         cls.volume_type_id_list = []
         cls.volume_id_list = []
         try:
@@ -59,7 +42,7 @@
             type1_name = data_utils.rand_name('Type-')
             vol1_name = data_utils.rand_name('Volume-')
             extra_specs1 = {"volume_backend_name": cls.backend1_name}
-            resp, cls.type1 = cls.type_client.create_volume_type(
+            resp, cls.type1 = cls.client.create_volume_type(
                 type1_name, extra_specs=extra_specs1)
             cls.volume_type_id_list.append(cls.type1['id'])
 
@@ -74,7 +57,7 @@
                 type2_name = data_utils.rand_name('Type-')
                 vol2_name = data_utils.rand_name('Volume-')
                 extra_specs2 = {"volume_backend_name": cls.backend2_name}
-                resp, cls.type2 = cls.type_client.create_volume_type(
+                resp, cls.type2 = cls.client.create_volume_type(
                     type2_name, extra_specs=extra_specs2)
                 cls.volume_type_id_list.append(cls.type2['id'])
 
@@ -99,7 +82,7 @@
         # volume types deletion
         volume_type_id_list = getattr(cls, 'volume_type_id_list', [])
         for volume_type_id in volume_type_id_list:
-            cls.type_client.delete_volume_type(volume_type_id)
+            cls.client.delete_volume_type(volume_type_id)
 
         super(VolumeMultiBackendTest, cls).tearDownClass()
 
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index 3211ef8..12fda92 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -64,6 +64,19 @@
                                                           status)
         super(SnapshotsActionsTest, self).tearDown()
 
+    def _create_reset_and_force_delete_temp_snapshot(self, status=None):
+        # Create snapshot, reset snapshot status,
+        # and force delete temp snapshot
+        temp_snapshot = self.create_snapshot(self.volume['id'])
+        if status:
+            resp, body = self.admin_snapshots_client.\
+                reset_snapshot_status(temp_snapshot['id'], status)
+            self.assertEqual(202, resp.status)
+        resp_delete, volume_delete = self.admin_snapshots_client.\
+            force_delete_snapshot(temp_snapshot['id'])
+        self.assertEqual(202, resp_delete.status)
+        self.client.wait_for_resource_deletion(temp_snapshot['id'])
+
     def _get_progress_alias(self):
         return 'os-extended-snapshot-attributes:progress'
 
@@ -99,6 +112,26 @@
         self.assertEqual(status, snapshot_get['status'])
         self.assertEqual(progress, snapshot_get[progress_alias])
 
+    @attr(type='gate')
+    def test_snapshot_force_delete_when_snapshot_is_creating(self):
+        # test force delete when status of snapshot is creating
+        self._create_reset_and_force_delete_temp_snapshot('creating')
+
+    @attr(type='gate')
+    def test_snapshot_force_delete_when_snapshot_is_deleting(self):
+        # test force delete when status of snapshot is deleting
+        self._create_reset_and_force_delete_temp_snapshot('deleting')
+
+    @attr(type='gate')
+    def test_snapshot_force_delete_when_snapshot_is_error(self):
+        # test force delete when status of snapshot is error
+        self._create_reset_and_force_delete_temp_snapshot('error')
+
+    @attr(type='gate')
+    def test_snapshot_force_delete_when_snapshot_is_error_deleting(self):
+        # test force delete when status of snapshot is error_deleting
+        self._create_reset_and_force_delete_temp_snapshot('error_deleting')
+
 
 class SnapshotsActionsTestXML(SnapshotsActionsTest):
     _interface = "xml"
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index fc4f07d..cf4e052 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
@@ -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,
@@ -107,10 +109,14 @@
         self.client.wait_for_volume_status(volume['id'],
                                            'awaiting-transfer')
 
-        # List all volume transfers, there's only one in this test
+        # List all volume transfers (looking for the one we created)
         resp, body = self.client.list_volume_transfers()
         self.assertEqual(200, resp.status)
-        self.assertEqual(volume['id'], body[0]['volume_id'])
+        for transfer in body:
+            if volume['id'] == transfer['volume_id']:
+                break
+        else:
+            self.fail('Transfer not found for volume %s' % volume['id'])
 
         # Delete a volume transfer
         resp, body = self.client.delete_volume_transfer(transfer_id)
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..049544d
--- /dev/null
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -0,0 +1,228 @@
+# 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', 'display_name')
+
+
+class VolumesListTest(base.BaseVolumeV1Test):
+
+    """
+    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['display_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(VolumesListTest, 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(VolumesListTest, cls).tearDownClass()
+
+    def _list_by_param_value_and_assert(self, params, 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)
+        # Validating params of fetched volumes
+        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 = {'display_name': volume['display_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]['display_name'],
+                         volume['display_name'])
+
+    @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']}
+        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]['display_name'],
+                         volume['display_name'])
+
+    @attr(type='gate')
+    def test_volumes_list_by_status(self):
+        params = {'status': 'available'}
+        resp, fetched_list = self.client.list_volumes(params)
+        self.assertEqual(200, resp.status)
+        for volume in fetched_list:
+            self.assertEqual('available', volume['status'])
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
+
+    @attr(type='gate')
+    def test_volumes_list_details_by_status(self):
+        params = {'status': 'available'}
+        resp, fetched_list = self.client.list_volumes_with_detail(params)
+        self.assertEqual(200, resp.status)
+        for volume in fetched_list:
+            self.assertEqual('available', volume['status'])
+        self.assertVolumesIn(fetched_list, self.volume_list)
+
+    @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}
+        resp, fetched_list = self.client.list_volumes(params)
+        self.assertEqual(200, resp.status)
+        for volume in fetched_list:
+            self.assertEqual(zone, volume['availability_zone'])
+        self.assertVolumesIn(fetched_list, self.volume_list,
+                             fields=VOLUME_FIELDS)
+
+    @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}
+        resp, fetched_list = self.client.list_volumes_with_detail(params)
+        self.assertEqual(200, resp.status)
+        for volume in fetched_list:
+            self.assertEqual(zone, volume['availability_zone'])
+        self.assertVolumesIn(fetched_list, self.volume_list)
+
+    @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 = {'display_name': volume['display_name'],
+                  'status': 'available'}
+        self._list_by_param_value_and_assert(params)
+
+    @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 = {'display_name': volume['display_name'],
+                  'status': 'available'}
+        self._list_by_param_value_and_assert(params, with_detail=True)
+
+
+class VolumeListTestXML(VolumesListTest):
+    _interface = 'xml'
diff --git a/tempest/auth.py b/tempest/auth.py
new file mode 100644
index 0000000..582cfdd
--- /dev/null
+++ b/tempest/auth.py
@@ -0,0 +1,396 @@
+# Copyright 2014 Hewlett-Packard Development Company, L.P.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import copy
+import exceptions
+import re
+import urlparse
+
+from datetime import datetime
+from tempest import config
+from tempest.services.identity.json import identity_client as json_id
+from tempest.services.identity.v3.json import identity_client as json_v3id
+from tempest.services.identity.v3.xml import identity_client as xml_v3id
+from tempest.services.identity.xml import identity_client as xml_id
+
+from tempest.openstack.common import log as logging
+
+CONF = config.CONF
+LOG = logging.getLogger(__name__)
+
+
+class AuthProvider(object):
+    """
+    Provide authentication
+    """
+
+    def __init__(self, credentials, client_type='tempest',
+                 interface=None):
+        """
+        :param credentials: credentials for authentication
+        :param client_type: 'tempest' or 'official'
+        :param interface: 'json' or 'xml'. Applicable for tempest client only
+        """
+        if self.check_credentials(credentials):
+            self.credentials = credentials
+        else:
+            raise TypeError("Invalid credentials")
+        self.credentials = credentials
+        self.client_type = client_type
+        self.interface = interface
+        if self.client_type == 'tempest' and self.interface is None:
+            self.interface = 'json'
+        self.cache = None
+        self.alt_auth_data = None
+        self.alt_part = None
+
+    def __str__(self):
+        return "Creds :{creds}, client type: {client_type}, interface: " \
+               "{interface}, cached auth data: {cache}".format(
+                   creds=self.credentials, client_type=self.client_type,
+                   interface=self.interface, cache=self.cache
+               )
+
+    def _decorate_request(self, filters, method, url, headers=None, body=None,
+                          auth_data=None):
+        """
+        Decorate request with authentication data
+        """
+        raise NotImplementedError
+
+    def _get_auth(self):
+        raise NotImplementedError
+
+    @classmethod
+    def check_credentials(cls, credentials):
+        """
+        Verify credentials are valid. Subclasses can do a better check.
+        """
+        return isinstance(credentials, dict)
+
+    @property
+    def auth_data(self):
+        if self.cache is None or self.is_expired(self.cache):
+            self.cache = self._get_auth()
+        return self.cache
+
+    @auth_data.deleter
+    def auth_data(self):
+        self.clear_auth()
+
+    def clear_auth(self):
+        """
+        Can be called to clear the access cache so that next request
+        will fetch a new token and base_url.
+        """
+        self.cache = None
+
+    def is_expired(self, auth_data):
+        raise NotImplementedError
+
+    def auth_request(self, method, url, headers=None, body=None, filters=None):
+        """
+        Obtains auth data and decorates a request with that.
+        :param method: HTTP method of the request
+        :param url: relative URL of the request (path)
+        :param headers: HTTP headers of the request
+        :param body: HTTP body in case of POST / PUT
+        :param filters: select a base URL out of the catalog
+        :returns a Tuple (url, headers, body)
+        """
+        orig_req = dict(url=url, headers=headers, body=body)
+
+        auth_url, auth_headers, auth_body = self._decorate_request(
+            filters, method, url, headers, body)
+        auth_req = dict(url=auth_url, headers=auth_headers, body=auth_body)
+
+        # Overwrite part if the request if it has been requested
+        if self.alt_part is not None:
+            if self.alt_auth_data is not None:
+                alt_url, alt_headers, alt_body = self._decorate_request(
+                    filters, method, url, headers, body,
+                    auth_data=self.alt_auth_data)
+                alt_auth_req = dict(url=alt_url, headers=alt_headers,
+                                    body=alt_body)
+                auth_req[self.alt_part] = alt_auth_req[self.alt_part]
+
+            else:
+                # If alt auth data is None, skip auth in the requested part
+                auth_req[self.alt_part] = orig_req[self.alt_part]
+
+            # Next auth request will be normal, unless otherwise requested
+            self.reset_alt_auth_data()
+
+        return auth_req['url'], auth_req['headers'], auth_req['body']
+
+    def reset_alt_auth_data(self):
+        """
+        Configure auth provider to provide valid authentication data
+        """
+        self.alt_part = None
+        self.alt_auth_data = None
+
+    def set_alt_auth_data(self, request_part, auth_data):
+        """
+        Configure auth provider to provide alt authentication data
+        on a part of the *next* auth_request. If credentials are None,
+        set invalid data.
+        :param request_part: request part to contain invalid auth: url,
+                             headers, body
+        :param auth_data: alternative auth_data from which to get the
+                          invalid data to be injected
+        """
+        self.alt_part = request_part
+        self.alt_auth_data = auth_data
+
+    def base_url(self, filters, auth_data=None):
+        """
+        Extracts the base_url based on provided filters
+        """
+        raise NotImplementedError
+
+
+class KeystoneAuthProvider(AuthProvider):
+
+    def __init__(self, credentials, client_type='tempest', interface=None):
+        super(KeystoneAuthProvider, self).__init__(credentials, client_type,
+                                                   interface)
+        self.auth_client = self._auth_client()
+
+    def _decorate_request(self, filters, method, url, headers=None, body=None,
+                          auth_data=None):
+        if auth_data is None:
+            auth_data = self.auth_data
+        token, _ = auth_data
+        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['X-Auth-Token'] = token
+        if url is None or url == "":
+            _url = base_url
+        else:
+            # Join base URL and url, and remove multiple contiguous slashes
+            _url = "/".join([base_url, url])
+            parts = [x for x in urlparse.urlparse(_url)]
+            parts[2] = re.sub("/{2,}", "/", parts[2])
+            _url = urlparse.urlunparse(parts)
+        # no change to method or body
+        return _url, _headers, body
+
+    def _auth_client(self):
+        raise NotImplementedError
+
+    def _auth_params(self):
+        raise NotImplementedError
+
+    def _get_auth(self):
+        # Bypasses the cache
+        if self.client_type == 'tempest':
+            auth_func = getattr(self.auth_client, 'get_token')
+            auth_params = self._auth_params()
+
+            # returns token, auth_data
+            token, auth_data = auth_func(**auth_params)
+            return token, auth_data
+        else:
+            raise NotImplementedError
+
+    def get_token(self):
+        return self.auth_data[0]
+
+
+class KeystoneV2AuthProvider(KeystoneAuthProvider):
+
+    EXPIRY_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
+
+    @classmethod
+    def check_credentials(cls, credentials, scoped=True):
+        # tenant_name is optional if not scoped
+        valid = super(KeystoneV2AuthProvider, cls).check_credentials(
+            credentials) and 'username' in credentials and \
+            'password' in credentials
+        if scoped:
+            valid = valid and 'tenant_name' in credentials
+        return valid
+
+    def _auth_client(self):
+        if self.client_type == 'tempest':
+            if self.interface == 'json':
+                return json_id.TokenClientJSON()
+            else:
+                return xml_id.TokenClientXML()
+        else:
+            raise NotImplementedError
+
+    def _auth_params(self):
+        if self.client_type == 'tempest':
+            return dict(
+                user=self.credentials['username'],
+                password=self.credentials['password'],
+                tenant=self.credentials.get('tenant_name', None),
+                auth_data=True)
+        else:
+            raise NotImplementedError
+
+    def base_url(self, filters, auth_data=None):
+        """
+        Filters can be:
+        - service: compute, image, etc
+        - region: the service region
+        - endpoint_type: adminURL, publicURL, internalURL
+        - api_version: replace catalog version with this
+        - skip_path: take just the base URL
+        """
+        if auth_data is None:
+            auth_data = self.auth_data
+        token, _auth_data = auth_data
+        service = filters.get('service')
+        region = filters.get('region')
+        endpoint_type = filters.get('endpoint_type', 'publicURL')
+
+        if service is None:
+            raise exceptions.EndpointNotFound("No service provided")
+
+        _base_url = None
+        for ep in _auth_data['serviceCatalog']:
+            if ep["type"] == service:
+                for _ep in ep['endpoints']:
+                    if region is not None and _ep['region'] == region:
+                        _base_url = _ep.get(endpoint_type)
+                if not _base_url:
+                    # No region matching, use the first
+                    _base_url = ep['endpoints'][0].get(endpoint_type)
+                break
+        if _base_url is None:
+            raise exceptions.EndpointNotFound(service)
+
+        parts = urlparse.urlparse(_base_url)
+        if filters.get('api_version', None) is not None:
+            path = "/" + filters['api_version']
+            noversion_path = "/".join(parts.path.split("/")[2:])
+            if 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, "/")
+
+        return _base_url
+
+    def is_expired(self, auth_data):
+        _, access = auth_data
+        expiry = datetime.strptime(access['token']['expires'],
+                                   self.EXPIRY_DATE_FORMAT)
+        return expiry <= datetime.now()
+
+
+class KeystoneV3AuthProvider(KeystoneAuthProvider):
+
+    EXPIRY_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
+
+    @classmethod
+    def check_credentials(cls, credentials, scoped=True):
+        # tenant_name is optional if not scoped
+        valid = super(KeystoneV3AuthProvider, cls).check_credentials(
+            credentials) and 'username' in credentials and \
+            'password' in credentials and 'domain_name' in credentials
+        if scoped:
+            valid = valid and 'tenant_name' in credentials
+        return valid
+
+    def _auth_client(self):
+        if self.client_type == 'tempest':
+            if self.interface == 'json':
+                return json_v3id.V3TokenClientJSON()
+            else:
+                return xml_v3id.V3TokenClientXML()
+        else:
+            raise NotImplementedError
+
+    def _auth_params(self):
+        if self.client_type == 'tempest':
+            return dict(
+                user=self.credentials['username'],
+                password=self.credentials['password'],
+                tenant=self.credentials.get('tenant_name', None),
+                domain=self.credentials['domain_name'],
+                auth_data=True)
+        else:
+            raise NotImplementedError
+
+    def base_url(self, filters, auth_data=None):
+        """
+        Filters can be:
+        - service: compute, image, etc
+        - region: the service region
+        - endpoint_type: adminURL, publicURL, internalURL
+        - api_version: replace catalog version with this
+        - skip_path: take just the base URL
+        """
+        if auth_data is None:
+            auth_data = self.auth_data
+        token, _auth_data = auth_data
+        service = filters.get('service')
+        region = filters.get('region')
+        endpoint_type = filters.get('endpoint_type', 'public')
+
+        if service is None:
+            raise exceptions.EndpointNotFound("No service provided")
+
+        if 'URL' in endpoint_type:
+            endpoint_type = endpoint_type.replace('URL', '')
+        _base_url = None
+        catalog = _auth_data['catalog']
+        # Select entries with matching service type
+        service_catalog = [ep for ep in catalog if ep['type'] == service]
+        if len(service_catalog) > 0:
+            service_catalog = service_catalog[0]['endpoints']
+        else:
+            # No matching service
+            raise exceptions.EndpointNotFound(service)
+        # Filter by endpoint type (interface)
+        filtered_catalog = [ep for ep in service_catalog if
+                            ep['interface'] == endpoint_type]
+        if len(filtered_catalog) == 0:
+            # No matching type, keep all and try matching by region at least
+            filtered_catalog = service_catalog
+        # Filter by region
+        filtered_catalog = [ep for ep in filtered_catalog if
+                            ep['region'] == region]
+        if len(filtered_catalog) == 0:
+            # No matching region, take the first endpoint
+            filtered_catalog = [filtered_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:
+                raise exceptions.EndpointNotFound(service)
+
+        parts = urlparse.urlparse(_base_url)
+        if filters.get('api_version', None) is not None:
+            path = "/" + filters['api_version']
+            noversion_path = "/".join(parts.path.split("/")[2:])
+            if 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, "/")
+
+        return _base_url
+
+    def is_expired(self, auth_data):
+        _, access = auth_data
+        expiry = datetime.strptime(access['expires_at'],
+                                   self.EXPIRY_DATE_FORMAT)
+        return expiry <= datetime.now()
diff --git a/tempest/clients.py b/tempest/clients.py
index 797185a..9c1a0f1 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -13,6 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import auth
+from tempest.common.rest_client import NegativeRestClient
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
@@ -174,7 +176,7 @@
     """
 
     def __init__(self, username=None, password=None, tenant_name=None,
-                 interface='json'):
+                 interface='json', service=None):
         """
         We allow overriding of the credentials used within the various
         client classes managed by the Manager object. Left as None, the
@@ -184,167 +186,208 @@
         :param password: Override of the password
         :param tenant_name: Override of the tenant name
         """
-        # If no creds are provided, we fall back on the defaults
-        # in the config file for the Compute API.
-        self.username = username or CONF.identity.username
-        self.password = password or CONF.identity.password
-        self.tenant_name = tenant_name or CONF.identity.tenant_name
-
-        if None in (self.username, self.password, self.tenant_name):
-            msg = ("Missing required credentials. "
-                   "username: %(u)s, password: %(p)s, "
-                   "tenant_name: %(t)s" %
-                   {'u': username, 'p': password, 't': tenant_name})
-            raise exceptions.InvalidConfiguration(msg)
-
-        self.auth_url = CONF.identity.uri
-        self.auth_url_v3 = CONF.identity.uri_v3
-
-        client_args = (self.username, self.password,
-                       self.auth_url, self.tenant_name)
-
-        if self.auth_url_v3:
-            auth_version = 'v3'
-            client_args_v3_auth = (self.username,
-                                   self.password, self.auth_url_v3,
-                                   self.tenant_name, auth_version)
+        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:
-            client_args_v3_auth = None
+            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.servers_client_v3_auth = None
-
-        if interface == 'xml':
-            self.certificates_client = CertificatesClientXML(*client_args)
-            self.servers_client = ServersClientXML(*client_args)
-            self.limits_client = LimitsClientXML(*client_args)
-            self.images_client = ImagesClientXML(*client_args)
-            self.keypairs_client = KeyPairsClientXML(*client_args)
-            self.quotas_client = QuotasClientXML(*client_args)
-            self.flavors_client = FlavorsClientXML(*client_args)
-            self.extensions_client = ExtensionsClientXML(*client_args)
+        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.volumes_extensions_client = VolumesExtensionsClientXML(
-                *client_args)
-            self.floating_ips_client = FloatingIPsClientXML(*client_args)
-            self.snapshots_client = SnapshotsClientXML(*client_args)
-            self.volumes_client = VolumesClientXML(*client_args)
-            self.volume_types_client = VolumeTypesClientXML(*client_args)
-            self.identity_client = IdentityClientXML(*client_args)
-            self.identity_v3_client = IdentityV3ClientXML(*client_args)
-            self.token_client = TokenClientXML()
+                auth_provider)
+            self.floating_ips_client = FloatingIPsClientXML(
+                auth_provider)
+            self.snapshots_client = SnapshotsClientXML(auth_provider)
+            self.volumes_client = VolumesClientXML(auth_provider)
+            self.volume_types_client = VolumeTypesClientXML(
+                auth_provider)
+            self.identity_client = IdentityClientXML(auth_provider)
+            self.identity_v3_client = IdentityV3ClientXML(
+                auth_provider)
             self.security_groups_client = SecurityGroupsClientXML(
-                *client_args)
-            self.interfaces_client = InterfacesClientXML(*client_args)
-            self.endpoints_client = EndPointClientXML(*client_args)
-            self.fixed_ips_client = FixedIPsClientXML(*client_args)
+                auth_provider)
+            self.interfaces_client = InterfacesClientXML(auth_provider)
+            self.endpoints_client = EndPointClientXML(auth_provider)
+            self.fixed_ips_client = FixedIPsClientXML(auth_provider)
             self.availability_zone_client = AvailabilityZoneClientXML(
-                *client_args)
-            self.service_client = ServiceClientXML(*client_args)
-            self.aggregates_client = AggregatesClientXML(*client_args)
-            self.services_client = ServicesClientXML(*client_args)
-            self.tenant_usages_client = TenantUsagesClientXML(*client_args)
-            self.policy_client = PolicyClientXML(*client_args)
-            self.hosts_client = HostsClientXML(*client_args)
-            self.hypervisor_client = HypervisorClientXML(*client_args)
-            self.token_v3_client = V3TokenClientXML(*client_args)
-            self.network_client = NetworkClientXML(*client_args)
-            self.credentials_client = CredentialsClientXML(*client_args)
+                auth_provider)
+            self.service_client = ServiceClientXML(auth_provider)
+            self.aggregates_client = AggregatesClientXML(auth_provider)
+            self.services_client = ServicesClientXML(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.credentials_client = CredentialsClientXML(
+                auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientXML(*client_args)
-            self.volume_hosts_client = VolumeHostsClientXML(*client_args)
+                InstanceUsagesAuditLogClientXML(auth_provider)
+            self.volume_hosts_client = VolumeHostsClientXML(
+                auth_provider)
             self.volumes_extension_client = VolumeExtensionClientXML(
-                *client_args)
-
-            if client_args_v3_auth:
-                self.servers_client_v3_auth = ServersClientXML(
-                    *client_args_v3_auth)
+                auth_provider)
             if CONF.service_available.ceilometer:
-                self.telemetry_client = TelemetryClientXML(*client_args)
+                self.telemetry_client = TelemetryClientXML(
+                    auth_provider)
+            self.token_client = TokenClientXML()
+            self.token_v3_client = V3TokenClientXML()
 
-        elif interface == 'json':
-            self.certificates_client = CertificatesClientJSON(*client_args)
+        elif self.interface == 'json':
+            self.certificates_client = CertificatesClientJSON(
+                auth_provider)
             self.certificates_v3_client = CertificatesV3ClientJSON(
-                *client_args)
-            self.baremetal_client = BaremetalClientJSON(*client_args)
-            self.servers_client = ServersClientJSON(*client_args)
-            self.servers_v3_client = ServersV3ClientJSON(*client_args)
-            self.limits_client = LimitsClientJSON(*client_args)
-            self.images_client = ImagesClientJSON(*client_args)
-            self.keypairs_v3_client = KeyPairsV3ClientJSON(*client_args)
-            self.keypairs_client = KeyPairsClientJSON(*client_args)
-            self.keypairs_v3_client = KeyPairsV3ClientJSON(*client_args)
-            self.quotas_client = QuotasClientJSON(*client_args)
-            self.quotas_v3_client = QuotasV3ClientJSON(*client_args)
-            self.flavors_client = FlavorsClientJSON(*client_args)
-            self.flavors_v3_client = FlavorsV3ClientJSON(*client_args)
-            self.extensions_v3_client = ExtensionsV3ClientJSON(*client_args)
-            self.extensions_client = ExtensionsClientJSON(*client_args)
+                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.keypairs_v3_client = KeyPairsV3ClientJSON(
+                auth_provider)
+            self.keypairs_client = KeyPairsClientJSON(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.extensions_v3_client = ExtensionsV3ClientJSON(
+                auth_provider)
+            self.extensions_client = ExtensionsClientJSON(
+                auth_provider)
             self.volumes_extensions_client = VolumesExtensionsClientJSON(
-                *client_args)
-            self.floating_ips_client = FloatingIPsClientJSON(*client_args)
-            self.snapshots_client = SnapshotsClientJSON(*client_args)
-            self.volumes_client = VolumesClientJSON(*client_args)
-            self.volume_types_client = VolumeTypesClientJSON(*client_args)
-            self.identity_client = IdentityClientJSON(*client_args)
-            self.identity_v3_client = IdentityV3ClientJSON(*client_args)
-            self.token_client = TokenClientJSON()
+                auth_provider)
+            self.floating_ips_client = FloatingIPsClientJSON(
+                auth_provider)
+            self.snapshots_client = SnapshotsClientJSON(auth_provider)
+            self.volumes_client = VolumesClientJSON(auth_provider)
+            self.volume_types_client = VolumeTypesClientJSON(
+                auth_provider)
+            self.identity_client = IdentityClientJSON(auth_provider)
+            self.identity_v3_client = IdentityV3ClientJSON(
+                auth_provider)
             self.security_groups_client = SecurityGroupsClientJSON(
-                *client_args)
-            self.interfaces_v3_client = InterfacesV3ClientJSON(*client_args)
-            self.interfaces_client = InterfacesClientJSON(*client_args)
-            self.endpoints_client = EndPointClientJSON(*client_args)
-            self.fixed_ips_client = FixedIPsClientJSON(*client_args)
+                auth_provider)
+            self.interfaces_v3_client = InterfacesV3ClientJSON(
+                auth_provider)
+            self.interfaces_client = InterfacesClientJSON(
+                auth_provider)
+            self.endpoints_client = EndPointClientJSON(auth_provider)
+            self.fixed_ips_client = FixedIPsClientJSON(auth_provider)
             self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
-                *client_args)
+                auth_provider)
             self.availability_zone_client = AvailabilityZoneClientJSON(
-                *client_args)
-            self.services_v3_client = ServicesV3ClientJSON(*client_args)
-            self.service_client = ServiceClientJSON(*client_args)
-            self.aggregates_v3_client = AggregatesV3ClientJSON(*client_args)
-            self.aggregates_client = AggregatesClientJSON(*client_args)
-            self.services_client = ServicesClientJSON(*client_args)
+                auth_provider)
+            self.services_v3_client = ServicesV3ClientJSON(
+                auth_provider)
+            self.service_client = ServiceClientJSON(auth_provider)
+            self.aggregates_v3_client = AggregatesV3ClientJSON(
+                auth_provider)
+            self.aggregates_client = AggregatesClientJSON(
+                auth_provider)
+            self.services_client = ServicesClientJSON(auth_provider)
             self.tenant_usages_v3_client = TenantUsagesV3ClientJSON(
-                *client_args)
-            self.tenant_usages_client = TenantUsagesClientJSON(*client_args)
-            self.version_v3_client = VersionV3ClientJSON(*client_args)
-            self.policy_client = PolicyClientJSON(*client_args)
-            self.hosts_client = HostsClientJSON(*client_args)
-            self.hypervisor_v3_client = HypervisorV3ClientJSON(*client_args)
-            self.hypervisor_client = HypervisorClientJSON(*client_args)
-            self.token_v3_client = V3TokenClientJSON(*client_args)
-            self.network_client = NetworkClientJSON(*client_args)
-            self.credentials_client = CredentialsClientJSON(*client_args)
+                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.hypervisor_v3_client = HypervisorV3ClientJSON(
+                auth_provider)
+            self.hypervisor_client = HypervisorClientJSON(
+                auth_provider)
+            self.network_client = NetworkClientJSON(auth_provider)
+            self.credentials_client = CredentialsClientJSON(
+                auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientJSON(*client_args)
+                InstanceUsagesAuditLogClientJSON(auth_provider)
             self.instance_usages_audit_log_v3_client = \
-                InstanceUsagesAuditLogV3ClientJSON(*client_args)
-            self.volume_hosts_client = VolumeHostsClientJSON(*client_args)
+                InstanceUsagesAuditLogV3ClientJSON(auth_provider)
+            self.volume_hosts_client = VolumeHostsClientJSON(
+                auth_provider)
             self.volumes_extension_client = VolumeExtensionClientJSON(
-                *client_args)
-            self.hosts_v3_client = HostsV3ClientJSON(*client_args)
+                auth_provider)
+            self.hosts_v3_client = HostsV3ClientJSON(auth_provider)
             if CONF.service_available.ceilometer:
-                self.telemetry_client = TelemetryClientJSON(*client_args)
+                self.telemetry_client = TelemetryClientJSON(
+                    auth_provider)
+            self.token_client = TokenClientJSON()
+            self.token_v3_client = V3TokenClientJSON()
+            self.negative_client = NegativeRestClient(auth_provider)
+            self.negative_client.service = service
 
-            if client_args_v3_auth:
-                self.servers_client_v3_auth = ServersClientJSON(
-                    *client_args_v3_auth)
         else:
             msg = "Unsupported interface type `%s'" % interface
             raise exceptions.InvalidConfiguration(msg)
 
+        # TODO(andreaf) EC2 client still do their auth, v2 only
+        ec2_client_args = (self.credentials.get('username'),
+                           self.credentials.get('password'),
+                           CONF.identity.uri,
+                           self.credentials.get('tenant_name'))
+
         # common clients
-        self.account_client = AccountClient(*client_args)
+        self.account_client = AccountClient(auth_provider)
         if CONF.service_available.glance:
-            self.image_client = ImageClientJSON(*client_args)
-            self.image_client_v2 = ImageClientV2JSON(*client_args)
-        self.container_client = ContainerClient(*client_args)
-        self.object_client = ObjectClient(*client_args)
-        self.orchestration_client = OrchestrationClient(*client_args)
-        self.ec2api_client = botoclients.APIClientEC2(*client_args)
-        self.s3_client = botoclients.ObjectClientS3(*client_args)
-        self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
+            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.orchestration_client = OrchestrationClient(
+            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.custom_account_client = \
-            AccountClientCustomizedHeader(*client_args)
-        self.data_processing_client = DataProcessingClient(*client_args)
+            AccountClientCustomizedHeader(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)
 
 
 class AltManager(Manager):
@@ -354,11 +397,12 @@
     managed client objects
     """
 
-    def __init__(self, interface='json'):
+    def __init__(self, interface='json', service=None):
         super(AltManager, self).__init__(CONF.identity.alt_username,
                                          CONF.identity.alt_password,
                                          CONF.identity.alt_tenant_name,
-                                         interface=interface)
+                                         interface=interface,
+                                         service=service)
 
 
 class AdminManager(Manager):
@@ -368,11 +412,12 @@
     managed client objects
     """
 
-    def __init__(self, interface='json'):
+    def __init__(self, interface='json', service=None):
         super(AdminManager, self).__init__(CONF.identity.admin_username,
                                            CONF.identity.admin_password,
                                            CONF.identity.admin_tenant_name,
-                                           interface=interface)
+                                           interface=interface,
+                                           service=service)
 
 
 class ComputeAdminManager(Manager):
@@ -382,12 +427,13 @@
     managed client objects
     """
 
-    def __init__(self, interface='json'):
+    def __init__(self, interface='json', service=None):
         base = super(ComputeAdminManager, self)
         base.__init__(CONF.compute_admin.username,
                       CONF.compute_admin.password,
                       CONF.compute_admin.tenant_name,
-                      interface=interface)
+                      interface=interface,
+                      service=service)
 
 
 class OrchestrationManager(Manager):
@@ -395,9 +441,10 @@
     Manager object that uses the admin credentials for its
     so that heat templates can create users
     """
-    def __init__(self, interface='json'):
+    def __init__(self, interface='json', service=None):
         base = super(OrchestrationManager, self)
         base.__init__(CONF.identity.admin_username,
                       CONF.identity.admin_password,
-                      CONF.identity.tenant_name,
-                      interface=interface)
+                      CONF.identity.admin_tenant_name,
+                      interface=interface,
+                      service=service)
diff --git a/tempest/common/commands.py b/tempest/common/commands.py
index af7a692..6405eaa 100644
--- a/tempest/common/commands.py
+++ b/tempest/common/commands.py
@@ -29,7 +29,8 @@
     subprocess_args = {'stdout': subprocess.PIPE,
                        'stderr': subprocess.STDOUT}
     try:
-        proc = subprocess.Popen(['/usr/bin/sudo'] + args, **subprocess_args)
+        proc = subprocess.Popen(['/usr/bin/sudo', '-n'] + args,
+                                **subprocess_args)
         return proc.communicate()[0]
         if proc.returncode != 0:
             LOG.error(cmd + "returned with: " +
diff --git a/tempest/common/custom_matchers.py b/tempest/common/custom_matchers.py
index a02c967..4a7921f 100644
--- a/tempest/common/custom_matchers.py
+++ b/tempest/common/custom_matchers.py
@@ -131,6 +131,8 @@
                 return InvalidFormat(key, value)
             elif key == 'etag' and not value.isalnum():
                 return InvalidFormat(key, value)
+            elif key == 'transfer-encoding' and not value == 'chunked':
+                return InvalidFormat(key, value)
 
         return None
 
diff --git a/tempest/common/generate_json.py b/tempest/common/generate_json.py
new file mode 100644
index 0000000..c8e86dc
--- /dev/null
+++ b/tempest/common/generate_json.py
@@ -0,0 +1,265 @@
+# Copyright 2014 Red Hat, Inc. & Deutsche Telekom AG
+# 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
+import jsonschema
+
+from tempest.openstack.common import log as logging
+
+LOG = logging.getLogger(__name__)
+
+
+def generate_valid(schema):
+    """
+    Create a valid dictionary based on the types in a json schema.
+    """
+    LOG.debug("generate_valid: %s" % schema)
+    schema_type = schema["type"]
+    if isinstance(schema_type, list):
+        # Just choose the first one since all are valid.
+        schema_type = schema_type[0]
+    return type_map_valid[schema_type](schema)
+
+
+def generate_valid_string(schema):
+    size = schema.get("minLength", 0)
+    # TODO(dkr mko): handle format and pattern
+    return "x" * size
+
+
+def generate_valid_integer(schema):
+    # TODO(dkr mko): handle multipleOf
+    if "minimum" in schema:
+        minimum = schema["minimum"]
+        if "exclusiveMinimum" not in schema:
+            return minimum
+        else:
+            return minimum + 1
+    if "maximum" in schema:
+        maximum = schema["maximum"]
+        if "exclusiveMaximum" not in schema:
+            return maximum
+        else:
+            return maximum - 1
+    return 0
+
+
+def generate_valid_object(schema):
+    obj = {}
+    for k, v in schema["properties"].iteritems():
+        obj[k] = generate_valid(v)
+    return obj
+
+
+def generate_invalid(schema):
+    """
+    Generate an invalid json dictionary based on a schema.
+    Only one value is mis-generated for each dictionary created.
+
+    Any generator must return a list of tuples or a single tuple.
+    The values of this tuple are:
+      result[0]: Name of the test
+      result[1]: json schema for the test
+      result[2]: expected result of the test (can be None)
+    """
+    LOG.debug("generate_invalid: %s" % schema)
+    schema_type = schema["type"]
+    if isinstance(schema_type, list):
+        if "integer" in schema_type:
+            schema_type = "integer"
+        else:
+            raise Exception("non-integer list types not supported")
+    result = []
+    for generator in type_map_invalid[schema_type]:
+        ret = generator(schema)
+        if ret is not None:
+            if isinstance(ret, list):
+                result.extend(ret)
+            elif isinstance(ret, tuple):
+                result.append(ret)
+            else:
+                raise Exception("generator (%s) returns invalid result"
+                                % generator)
+    LOG.debug("result: %s" % result)
+    return result
+
+
+def _check_for_expected_result(name, schema):
+    expected_result = None
+    if "results" in schema:
+        if name in schema["results"]:
+            expected_result = schema["results"][name]
+    return expected_result
+
+
+def generator(fn):
+    """
+    Decorator for simple generators that simply return one value
+    """
+    def wrapped(schema):
+        result = fn(schema)
+        if result is not None:
+            expected_result = _check_for_expected_result(fn.__name__, schema)
+            return (fn.__name__, result, expected_result)
+        return
+    return wrapped
+
+
+@generator
+def gen_int(_):
+    return 4
+
+
+@generator
+def gen_string(_):
+    return "XXXXXX"
+
+
+def gen_none(schema):
+    # Note(mkoderer): it's not using the decorator otherwise it'd be filtered
+    expected_result = _check_for_expected_result('gen_none', schema)
+    return ('gen_none', None, expected_result)
+
+
+@generator
+def gen_str_min_length(schema):
+    min_length = schema.get("minLength", 0)
+    if min_length > 0:
+        return "x" * (min_length - 1)
+
+
+@generator
+def gen_str_max_length(schema):
+    max_length = schema.get("maxLength", -1)
+    if max_length > -1:
+        return "x" * (max_length + 1)
+
+
+@generator
+def gen_int_min(schema):
+    if "minimum" in schema:
+        minimum = schema["minimum"]
+        if "exclusiveMinimum" not in schema:
+            minimum -= 1
+        return minimum
+
+
+@generator
+def gen_int_max(schema):
+    if "maximum" in schema:
+        maximum = schema["maximum"]
+        if "exclusiveMaximum" not in schema:
+            maximum += 1
+        return maximum
+
+
+def gen_obj_remove_attr(schema):
+    invalids = []
+    valid = generate_valid(schema)
+    required = schema.get("required", [])
+    for r in required:
+        new_valid = copy.deepcopy(valid)
+        del new_valid[r]
+        invalids.append(("gen_obj_remove_attr", new_valid, None))
+    return invalids
+
+
+@generator
+def gen_obj_add_attr(schema):
+    valid = generate_valid(schema)
+    if not schema.get("additionalProperties", True):
+        new_valid = copy.deepcopy(valid)
+        new_valid["$$$$$$$$$$"] = "xxx"
+        return new_valid
+
+
+def gen_inv_prop_obj(schema):
+    LOG.debug("generate_invalid_object: %s" % schema)
+    valid = generate_valid(schema)
+    invalids = []
+    properties = schema["properties"]
+
+    for k, v in properties.iteritems():
+        for invalid in generate_invalid(v):
+            LOG.debug(v)
+            new_valid = copy.deepcopy(valid)
+            new_valid[k] = invalid[1]
+            name = "prop_%s_%s" % (k, invalid[0])
+            invalids.append((name, new_valid, invalid[2]))
+
+    LOG.debug("generate_invalid_object return: %s" % invalids)
+    return invalids
+
+
+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]
+}
+
+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):
+    jsonschema.validate(nts, schema)
diff --git a/tempest/common/glance_http.py b/tempest/common/glance_http.py
index d8afab3..4503f13 100644
--- a/tempest/common/glance_http.py
+++ b/tempest/common/glance_http.py
@@ -45,8 +45,10 @@
 
 class HTTPClient(object):
 
-    def __init__(self, endpoint, **kwargs):
-        self.endpoint = endpoint
+    def __init__(self, auth_provider, filters, **kwargs):
+        self.auth_provider = auth_provider
+        self.filters = filters
+        self.endpoint = auth_provider.base_url(filters)
         endpoint_parts = self.parse_endpoint(self.endpoint)
         self.endpoint_scheme = endpoint_parts.scheme
         self.endpoint_hostname = endpoint_parts.hostname
@@ -57,8 +59,6 @@
         self.connection_kwargs = self.get_connection_kwargs(
             self.endpoint_scheme, **kwargs)
 
-        self.auth_token = kwargs.get('token')
-
     @staticmethod
     def parse_endpoint(endpoint):
         return urlparse.urlparse(endpoint)
@@ -100,15 +100,15 @@
         # Copy the kwargs so we can reuse the original in case of redirects
         kwargs['headers'] = copy.deepcopy(kwargs.get('headers', {}))
         kwargs['headers'].setdefault('User-Agent', USER_AGENT)
-        if self.auth_token:
-            kwargs['headers'].setdefault('X-Auth-Token', self.auth_token)
 
         self._log_request(method, url, kwargs['headers'])
 
         conn = self.get_connection()
 
         try:
-            conn_url = posixpath.normpath('%s/%s' % (self.endpoint_path, url))
+            url_parts = self.parse_endpoint(url)
+            conn_url = posixpath.normpath(url_parts.path)
+            LOG.debug('Actual Path: {path}'.format(path=conn_url))
             if kwargs['headers'].get('Transfer-Encoding') == 'chunked':
                 conn.putrequest(method, conn_url)
                 for header, value in kwargs['headers'].items():
@@ -198,7 +198,13 @@
                 # We use 'Transfer-Encoding: chunked' because
                 # body size may not always be known in advance.
                 kwargs['headers']['Transfer-Encoding'] = 'chunked'
-        return self._http_request(url, method, **kwargs)
+
+        # Decorate the request with auth
+        req_url, kwargs['headers'], kwargs['body'] = \
+            self.auth_provider.auth_request(
+                method=method, url=url, headers=kwargs['headers'],
+                body=kwargs.get('body', None), filters=self.filters)
+        return self._http_request(req_url, method, **kwargs)
 
 
 class OpenSSLConnectionDelegator(object):
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 146fac9..ac8b14f 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -36,7 +36,6 @@
         self.isolated_net_resources = {}
         self.ports = []
         self.name = name
-        self.config = CONF
         self.tempest_client = tempest_client
         self.interface = interface
         self.password = password
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 636e2bf..212d41d 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -38,32 +38,34 @@
 
 
 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, user, password, auth_url, tenant_name=None,
-                 auth_version='v2'):
-        self.user = user
-        self.password = password
-        self.auth_url = auth_url
-        self.tenant_name = tenant_name
-        self.auth_version = auth_version
+    def __init__(self, auth_provider):
+        self.auth_provider = auth_provider
 
-        self.service = None
-        self.token = None
-        self.base_url = None
-        self.region = {}
-        for cfgname in dir(CONF):
-            # Find all config.FOO.catalog_type and assume FOO is a service.
-            cfg = getattr(CONF, cfgname)
-            catalog_type = getattr(cfg, 'catalog_type', None)
-            if not catalog_type:
-                continue
-            service_region = getattr(cfg, 'region', None)
-            if not service_region:
-                service_region = CONF.identity.region
-            self.region[catalog_type] = service_region
         self.endpoint_url = 'publicURL'
+        self.service = None
+        # The version of the API this client implements
+        self.api_version = None
+        self._skip_path = False
+        # NOTE(vponomaryov): self.headers is deprecated now.
+        # should be removed after excluding it from all use places.
+        # Insted of this should be used 'get_headers' method
         self.headers = {'Content-Type': 'application/%s' % self.TYPE,
                         'Accept': 'application/%s' % self.TYPE}
         self.build_interval = CONF.compute.build_interval
@@ -80,195 +82,89 @@
         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):
+        # This method should be used instead of
+        # deprecated 'self.headers'
+        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 = ("user:%s, password:%s, "
-                      "auth_url:%s, tenant_name:%s, auth_version:%s, "
-                      "service:%s, base_url:%s, region:%s, "
-                      "endpoint_url:%s, build_interval:%s, build_timeout:%s"
+        str_format = ("config:%s, service:%s, base_url:%s, "
+                      "filters: %s, build_interval:%s, build_timeout:%s"
                       "\ntoken:%s..., \nheaders:%s...")
-        return str_format % (self.user, self.password,
-                             self.auth_url, self.tenant_name,
-                             self.auth_version, self.service,
-                             self.base_url, self.region, self.endpoint_url,
-                             self.build_interval, self.build_timeout,
+        return str_format % (CONF, self.service, self.base_url,
+                             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 _set_auth(self):
+    def _get_region(self, service):
         """
-        Sets the token and base_url used in requests based on the strategy type
+        Returns the region for a specific service
         """
+        service_region = 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:
+                service_region = getattr(cfg, 'region', None)
+        if not service_region:
+            service_region = CONF.identity.region
+        return service_region
 
-        if self.auth_version == 'v3':
-            auth_func = self.identity_auth_v3
-        else:
-            auth_func = self.keystone_auth
+    @property
+    def user(self):
+        return self.auth_provider.credentials.get('username', None)
 
-        self.token, self.base_url = (
-            auth_func(self.user, self.password, self.auth_url,
-                      self.service, self.tenant_name))
+    @property
+    def tenant_name(self):
+        return self.auth_provider.credentials.get('tenant_name', None)
 
-    def clear_auth(self):
+    @property
+    def password(self):
+        return self.auth_provider.credentials.get('password', None)
+
+    @property
+    def base_url(self):
+        return self.auth_provider.base_url(filters=self.filters)
+
+    @property
+    def token(self):
+        return self.auth_provider.get_token()
+
+    @property
+    def filters(self):
+        _filters = dict(
+            service=self.service,
+            endpoint_type=self.endpoint_url,
+            region=self._get_region(self.service)
+        )
+        if self.api_version is not None:
+            _filters['api_version'] = self.api_version
+        if self._skip_path:
+            _filters['skip_path'] = self._skip_path
+        return _filters
+
+    def skip_path(self):
         """
-        Can be called to clear the token and base_url so that the next request
-        will fetch a new token and base_url.
+        When set, ignore the path part of the base URL from the catalog
         """
+        self._skip_path = True
 
-        self.token = None
-        self.base_url = None
-
-    def get_auth(self):
-        """Returns the token of the current request or sets the token if
-        none.
+    def reset_path(self):
         """
-
-        if not self.token:
-            self._set_auth()
-
-        return self.token
-
-    def keystone_auth(self, user, password, auth_url, service, tenant_name):
+        When reset, use the base URL from the catalog as-is
         """
-        Provides authentication via Keystone using v2 identity API.
-        """
-
-        # Normalize URI to ensure /tokens is in it.
-        if 'tokens' not in auth_url:
-            auth_url = auth_url.rstrip('/') + '/tokens'
-
-        creds = {
-            'auth': {
-                'passwordCredentials': {
-                    'username': user,
-                    'password': password,
-                },
-                'tenantName': tenant_name,
-            }
-        }
-
-        headers = {'Content-Type': 'application/json'}
-        body = json.dumps(creds)
-        self._log_request('POST', auth_url, headers, body)
-        resp, resp_body = self.http_obj.request(auth_url, 'POST',
-                                                headers=headers, body=body)
-        self._log_response(resp, resp_body)
-
-        if resp.status == 200:
-            try:
-                auth_data = json.loads(resp_body)['access']
-                token = auth_data['token']['id']
-            except Exception as e:
-                print("Failed to obtain token for user: %s" % e)
-                raise
-
-            mgmt_url = None
-            for ep in auth_data['serviceCatalog']:
-                if ep["type"] == service:
-                    for _ep in ep['endpoints']:
-                        if service in self.region and \
-                                _ep['region'] == self.region[service]:
-                            mgmt_url = _ep[self.endpoint_url]
-                    if not mgmt_url:
-                        mgmt_url = ep['endpoints'][0][self.endpoint_url]
-                    break
-
-            if mgmt_url is None:
-                raise exceptions.EndpointNotFound(service)
-
-            return token, mgmt_url
-
-        elif resp.status == 401:
-            raise exceptions.AuthenticationFailure(user=user,
-                                                   password=password,
-                                                   tenant=tenant_name)
-        raise exceptions.IdentityError('Unexpected status code {0}'.format(
-            resp.status))
-
-    def identity_auth_v3(self, user, password, auth_url, service,
-                         project_name, domain_id='default'):
-        """Provides authentication using Identity API v3."""
-
-        req_url = auth_url.rstrip('/') + '/auth/tokens'
-
-        creds = {
-            "auth": {
-                "identity": {
-                    "methods": ["password"],
-                    "password": {
-                        "user": {
-                            "name": user, "password": password,
-                            "domain": {"id": domain_id}
-                        }
-                    }
-                },
-                "scope": {
-                    "project": {
-                        "domain": {"id": domain_id},
-                        "name": project_name
-                    }
-                }
-            }
-        }
-
-        headers = {'Content-Type': 'application/json'}
-        body = json.dumps(creds)
-        resp, body = self.http_obj.request(req_url, 'POST',
-                                           headers=headers, body=body)
-
-        if resp.status == 201:
-            try:
-                token = resp['x-subject-token']
-            except Exception:
-                self.LOG.exception("Failed to obtain token using V3"
-                                   " authentication (auth URL is '%s')" %
-                                   req_url)
-                raise
-
-            catalog = json.loads(body)['token']['catalog']
-
-            mgmt_url = None
-            for service_info in catalog:
-                if service_info['type'] != service:
-                    continue  # this isn't the entry for us.
-
-                endpoints = service_info['endpoints']
-
-                # Look for an endpoint in the region if configured.
-                if service in self.region:
-                    region = self.region[service]
-
-                    for ep in endpoints:
-                        if ep['region'] != region:
-                            continue
-
-                        mgmt_url = ep['url']
-                        # FIXME(blk-u): this isn't handling endpoint type
-                        # (public, internal, admin).
-                        break
-
-                if not mgmt_url:
-                    # Didn't find endpoint for region, use the first.
-
-                    ep = endpoints[0]
-                    mgmt_url = ep['url']
-                    # FIXME(blk-u): this isn't handling endpoint type
-                    # (public, internal, admin).
-
-                break
-
-            return token, mgmt_url
-
-        elif resp.status == 401:
-            raise exceptions.AuthenticationFailure(user=user,
-                                                   password=password)
-        else:
-            self.LOG.error("Failed to obtain token using V3 authentication"
-                           " (auth URL is '%s'), the response status is %s" %
-                           (req_url, resp.status))
-            raise exceptions.AuthenticationFailure(user=user,
-                                                   password=password,
-                                                   tenant=project_name)
+        self._skip_path = False
 
     def expected_success(self, expected_code, read_code):
         assert_msg = ("This function only allowed to use for HTTP status"
@@ -284,19 +180,19 @@
                 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):
         return self.request('GET', url, headers)
 
-    def delete(self, url, headers=None):
-        return self.request('DELETE', url, headers)
+    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):
@@ -352,7 +248,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
@@ -382,28 +319,29 @@
         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."""
-
-        req_url = "%s/%s" % (self.base_url, url)
-        self._log_request(method, req_url, headers, body)
-        resp, resp_body = self.http_obj.request(req_url, method,
-                                                headers=headers, body=body)
+        # Authenticate the request with the auth provider
+        req_url, req_headers, req_body = self.auth_provider.auth_request(
+            method, url, headers, body, self.filters)
+        self._log_request(method, req_url, req_headers, req_body)
+        # Do the actual request
+        resp, resp_body = self.http_obj.request(
+            req_url, method, headers=req_headers, body=req_body)
         self._log_response(resp, resp_body)
-        self.response_checker(method, url, headers, body, resp, resp_body)
+        # Verify HTTP response codes
+        self.response_checker(method, url, req_headers, req_body, resp,
+                              resp_body)
 
         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 (self.token is None) or (self.base_url is None):
-            self._set_auth()
 
         if headers is None:
-            headers = {}
-        headers['X-Auth-Token'] = self.token
+            # 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)
@@ -523,10 +461,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."""
@@ -548,6 +489,11 @@
 
 
 class RestClientXML(RestClient):
+
+    # NOTE(vponomaryov): This is deprecated class
+    # and should be removed after excluding it
+    # from all service clients
+
     TYPE = "xml"
 
     def _parse_resp(self, body):
@@ -558,3 +504,33 @@
                 '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.
+    """
+    def _error_checker(self, method, url,
+                       headers, body, resp, resp_body):
+        pass
+
+    def send_request(self, method, url_template, resources, body=None):
+        url = url_template % tuple(resources)
+        if method == "GET":
+            resp, body = self.get(url)
+        elif method == "POST":
+            resp, body = self.post(url, body)
+        elif method == "PUT":
+            resp, body = self.put(url, body)
+        elif method == "PATCH":
+            resp, body = self.patch(url, body)
+        elif method == "HEAD":
+            resp, body = self.head(url)
+        elif method == "DELETE":
+            resp, body = self.delete(url)
+        elif method == "COPY":
+            resp, body = self.copy(url)
+        else:
+            assert False
+
+        return resp, body
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index 0ed9b82..c772ce9 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -49,7 +49,7 @@
         self.channel_timeout = float(channel_timeout)
         self.buf_size = 1024
 
-    def _get_ssh_connection(self, sleep=1.5, backoff=1.01):
+    def _get_ssh_connection(self, sleep=1.5, backoff=1):
         """Returns an ssh connection to the specified host."""
         bsleep = sleep
         ssh = paramiko.SSHClient()
@@ -76,19 +76,21 @@
                          self.username, self.host)
                 return ssh
             except (socket.error,
-                    paramiko.SSHException):
-                attempts += 1
-                time.sleep(bsleep)
-                bsleep *= backoff
-                if not self._is_timed_out(_start_time):
-                    continue
-                else:
+                    paramiko.SSHException) as e:
+                if self._is_timed_out(_start_time):
                     LOG.exception("Failed to establish authenticated ssh"
                                   " connection to %s@%s after %d attempts",
                                   self.username, self.host, attempts)
                     raise exceptions.SSHTimeout(host=self.host,
                                                 user=self.username,
                                                 password=self.password)
+                bsleep += backoff
+                attempts += 1
+                LOG.warning("Failed to establish authenticated ssh"
+                            " connection to %s@%s (%s). Number attempts: %s."
+                            " Retry after %d seconds.",
+                            self.username, self.host, e, attempts, bsleep)
+                time.sleep(bsleep)
 
     def _is_timed_out(self, start_time):
         return (time.time() - self.timeout) > start_time
diff --git a/tempest/common/utils/__init__.py b/tempest/common/utils/__init__.py
index 38f3d38..04d898d 100644
--- a/tempest/common/utils/__init__.py
+++ b/tempest/common/utils/__init__.py
@@ -1,4 +1,3 @@
-LAST_REBOOT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
 PING_IPV4_COMMAND = 'ping -c 3 '
 PING_IPV6_COMMAND = 'ping6 -c 3 '
 PING_PACKET_LOSS_REGEX = '(\d{1,3})\.?\d*\% packet loss'
diff --git a/tempest/config.py b/tempest/config.py
index 704556f..d24ab34 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -43,6 +43,10 @@
                help="Full URI of the OpenStack Identity API (Keystone), v2"),
     cfg.StrOpt('uri_v3',
                help='Full URI of the OpenStack Identity API (Keystone), v3'),
+    cfg.StrOpt('auth_version',
+               default='v2',
+               help="Identity API version to be used for authentication "
+                    "for API tests."),
     cfg.StrOpt('region',
                default='RegionOne',
                help="The identity region name to use. Also used as the other "
@@ -582,7 +586,12 @@
                help='time (in seconds) between log file error checks.'),
     cfg.IntOpt('default_thread_number_per_action',
                default=4,
-               help='The number of threads created while stress test.')
+               help='The number of threads created while stress test.'),
+    cfg.BoolOpt('leave_dirty_stack',
+                default=False,
+                help='Prevent the cleaning (tearDownClass()) between'
+                     ' each stress test run if an exception occurs'
+                     ' during this run.')
 ]
 
 
@@ -667,7 +676,7 @@
                default='^cirros-0.3.1-x86_64-uec$',
                help="Matching images become parameters for scenario tests"),
     cfg.StrOpt('flavor_regex',
-               default='^m1.(micro|nano|tiny)$',
+               default='^m1.nano$',
                help="Matching flavors become parameters for scenario tests"),
     cfg.StrOpt('non_ssh_image_regex',
                default='^.*[Ww]in.*$',
@@ -727,9 +736,7 @@
 
         path = os.path.join(conf_dir, conf_file)
 
-        if not (os.path.isfile(path) or
-                'TEMPEST_CONFIG_DIR' in os.environ or
-                'TEMPEST_CONFIG' in os.environ):
+        if not os.path.isfile(path):
             path = failsafe_path
 
         # only parse the config file if we expect one to exist. This is needed
@@ -778,7 +785,7 @@
         self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
         self.identity = cfg.CONF.identity
         self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
-        self.images = cfg.CONF.image
+        self.image = cfg.CONF.image
         self.image_feature_enabled = cfg.CONF['image-feature-enabled']
         self.network = cfg.CONF.network
         self.network_feature_enabled = cfg.CONF['network-feature-enabled']
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 809037d..3b3f3eb 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -123,8 +123,7 @@
 
 
 class RateLimitExceeded(TempestException):
-    message = ("Rate limit exceeded.\nMessage: %(message)s\n"
-               "Details: %(details)s")
+    message = "Rate limit exceeded"
 
 
 class OverLimit(TempestException):
@@ -162,10 +161,6 @@
     message = "The server is not reachable via the configured network"
 
 
-class SQLException(TempestException):
-    message = "SQL error: %(message)s"
-
-
 class TearDownException(TempestException):
     message = "%(num)d cleanUp operation failed"
 
diff --git a/tempest/manager.py b/tempest/manager.py
index cba6ba5..93ff10f 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import config
 from tempest import exceptions
 
 
@@ -27,7 +26,6 @@
     """
 
     def __init__(self):
-        self.config = config.CONF
         self.client_attr_names = []
 
     # we do this everywhere, have it be part of the super class
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 12d81cc..0fc304a 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -22,7 +22,7 @@
 import cinderclient.client
 import glanceclient
 import heatclient.client
-import keystoneclient.apiclient.exceptions
+import keystoneclient.exceptions
 import keystoneclient.v2_0.client
 import netaddr
 from neutronclient.common import exceptions as exc
@@ -112,7 +112,7 @@
         region = CONF.identity.region
         endpoint = self.identity_client.service_catalog.url_for(
             attr='region', filter_value=region,
-            service_type='image', endpoint_type='publicURL')
+            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)
@@ -146,7 +146,7 @@
             keystone_admin.roles.add_user_role(self.identity_client.user_id,
                                                member_role.id,
                                                self.identity_client.tenant_id)
-        except keystoneclient.apiclient.exceptions.Conflict:
+        except keystoneclient.exceptions.Conflict:
             pass
 
         return swiftclient.Connection(auth_url, username, password,
@@ -167,11 +167,12 @@
         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='orchestration',
+                service_type=service_type,
                 endpoint_type='publicURL')
         except keystoneclient.exceptions.EndpointNotFound:
             return None
@@ -397,7 +398,8 @@
             if new_status.lower() == error_status.lower():
                 message = ("%s failed to get to expected status. "
                            "In %s state.") % (thing, new_status)
-                raise exceptions.BuildErrorException(message)
+                raise exceptions.BuildErrorException(message,
+                                                     server_id=thing_id)
             elif new_status == expected_status and expected_status is not None:
                 return True  # All good.
             LOG.debug("Waiting for %s to get to %s status. "
@@ -669,13 +671,17 @@
                          "Unable to determine which port to target.")
         return ports[0]['id']
 
-    def _create_floating_ip(self, server, external_network_id):
-        port_id = self._get_server_port_id(server)
+    def _create_floating_ip(self, thing, external_network_id,
+                            port_filters=None):
+        if port_filters is None:
+            port_id = self._get_server_port_id(thing)
+        else:
+            port_id = port_filters
         body = dict(
             floatingip=dict(
                 floating_network_id=external_network_id,
                 port_id=port_id,
-                tenant_id=server.tenant_id,
+                tenant_id=thing.tenant_id,
             )
         )
         result = self.network_client.create_floatingip(body=body)
@@ -712,6 +718,58 @@
         return tempest.test.call_until_true(
             ping, CONF.compute.ping_timeout, 1)
 
+    def _create_pool(self, lb_method, protocol, subnet_id):
+        """Wrapper utility that returns a test pool."""
+        name = data_utils.rand_name('pool-')
+        body = {
+            "pool": {
+                "protocol": protocol,
+                "name": name,
+                "subnet_id": subnet_id,
+                "lb_method": lb_method
+            }
+        }
+        resp = self.network_client.create_pool(body=body)
+        pool = net_common.DeletablePool(client=self.network_client,
+                                        **resp['pool'])
+        self.assertEqual(pool['name'], name)
+        self.set_resource(name, pool)
+        return pool
+
+    def _create_member(self, address, protocol_port, pool_id):
+        """Wrapper utility that returns a test member."""
+        body = {
+            "member": {
+                "protocol_port": protocol_port,
+                "pool_id": pool_id,
+                "address": address
+            }
+        }
+        resp = self.network_client.create_member(body)
+        member = net_common.DeletableMember(client=self.network_client,
+                                            **resp['member'])
+        self.set_resource(data_utils.rand_name('member-'), member)
+        return member
+
+    def _create_vip(self, protocol, protocol_port, subnet_id, pool_id):
+        """Wrapper utility that returns a test vip."""
+        name = data_utils.rand_name('vip-')
+        body = {
+            "vip": {
+                "protocol": protocol,
+                "name": name,
+                "subnet_id": subnet_id,
+                "pool_id": pool_id,
+                "protocol_port": protocol_port
+            }
+        }
+        resp = self.network_client.create_vip(body)
+        vip = net_common.DeletableVip(client=self.network_client,
+                                      **resp['vip'])
+        self.assertEqual(vip['name'], name)
+        self.set_resource(name, vip)
+        return vip
+
     def _check_vm_connectivity(self, ip_address,
                                username=None,
                                private_key=None,
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 7afa863..f2b681e 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -36,9 +36,10 @@
     def credentials(cls):
         return cls.admin_credentials()
 
-    def _create_aggregate(self, aggregate_name, availability_zone=None):
-        aggregate = self.compute_client.aggregates.create(aggregate_name,
-                                                          availability_zone)
+    def _create_aggregate(self, **kwargs):
+        aggregate = self.compute_client.aggregates.create(**kwargs)
+        aggregate_name = kwargs['name']
+        availability_zone = kwargs['availability_zone']
         self.assertEqual(aggregate.name, aggregate_name)
         self.assertEqual(aggregate.availability_zone, availability_zone)
         self.set_resource(aggregate.id, aggregate)
@@ -107,7 +108,8 @@
         self.useFixture(fixtures.LockFixture('availability_zone'))
         az = 'foo_zone'
         aggregate_name = rand_name('aggregate-scenario')
-        aggregate = self._create_aggregate(aggregate_name, az)
+        aggregate = self._create_aggregate(name=aggregate_name,
+                                           availability_zone=az)
 
         metadata = {'meta_key': 'meta_value'}
         self._set_aggregate_metadata(aggregate, metadata)
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
new file mode 100644
index 0000000..68f6e62
--- /dev/null
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -0,0 +1,240 @@
+# Copyright 2014 Mirantis.inc
+# 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 tempest.api.network import common as net_common
+from tempest.common import ssh
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest.scenario import manager
+from tempest import test
+
+config = config.CONF
+
+
+class TestLoadBalancerBasic(manager.NetworkScenarioTest):
+
+    """
+    This test checks basic load balancing.
+
+    The following is the scenario outline:
+    1. Create an instance
+    2. SSH to the instance and start two servers
+    3. Create a load balancer with two members and with ROUND_ROBIN algorithm
+       associate the VIP with a floating ip
+    4. Send 10 requests to the floating ip and check that they are shared
+       between the two servers and that both of them get equal portions
+    of the requests
+    """
+
+    @classmethod
+    def check_preconditions(cls):
+        super(TestLoadBalancerBasic, cls).check_preconditions()
+        cfg = config.network
+        if not test.is_extension_enabled('lbaas', 'network'):
+            msg = 'LBaaS Extension is not enabled'
+            cls.enabled = False
+            raise cls.skipException(msg)
+        if not (cfg.tenant_networks_reachable or cfg.public_network_id):
+            msg = ('Either tenant_networks_reachable must be "true", or '
+                   'public_network_id must be defined.')
+            cls.enabled = False
+            raise cls.skipException(msg)
+
+    @classmethod
+    def setUpClass(cls):
+        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
+
+    def _create_security_groups(self):
+        self.security_groups[self.tenant_id] =\
+            self._create_security_group_neutron(tenant_id=self.tenant_id)
+
+    def _create_server(self):
+        tenant_id = self.tenant_id
+        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
+        self.assertTrue(self.servers_keypairs)
+
+    def _start_servers(self):
+        """
+        1. SSH to the instance
+        2. Start two servers listening on ports 80 and 88 respectively
+        """
+        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']
+
+            ip_address = server.networks[network_name][0]
+            ssh_client = ssh.Client(ip_address, ssh_login,
+                                    pkey=private_key,
+                                    timeout=100)
+            start_server = "while true; do echo -e 'HTTP/1.0 200 OK\r\n\r\n" \
+                           "%(server)s' | sudo nc -l -p %(port)s ; done &"
+            cmd = start_server % {'server': 'server1',
+                                  'port': self.port1}
+            ssh_client.exec_command(cmd)
+            cmd = start_server % {'server': 'server2',
+                                  'port': self.port2}
+            ssh_client.exec_command(cmd)
+
+    def _check_connection(self, check_ip):
+        def try_connect(ip):
+            try:
+                urllib.urlopen("http://{0}/".format(ip))
+                return True
+            except IOError:
+                return False
+        timeout = config.compute.ping_timeout
+        timer = 0
+        while not try_connect(check_ip):
+            time.sleep(1)
+            timer += 1
+            if timer >= timeout:
+                message = "Timed out trying to connect to %s" % check_ip
+                raise exceptions.TimeoutException(message)
+
+    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)
+
+    def _create_members(self, network_name, server_ids):
+        """
+        Create two members.
+
+        In case there is only one server, create both members with the same ip
+        but with different ports to listen on.
+        """
+        servers = self.compute_client.servers.list()
+        for server in servers:
+            if server.id in server_ids:
+                ip = server.networks[network_name][0]
+                pool_id = self.pools[0]['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)
+                    self.members.extend([member1, member2])
+                else:
+                    member = self._create_member(ip, self.port1, pool_id)
+                    self.members.append(member)
+        self.assertTrue(self.members)
+
+    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)
+
+    def _create_load_balancer(self):
+        self._create_pool()
+        self._create_members(self.networks[0]['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)
+        self._status_timeout(NeutronRetriever(self.network_client,
+                                              self.network_client.vip_path,
+                                              net_common.DeletableVip),
+                             self.vips[0]['id'],
+                             expected_status='ACTIVE')
+        self._assign_floating_ip_to_vip(self.vips[0])
+
+    def _check_load_balancing(self):
+        """
+        1. Send 10 requests on the floating ip associated with the VIP
+        2. Check that the requests are shared between
+           the two servers and that both of them get equal portions
+           of the requests
+        """
+
+        vip = self.vips[0]
+        floating_ip_vip = self.floating_ips[
+            vip['id']][0]['floating_ip_address']
+        self._check_connection(floating_ip_vip)
+        resp = []
+        for count in range(10):
+            resp.append(
+                urllib.urlopen(
+                    "http://{0}/".format(floating_ip_vip)).read())
+        self.assertEqual(set(["server1\n", "server2\n"]), set(resp))
+        self.assertEqual(5, resp.count("server1\n"))
+        self.assertEqual(5, resp.count("server2\n"))
+
+    @test.skip_because(bug="1277381")
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
+    def test_load_balancer_basic(self):
+        self._create_security_groups()
+        self._create_server()
+        self._start_servers()
+        self._create_load_balancer()
+        self._check_load_balancing()
+
+
+class NeutronRetriever(object):
+    def __init__(self, network_client, path, resource):
+        self.network_client = network_client
+        self.path = path
+        self.resource = resource
+
+    def get(self, thing_id):
+        obj = self.network_client.get(self.path % thing_id)
+        return self.resource(client=self.network_client, **obj.values()[0])
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index be0e045..020a256 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -196,7 +196,8 @@
             floating_ip = self._create_floating_ip(server, public_network_id)
             self.floating_ips[floating_ip] = server
 
-    def _check_public_network_connectivity(self, should_connect=True):
+    def _check_public_network_connectivity(self, should_connect=True,
+                                           msg=None):
         # The target login is assumed to have been configured for
         # key-based authentication by cloud-init.
         ssh_login = CONF.compute.image_ssh_user
@@ -212,7 +213,10 @@
                                             private_key,
                                             should_connect=should_connect)
         except Exception:
-            LOG.exception('Public network connectivity check failed')
+            ex_msg = 'Public network connectivity check failed'
+            if msg:
+                ex_msg += ": " + msg
+            LOG.exception(ex_msg)
             self._log_console_output(servers=self.servers.keys())
             debug.log_ip_ns()
             raise
@@ -242,6 +246,10 @@
         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)
+        self._check_public_network_connectivity(should_connect=False,
+                                                msg="after disassociate "
+                                                    "floating ip")
         self._reassociate_floating_ips()
-        self._check_public_network_connectivity(should_connect=True)
+        self._check_public_network_connectivity(should_connect=True,
+                                                msg="after re-associate "
+                                                    "floating ip")
diff --git a/tempest/scenario/test_swift_basic_ops.py b/tempest/scenario/test_swift_basic_ops.py
index b367f7f..60df606 100644
--- a/tempest/scenario/test_swift_basic_ops.py
+++ b/tempest/scenario/test_swift_basic_ops.py
@@ -93,7 +93,7 @@
             for obj in not_present_obj:
                 self.assertNotIn(obj, object_list)
 
-    @services('object')
+    @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 54851b5..7b002eb 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -14,7 +14,6 @@
 from tempest import config
 from tempest.openstack.common import log
 from tempest.scenario import manager
-import tempest.test
 from tempest.test import services
 
 CONF = config.CONF
@@ -128,7 +127,6 @@
         actual = self._get_content(ssh_client)
         self.assertEqual(expected, actual)
 
-    @tempest.test.skip_because(bug="1270608")
     @services('compute', 'volume', 'image')
     def test_volume_boot_pattern(self):
         keypair = self.create_keypair()
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 0b5426e..6e86466 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -47,9 +47,8 @@
 
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(BaremetalClient, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(BaremetalClient, self).__init__(auth_provider)
         self.service = CONF.baremetal.catalog_type
         self.uri_prefix = ''
 
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 13693e1..3f4c509 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -21,9 +21,8 @@
     methods in order to send requests to Ironic.
 
     """
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(BaremetalClientV1, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(BaremetalClientV1, self).__init__(auth_provider)
         self.version = '1'
         self.uri_prefix = 'v%s' % self.version
 
diff --git a/tempest/services/baremetal/v1/client_json.py b/tempest/services/baremetal/v1/client_json.py
index c98b20f..c9dc874 100644
--- a/tempest/services/baremetal/v1/client_json.py
+++ b/tempest/services/baremetal/v1/client_json.py
@@ -18,9 +18,8 @@
 class BaremetalClientJSON(base_v1.BaremetalClientV1):
     """Tempest REST client for Ironic JSON API v1."""
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(BaremetalClientJSON, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(BaremetalClientJSON, self).__init__(auth_provider)
 
         self.serialize = lambda obj_type, obj_body: json.dumps(obj_body)
         self.deserialize = json.loads
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index 235d006..aa52081 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -24,9 +24,8 @@
 
 class AggregatesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AggregatesClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(AggregatesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_aggregates(self):
@@ -41,13 +40,9 @@
         body = json.loads(body)
         return resp, body['aggregate']
 
-    def create_aggregate(self, name, availability_zone=None):
+    def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
-        post_body = {
-            'name': name,
-            'availability_zone': availability_zone,
-        }
-        post_body = json.dumps({'aggregate': post_body})
+        post_body = json.dumps({'aggregate': kwargs})
         resp, body = self.post('os-aggregates', post_body, self.headers)
 
         body = json.loads(body)
diff --git a/tempest/services/compute/json/availability_zone_client.py b/tempest/services/compute/json/availability_zone_client.py
index 2b7e23c..ea4e95e 100644
--- a/tempest/services/compute/json/availability_zone_client.py
+++ b/tempest/services/compute/json/availability_zone_client.py
@@ -23,10 +23,9 @@
 
 class AvailabilityZoneClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AvailabilityZoneClientJSON, self).__init__(username,
-                                                         password, auth_url,
-                                                         tenant_name)
+    def __init__(self, auth_provider):
+        super(AvailabilityZoneClientJSON, self).__init__(
+            auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_availability_zone_list(self):
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index 06e2ae7..b7135f6 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -23,10 +23,8 @@
 
 class CertificatesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(CertificatesClientJSON, self).__init__(username,
-                                                     password,
-                                                     auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(CertificatesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_certificate(self, id):
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
index 8505d93..f7e2737 100644
--- a/tempest/services/compute/json/extensions_client.py
+++ b/tempest/services/compute/json/extensions_client.py
@@ -23,9 +23,8 @@
 
 class ExtensionsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ExtensionsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_extensions(self):
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 19bf4e2..144b7dc 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -23,9 +23,8 @@
 
 class FixedIPsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FixedIPsClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FixedIPsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_fixed_ip_details(self, fixed_ip):
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 7fcf1b2..96ab6d7 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -24,9 +24,8 @@
 
 class FlavorsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FlavorsClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FlavorsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_flavors(self, params=None):
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 7c2139d..2bf5241 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -24,9 +24,8 @@
 
 
 class FloatingIPsClientJSON(RestClient):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FloatingIPsClientJSON, self).__init__(username, password,
-                                                    auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FloatingIPsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_floating_ips(self, params=None):
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index 33e5345..aa63927 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -23,9 +23,8 @@
 
 class HostsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HostsClientJSON, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(HostsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_hosts(self, params=None):
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index a4d8660..74844dc 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -23,10 +23,8 @@
 
 class HypervisorClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HypervisorClientJSON, self).__init__(username,
-                                                   password, auth_url,
-                                                   tenant_name)
+    def __init__(self, auth_provider):
+        super(HypervisorClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_hypervisor_list(self):
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index c9adc3f..7324d84 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -26,9 +26,8 @@
 
 class ImagesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ImagesClientJSON, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ImagesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index 2673bd7..27930f2 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -23,9 +23,9 @@
 
 class InstanceUsagesAuditLogClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
+    def __init__(self, auth_provider):
         super(InstanceUsagesAuditLogClientJSON, self).__init__(
-            username, password, auth_url, tenant_name)
+            auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_instance_usage_audit_logs(self):
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index 21d3a5a..d9a2030 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -25,9 +25,8 @@
 
 class InterfacesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(InterfacesClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(InterfacesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_interfaces(self, server):
@@ -39,11 +38,12 @@
                          fixed_ip=None):
         post_body = dict(interfaceAttachment=dict())
         if port_id:
-            post_body['port_id'] = port_id
+            post_body['interfaceAttachment']['port_id'] = port_id
         if network_id:
-            post_body['net_id'] = network_id
+            post_body['interfaceAttachment']['net_id'] = network_id
         if fixed_ip:
-            post_body['fixed_ips'] = [dict(ip_address=fixed_ip)]
+            fip = dict(ip_address=fixed_ip)
+            post_body['interfaceAttachment']['fixed_ips'] = [fip]
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/os-interface' % server,
                                headers=self.headers,
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index dd4e3e1..3e2d4a7 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -23,9 +23,8 @@
 
 class KeyPairsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(KeyPairsClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(KeyPairsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_keypairs(self):
diff --git a/tempest/services/compute/json/limits_client.py b/tempest/services/compute/json/limits_client.py
index c5cc988..765ba79 100644
--- a/tempest/services/compute/json/limits_client.py
+++ b/tempest/services/compute/json/limits_client.py
@@ -23,9 +23,8 @@
 
 class LimitsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(LimitsClientJSON, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(LimitsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_absolute_limits(self):
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index df12467..2007d4e 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -23,9 +23,8 @@
 
 class QuotasClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(QuotasClientJSON, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(QuotasClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_quota_set(self, tenant_id):
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index 299a6e6..edaf4a3 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -25,10 +25,8 @@
 
 class SecurityGroupsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(SecurityGroupsClientJSON, self).__init__(username,
-                                                       password, auth_url,
-                                                       tenant_name)
+    def __init__(self, auth_provider):
+        super(SecurityGroupsClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_security_groups(self, params=None):
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 0987f05..371a59c 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -28,11 +28,9 @@
 
 class ServersClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None,
-                 auth_version='v2'):
-        super(ServersClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name,
-                                                auth_version=auth_version)
+    def __init__(self, auth_provider):
+        super(ServersClientJSON, self).__init__(auth_provider)
+
         self.service = CONF.compute.catalog_type
 
     def create_server(self, name, image_ref, flavor_ref, **kwargs):
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index c209cf3..4abee47 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -25,9 +25,8 @@
 
 class ServicesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ServicesClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ServicesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_services(self, params=None):
diff --git a/tempest/services/compute/json/tenant_usages_client.py b/tempest/services/compute/json/tenant_usages_client.py
index c141fa7..b14fa9b 100644
--- a/tempest/services/compute/json/tenant_usages_client.py
+++ b/tempest/services/compute/json/tenant_usages_client.py
@@ -24,9 +24,8 @@
 
 class TenantUsagesClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(TenantUsagesClientJSON, self).__init__(
-            username, password, auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(TenantUsagesClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_tenant_usages(self, params=None):
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index d61b8a5..ba7b5df 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -26,10 +26,9 @@
 
 class VolumesExtensionsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumesExtensionsClientJSON, self).__init__(username,
-                                                          password, auth_url,
-                                                          tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumesExtensionsClientJSON, self).__init__(
+            auth_provider)
         self.service = CONF.compute.catalog_type
         self.build_interval = CONF.volume.build_interval
         self.build_timeout = CONF.volume.build_timeout
diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py
index bc037c9..6bc758c 100644
--- a/tempest/services/compute/v3/json/aggregates_client.py
+++ b/tempest/services/compute/v3/json/aggregates_client.py
@@ -24,10 +24,8 @@
 
 class AggregatesV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AggregatesV3ClientJSON, self).__init__(username,
-                                                     password, auth_url,
-                                                     tenant_name)
+    def __init__(self, auth_provider):
+        super(AggregatesV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_aggregates(self):
@@ -42,13 +40,9 @@
         body = json.loads(body)
         return resp, body['aggregate']
 
-    def create_aggregate(self, name, availability_zone=None):
+    def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
-        post_body = {
-            'name': name,
-            'availability_zone': availability_zone,
-        }
-        post_body = json.dumps({'aggregate': post_body})
+        post_body = json.dumps({'aggregate': kwargs})
         resp, body = self.post('os-aggregates', post_body, self.headers)
 
         body = json.loads(body)
diff --git a/tempest/services/compute/v3/json/availability_zone_client.py b/tempest/services/compute/v3/json/availability_zone_client.py
index a3f4d94..4a6db55 100644
--- a/tempest/services/compute/v3/json/availability_zone_client.py
+++ b/tempest/services/compute/v3/json/availability_zone_client.py
@@ -23,10 +23,9 @@
 
 class AvailabilityZoneV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AvailabilityZoneV3ClientJSON, self).__init__(username,
-                                                           password, auth_url,
-                                                           tenant_name)
+    def __init__(self, auth_provider):
+        super(AvailabilityZoneV3ClientJSON, self).__init__(
+            auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def get_availability_zone_list(self):
diff --git a/tempest/services/compute/v3/json/certificates_client.py b/tempest/services/compute/v3/json/certificates_client.py
index 1833cb9..0c9f9ac 100644
--- a/tempest/services/compute/v3/json/certificates_client.py
+++ b/tempest/services/compute/v3/json/certificates_client.py
@@ -23,10 +23,8 @@
 
 class CertificatesV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(CertificatesV3ClientJSON, self).__init__(username,
-                                                       password,
-                                                       auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(CertificatesV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def get_certificate(self, id):
diff --git a/tempest/services/compute/v3/json/extensions_client.py b/tempest/services/compute/v3/json/extensions_client.py
index f760093..54f0aba 100644
--- a/tempest/services/compute/v3/json/extensions_client.py
+++ b/tempest/services/compute/v3/json/extensions_client.py
@@ -23,10 +23,8 @@
 
 class ExtensionsV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ExtensionsV3ClientJSON, self).__init__(username,
-                                                     password, auth_url,
-                                                     tenant_name)
+    def __init__(self, auth_provider):
+        super(ExtensionsV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_extensions(self):
diff --git a/tempest/services/compute/v3/json/flavors_client.py b/tempest/services/compute/v3/json/flavors_client.py
index d8a54a6..df3d0c1 100644
--- a/tempest/services/compute/v3/json/flavors_client.py
+++ b/tempest/services/compute/v3/json/flavors_client.py
@@ -24,9 +24,8 @@
 
 class FlavorsV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FlavorsV3ClientJSON, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FlavorsV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_flavors(self, params=None):
diff --git a/tempest/services/compute/v3/json/hosts_client.py b/tempest/services/compute/v3/json/hosts_client.py
index d15b237..e33dd5f 100644
--- a/tempest/services/compute/v3/json/hosts_client.py
+++ b/tempest/services/compute/v3/json/hosts_client.py
@@ -23,9 +23,8 @@
 
 class HostsV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HostsV3ClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(HostsV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_hosts(self, params=None):
diff --git a/tempest/services/compute/v3/json/hypervisor_client.py b/tempest/services/compute/v3/json/hypervisor_client.py
index a4ec606..e07a1fb 100644
--- a/tempest/services/compute/v3/json/hypervisor_client.py
+++ b/tempest/services/compute/v3/json/hypervisor_client.py
@@ -23,10 +23,8 @@
 
 class HypervisorV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HypervisorV3ClientJSON, self).__init__(username,
-                                                     password, auth_url,
-                                                     tenant_name)
+    def __init__(self, auth_provider):
+        super(HypervisorV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def get_hypervisor_list(self):
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
index b51f490..3a6ac5f 100644
--- a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
@@ -23,9 +23,9 @@
 
 class InstanceUsagesAuditLogV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
+    def __init__(self, auth_provider):
         super(InstanceUsagesAuditLogV3ClientJSON, self).__init__(
-            username, password, auth_url, tenant_name)
+            auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_instance_usage_audit_logs(self, time_before=None):
diff --git a/tempest/services/compute/v3/json/interfaces_client.py b/tempest/services/compute/v3/json/interfaces_client.py
index 8f0760c..053b9af 100644
--- a/tempest/services/compute/v3/json/interfaces_client.py
+++ b/tempest/services/compute/v3/json/interfaces_client.py
@@ -25,10 +25,8 @@
 
 class InterfacesV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(InterfacesV3ClientJSON, self).__init__(username,
-                                                     password, auth_url,
-                                                     tenant_name)
+    def __init__(self, auth_provider):
+        super(InterfacesV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_interfaces(self, server):
@@ -38,14 +36,14 @@
 
     def create_interface(self, server, port_id=None, network_id=None,
                          fixed_ip=None):
-        post_body = dict(interface_attachment=dict())
+        post_body = dict()
         if port_id:
             post_body['port_id'] = port_id
         if network_id:
             post_body['net_id'] = network_id
         if fixed_ip:
             post_body['fixed_ips'] = [dict(ip_address=fixed_ip)]
-        post_body = json.dumps(post_body)
+        post_body = json.dumps({'interface_attachment': post_body})
         resp, body = self.post('servers/%s/os-attach-interfaces' % server,
                                headers=self.headers,
                                body=post_body)
diff --git a/tempest/services/compute/v3/json/keypairs_client.py b/tempest/services/compute/v3/json/keypairs_client.py
index c2efb84..05dbe25 100644
--- a/tempest/services/compute/v3/json/keypairs_client.py
+++ b/tempest/services/compute/v3/json/keypairs_client.py
@@ -23,9 +23,8 @@
 
 class KeyPairsV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(KeyPairsV3ClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(KeyPairsV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_keypairs(self):
diff --git a/tempest/services/compute/v3/json/quotas_client.py b/tempest/services/compute/v3/json/quotas_client.py
index ea0d3a2..1ec8651 100644
--- a/tempest/services/compute/v3/json/quotas_client.py
+++ b/tempest/services/compute/v3/json/quotas_client.py
@@ -23,9 +23,8 @@
 
 class QuotasV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(QuotasV3ClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(QuotasV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def get_quota_set(self, tenant_id):
diff --git a/tempest/services/compute/v3/json/servers_client.py b/tempest/services/compute/v3/json/servers_client.py
index aa8c95a..11538f5 100644
--- a/tempest/services/compute/v3/json/servers_client.py
+++ b/tempest/services/compute/v3/json/servers_client.py
@@ -29,11 +29,8 @@
 
 class ServersV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url,
-                 tenant_name=None, auth_version='v2'):
-        super(ServersV3ClientJSON, self).__init__(username, password,
-                                                  auth_url, tenant_name,
-                                                  auth_version=auth_version)
+    def __init__(self, auth_provider):
+        super(ServersV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def create_server(self, name, image_ref, flavor_ref, **kwargs):
diff --git a/tempest/services/compute/v3/json/services_client.py b/tempest/services/compute/v3/json/services_client.py
index 174a4f7..1082ea9 100644
--- a/tempest/services/compute/v3/json/services_client.py
+++ b/tempest/services/compute/v3/json/services_client.py
@@ -25,9 +25,8 @@
 
 class ServicesV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ServicesV3ClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ServicesV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def list_services(self, params=None):
diff --git a/tempest/services/compute/v3/json/tenant_usages_client.py b/tempest/services/compute/v3/json/tenant_usages_client.py
index fbc41de..6d59e20 100644
--- a/tempest/services/compute/v3/json/tenant_usages_client.py
+++ b/tempest/services/compute/v3/json/tenant_usages_client.py
@@ -24,9 +24,8 @@
 
 class TenantUsagesV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(TenantUsagesV3ClientJSON, self).__init__(
-            username, password, auth_url, tenant_name)
+    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):
diff --git a/tempest/services/compute/v3/json/version_client.py b/tempest/services/compute/v3/json/version_client.py
index 419bbb8..b560c58 100644
--- a/tempest/services/compute/v3/json/version_client.py
+++ b/tempest/services/compute/v3/json/version_client.py
@@ -23,10 +23,8 @@
 
 class VersionV3ClientJSON(rest_client.RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VersionV3ClientJSON, self).__init__(username,
-                                                  password, auth_url,
-                                                  tenant_name)
+    def __init__(self, auth_provider):
+        super(VersionV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_v3_type
 
     def get_version(self):
diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py
index ddef18b..ba08f58 100644
--- a/tempest/services/compute/xml/aggregates_client.py
+++ b/tempest/services/compute/xml/aggregates_client.py
@@ -28,9 +28,8 @@
 
 class AggregatesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AggregatesClientXML, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(AggregatesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _format_aggregate(self, g):
diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py
index ac1bb4b..38280b5 100644
--- a/tempest/services/compute/xml/availability_zone_client.py
+++ b/tempest/services/compute/xml/availability_zone_client.py
@@ -24,10 +24,9 @@
 
 class AvailabilityZoneClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AvailabilityZoneClientXML, self).__init__(username,
-                                                        password, auth_url,
-                                                        tenant_name)
+    def __init__(self, auth_provider):
+        super(AvailabilityZoneClientXML, self).__init__(
+            auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py
index 3f2438d..aad20a4 100644
--- a/tempest/services/compute/xml/certificates_client.py
+++ b/tempest/services/compute/xml/certificates_client.py
@@ -22,9 +22,8 @@
 
 class CertificatesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(CertificatesClientXML, self).__init__(username, password,
-                                                    auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(CertificatesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_certificate(self, id):
diff --git a/tempest/services/compute/xml/common.py b/tempest/services/compute/xml/common.py
index 9c562b7..4def19f 100644
--- a/tempest/services/compute/xml/common.py
+++ b/tempest/services/compute/xml/common.py
@@ -112,11 +112,27 @@
     others, it requires a little hand-editing of the result.
     """
     json = {}
+    bool_flag = False
+    int_flag = False
+    long_flag = False
     for attr in node.keys():
         if not attr.startswith("xmlns"):
             json[attr] = node.get(attr)
+            if json[attr] == 'bool':
+                bool_flag = True
+            elif json[attr] == 'int':
+                int_flag = True
+            elif json[attr] == 'long':
+                long_flag = True
     if not node.getchildren():
-        return node.text or json
+        if bool_flag:
+            return node.text == 'True'
+        elif int_flag:
+            return int(node.text)
+        elif long_flag:
+            return long(node.text)
+        else:
+            return node.text or json
     for child in node.getchildren():
         tag = child.tag
         if tag.startswith("{"):
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
index 98cd3e3..9753ca8 100644
--- a/tempest/services/compute/xml/extensions_client.py
+++ b/tempest/services/compute/xml/extensions_client.py
@@ -24,9 +24,8 @@
 
 class ExtensionsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientXML, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ExtensionsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py
index f212e21..599e168 100644
--- a/tempest/services/compute/xml/fixed_ips_client.py
+++ b/tempest/services/compute/xml/fixed_ips_client.py
@@ -25,9 +25,8 @@
 
 class FixedIPsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FixedIPsClientXML, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FixedIPsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_fixed_ip_details(self, fixed_ip):
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index 74c0e47..fb16d20 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -35,9 +35,8 @@
 
 class FlavorsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FlavorsClientXML, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FlavorsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _format_flavor(self, f):
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
index bbfe86b..0119d8a 100644
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -28,9 +28,8 @@
 
 
 class FloatingIPsClientXML(RestClientXML):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(FloatingIPsClientXML, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(FloatingIPsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py
index 441be0e..daa83c9 100644
--- a/tempest/services/compute/xml/hosts_client.py
+++ b/tempest/services/compute/xml/hosts_client.py
@@ -26,9 +26,8 @@
 
 class HostsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HostsClientXML, self).__init__(username, password,
-                                             auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(HostsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_hosts(self, params=None):
diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py
index bee2dfd..5abaad8 100644
--- a/tempest/services/compute/xml/hypervisor_client.py
+++ b/tempest/services/compute/xml/hypervisor_client.py
@@ -24,10 +24,8 @@
 
 class HypervisorClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(HypervisorClientXML, self).__init__(username,
-                                                  password, auth_url,
-                                                  tenant_name)
+    def __init__(self, auth_provider):
+        super(HypervisorClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
index 98de7df..d90a7d8 100644
--- a/tempest/services/compute/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -32,9 +32,8 @@
 
 class ImagesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ImagesClientXML, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ImagesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
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 2e1d6c8..562774b 100644
--- a/tempest/services/compute/xml/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/xml/instance_usage_audit_log_client.py
@@ -24,9 +24,9 @@
 
 class InstanceUsagesAuditLogClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
+    def __init__(self, auth_provider):
         super(InstanceUsagesAuditLogClientXML, self).__init__(
-            username, password, auth_url, tenant_name)
+            auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_instance_usage_audit_logs(self):
diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py
index c90f507..4194d7d 100644
--- a/tempest/services/compute/xml/interfaces_client.py
+++ b/tempest/services/compute/xml/interfaces_client.py
@@ -30,9 +30,8 @@
 
 class InterfacesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(InterfacesClientXML, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(InterfacesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _process_xml_interface(self, node):
diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
index da3303e..92fade4 100644
--- a/tempest/services/compute/xml/keypairs_client.py
+++ b/tempest/services/compute/xml/keypairs_client.py
@@ -28,9 +28,8 @@
 
 class KeyPairsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(KeyPairsClientXML, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(KeyPairsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_keypairs(self):
diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
index 9233697..2a8fbec 100644
--- a/tempest/services/compute/xml/limits_client.py
+++ b/tempest/services/compute/xml/limits_client.py
@@ -25,9 +25,8 @@
 
 class LimitsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(LimitsClientXML, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(LimitsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_absolute_limits(self):
diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py
index 74aad1b..f1041f0 100644
--- a/tempest/services/compute/xml/quotas_client.py
+++ b/tempest/services/compute/xml/quotas_client.py
@@ -27,9 +27,8 @@
 
 class QuotasClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(QuotasClientXML, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(QuotasClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _format_quota(self, q):
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index c32a81e..83072be 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -30,10 +30,8 @@
 
 class SecurityGroupsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(SecurityGroupsClientXML, self).__init__(
-            username, password,
-            auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(SecurityGroupsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index 68268a1..37980c9 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -141,11 +141,8 @@
 
 class ServersClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None,
-                 auth_version='v2'):
-        super(ServersClientXML, self).__init__(username, password,
-                                               auth_url, tenant_name,
-                                               auth_version=auth_version)
+    def __init__(self, auth_provider):
+        super(ServersClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_key_value(self, node):
@@ -381,7 +378,7 @@
 
             server_status = body['status']
             if server_status == 'ERROR' and not ignore_error:
-                raise exceptions.BuildErrorException
+                raise exceptions.BuildErrorException(server_id=server_id)
 
             if int(time.time()) - start_time >= self.build_timeout:
                 raise exceptions.TimeoutException
diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py
index bfc824d..c28dc12 100644
--- a/tempest/services/compute/xml/services_client.py
+++ b/tempest/services/compute/xml/services_client.py
@@ -29,9 +29,8 @@
 
 class ServicesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ServicesClientXML, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ServicesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_services(self, params=None):
diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py
index ae813a6..93eeb00 100644
--- a/tempest/services/compute/xml/tenant_usages_client.py
+++ b/tempest/services/compute/xml/tenant_usages_client.py
@@ -26,10 +26,8 @@
 
 class TenantUsagesClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(TenantUsagesClientXML, self).__init__(username,
-                                                    password, auth_url,
-                                                    tenant_name)
+    def __init__(self, auth_provider):
+        super(TenantUsagesClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
index d6723e1..941cd69 100644
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -32,9 +32,9 @@
 
 class VolumesExtensionsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumesExtensionsClientXML, self).__init__(username, password,
-                                                         auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumesExtensionsClientXML, self).__init__(
+            auth_provider)
         self.service = CONF.compute.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
diff --git a/tempest/services/data_processing/v1_1/client.py b/tempest/services/data_processing/v1_1/client.py
index a1d558a..e96b44b 100644
--- a/tempest/services/data_processing/v1_1/client.py
+++ b/tempest/services/data_processing/v1_1/client.py
@@ -22,9 +22,8 @@
 
 
 class DataProcessingClient(rest_client.RestClient):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(DataProcessingClient, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(DataProcessingClient, self).__init__(auth_provider)
         self.service = CONF.data_processing.catalog_type
 
     @classmethod
@@ -78,3 +77,17 @@
 
         uri = "node-group-templates/%s" % tmpl_id
         return self.delete(uri)
+
+    def list_plugins(self):
+        """List all enabled plugins."""
+
+        uri = 'plugins'
+        return self._request_and_parse(self.get, uri, 'plugins')
+
+    def get_plugin(self, plugin_name, plugin_version=None):
+        """Returns the details of a single plugin."""
+
+        uri = "plugins/%s" % plugin_name
+        if plugin_version:
+            uri += '/%s' % plugin_version
+        return self._request_and_parse(self.get, uri, 'plugin')
diff --git a/tempest/services/identity/json/identity_client.py b/tempest/services/identity/json/identity_client.py
index 1ed7044..349a9e9 100644
--- a/tempest/services/identity/json/identity_client.py
+++ b/tempest/services/identity/json/identity_client.py
@@ -12,22 +12,23 @@
 
 import json
 
-from tempest.common import http
-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, username, password, auth_url, tenant_name=None):
-        super(IdentityClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    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
@@ -45,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):
         """
@@ -62,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."""
@@ -94,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."""
@@ -135,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."""
@@ -151,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."""
@@ -186,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)
@@ -217,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."""
@@ -240,12 +216,12 @@
         return self.delete(url)
 
 
-class TokenClientJSON(RestClient):
+class TokenClientJSON(IdentityClientJSON):
 
     def __init__(self):
+        super(TokenClientJSON, self).__init__(None)
         auth_url = CONF.identity.uri
 
-        # TODO(jaypipes) Why is this all repeated code in here?
         # Normalize URI to ensure /tokens is in it.
         if 'tokens' not in auth_url:
             auth_url = auth_url.rstrip('/') + '/tokens'
@@ -262,34 +238,41 @@
                 'tenantName': tenant,
             }
         }
-        headers = {'Content-Type': 'application/json'}
         body = json.dumps(creds)
-        resp, body = self.post(self.auth_url, headers=headers, body=body)
-        return resp, 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."""
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
         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)
         self._log_response(resp, resp_body)
 
-        if resp.status in (401, 403):
+        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))
 
+        if isinstance(resp_body, str):
+            resp_body = json.loads(resp_body)
         return resp, resp_body
 
-    def get_token(self, user, password, tenant):
+    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 resp['status'] != '202':
-            body = json.loads(body)
-            access = body['access']
-            token = access['token']
-            return token['id']
+
+        if auth_data:
+            return body['token']['id'], body
+        else:
+            return body['token']['id']
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index 1250d79..a0fbb76 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-from urlparse import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -24,20 +23,11 @@
 
 class CredentialsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(CredentialsClientJSON, self).__init__(username, password,
-                                                    auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(CredentialsClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(CredentialsClientJSON, self).request(method, url,
-                                                          headers=headers,
-                                                          body=body)
+        self.api_version = "v3"
 
     def create_credential(self, access_key, secret_key, user_id, project_id):
         """Creates a credential."""
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index bb2230b..1b78115 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -24,20 +23,11 @@
 
 class EndPointClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(EndPointClientJSON, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(EndPointClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(
-            urlparse.urlparse(self.base_url).path, "/v3")
-        return super(EndPointClientJSON, self).request(method, url,
-                                                       headers=headers,
-                                                       body=body)
+        self.api_version = "v3"
 
     def list_endpoints(self):
         """GET endpoints."""
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index 7dd5c6e..ab1dc94 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -14,30 +14,22 @@
 #    under the License.
 
 import json
-from urlparse import urlparse
+import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
+from tempest import exceptions
 
 CONF = config.CONF
 
 
 class IdentityV3ClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(IdentityV3ClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(IdentityV3ClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(IdentityV3ClientJSON, self).request(method, url,
-                                                         headers=headers,
-                                                         body=body)
+        self.api_version = "v3"
 
     def create_user(self, user_name, **kwargs):
         """Creates a user."""
@@ -462,43 +454,89 @@
 
 class V3TokenClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(V3TokenClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
+    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")
 
-        auth_url = CONF.identity.uri
-
-        if 'tokens' not in auth_url:
-            auth_url = auth_url.rstrip('/') + '/tokens'
+        if 'auth/tokens' not in auth_url:
+            auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
         self.auth_url = auth_url
 
-    def auth(self, user_id, password):
+    def auth(self, user, password, tenant=None, user_type='id', domain=None):
+        """
+        :param user: user id or name, as specified in user_type
+        :param domain: the user and tenant domain
+
+        Accepts different combinations of credentials. Restrictions:
+        - tenant and domain are only name (no id)
+        - user domain and tenant domain are assumed identical
+        - domain scope is not supported here
+        Sample sample valid combinations:
+        - user_id, password
+        - username, password, domain
+        - username, password, tenant, domain
+        Validation is left to the server side.
+        """
         creds = {
             'auth': {
                 'identity': {
                     'methods': ['password'],
                     'password': {
                         'user': {
-                            'id': user_id,
-                            'password': password
+                            'password': password,
                         }
                     }
                 }
             }
         }
-        headers = {'Content-Type': 'application/json'}
+        if user_type == 'id':
+            creds['auth']['identity']['password']['user']['id'] = user
+        else:
+            creds['auth']['identity']['password']['user']['name'] = user
+        if domain is not None:
+            _domain = dict(name=domain)
+            creds['auth']['identity']['password']['user']['domain'] = _domain
+        if tenant is not None:
+            project = dict(name=tenant, domain=_domain)
+            scope = dict(project=project)
+            creds['auth']['scope'] = scope
+
         body = json.dumps(creds)
-        resp, body = self.post("auth/tokens", headers=headers, body=body)
+        resp, body = self.post(self.auth_url, headers=self.headers, body=body)
         return resp, body
 
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(V3TokenClientJSON, self).request(method, url,
-                                                      headers=headers,
-                                                      body=body)
+    def request(self, method, url, headers=None, body=None):
+        """A simple HTTP request interface."""
+        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, 204]:
+            raise exceptions.IdentityError(
+                'Unexpected status code {0}'.format(resp.status))
+
+        return resp, json.loads(resp_body)
+
+    def get_token(self, user, password, tenant, domain='Default',
+                  auth_data=False):
+        """
+        :param user: username
+        Returns (token id, token data) for supplied credentials
+        """
+        resp, body = self.auth(user, password, tenant, user_type='name',
+                               domain=domain)
+
+        token = resp.get('x-subject-token')
+        if auth_data:
+            return token, body['token']
+        else:
+            return token
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index 3d98d99..c376979 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-from urlparse import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -24,20 +23,11 @@
 
 class PolicyClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(PolicyClientJSON, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(PolicyClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(PolicyClientJSON, self).request(method, url,
-                                                     headers=headers,
-                                                     body=body)
+        self.api_version = "v3"
 
     def create_policy(self, blob, type):
         """Creates a Policy."""
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index 57b6e9e..92f7629 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-from urlparse import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -24,20 +23,11 @@
 
 class ServiceClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ServiceClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ServiceClientJSON, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(ServiceClientJSON, self).request(method, url,
-                                                      headers=headers,
-                                                      body=body)
+        self.api_version = "v3"
 
     def update_service(self, service_id, **kwargs):
         """Updates a service."""
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
index c8cdce7..eca86ab 100644
--- a/tempest/services/identity/v3/xml/credentials_client.py
+++ b/tempest/services/identity/v3/xml/credentials_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-from urlparse import urlparse
 
 from lxml import etree
 
@@ -32,20 +31,11 @@
 
 class CredentialsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(CredentialsClientXML, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(CredentialsClientXML, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(CredentialsClientXML, self).request(method, url,
-                                                         headers=headers,
-                                                         body=body)
+        self.api_version = "v3"
 
     def _parse_body(self, body):
         data = xml_to_json(body)
diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py
index e1df3a9..a20a9f5 100644
--- a/tempest/services/identity/v3/xml/endpoints_client.py
+++ b/tempest/services/identity/v3/xml/endpoints_client.py
@@ -12,7 +12,6 @@
 #    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 urlparse
 
 from lxml import etree
 
@@ -30,11 +29,11 @@
 
 class EndPointClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(EndPointClientXML, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(EndPointClientXML, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
+        self.api_version = "v3"
 
     def _parse_array(self, node):
         array = []
@@ -53,9 +52,6 @@
         dscv = CONF.identity.disable_ssl_certificate_validation
         self.http_obj = http.ClosingHttp(
             disable_ssl_certificate_validation=dscv)
-        self._set_auth()
-        self.base_url = self.base_url.replace(
-            urlparse.urlparse(self.base_url).path, "/v3")
         return super(EndPointClientXML, self).request(method, url,
                                                       headers=headers,
                                                       body=body)
diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py
index de75fe5..e7b85c1 100644
--- a/tempest/services/identity/v3/xml/identity_client.py
+++ b/tempest/services/identity/v3/xml/identity_client.py
@@ -13,12 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from urlparse import urlparse
+import json
+import urlparse
 
 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 Text
@@ -31,11 +33,11 @@
 
 class IdentityV3ClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(IdentityV3ClientXML, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(IdentityV3ClientXML, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
+        self.api_version = "v3"
 
     def _parse_projects(self, node):
         array = []
@@ -76,17 +78,8 @@
         return array
 
     def _parse_body(self, body):
-        json = xml_to_json(body)
-        return json
-
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class RestClient."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(IdentityV3ClientXML, self).request(method, url,
-                                                        headers=headers,
-                                                        body=body)
+        _json = xml_to_json(body)
+        return _json
 
     def create_user(self, user_name, **kwargs):
         """Creates a user."""
@@ -454,25 +447,41 @@
 
 class V3TokenClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(V3TokenClientXML, self).__init__(username, password,
-                                               auth_url, tenant_name)
-        self.service = CONF.identity.catalog_type
-        self.endpoint_url = 'adminURL'
-
-        auth_url = CONF.identity.uri
-
-        if 'tokens' not in auth_url:
-            auth_url = auth_url.rstrip('/') + '/tokens'
+    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 'auth/tokens' not in auth_url:
+            auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
         self.auth_url = auth_url
 
-    def auth(self, user_id, password):
-        user = Element('user',
-                       id=user_id,
-                       password=password)
+    def auth(self, user, password, tenant=None, user_type='id', domain=None):
+        """
+        :param user: user id or name, as specified in user_type
+
+        Accepts different combinations of credentials. Restrictions:
+        - tenant and domain are only name (no id)
+        - user domain and tenant domain are assumed identical
+        Sample sample valid combinations:
+        - user_id, password
+        - username, password, domain
+        - username, password, tenant, domain
+        Validation is left to the server side.
+        """
+        if user_type == 'id':
+            _user = Element('user', id=user, password=password)
+        else:
+            _user = Element('user', name=user, password=password)
+        if domain is not None:
+            _domain = Element('domain', name=domain)
+            _user.append(_domain)
+
         password = Element('password')
-        password.append(user)
+        password.append(_user)
 
         method = Element('method')
         method.append(Text('password'))
@@ -481,18 +490,51 @@
         identity = Element('identity')
         identity.append(methods)
         identity.append(password)
+
         auth = Element('auth')
         auth.append(identity)
-        headers = {'Content-Type': 'application/xml'}
-        resp, body = self.post("auth/tokens", headers=headers,
+
+        if tenant is not None:
+            project = Element('project', name=tenant)
+            project.append(_domain)
+            scope = Element('scope')
+            scope.append(project)
+            auth.append(scope)
+
+        resp, body = self.post(self.auth_url, headers=self.headers,
                                body=str(Document(auth)))
         return resp, body
 
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(V3TokenClientXML, self).request(method, url,
-                                                     headers=headers,
-                                                     body=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'
+        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, 204]:
+            raise exceptions.IdentityError(
+                'Unexpected status code {0}'.format(resp.status))
+
+        return resp, json.loads(resp_body)
+
+    def get_token(self, user, password, tenant, domain='Default',
+                  auth_data=False):
+        """
+        :param user: username
+        Returns (token id, token data) for supplied credentials
+        """
+        resp, body = self.auth(user, password, tenant, user_type='name',
+                               domain=domain)
+
+        token = resp.get('x-subject-token')
+        if auth_data:
+            return token, body['token']
+        else:
+            return token
diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py
index 54b4ad8..429c6a4 100644
--- a/tempest/services/identity/v3/xml/policy_client.py
+++ b/tempest/services/identity/v3/xml/policy_client.py
@@ -13,8 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from urlparse import urlparse
-
 from lxml import etree
 
 from tempest.common import http
@@ -31,11 +29,11 @@
 
 class PolicyClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(PolicyClientXML, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(PolicyClientXML, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
+        self.api_version = "v3"
 
     def _parse_array(self, node):
         array = []
@@ -54,9 +52,6 @@
         dscv = CONF.identity.disable_ssl_certificate_validation
         self.http_obj = http.ClosingHttp(
             disable_ssl_certificate_validation=dscv)
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
         return super(PolicyClientXML, self).request(method, url,
                                                     headers=headers,
                                                     body=body)
diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py
index 2997775..df9b234 100644
--- a/tempest/services/identity/v3/xml/service_client.py
+++ b/tempest/services/identity/v3/xml/service_client.py
@@ -13,8 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from urlparse import urlparse
-
 from lxml import etree
 
 from tempest.common.rest_client import RestClientXML
@@ -30,11 +28,11 @@
 
 class ServiceClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ServiceClientXML, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ServiceClientXML, self).__init__(auth_provider)
         self.service = CONF.identity.catalog_type
         self.endpoint_url = 'adminURL'
+        self.api_version = "v3"
 
     def _parse_array(self, node):
         array = []
@@ -46,15 +44,6 @@
         data = xml_to_json(body)
         return data
 
-    def request(self, method, url, headers=None, body=None, wait=None):
-        """Overriding the existing HTTP request in super class rest_client."""
-        self._set_auth()
-        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
-                                              "/v3")
-        return super(ServiceClientXML, self).request(method, url,
-                                                     headers=headers,
-                                                     body=body)
-
     def update_service(self, service_id, **kwargs):
         """Updates a service_id."""
         resp, body = self.get_service(service_id)
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
index e6a7188..81846da 100644
--- a/tempest/services/identity/xml/identity_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -12,60 +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 import http
-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, username, password, auth_url, tenant_name=None):
-        super(IdentityClientXML, self).__init__(username, password,
-                                                auth_url, tenant_name)
-        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):
         """
@@ -75,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."""
@@ -146,168 +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)), self.headers)
+        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):
-        auth_url = CONF.identity.uri
-
-        # TODO(jaypipes) Why is this all repeated code in here?
-        # 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)
-        headers = {'Content-Type': 'application/xml'}
-        resp, body = self.post(self.auth_url, headers=headers,
-                               body=str(Document(auth)))
-        return resp, body
-
-    def request(self, method, url, headers=None, body=None):
-        """A simple HTTP request interface."""
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        self.http_obj = http.ClosingHttp(
-            disable_ssl_certificate_validation=dscv)
-        if headers is None:
-            headers = {}
-        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'])
-
-        return resp, resp_body
-
-    def get_token(self, user, password, tenant):
-        resp, body = self.auth(user, password, tenant)
-        if resp['status'] != '202':
-            body = json.loads(body)
-            access = body['access']
-            token = access['token']
-            return token['id']
+        resp, body = self.post(self.auth_url, body=str(xml.Document(auth)))
+        return resp, body['access']
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index a5b93a0..bc9db38 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -33,12 +33,10 @@
 
 class ImageClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ImageClientJSON, self).__init__(username, password,
-                                              auth_url, tenant_name)
-        self.service = CONF.images.catalog_type
-        if CONF.service_available.glance:
-            self.http = self._get_http()
+    def __init__(self, auth_provider):
+        super(ImageClientJSON, self).__init__(auth_provider)
+        self.service = CONF.image.catalog_type
+        self._http = None
 
     def _image_meta_from_headers(self, headers):
         meta = {'properties': {}}
@@ -106,13 +104,9 @@
             return None
 
     def _get_http(self):
-        token, endpoint = self.keystone_auth(self.user,
-                                             self.password,
-                                             self.auth_url,
-                                             self.service,
-                                             self.tenant_name)
         dscv = CONF.identity.disable_ssl_certificate_validation
-        return glance_http.HTTPClient(endpoint=endpoint, token=token,
+        return glance_http.HTTPClient(auth_provider=self.auth_provider,
+                                      filters=self.filters,
                                       insecure=dscv)
 
     def _create_with_data(self, headers, data):
@@ -132,6 +126,13 @@
         body = json.loads(''.join([c for c in body_iter]))
         return resp, body['image']
 
+    @property
+    def http(self):
+        if self._http is None:
+            if CONF.service_available.glance:
+                self._http = self._get_http()
+        return self._http
+
     def create_image(self, name, container_format, disk_format, **kwargs):
         params = {
             "name": name,
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 0c4fb5c..b825519 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -28,19 +28,15 @@
 
 class ImageClientV2JSON(rest_client.RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ImageClientV2JSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
-        self.service = CONF.images.catalog_type
-        if CONF.service_available.glance:
-            self.http = self._get_http()
+    def __init__(self, auth_provider):
+        super(ImageClientV2JSON, self).__init__(auth_provider)
+        self.service = CONF.image.catalog_type
+        self._http = None
 
     def _get_http(self):
-        token, endpoint = self.keystone_auth(self.user, self.password,
-                                             self.auth_url, self.service,
-                                             self.tenant_name)
         dscv = CONF.identity.disable_ssl_certificate_validation
-        return glance_http.HTTPClient(endpoint=endpoint, token=token,
+        return glance_http.HTTPClient(auth_provider=self.auth_provider,
+                                      filters=self.filters,
                                       insecure=dscv)
 
     def get_images_schema(self):
@@ -65,6 +61,13 @@
 
         jsonschema.validate(body, schema)
 
+    @property
+    def http(self):
+        if self._http is None:
+            if CONF.service_available.glance:
+                self._http = self._get_http()
+        return self._http
+
     def create_image(self, name, container_format, disk_format, **kwargs):
         params = {
             "name": name,
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 9908816..1458c7b 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -31,9 +31,8 @@
     quotas
     """
 
-    def get_rest_client(self, username,
-                        password, auth_url, tenant_name=None):
-        return RestClient(username, password, auth_url, tenant_name)
+    def get_rest_client(self, auth_provider):
+        return RestClient(auth_provider)
 
     def deserialize_single(self, body):
         return json.loads(body)
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index 467256e..96b9b1d 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -46,16 +46,14 @@
 
 
 class NetworkClientBase(object):
-    def __init__(self, username, password,
-                 auth_url, tenant_name=None):
+    def __init__(self, auth_provider):
         self.rest_client = self.get_rest_client(
-            username, password, auth_url, tenant_name)
+            auth_provider)
         self.rest_client.service = CONF.network.catalog_type
         self.version = '2.0'
         self.uri_prefix = "v%s" % (self.version)
 
-    def get_rest_client(self, username, password,
-                        auth_url, tenant_name):
+    def get_rest_client(self, auth_provider):
         raise NotImplementedError
 
     def post(self, uri, body, headers=None):
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
index 4eb38be..720c842 100644
--- a/tempest/services/network/xml/network_client.py
+++ b/tempest/services/network/xml/network_client.py
@@ -28,10 +28,8 @@
     PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools',
                'fixed_ips', 'extensions']
 
-    def get_rest_client(self, username, password,
-                        auth_url, tenant_name=None):
-        return RestClientXML(username, password,
-                             auth_url, tenant_name)
+    def get_rest_client(self, auth_provider):
+        return RestClientXML(auth_provider)
 
     def _parse_array(self, node):
         array = []
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 4c5b832..efac5f5 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -25,12 +25,42 @@
 
 
 class AccountClient(RestClient):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AccountClient, self).__init__(username, password,
-                                            auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(AccountClient, self).__init__(auth_provider)
         self.service = CONF.object_storage.catalog_type
         self.format = 'json'
 
+    def create_account(self, data=None,
+                       params=None,
+                       metadata={},
+                       remove_metadata={},
+                       metadata_prefix='X-Account-Meta-',
+                       remove_metadata_prefix='X-Remove-Account-Meta-'):
+        """Create an account."""
+        url = ''
+        if params:
+            url += '?%s' % urllib.urlencode(params)
+
+        headers = {}
+        for key in metadata:
+            headers[metadata_prefix + key] = metadata[key]
+        for key in remove_metadata:
+            headers[remove_metadata_prefix + key] = remove_metadata[key]
+
+        resp, body = self.put(url, data, headers)
+        return resp, body
+
+    def delete_account(self, data=None, params=None):
+        """Delete an account."""
+        url = ''
+        if params:
+            if 'bulk-delete' in params:
+                url += 'bulk-delete&'
+            url = '?%s%s' % (url, urllib.urlencode(params))
+
+        resp, body = self.delete(url, headers={}, body=data)
+        return resp, body
+
     def list_account_metadata(self):
         """
         HEAD on the storage URL
@@ -91,24 +121,26 @@
 
         url = '?' + urllib.urlencode(params)
         resp, body = self.get(url)
-        body = json.loads(body)
+
+        if params and params.get('format') == 'json':
+            body = json.loads(body)
         return resp, body
 
     def list_extensions(self):
-        _base_url = self.base_url
-        self.base_url = "/".join(self.base_url.split("/")[:-2])
+        self.skip_path()
         resp, body = self.get('info')
-        self.base_url = _base_url
+        self.reset_path()
         body = json.loads(body)
         return resp, body
 
 
 class AccountClientCustomizedHeader(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(AccountClientCustomizedHeader, self).__init__(username,
-                                                            password, auth_url,
-                                                            tenant_name)
+    # TODO(andreaf) This class is now redundant, to be removed in next patch
+
+    def __init__(self, auth_provider):
+        super(AccountClientCustomizedHeader, self).__init__(
+            auth_provider)
         # Overwrites json-specific header encoding in RestClient
         self.service = CONF.object_storage.catalog_type
         self.format = 'json'
@@ -118,14 +150,17 @@
         self.http_obj = http.ClosingHttp()
         if headers is None:
             headers = {}
-        if self.base_url is None:
-            self._set_auth()
 
-        req_url = "%s/%s" % (self.base_url, url)
-
+        # Authorize the request
+        req_url, req_headers, req_body = self.auth_provider.auth_request(
+            method=method, url=url, headers=headers, body=body,
+            filters=self.filters
+        )
         self._log_request(method, req_url, headers, body)
+        # use original body
         resp, resp_body = self.http_obj.request(req_url, method,
-                                                headers=headers, body=body)
+                                                headers=req_headers,
+                                                body=req_body)
         self._log_response(resp, resp_body)
 
         if resp.status == 401 or resp.status == 403:
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index 4308589..f224407 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -18,22 +18,26 @@
 
 from tempest.common.rest_client import RestClient
 from tempest import config
+from xml.etree import ElementTree as etree
 
 CONF = config.CONF
 
 
 class ContainerClient(RestClient):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ContainerClient, self).__init__(username, password,
-                                              auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ContainerClient, self).__init__(auth_provider)
 
         # Overwrites json-specific header encoding in RestClient
         self.headers = {}
         self.service = CONF.object_storage.catalog_type
         self.format = 'json'
 
-    def create_container(self, container_name, metadata=None,
-                         metadata_prefix='X-Container-Meta-'):
+    def create_container(
+            self, container_name,
+            metadata=None,
+            remove_metadata=None,
+            metadata_prefix='X-Container-Meta-',
+            remove_metadata_prefix='X-Remove-Container-Meta-'):
         """
            Creates a container, with optional metadata passed in as a
            dictionary
@@ -44,6 +48,9 @@
         if metadata is not None:
             for key in metadata:
                 headers[metadata_prefix + key] = metadata[key]
+        if remove_metadata is not None:
+            for key in remove_metadata:
+                headers[remove_metadata_prefix + key] = remove_metadata[key]
 
         resp, body = self.put(url, body=None, headers=headers)
         return resp, body
@@ -54,8 +61,12 @@
         resp, body = self.delete(url)
         return resp, body
 
-    def update_container_metadata(self, container_name, metadata,
-                                  metadata_prefix='X-Container-Meta-'):
+    def update_container_metadata(
+            self, container_name,
+            metadata=None,
+            remove_metadata=None,
+            metadata_prefix='X-Container-Meta-',
+            remove_metadata_prefix='X-Remove-Container-Meta-'):
         """Updates arbitrary metadata on container."""
         url = str(container_name)
         headers = {}
@@ -63,6 +74,9 @@
         if metadata is not None:
             for key in metadata:
                 headers[metadata_prefix + key] = metadata[key]
+        if remove_metadata is not None:
+            for key in remove_metadata:
+                headers[remove_metadata_prefix + key] = remove_metadata[key]
 
         resp, body = self.post(url, body=None, headers=headers)
         return resp, body
@@ -75,7 +89,7 @@
 
         if metadata is not None:
             for item in metadata:
-                headers[metadata_prefix + item] = 'x'
+                headers[metadata_prefix + item] = metadata[item]
 
         resp, body = self.post(url, body=None, headers=headers)
         return resp, body
@@ -104,8 +118,9 @@
             if 'marker' in params:
                 limit = params['marker']
 
-        resp, objlist = self.list_container_contents(container,
-                                                     params={'limit': limit})
+        resp, objlist = self.list_container_contents(
+            container,
+            params={'limit': limit, 'format': 'json'})
         return objlist
         """tmp = []
         for obj in objlist:
@@ -162,10 +177,13 @@
         """
 
         url = str(container)
-        url += '?format=%s' % self.format
         if params:
+            url += '?'
             url += '&%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url)
-        body = json.loads(body)
+        resp, body = self.get(url, headers={})
+        if params and params.get('format') == 'json':
+            body = json.loads(body)
+        elif params and params.get('format') == 'xml':
+            body = etree.fromstring(body)
         return resp, body
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 2a68a4f..79c5719 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -24,9 +24,8 @@
 
 
 class ObjectClient(RestClient):
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ObjectClient, self).__init__(username, password,
-                                           auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ObjectClient, self).__init__(auth_provider)
 
         self.service = CONF.object_storage.catalog_type
 
@@ -52,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,
@@ -138,10 +137,11 @@
 
 class ObjectClientCustomizedHeader(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ObjectClientCustomizedHeader, self).__init__(username,
-                                                           password, auth_url,
-                                                           tenant_name)
+    # TODO(andreaf) This class is now redundant, to be removed in next patch
+
+    def __init__(self, auth_provider):
+        super(ObjectClientCustomizedHeader, self).__init__(
+            auth_provider)
         # Overwrites json-specific header encoding in RestClient
         self.service = CONF.object_storage.catalog_type
         self.format = 'json'
@@ -153,13 +153,17 @@
             disable_ssl_certificate_validation=dscv)
         if headers is None:
             headers = {}
-        if self.base_url is None:
-            self._set_auth()
 
-        req_url = "%s/%s" % (self.base_url, url)
+        # Authorize the request
+        req_url, req_headers, req_body = self.auth_provider.auth_request(
+            method=method, url=url, headers=headers, body=body,
+            filters=self.filters
+        )
+        # Use original method
         self._log_request(method, req_url, headers, body)
         resp, resp_body = self.http_obj.request(req_url, method,
-                                                headers=headers, body=body)
+                                                headers=req_headers,
+                                                body=req_body)
         self._log_response(resp, resp_body)
         if resp.status == 401 or resp.status == 403:
             raise exceptions.Unauthorized()
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index 273c2ae..b70b2e8 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -27,9 +27,8 @@
 
 class OrchestrationClient(rest_client.RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(OrchestrationClient, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(OrchestrationClient, self).__init__(auth_provider)
         self.service = CONF.orchestration.catalog_type
         self.build_interval = CONF.orchestration.build_interval
         self.build_timeout = CONF.orchestration.build_timeout
@@ -178,7 +177,7 @@
             stack_name = body['stack_name']
             stack_status = body['stack_status']
             if stack_status == status:
-                return
+                return body
             if fail_regexp.search(stack_status):
                 raise exceptions.StackBuildErrorException(
                     stack_identifier=stack_identifier,
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index a1112da..747d7c1 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -20,9 +20,8 @@
 
 class TelemetryClientJSON(client.TelemetryClientBase):
 
-    def get_rest_client(self, username,
-                        password, auth_url, tenant_name=None):
-        return RestClient(username, password, auth_url, tenant_name)
+    def get_rest_client(self, auth_provider):
+        return RestClient(auth_provider)
 
     def deserialize(self, body):
         return json.loads(body.replace("\n", ""))
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
index 24039c6..200c94a 100644
--- a/tempest/services/telemetry/telemetry_client_base.py
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -35,17 +35,15 @@
     statistics
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        self.rest_client = self.get_rest_client(username, password,
-                                                auth_url, tenant_name)
+    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
 
     @abc.abstractmethod
-    def get_rest_client(self, username, password,
-                        auth_url, tenant_name):
+    def get_rest_client(self, auth_provider):
         """
         :param config:
         :param username:
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
index 862d08f..f29fe22 100644
--- a/tempest/services/telemetry/xml/telemetry_client.py
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -23,9 +23,8 @@
 
 class TelemetryClientXML(client.TelemetryClientBase):
 
-    def get_rest_client(self, username,
-                        password, auth_url, tenant_name=None):
-        return RestClientXML(username, password, auth_url, tenant_name)
+    def get_rest_client(self, auth_provider):
+        return RestClientXML(auth_provider)
 
     def _parse_array(self, body):
         array = []
diff --git a/tempest/services/volume/json/admin/volume_hosts_client.py b/tempest/services/volume/json/admin/volume_hosts_client.py
index e4178b9..6efb258 100644
--- a/tempest/services/volume/json/admin/volume_hosts_client.py
+++ b/tempest/services/volume/json/admin/volume_hosts_client.py
@@ -27,9 +27,8 @@
     Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumeHostsClientJSON, self).__init__(username, password,
-                                                    auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumeHostsClientJSON, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index 5b6328b..653532e 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -27,9 +27,8 @@
     Client class to send CRUD Volume Types API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumeTypesClientJSON, self).__init__(username, password,
-                                                    auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumeTypesClientJSON, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
diff --git a/tempest/services/volume/json/extensions_client.py b/tempest/services/volume/json/extensions_client.py
index c3bbb20..257b7c8 100644
--- a/tempest/services/volume/json/extensions_client.py
+++ b/tempest/services/volume/json/extensions_client.py
@@ -23,9 +23,8 @@
 
 class ExtensionsClientJSON(RestClient):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientJSON, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ExtensionsClientJSON, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
 
     def list_extensions(self):
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index a36083b..0a79469 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -27,9 +27,8 @@
 class SnapshotsClientJSON(RestClient):
     """Client class to send CRUD Volume API requests."""
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(SnapshotsClientJSON, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(SnapshotsClientJSON, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
@@ -187,3 +186,10 @@
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
         resp, body = self.delete(url, self.headers)
         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)
+        return resp, body
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 6c09e02..0524212 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -29,9 +29,8 @@
     Client class to send CRUD Volume API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumesClientJSON, self).__init__(username, password,
-                                                auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumesClientJSON, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
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..0524212
--- /dev/null
+++ b/tempest/services/volume/v2/json/volumes_client.py
@@ -0,0 +1,302 @@
+# 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 VolumesClientJSON(RestClient):
+    """
+    Client class to send CRUD Volume API requests to a Cinder endpoint
+    """
+
+    def __init__(self, auth_provider):
+        super(VolumesClientJSON, 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 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:
+        display_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, self.headers)
+        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)
+        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, self.headers)
+        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, self.headers)
+        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, self.headers)
+        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, self.headers)
+        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, self.headers)
+        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['display_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, self.headers)
+        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)
+        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)
+        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)
+        return resp, body
+
+    def create_volume_transfer(self, vol_id, display_name=None):
+        """Create a volume transfer."""
+        post_body = {
+            'volume_id': vol_id
+        }
+        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)
+        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)
+        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, self.headers)
+        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, self.headers)
+        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)
+        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)
+        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)
+        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, self.headers)
+        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, self.headers)
+        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)
+        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..deb56fd
--- /dev/null
+++ b/tempest/services/volume/v2/xml/volumes_client.py
@@ -0,0 +1,412 @@
+# 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.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 Text
+from tempest.services.compute.xml.common import xml_to_json
+from tempest.services.compute.xml.common import XMLNS_11
+
+CONF = config.CONF
+
+
+class VolumesClientXML(RestClientXML):
+    """
+    Client class to send CRUD Volume API requests to a Cinder endpoint
+    """
+
+    def __init__(self, auth_provider):
+        super(VolumesClientXML, self).__init__(auth_provider)
+        self.service = CONF.volume.catalog_type
+        self.build_interval = CONF.compute.build_interval
+        self.build_timeout = CONF.compute.build_timeout
+
+    def _parse_volume(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, self.headers)
+        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 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, self.headers)
+        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, self.headers)
+        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 display_name: Optional Volume Name.
+        :param metadata: An optional dictionary of values for metadata.
+        :param volume_type: Optional Name of volume_type for the volume
+        :param snapshot_id: When specified the volume is created from
+                            this snapshot
+        :param imageRef: When specified the volume is created from this
+                         image
+        """
+        # 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)),
+                               self.headers)
+        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)),
+                              self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        if body:
+            body = xml_to_json(etree.fromstring(body))
+        return resp, body
+
+    def create_volume_transfer(self, vol_id, display_name=None):
+        """Create a volume transfer."""
+        post_body = Element("transfer",
+                            volume_id=vol_id)
+        if display_name:
+            post_body.add_attr('name', display_name)
+        resp, body = self.post('os-volume-transfer',
+                               str(Document(post_body)),
+                               self.headers)
+        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)
+        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, self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)), self.headers)
+        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)),
+                               self.headers)
+        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)
+        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)), self.headers)
+        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)), self.headers)
+        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 39b82e5..7278fd9 100644
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ b/tempest/services/volume/xml/admin/volume_hosts_client.py
@@ -29,9 +29,8 @@
     Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumeHostsClientXML, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumeHostsClientXML, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 942c4e1..29ba431 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -34,9 +34,8 @@
     Client class to send CRUD Volume Types API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumeTypesClientXML, self).__init__(username, password,
-                                                   auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumeTypesClientXML, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py
index a04616d..21e1d04 100644
--- a/tempest/services/volume/xml/extensions_client.py
+++ b/tempest/services/volume/xml/extensions_client.py
@@ -24,9 +24,8 @@
 
 class ExtensionsClientXML(RestClientXML):
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientXML, self).__init__(username, password,
-                                                  auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(ExtensionsClientXML, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
 
     def _parse_array(self, node):
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index 3e85041..4f066a6 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -33,9 +33,8 @@
 class SnapshotsClientXML(RestClientXML):
     """Client class to send CRUD Volume API requests."""
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(SnapshotsClientXML, self).__init__(username, password,
-                                                 auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(SnapshotsClientXML, self).__init__(auth_provider)
 
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
@@ -226,3 +225,12 @@
         """Delete metadata item for the snapshot."""
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
         return self.delete(url)
+
+    def force_delete_snapshot(self, snapshot_id):
+        """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)
+        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 7adaf4b..deb56fd 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -35,9 +35,8 @@
     Client class to send CRUD Volume API requests to a Cinder endpoint
     """
 
-    def __init__(self, username, password, auth_url, tenant_name=None):
-        super(VolumesClientXML, self).__init__(username, password,
-                                               auth_url, tenant_name)
+    def __init__(self, auth_provider):
+        super(VolumesClientXML, self).__init__(auth_provider)
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
diff --git a/tempest/stress/README.rst b/tempest/stress/README.rst
index 20e58d4..b56f96b 100644
--- a/tempest/stress/README.rst
+++ b/tempest/stress/README.rst
@@ -1,7 +1,7 @@
 Tempest Field Guide to Stress Tests
 ===================================
 
-Nova is a distributed, asynchronous system that is prone to race condition
+OpenStack is a distributed, asynchronous system that is prone to race condition
 bugs. These bugs will not be easily found during
 functional testing but will be encountered by users in large deployments in a
 way that is hard to debug. The stress test tries to cause these bugs to happen
diff --git a/tempest/stress/actions/unit_test.py b/tempest/stress/actions/unit_test.py
index 8bd2f22..2f1d28f 100644
--- a/tempest/stress/actions/unit_test.py
+++ b/tempest/stress/actions/unit_test.py
@@ -10,10 +10,13 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import config
 from tempest.openstack.common import importutils
 from tempest.openstack.common import log as logging
 import tempest.stress.stressaction as stressaction
 
+CONF = config.CONF
+
 
 class SetUpClassRunTime(object):
 
@@ -73,10 +76,14 @@
                 self.klass.setUpClass()
                 self.setupclass_called = True
 
-            self.run_core()
-
-            if (self.class_setup_per == SetUpClassRunTime.action):
-                self.klass.tearDownClass()
+            try:
+                self.run_core()
+            except Exception as e:
+                raise e
+            finally:
+                if (CONF.stress.leave_dirty_stack is False
+                    and self.class_setup_per == SetUpClassRunTime.action):
+                    self.klass.tearDownClass()
         else:
             self.run_core()
 
diff --git a/tempest/test.py b/tempest/test.py
index 6754831..dcba226 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -15,8 +15,12 @@
 
 import atexit
 import functools
+import json
 import os
+import sys
 import time
+import urllib
+import uuid
 
 import fixtures
 import nose.plugins.attrib
@@ -24,6 +28,7 @@
 import testtools
 
 from tempest import clients
+from tempest.common import generate_json
 from tempest.common import isolated_creds
 from tempest import config
 from tempest import exceptions
@@ -66,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', '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
 
 
@@ -155,13 +179,12 @@
     """A function that will check the list of enabled extensions from config
 
     """
-    configs = CONF
     config_dict = {
-        'compute': configs.compute_feature_enabled.api_extensions,
-        'compute_v3': configs.compute_feature_enabled.api_v3_extensions,
-        'volume': configs.volume_feature_enabled.api_extensions,
-        'network': configs.network_feature_enabled.api_extensions,
-        'object': configs.object_storage_feature_enabled.discoverable_apis,
+        'compute': CONF.compute_feature_enabled.api_extensions,
+        'compute_v3': CONF.compute_feature_enabled.api_v3_extensions,
+        'volume': CONF.volume_feature_enabled.api_extensions,
+        'network': CONF.network_feature_enabled.api_extensions,
+        'object': CONF.object_storage_feature_enabled.discoverable_apis,
     }
     if config_dict[service][0] == 'all':
         return True
@@ -219,14 +242,26 @@
 
 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
 
-    config = CONF
+    class BaseDeps(testtools.TestCase,
+                   testtools.testcase.WithAttributes,
+                   testresources.ResourcedTestCase,
+                   unittest2.TestCase):
+        pass
+
+
+class BaseTestCase(BaseDeps):
 
     setUpClassCalled = False
+    _service = None
 
     network_resources = {}
 
@@ -273,7 +308,7 @@
                                                    level=None))
 
     @classmethod
-    def get_client_manager(cls):
+    def get_client_manager(cls, interface=None):
         """
         Returns an Openstack client manager
         """
@@ -281,16 +316,35 @@
             cls.__name__, network_resources=cls.network_resources)
 
         force_tenant_isolation = getattr(cls, 'force_tenant_isolation', None)
-        if (cls.config.compute.allow_tenant_isolation or
+        if (CONF.compute.allow_tenant_isolation or
             force_tenant_isolation):
             creds = cls.isolated_creds.get_primary_creds()
             username, tenant_name, password = creds
-            os = clients.Manager(username=username,
-                                 password=password,
-                                 tenant_name=tenant_name,
-                                 interface=cls._interface)
+            if getattr(cls, '_interface', None):
+                os = clients.Manager(username=username,
+                                     password=password,
+                                     tenant_name=tenant_name,
+                                     interface=cls._interface,
+                                     service=cls._service)
+            elif interface:
+                os = clients.Manager(username=username,
+                                     password=password,
+                                     tenant_name=tenant_name,
+                                     interface=interface,
+                                     service=cls._service)
+            else:
+                os = clients.Manager(username=username,
+                                     password=password,
+                                     tenant_name=tenant_name,
+                                     service=cls._service)
         else:
-            os = clients.Manager(interface=cls._interface)
+            if getattr(cls, '_interface', None):
+                os = clients.Manager(interface=cls._interface,
+                                     service=cls._service)
+            elif interface:
+                os = clients.Manager(interface=interface, service=cls._service)
+            else:
+                os = clients.Manager(service=cls._service)
         return os
 
     @classmethod
@@ -306,21 +360,12 @@
         """
         Returns an instance of the Identity Admin API client
         """
-        os = clients.AdminManager(interface=cls._interface)
+        os = clients.AdminManager(interface=cls._interface,
+                                  service=cls._service)
         admin_client = os.identity_client
         return admin_client
 
     @classmethod
-    def _get_client_args(cls):
-
-        return (
-            cls.config,
-            cls.config.identity.admin_username,
-            cls.config.identity.admin_password,
-            cls.config.identity.uri
-        )
-
-    @classmethod
     def set_network_resources(self, network=False, router=False, subnet=False,
                               dhcp=False):
         """Specify which network resources should be created
@@ -342,6 +387,174 @@
                 'dhcp': dhcp}
 
 
+class NegativeAutoTest(BaseTestCase):
+
+    _resources = {}
+
+    @classmethod
+    def setUpClass(cls):
+        super(NegativeAutoTest, cls).setUpClass()
+        os = cls.get_client_manager()
+        cls.client = os.negative_client
+
+    @staticmethod
+    def load_schema(file):
+        """
+        Loads a schema from a file on a specified location.
+
+        :param file: the file name
+        """
+        #NOTE(mkoderer): must be extended for xml support
+        fn = os.path.join(
+            os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
+            "etc", "schemas", file)
+        LOG.debug("Open schema file: %s" % (fn))
+        return json.load(open(fn))
+
+    @staticmethod
+    def generate_scenario(description_file):
+        """
+        Generates the test scenario list for a given description.
+
+        :param description: A dictionary with the following entries:
+            name (required) name for the api
+            http-method (required) one of HEAD,GET,PUT,POST,PATCH,DELETE
+            url (required) the url to be appended to the catalog url with '%s'
+                for each resource mentioned
+            resources: (optional) A list of resource names such as "server",
+                "flavor", etc. with an element for each '%s' in the url. This
+                method will call self.get_resource for each element when
+                constructing the positive test case template so negative
+                subclasses are expected to return valid resource ids when
+                appropriate.
+            json-schema (optional) A valid json schema that will be used to
+                create invalid data for the api calls. For "GET" and "HEAD",
+                the data is used to generate query strings appended to the url,
+                otherwise for the body of the http call.
+        """
+        description = NegativeAutoTest.load_schema(description_file)
+        LOG.debug(description)
+        generate_json.validate_negative_test_schema(description)
+        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())),
+                                             "expected_result": expected_result
+                                             }))
+        if schema is not None:
+            for invalid in generate_json.generate_invalid(schema):
+                scenario_list.append((invalid[0],
+                                      {"schema": invalid[1],
+                                       "expected_result": invalid[2]}))
+        LOG.debug(scenario_list)
+        return scenario_list
+
+    def execute(self, description_file):
+        """
+        Execute a http call on an api that are expected to
+        result in client errors. First it uses invalid resources that are part
+        of the url, and then invalid data for queries and http request bodies.
+
+        :param description: A dictionary with the following entries:
+            name (required) name for the api
+            http-method (required) one of HEAD,GET,PUT,POST,PATCH,DELETE
+            url (required) the url to be appended to the catalog url with '%s'
+                for each resource mentioned
+            resources: (optional) A list of resource names such as "server",
+                "flavor", etc. with an element for each '%s' in the url. This
+                method will call self.get_resource for each element when
+                constructing the positive test case template so negative
+                subclasses are expected to return valid resource ids when
+                appropriate.
+            json-schema (optional) A valid json schema that will be used to
+                create invalid data for the api calls. For "GET" and "HEAD",
+                the data is used to generate query strings appended to the url,
+                otherwise for the body of the http call.
+
+        """
+        description = NegativeAutoTest.load_schema(description_file)
+        LOG.info("Executing %s" % description["name"])
+        LOG.debug(description)
+        method = description["http-method"]
+        url = description["url"]
+
+        resources = [self.get_resource(r) for
+                     r in description.get("resources", [])]
+
+        if hasattr(self, "resource"):
+            # Note(mkoderer): The resources list already contains an invalid
+            # entry (see get_resource).
+            # We just send a valid json-schema with it
+            valid = None
+            schema = description.get("json-schema", None)
+            if schema:
+                valid = generate_json.generate_valid(schema)
+            new_url, body = self._http_arguments(valid, url, method)
+        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)
+
+    def _http_arguments(self, json_dict, url, method):
+        LOG.debug("dict: %s url: %s method: %s" % (json_dict, url, method))
+        if not json_dict:
+            return url, None
+        elif method in ["GET", "HEAD", "PUT", "DELETE"]:
+            return "%s?%s" % (url, urllib.urlencode(json_dict)), None
+        else:
+            return url, json.dumps(json_dict)
+
+    def _check_negative_response(self, result, body):
+        expected_result = getattr(self, "expected_result", None)
+        self.assertTrue(result >= 400 and result < 500 and result != 413,
+                        "Expected client error, got %s:%s" %
+                        (result, body))
+        self.assertTrue(expected_result is None or expected_result == result,
+                        "Expected %s, got %s:%s" %
+                        (expected_result, result, body))
+
+    @classmethod
+    def set_resource(cls, name, resource):
+        """
+        This function can be used in setUpClass context to register a resoruce
+        for a test.
+
+        :param name: The name of the kind of resource such as "flavor", "role",
+            etc.
+        :resource: The id of the resource
+        """
+        cls._resources[name] = resource
+
+    def get_resource(self, name):
+        """
+        Return a valid uuid for a type of resource. If a real resource is
+        needed as part of a url then this method should return one. Otherwise
+        it can return None.
+
+        :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]))
+            return self.resource[1]
+        if name in self._resources:
+            return self._resources[name]
+        return None
+
+
 def call_until_true(func, duration, sleep_for):
     """
     Call the given function until it returns True (and return True) or
diff --git a/tempest/tests/fake_auth_provider.py b/tempest/tests/fake_auth_provider.py
new file mode 100644
index 0000000..bc68d26
--- /dev/null
+++ b/tempest/tests/fake_auth_provider.py
@@ -0,0 +1,20 @@
+# Copyright 2014 Hewlett-Packard Development Company, L.P.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+class FakeAuthProvider(object):
+
+    def auth_request(self, method, url, headers=None, body=None, filters=None):
+        return url, headers, body
diff --git a/tempest/tests/negative/__init__.py b/tempest/tests/negative/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/tests/negative/__init__.py
diff --git a/tempest/tests/negative/test_generate_json.py b/tempest/tests/negative/test_generate_json.py
new file mode 100644
index 0000000..a0aa088
--- /dev/null
+++ b/tempest/tests/negative/test_generate_json.py
@@ -0,0 +1,53 @@
+# Copyright 2014 Deutsche Telekom AG
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.common import generate_json as gen
+import tempest.test
+
+
+class TestGenerateJson(tempest.test.BaseTestCase):
+
+    fake_input_str = {"type": "string",
+                      "minLength": 2,
+                      "maxLength": 8,
+                      'results': {'gen_number': 404}}
+
+    fake_input_int = {"type": "integer",
+                      "maximum": 255,
+                      "minimum": 1}
+
+    fake_input_obj = {"type": "object",
+                      "properties": {"minRam": {"type": "integer"},
+                                     "diskName": {"type": "string"},
+                                     "maxRam": {"type": "integer", }
+                                     }
+                      }
+
+    def _validate_result(self, data):
+        self.assertTrue(isinstance(data, list))
+        for t in data:
+            self.assertTrue(isinstance(t, tuple))
+
+    def test_generate_invalid_string(self):
+        result = gen.generate_invalid(self.fake_input_str)
+        self._validate_result(result)
+
+    def test_generate_invalid_integer(self):
+        result = gen.generate_invalid(self.fake_input_int)
+        self._validate_result(result)
+
+    def test_generate_invalid_obj(self):
+        result = gen.generate_invalid(self.fake_input_obj)
+        self._validate_result(result)
diff --git a/tempest/tests/negative/test_negative_auto_test.py b/tempest/tests/negative/test_negative_auto_test.py
new file mode 100644
index 0000000..4c59383
--- /dev/null
+++ b/tempest/tests/negative/test_negative_auto_test.py
@@ -0,0 +1,64 @@
+# Copyright 2014 Deutsche Telekom AG
+# 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 mock
+
+import tempest.test as test
+
+
+class TestNegativeAutoTest(test.BaseTestCase):
+    # Fake entries
+    _interface = 'json'
+    _service = 'compute'
+
+    fake_input_desc = {"name": "list-flavors-with-detail",
+                       "http-method": "GET",
+                       "url": "flavors/detail",
+                       "json-schema": {"type": "object",
+                                      "properties":
+                                      {"minRam": {"type": "integer"},
+                                       "minDisk": {"type": "integer"}}
+                                       },
+                       "resources": ["flavor", "volume", "image"]
+                       }
+
+    def _check_prop_entries(self, result, entry):
+        entries = [a for a in result if entry in a[0]]
+        self.assertIsNotNone(entries)
+        self.assertIs(len(entries), 2)
+        for entry in entries:
+            self.assertIsNotNone(entry[1]['schema'])
+
+    def _check_resource_entries(self, result, entry):
+        entries = [a for a in result if entry in a[0]]
+        self.assertIsNotNone(entries)
+        self.assertIs(len(entries), 3)
+        for entry in entries:
+            self.assertIsNotNone(entry[1]['resource'])
+
+    @mock.patch('tempest.test.NegativeAutoTest.load_schema')
+    def test_generate_scenario(self, open_mock):
+        open_mock.return_value = self.fake_input_desc
+        scenarios = test.NegativeAutoTest.\
+            generate_scenario(None)
+
+        self.assertIsInstance(scenarios, list)
+        for scenario in scenarios:
+            self.assertIsInstance(scenario, tuple)
+            self.assertIsInstance(scenario[0], str)
+            self.assertIsInstance(scenario[1], dict)
+        self._check_prop_entries(scenarios, "prop_minRam")
+        self._check_prop_entries(scenarios, "prop_minDisk")
+        self._check_resource_entries(scenarios, "inv_res")
diff --git a/tempest/tests/test_compute_xml_common.py b/tempest/tests/test_compute_xml_common.py
new file mode 100644
index 0000000..bfa6a10
--- /dev/null
+++ b/tempest/tests/test_compute_xml_common.py
@@ -0,0 +1,67 @@
+# Copyright 2013 IBM Corp.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+from lxml import etree
+
+from tempest.services.compute.xml import common
+from tempest.tests import base
+
+
+class TestXMLParser(base.TestCase):
+
+    def test_xml_to_json_parser_bool_value(self):
+        node = etree.fromstring('''<health_monitor
+        xmlns="http://openstack.org/quantum/api/v2.0"
+         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+           <admin_state_up quantum:type="bool">False</admin_state_up>
+          <fake_state_up quantum:type="bool">True</fake_state_up>
+          </health_monitor>''')
+        body = common.xml_to_json(node)
+        self.assertEqual(body['admin_state_up'], False)
+        self.assertEqual(body['fake_state_up'], True)
+
+    def test_xml_to_json_parser_int_value(self):
+        node = etree.fromstring('''<health_monitor
+        xmlns="http://openstack.org/quantum/api/v2.0"
+         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+          <delay quantum:type="long">4</delay>
+          <max_retries quantum:type="int">3</max_retries>
+          </health_monitor>''')
+        body = common.xml_to_json(node)
+        self.assertEqual(body['delay'], 4L)
+        self.assertEqual(body['max_retries'], 3)
+
+    def test_xml_to_json_parser_text_value(self):
+        node = etree.fromstring('''<health_monitor
+        xmlns="http://openstack.org/quantum/api/v2.0"
+         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+          <status>ACTIVE</status>
+          </health_monitor>''')
+        body = common.xml_to_json(node)
+        self.assertEqual(body['status'], 'ACTIVE')
+
+    def test_xml_to_json_parser_list_as_value(self):
+        node = etree.fromstring('''<health_monitor
+        xmlns="http://openstack.org/quantum/api/v2.0"
+         xmlns:quantum="http://openstack.org/quantum/api/v2.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+          <elements>
+          <element>first_element</element>
+          <element>second_element</element>
+          </elements>
+          </health_monitor>''')
+        body = common.xml_to_json(node, 'elements')
+        self.assertEqual(body['elements'], ['first_element', 'second_element'])
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index f3c7440..ba43daf 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -13,29 +13,34 @@
 #    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
 from tempest.tests import fake_http
 
 
 class BaseRestClientTestClass(base.TestCase):
 
-    def _set_token(self):
-        self.rest_client.token = 'fake token'
+    url = 'fake_endpoint'
+
+    def _get_region(self):
+        return 'fake region'
 
     def setUp(self):
         super(BaseRestClientTestClass, self).setUp()
         self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakeConfig)
-        self.rest_client = rest_client.RestClient('fake_user', 'fake_pass',
-                                                  'http://fake_url/v2.0')
+        self.rest_client = rest_client.RestClient(
+            fake_auth_provider.FakeAuthProvider())
         self.stubs.Set(httplib2.Http, 'request', self.fake_http.request)
-        self.useFixture(mockpatch.PatchObject(self.rest_client, '_set_auth',
-                                              side_effect=self._set_token()))
+        self.useFixture(mockpatch.PatchObject(self.rest_client, '_get_region',
+                                              side_effect=self._get_region()))
         self.useFixture(mockpatch.PatchObject(self.rest_client,
                                               '_log_response'))
 
@@ -48,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'])
 
 
@@ -88,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/tests/test_ssh.py b/tempest/tests/test_ssh.py
index 429ed56..a6eedc4 100644
--- a/tempest/tests/test_ssh.py
+++ b/tempest/tests/test_ssh.py
@@ -88,15 +88,17 @@
         client_mock.connect.side_effect = [socket.error, socket.error, True]
         t_mock.side_effect = [
             1000,  # Start time
+            1000,  # LOG.warning() calls time.time() loop 1
             1001,  # Sleep loop 1
+            1001,  # LOG.warning() calls time.time() loop 2
             1002   # Sleep loop 2
         ]
 
         client._get_ssh_connection(sleep=1)
 
         expected_sleeps = [
-            mock.call(1),
-            mock.call(1.01)
+            mock.call(2),
+            mock.call(3)
         ]
         self.assertEqual(expected_sleeps, s_mock.mock_calls)
 
@@ -111,7 +113,9 @@
         ]
         t_mock.side_effect = [
             1000,  # Start time
+            1000,  # LOG.warning() calls time.time() loop 1
             1001,  # Sleep loop 1
+            1001,  # LOG.warning() calls time.time() loop 2
             1002,  # Sleep loop 2
             1003,  # Sleep loop 3
             1004  # LOG.error() calls time.time()
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index d484d94..b36e8c7 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -195,6 +195,7 @@
     def setUpClass(cls):
         super(BotoTestCase, cls).setUpClass()
         cls.conclusion = decision_maker()
+        cls.os = cls.get_client_manager()
         # The trash contains cleanup functions and paramaters in tuples
         # (function, *args, **kwargs)
         cls._resource_trash_bin = {}
@@ -259,6 +260,7 @@
                 LOG.exception("Cleanup failed %s" % func_name)
             finally:
                 del cls._resource_trash_bin[key]
+        cls.clear_isolated_creds()
         super(BotoTestCase, cls).tearDownClass()
         # NOTE(afazekas): let the super called even on exceptions
         # The real exceptions already logged, if the super throws another,
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index 19ddd18..a6932bc 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -15,7 +15,6 @@
 
 from boto import exception
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest.common.utils.linux.remote_client import RemoteClient
 from tempest import config
@@ -41,7 +40,6 @@
         if not cls.conclusion['A_I_IMAGES_READY']:
             raise cls.skipException("".join(("EC2 ", cls.__name__,
                                     ": requires ami/aki/ari manifest")))
-        cls.os = clients.Manager()
         cls.s3_client = cls.os.s3_client
         cls.ec2_client = cls.os.ec2api_client
         cls.zone = cls.ec2_client.get_good_zone()
diff --git a/tempest/thirdparty/boto/test_ec2_keys.py b/tempest/thirdparty/boto/test_ec2_keys.py
index b4c1827..329ace3 100644
--- a/tempest/thirdparty/boto/test_ec2_keys.py
+++ b/tempest/thirdparty/boto/test_ec2_keys.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest.test import attr
 from tempest.test import skip_because
@@ -30,7 +29,6 @@
     @classmethod
     def setUpClass(cls):
         super(EC2KeysTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.ec2api_client
         cls.ec = cls.ec2_error_code
 
diff --git a/tempest/thirdparty/boto/test_ec2_network.py b/tempest/thirdparty/boto/test_ec2_network.py
index 3c3c74d..4b2f01f 100644
--- a/tempest/thirdparty/boto/test_ec2_network.py
+++ b/tempest/thirdparty/boto/test_ec2_network.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import clients
 from tempest.test import attr
 from tempest.test import skip_because
 from tempest.thirdparty.boto.test import BotoTestCase
@@ -24,7 +23,6 @@
     @classmethod
     def setUpClass(cls):
         super(EC2NetworkTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.ec2api_client
 
     # Note(afazekas): these tests for things duable without an instance
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
index 75dd254..9b58603 100644
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ b/tempest/thirdparty/boto/test_ec2_security_groups.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest.test import attr
 from tempest.thirdparty.boto.test import BotoTestCase
@@ -24,7 +23,6 @@
     @classmethod
     def setUpClass(cls):
         super(EC2SecurityGroupTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.ec2api_client
 
     @attr(type='smoke')
diff --git a/tempest/thirdparty/boto/test_ec2_volumes.py b/tempest/thirdparty/boto/test_ec2_volumes.py
index 3e7e2de..04671c5 100644
--- a/tempest/thirdparty/boto/test_ec2_volumes.py
+++ b/tempest/thirdparty/boto/test_ec2_volumes.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import clients
 from tempest.openstack.common import log as logging
 from tempest.test import attr
 from tempest.thirdparty.boto.test import BotoTestCase
@@ -31,7 +30,6 @@
     @classmethod
     def setUpClass(cls):
         super(EC2VolumesTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.ec2api_client
         cls.zone = cls.client.get_good_zone()
 
diff --git a/tempest/thirdparty/boto/test_s3_buckets.py b/tempest/thirdparty/boto/test_s3_buckets.py
index f8948fd..f34faac 100644
--- a/tempest/thirdparty/boto/test_s3_buckets.py
+++ b/tempest/thirdparty/boto/test_s3_buckets.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest.test import attr
 from tempest.test import skip_because
@@ -25,7 +24,6 @@
     @classmethod
     def setUpClass(cls):
         super(S3BucketsTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.s3_client
 
     @skip_because(bug="1076965")
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
index 722577b..9607a92 100644
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ b/tempest/thirdparty/boto/test_s3_ec2_images.py
@@ -15,7 +15,6 @@
 
 import os
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.test import attr
@@ -33,7 +32,6 @@
         if not cls.conclusion['A_I_IMAGES_READY']:
             raise cls.skipException("".join(("EC2 ", cls.__name__,
                                     ": requires ami/aki/ari manifest")))
-        cls.os = clients.Manager()
         cls.s3_client = cls.os.s3_client
         cls.images_client = cls.os.ec2api_client
         cls.materials_path = CONF.boto.s3_materials_path
diff --git a/tempest/thirdparty/boto/test_s3_objects.py b/tempest/thirdparty/boto/test_s3_objects.py
index f355899..a102a22 100644
--- a/tempest/thirdparty/boto/test_s3_objects.py
+++ b/tempest/thirdparty/boto/test_s3_objects.py
@@ -17,7 +17,6 @@
 
 import boto.s3.key
 
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest.test import attr
 from tempest.thirdparty.boto.test import BotoTestCase
@@ -28,7 +27,6 @@
     @classmethod
     def setUpClass(cls):
         super(S3BucketsTest, cls).setUpClass()
-        cls.os = clients.Manager()
         cls.client = cls.os.s3_client
 
     @attr(type='smoke')
diff --git a/test-requirements.txt b/test-requirements.txt
index d7340f3..3fe2f27 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,7 +2,7 @@
 # needed for doc build
 docutils==0.9.1
 sphinx>=1.1.2,<1.2
-python-subunit
+python-subunit>=0.0.18
 oslo.sphinx
 mox>=0.5.3
 mock>=1.0
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/verify_tempest_config.py b/tools/verify_tempest_config.py
index b393402..29eed9d 100755
--- a/tools/verify_tempest_config.py
+++ b/tools/verify_tempest_config.py
@@ -40,12 +40,12 @@
 
 
 def verify_nova_api_versions(os):
-    # Check nova api versions
-    os.servers_client._set_auth()
-    v2_endpoint = os.servers_client.base_url
-    endpoint = 'http://' + v2_endpoint.split('/')[2]
-    __, body = RAW_HTTP.request(endpoint, 'GET')
+    # 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')
     body = json.loads(body)
+    # Restore full base_url
+    os.servers_client.skip_path = False
     versions = map(lambda x: x['id'], body['versions'])
     if CONF.compute_feature_enabled.api_v3 != ('v3.0' in versions):
         print('Config option compute api_v3 should be change to: %s' % (
@@ -127,11 +127,22 @@
                           "enabled extensions" % (service, extension))
 
 
+def check_service_availability(service):
+    if service == 'nova_v3':
+        service = 'nova'
+    return getattr(CONF.service_available, service)
+
+
 def main(argv):
     print('Running config verification...')
     os = clients.ComputeAdminManager(interface='json')
     results = {}
     for service in ['nova', 'nova_v3', 'cinder', 'neutron']:
+        # TODO(mtreinish) make this a keystone endpoint check for available
+        # services
+        if not check_service_availability(service):
+            print("%s is not available" % service)
+            continue
         results = verify_extensions(os, service, results)
     verify_glance_api_versions(os)
     verify_nova_api_versions(os)
diff --git a/tox.ini b/tox.ini
index 88f2537..1580b14 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,9 +6,6 @@
 [testenv]
 sitepackages = True
 setenv = VIRTUAL_ENV={envdir}
-         LANG=en_US.UTF-8
-         LANGUAGE=en_US:en
-         LC_ALL=C
          OS_TEST_PATH=./tempest/test_discover
 usedevelop = True
 install_command = pip install {opts} {packages}
@@ -40,6 +37,12 @@
 commands =
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
+[testenv:full-serial]
+# The regex below is used to select which tests to run and exclude the slow tag:
+# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
+commands =
+  bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
+
 [testenv:testr-full]
 commands =
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
