diff --git a/HACKING.rst b/HACKING.rst
index 3fa1ff5..c0df0fb 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -11,6 +11,7 @@
 - [T102] Cannot import OpenStack python clients in tempest/api tests
 - [T104] Scenario tests require a services decorator
 - [T105] Unit tests cannot use setUpClass
+- [T106] vim configuration should not be kept in source files.
 
 Test Data/Configuration
 -----------------------
@@ -107,16 +108,36 @@
 
 Negative Tests
 --------------
-When adding negative tests to tempest there are 2 requirements. First the tests
-must be marked with a negative attribute. For example::
+Newly added negative tests should use the negative test framework. First step
+is to create an interface description in a json file under `etc/schemas`.
+These descriptions consists of two important sections for the test
+(one of those is mandatory):
 
-  @attr(type=negative)
-  def test_resource_no_uuid(self):
-    ...
+ - A resource (part of the URL of the request): Resources needed for a test
+ must be created in `setUpClass` and registered with `set_resource` e.g.:
+ `cls.set_resource("server", server['id'])`
 
-The second requirement is that all negative tests must be added to a negative
-test file. If such a file doesn't exist for the particular resource being
-tested a new test file should be added.
+ - A json schema: defines properties for a request.
+
+After that a test class must be added to automatically generate test scenarios
+out of the given interface description:
+
+    class SampeTestNegativeTestJSON(<your base class>, test.NegativeAutoTest):
+        _interface = 'json'
+        _service = 'compute'
+        _schema_file = 'compute/servers/get_console_output.json'
+        scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+Negative tests must be marked with a negative attribute::
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_console_output(self):
+        self.execute(self._schema_file)
+
+All negative tests should be added into a separate negative test file.
+If such a file doesn't exist for the particular resource being tested a new
+test file should be added. Old XML based negative tests can be kept but should
+be renamed to `_xml.py`.
 
 Test skips because of Known Bugs
 --------------------------------
diff --git a/etc/schemas/compute/flavors/flavor_details_v3.json b/etc/schemas/compute/flavors/flavor_details_v3.json
new file mode 100644
index 0000000..d1c1077
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavor_details_v3.json
@@ -0,0 +1,6 @@
+{
+    "name": "get-flavor-details",
+    "http-method": "GET",
+    "url": "flavors/%s",
+    "resources": ["flavor"]
+}
diff --git a/etc/schemas/compute/flavors/flavors_list_v3.json b/etc/schemas/compute/flavors/flavors_list_v3.json
new file mode 100644
index 0000000..d5388b3
--- /dev/null
+++ b/etc/schemas/compute/flavors/flavors_list_v3.json
@@ -0,0 +1,24 @@
+{
+    "name": "list-flavors-with-detail",
+    "http-method": "GET",
+    "url": "flavors/detail",
+    "json-schema": {
+        "type": "object",
+        "properties": {
+            "min_ram": {
+                "type": "integer",
+                "results": {
+                    "gen_none": 400,
+                    "gen_string": 400
+                }
+            },
+            "min_disk": {
+                "type": "integer",
+                "results": {
+                    "gen_none": 400,
+                    "gen_string": 400
+                }
+            }
+        }
+    }
+}
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index fe4959b..95a4884 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -105,6 +105,10 @@
 # value)
 #catalog_type=baremetal
 
+# The endpoint type to use for the baremetal provisioning
+# service. (string value)
+#endpoint_type=publicURL
+
 
 [boto]
 
@@ -165,6 +169,11 @@
 # value)
 #cli_dir=/usr/local/bin
 
+# Whether the tempest run location has access to the *-manage
+# commands. In a pure blackbox environment it will not.
+# (boolean value)
+#has_manage=true
+
 # Number of seconds to wait on a CLI timeout (integer value)
 #timeout=15
 
@@ -261,6 +270,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the compute service. (string
+# value)
+#endpoint_type=publicURL
+
 # Catalog type of the Compute v3 service. (string value)
 #catalog_v3_type=computev3
 
@@ -316,6 +329,10 @@
 # If false, skip disk config tests (boolean value)
 #disk_config=true
 
+# A list of enabled compute extensions with a special entry
+# all which indicates every extension is enabled (list value)
+#api_extensions=all
+
 # A list of enabled v3 extensions with a special entry all
 # which indicates every extension is enabled (list value)
 #api_v3_extensions=all
@@ -365,6 +382,10 @@
 # Catalog type of the data processing service. (string value)
 #catalog_type=data_processing
 
+# The endpoint type to use for the data processing service.
+# (string value)
+#endpoint_type=publicURL
+
 
 [debug]
 
@@ -407,6 +428,10 @@
 # one is used. (string value)
 #region=RegionOne
 
+# The endpoint type to use for the identity service. (string
+# value)
+#endpoint_type=publicURL
+
 # Username to use for Nova API requests. (string value)
 #username=demo
 
@@ -453,6 +478,12 @@
 # enabled (boolean value)
 #trust=true
 
+# Is the v2 identity API enabled (boolean value)
+#api_v2=true
+
+# Is the v3 identity API enabled (boolean value)
+#api_v3=true
+
 
 [image]
 
@@ -469,6 +500,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the image service. (string
+# value)
+#endpoint_type=publicURL
+
 # http accessible image (string value)
 #http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz
 
@@ -524,13 +559,27 @@
 # value)
 #region=
 
-# The cidr block to allocate tenant networks from (string
+# The endpoint type to use for the network service. (string
+# value)
+#endpoint_type=publicURL
+
+# The cidr block to allocate tenant ipv4 subnets from (string
 # value)
 #tenant_network_cidr=10.100.0.0/16
 
-# The mask bits for tenant networks (integer value)
+# The mask bits for tenant ipv4 subnets (integer value)
 #tenant_network_mask_bits=28
 
+# Allow the execution of IPv6 tests (boolean value)
+#ipv6_enabled=true
+
+# The cidr block to allocate tenant ipv6 subnets from (string
+# value)
+#tenant_network_v6_cidr=2003::/64
+
+# The mask bits for tenant ipv6 subnets (integer value)
+#tenant_network_v6_mask_bits=96
+
 # Whether tenant network connectivity should be evaluated
 # directly (boolean value)
 #tenant_networks_reachable=false
@@ -550,16 +599,8 @@
 # Options defined in tempest.config
 #
 
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
-#api_extensions=all
-
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
-#api_extensions=all
-
-# A list of enabled extensions with a special entry all which
-# indicates every extension is enabled (list value)
+# A list of enabled network extensions with a special entry
+# all which indicates every extension is enabled (list value)
 #api_extensions=all
 
 
@@ -578,6 +619,10 @@
 # (string value)
 #region=
 
+# The endpoint type to use for the object-store service.
+# (string value)
+#endpoint_type=publicURL
+
 # Number of seconds to time on waiting for a container to
 # container synchronization complete. (integer value)
 #container_sync_timeout=120
@@ -618,6 +663,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the orchestration service.
+# (string value)
+#endpoint_type=publicURL
+
 # Time in seconds between build status checks. (integer value)
 #build_interval=1
 
@@ -651,6 +700,9 @@
 # Directory containing image files (string value)
 #img_dir=/opt/stack/new/devstack/files/images/cirros-0.3.1-x86_64-uec
 
+# QCOW2 image file name (string value)
+#qcow2_img_file=cirros-0.3.1-x86_64-disk.img
+
 # AMI image file name (string value)
 #ami_img_file=cirros-0.3.1-x86_64-blank.img
 
@@ -757,6 +809,11 @@
 # value)
 #leave_dirty_stack=false
 
+# Allows a full cleaning process after a stress test. Caution
+# : this cleanup will remove every objects of every tenant.
+# (boolean value)
+#full_clean_stack=false
+
 
 [telemetry]
 
@@ -767,6 +824,10 @@
 # Catalog type of the Telemetry service. (string value)
 #catalog_type=metering
 
+# The endpoint type to use for the telemetry service. (string
+# value)
+#endpoint_type=publicURL
+
 
 [volume]
 
@@ -791,6 +852,10 @@
 # value)
 #region=
 
+# The endpoint type to use for the volume service. (string
+# value)
+#endpoint_type=publicURL
+
 # Name of the backend1 (must be declared in cinder.conf)
 # (string value)
 #backend1_name=BACKEND_1
@@ -822,7 +887,17 @@
 # (boolean value)
 #multi_backend=false
 
+# Runs Cinder volumes backup test (boolean value)
+#backup=true
+
+# A list of enabled volume extensions with a special entry all
+# which indicates every extension is enabled (list value)
+#api_extensions=all
+
 # Is the v1 volume API enabled (boolean value)
 #api_v1=true
 
+# Is the v2 volume API enabled (boolean value)
+#api_v2=true
+
 
diff --git a/requirements.txt b/requirements.txt
index 8c0f872..a08a437 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
 pbr>=0.5.21,<1.0
 anyjson>=0.3.3
-nose
 httplib2>=0.7.5
 jsonschema>=2.0.0,<3.0.0
 testtools>=0.9.34
@@ -14,6 +13,7 @@
 python-neutronclient>=2.3.3,<3
 python-cinderclient>=1.0.6
 python-heatclient>=0.2.3
+python-savannaclient>=0.4.1
 python-swiftclient>=1.5
 testresources>=0.2.4
 keyring>=1.6.1,<2.0,>=2.1
diff --git a/run_tempest.sh b/run_tempest.sh
index f6c330d..bdd1f69 100755
--- a/run_tempest.sh
+++ b/run_tempest.sh
@@ -53,12 +53,12 @@
     -u|--update) update=1;;
     -d|--debug) debug=1;;
     -C|--config) config_file=$2; shift;;
-    -s|--smoke) testrargs+="smoke"; noseargs+="--attr=type=smoke";;
+    -s|--smoke) testrargs+="smoke";;
     -t|--serial) serial=1;;
     -l|--logging) logging=1;;
     -L|--logging-config) logging_config=$2; shift;;
     --) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no  ;;
-    *) testrargs="$testrargs $1"; noseargs+=" $1" ;;
+    *) testrargs+="$testrargs $1";;
   esac
   shift
 done
@@ -110,22 +110,6 @@
   fi
 }
 
-function run_tests_nose {
-    export NOSE_WITH_OPENSTACK=1
-    export NOSE_OPENSTACK_COLOR=1
-    export NOSE_OPENSTACK_RED=15.00
-    export NOSE_OPENSTACK_YELLOW=3.00
-    export NOSE_OPENSTACK_SHOW_ELAPSED=1
-    export NOSE_OPENSTACK_STDOUT=1
-    export TEMPEST_PY26_NOSE_COMPAT=1
-    if [[ "x$noseargs" =~ "tempest" ]]; then
-        noseargs="$testrargs"
-    else
-        noseargs="$noseargs tempest"
-    fi
-    ${wrapper} nosetests $noseargs
-}
-
 if [ $never_venv -eq 0 ]
 then
   # Remove the virtual environment if --force used
@@ -156,12 +140,7 @@
   fi
 fi
 
-py_version=`${wrapper} python --version 2>&1`
-if [[ $py_version =~ "2.6" ]] ; then
-    run_tests_nose
-else
-    run_tests
-fi
+run_tests
 retval=$?
 
 exit $retval
diff --git a/run_tests.sh b/run_tests.sh
index eaa7fd7..a12bf46 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -54,7 +54,7 @@
     -c|--coverage) coverage=1;;
     -t|--serial) serial=1;;
     --) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no  ;;
-    *) testrargs="$testrargs $1"; noseargs+=" $1" ;;
+    *) testrargs="$testrargs $1";;
   esac
   shift
 done
@@ -84,6 +84,11 @@
       return $?
   fi
 
+  if [ $coverage -eq 1 ]; then
+      ${wrapper} python setup.py test --coverage
+      return $?
+  fi
+
   if [ $serial -eq 1 ]; then
       ${wrapper} testr run --subunit $testrargs | ${wrapper} subunit-2to1 | ${wrapper} tools/colorizer.py
   else
@@ -98,6 +103,8 @@
       echo "Running flake8 without virtual env may miss OpenStack HACKING detection" >&2
   fi
   ${wrapper} flake8
+  export MODULEPATH=tempest.common.generate_sample_tempest
+  ${wrapper} tools/config/check_uptodate.sh
 }
 
 if [ $never_venv -eq 0 ]
@@ -135,10 +142,6 @@
     exit
 fi
 
-if [ $coverage -eq 1 ]; then
-    $testrargs = "--coverage $testrargs"
-fi
-
 run_tests
 retval=$?
 
diff --git a/setup.cfg b/setup.cfg
index 23a97ff..a701572 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,8 +4,8 @@
 summary = OpenStack Integration Testing
 description-file =
     README.rst
-author = OpenStack QA
-author-email = openstack-qa@lists.openstack.org
+author = OpenStack
+author-email = openstack-dev@lists.openstack.org
 home-page = http://www.openstack.org/
 classifier =
     Intended Audience :: Information Technology
@@ -21,3 +21,6 @@
 all_files = 1
 build-dir = doc/build
 source-dir = doc/source
+
+[wheel]
+universal = 1
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 18e4452..283a45a 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -29,7 +29,6 @@
     def setUpClass(cls):
         super(AZAdminTestJSON, cls).setUpClass()
         cls.client = cls.os_adm.availability_zone_client
-        cls.non_adm_client = cls.availability_zone_client
 
     @attr(type='gate')
     def test_get_availability_zone_list(self):
@@ -46,14 +45,6 @@
         self.assertEqual(200, resp.status)
         self.assertTrue(len(availability_zone) > 0)
 
-    @attr(type='gate')
-    def test_get_availability_zone_list_with_non_admin_user(self):
-        # List of availability zone with non-administrator user
-        resp, availability_zone = \
-            self.non_adm_client.get_availability_zone_list()
-        self.assertEqual(200, resp.status)
-        self.assertTrue(len(availability_zone) > 0)
-
 
 class AZAdminTestXML(AZAdminTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 252f4be..3e13bf8 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -172,7 +172,6 @@
                 flag = True
         self.assertTrue(flag)
 
-    @test.skip_because(bug="1209101")
     @test.attr(type='gate')
     def test_list_non_public_flavor(self):
         # Create a flavor with os-flavor-access:is_public false should
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index d4a32e6..81b0328 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -25,7 +25,6 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminTestJSON, cls).setUpClass()
-        cls.client = cls.os.quotas_client
         cls.adm_client = cls.os_adm.quotas_client
 
         # NOTE(afazekas): these test cases should always create and use a new
@@ -45,7 +44,7 @@
     def test_get_default_quotas(self):
         # Admin can get the default resource quota set for a tenant
         expected_quota_set = self.default_quota_set | set(['id'])
-        resp, quota_set = self.client.get_default_quota_set(
+        resp, quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(sorted(expected_quota_set),
@@ -55,7 +54,7 @@
     @test.attr(type='gate')
     def test_update_all_quota_resources_for_tenant(self):
         # Admin can update all the resource quota limits for a tenant
-        resp, default_quota_set = self.client.get_default_quota_set(
+        resp, default_quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         new_quota_set = {'injected_file_content_bytes': 20480,
                          'metadata_items': 256, 'injected_files': 10,
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index d3696a1..4c4acd4 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -49,7 +49,7 @@
     @test.attr(type=['negative', 'gate'])
     def test_create_server_when_cpu_quota_is_full(self):
         # Disallow server creation when tenant's vcpu quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
         default_vcpu_quota = quota_set['cores']
         vcpu_quota = 0  # Set the quota to zero to conserve resources
 
@@ -64,7 +64,7 @@
     @test.attr(type=['negative', 'gate'])
     def test_create_server_when_memory_quota_is_full(self):
         # Disallow server creation when tenant's memory quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
         default_mem_quota = quota_set['ram']
         mem_quota = 0  # Set the quota to zero to conserve resources
 
@@ -79,7 +79,7 @@
     @test.attr(type=['negative', 'gate'])
     def test_create_server_when_instances_quota_is_full(self):
         # Once instances quota limit is reached, disallow server creation
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
         default_instances_quota = quota_set['instances']
         instances_quota = 0  # Set quota to zero to disallow server creation
 
@@ -96,7 +96,7 @@
     def test_security_groups_exceed_limit(self):
         # Negative test: Creation Security Groups over limit should FAIL
 
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
         default_sg_quota = quota_set['security_groups']
         sg_quota = 0  # Set the quota to zero to conserve resources
 
@@ -121,7 +121,7 @@
         # Negative test: Creation of Security Group Rules should FAIL
         # when we reach limit maxSecurityGroupRules
 
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
         default_sg_rules_quota = quota_set['security_group_rules']
         sg_rules_quota = 0  # Set the quota to zero to conserve resources
 
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 2cee78a..8a5f1a5 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -15,8 +15,7 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 
 class ServersAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -25,6 +24,7 @@
     Tests Servers API using admin privileges
     """
 
+    _host_key = 'OS-EXT-SRV-ATTR:host'
     _interface = 'json'
 
     @classmethod
@@ -54,7 +54,7 @@
             flavor_id = data_utils.rand_int_id(start=1000)
         return flavor_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin(self):
         # Listing servers by admin user returns empty list by default
         resp, body = self.client.list_servers_with_detail()
@@ -62,7 +62,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual([], servers)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_error_status(self):
         # Filter the list of servers by server error status
         params = {'status': 'error'}
@@ -78,7 +78,7 @@
         self.assertIn(self.s1_id, map(lambda x: x['id'], servers))
         self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin_with_all_tenants(self):
         # Listing servers by admin user with all tenants parameter
         # Here should be listed all servers
@@ -90,27 +90,34 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
-    def test_admin_delete_servers_of_others(self):
-        # Administrator can delete servers of others
-        _, server = self.create_test_server()
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-        self.servers_client.wait_for_server_termination(server['id'])
+    @test.attr(type='gate')
+    def test_list_servers_filter_by_exist_host(self):
+        # Filter the list of servers by existent host
+        name = data_utils.rand_name('server')
+        flavor = self.flavor_ref
+        image_id = self.image_ref
+        resp, test_server = self.client.create_server(
+            name, image_id, flavor)
+        self.assertEqual('202', resp['status'])
+        self.addCleanup(self.client.delete_server, test_server['id'])
+        self.client.wait_for_server_status(test_server['id'], 'ACTIVE')
+        resp, server = self.client.get_server(test_server['id'])
+        self.assertEqual(server['status'], 'ACTIVE')
+        hostname = server[self._host_key]
+        params = {'host': hostname}
+        resp, body = self.client.list_servers(params)
+        self.assertEqual('200', resp['status'])
+        servers = body['servers']
+        nonexistent_params = {'host': 'nonexistent_host'}
+        resp, nonexistent_body = self.client.list_servers(
+            nonexistent_params)
+        self.assertEqual('200', resp['status'])
+        nonexistent_servers = nonexistent_body['servers']
+        self.assertIn(test_server['id'], map(lambda x: x['id'], servers))
+        self.assertNotIn(test_server['id'],
+                         map(lambda x: x['id'], nonexistent_servers))
 
-    @attr(type='gate')
-    def test_delete_server_while_in_error_state(self):
-        # Delete a server while it's VM state is error
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.reset_state(server['id'], state='error')
-        self.assertEqual(202, resp.status)
-        # Verify server's state
-        resp, server = self.client.get_server(server['id'])
-        self.assertEqual(server['status'], 'ERROR')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
@@ -128,8 +135,8 @@
         resp, server = self.client.get_server(self.s1_id)
         self.assertEqual(server['status'], 'ACTIVE')
 
-    @attr(type='gate')
-    @skip_because(bug="1240043")
+    @test.attr(type='gate')
+    @test.skip_because(bug="1240043")
     def test_get_server_diagnostics_by_admin(self):
         # Retrieve server diagnostics by admin user
         resp, diagnostic = self.client.get_server_diagnostics(self.s1_id)
@@ -140,12 +147,12 @@
         for key in basic_attrs:
             self.assertIn(key, str(diagnostic.keys()))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_error_state(self):
         # The server in error state should be rebuilt using the provided
         # image and changed to ACTIVE state
 
-        # resetting vm state require admin priviledge
+        # resetting vm state require admin privilege
         resp, server = self.client.reset_state(self.s1_id, state='error')
         self.assertEqual(202, resp.status)
         resp, rebuilt_server = self.non_admin_client.rebuild(
@@ -170,4 +177,6 @@
 
 
 class ServersAdminTestXML(ServersAdminTestJSON):
+    _host_key = (
+        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 16dcfcc..ac800fb 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -30,7 +30,6 @@
     def setUpClass(cls):
         super(ServicesAdminTestJSON, cls).setUpClass()
         cls.client = cls.os_adm.services_client
-        cls.non_admin_client = cls.services_client
 
     @attr(type='gate')
     def test_list_services(self):
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index fd069e7..9162926 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -51,6 +51,7 @@
         cls.servers = []
         cls.images = []
         cls.multi_user = cls.get_multi_user()
+        cls.security_groups = []
 
     @classmethod
     def get_multi_user(cls):
@@ -102,9 +103,25 @@
                 pass
 
     @classmethod
+    def clear_security_groups(cls):
+        for sg in cls.security_groups:
+            try:
+                resp, body =\
+                    cls.security_groups_client.delete_security_group(sg['id'])
+            except exceptions.NotFound:
+                # The security group may have already been deleted which is OK.
+                pass
+            except Exception as exc:
+                LOG.info('Exception raised deleting security group %s',
+                         sg['id'])
+                LOG.exception(exc)
+                pass
+
+    @classmethod
     def tearDownClass(cls):
         cls.clear_images()
         cls.clear_servers()
+        cls.clear_security_groups()
         cls.clear_isolated_creds()
         super(BaseComputeTest, cls).tearDownClass()
 
@@ -146,6 +163,19 @@
 
         return resp, body
 
+    @classmethod
+    def create_security_group(cls, name=None, description=None):
+        if name is None:
+            name = data_utils.rand_name(cls.__name__ + "-securitygroup")
+        if description is None:
+            description = data_utils.rand_name('description-')
+        resp, body = \
+            cls.security_groups_client.create_security_group(name,
+                                                             description)
+        cls.security_groups.append(body)
+
+        return resp, body
+
     def wait_for(self, condition):
         """Repeatedly calls condition() until a timeout."""
         start_time = int(time.time())
@@ -273,6 +303,8 @@
 
 class BaseV3ComputeTest(BaseComputeTest):
 
+    _interface = "json"
+
     @classmethod
     def setUpClass(cls):
         # By default compute tests do not create network resources
@@ -296,11 +328,8 @@
         cls.extensions_client = cls.os.extensions_v3_client
         cls.availability_zone_client = cls.os.availability_zone_v3_client
         cls.interfaces_client = cls.os.interfaces_v3_client
-        cls.instance_usages_audit_log_client = \
-            cls.os.instance_usages_audit_log_v3_client
         cls.hypervisor_client = cls.os.hypervisor_v3_client
         cls.keypairs_client = cls.os.keypairs_v3_client
-        cls.tenant_usages_client = cls.os.tenant_usages_v3_client
         cls.volumes_client = cls.os.volumes_client
         cls.certificates_client = cls.os.certificates_v3_client
         cls.keypairs_client = cls.os.keypairs_v3_client
@@ -372,13 +401,10 @@
 
         cls.os_adm = os_adm
         cls.servers_admin_client = cls.os_adm.servers_v3_client
-        cls.instance_usages_audit_log_admin_client = \
-            cls.os_adm.instance_usages_audit_log_v3_client
         cls.services_admin_client = cls.os_adm.services_v3_client
         cls.availability_zone_admin_client = \
             cls.os_adm.availability_zone_v3_client
         cls.hypervisor_admin_client = cls.os_adm.hypervisor_v3_client
-        cls.tenant_usages_admin_client = cls.os_adm.tenant_usages_v3_client
         cls.flavors_admin_client = cls.os_adm.flavors_v3_client
         cls.aggregates_admin_client = cls.os_adm.aggregates_v3_client
         cls.hosts_admin_client = cls.os_adm.hosts_v3_client
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 56bd291..ea785b3 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -14,9 +14,9 @@
 #    under the License.
 
 from tempest.api.compute.floating_ips import base
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
@@ -44,7 +44,7 @@
         resp, body = cls.client.delete_floating_ip(cls.floating_ip_id)
         super(FloatingIPsTestJSON, cls).tearDownClass()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_allocate_floating_ip(self):
         # Positive test:Allocation of a new floating IP to a project
         # should be successful
@@ -59,7 +59,7 @@
         resp, body = self.client.list_floating_ips()
         self.assertIn(floating_ip_details, body)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_floating_ip(self):
         # Positive test:Deletion of valid floating IP from project
         # should be successful
@@ -74,7 +74,7 @@
         # Check it was really deleted.
         self.client.wait_for_resource_deletion(floating_ip_body['id'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_disassociate_floating_ip(self):
         # Positive test:Associate and disassociate the provided floating IP
         # to a specific server should be successful
@@ -90,12 +90,12 @@
             self.server_id)
         self.assertEqual(202, resp.status)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_already_associated_floating_ip(self):
         # positive test:Association of an already associated floating IP
         # to specific server should change the association of the Floating IP
         # Create server so as to use for Multiple association
-        new_name = rand_name('floating_server')
+        new_name = data_utils.rand_name('floating_server')
         resp, body = self.create_test_server(name=new_name)
         self.servers_client.wait_for_server_status(body['id'], 'ACTIVE')
         self.new_server_id = body['id']
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 4cc36c9..8964dcf 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -13,11 +13,10 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -36,18 +35,6 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def tearDown(self):
         """Terminate test instances created after a test is executed."""
         for image_id in self.image_ids:
@@ -62,7 +49,7 @@
         self.image_ids.append(image_id)
         return resp, body
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_deleted_server(self):
         # An image should not be created if the server instance is removed
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -77,7 +64,7 @@
                           self.__create_image__,
                           server['id'], name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_invalid_server(self):
         # An image should not be created with invalid server id
         # Create a new image with invalid server id
@@ -88,7 +75,7 @@
         self.assertRaises(exceptions.NotFound, self.__create_image__,
                           '!@#$%^&*()', name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_stopped_server(self):
         resp, server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.stop(server['id'])
@@ -103,7 +90,7 @@
         self.addCleanup(self.client.delete_image, image['id'])
         self.assertEqual(snapshot_name, image['name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_saving_image(self):
         snapshot_name = data_utils.rand_name('test-snap-')
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -114,7 +101,7 @@
         resp, body = self.client.delete_image(image['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_35_characters_or_less(self):
         # Return an error if Image ID passed is 35 characters or less
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -122,7 +109,7 @@
         self.assertRaises(exceptions.NotFound, self.client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_37_characters_or_more(self):
         # Return an error if Image ID passed is 37 characters or more
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -130,13 +117,13 @@
         self.assertRaises(exceptions.NotFound, self.client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_with_invalid_image_id(self):
         # An image should not be deleted with invalid image id
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           '!@$%^&*()')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_non_existent_image(self):
         # Return an error while trying to delete a non-existent image
 
@@ -144,24 +131,24 @@
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           non_existent_image_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_blank_id(self):
         # Return an error while trying to delete an image with blank Id
         self.assertRaises(exceptions.NotFound, self.client.delete_image, '')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_non_hex_string_id(self):
         # Return an error while trying to delete an image with non hex id
         image_id = '11a22b9-120q-5555-cc11-00ab112223gj'
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
                           image_id)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_negative_image_id(self):
         # Return an error while trying to delete an image with negative id
         self.assertRaises(exceptions.NotFound, self.client.delete_image, -1)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_id_is_over_35_character_limit(self):
         # Return an error while trying to delete image with id over limit
         self.assertRaises(exceptions.NotFound, self.client.delete_image,
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 8d60623..7d5593d 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -16,11 +16,10 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -29,13 +28,6 @@
 class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
 
-    def tearDown(self):
-        """Terminate test instances created after a test is executed."""
-        for image_id in self.image_ids:
-            self.client.delete_image(image_id)
-            self.image_ids.remove(image_id)
-        super(ImagesOneServerTestJSON, self).tearDown()
-
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
@@ -66,27 +58,13 @@
             cls.tearDownClass()
             raise
 
-        cls.image_ids = []
-
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def _get_default_flavor_disk_size(self, flavor_id):
         resp, flavor = self.flavors_client.get_flavor_details(flavor_id)
         return flavor['disk']
 
     @testtools.skipUnless(CONF.compute_feature_enabled.create_image,
                           'Environment unable to create images.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_delete_image(self):
 
         # Create a new image
@@ -117,7 +95,7 @@
         self.assertEqual('204', resp['status'])
         self.client.wait_for_resource_deletion(image_id)
 
-    @attr(type=['gate'])
+    @test.attr(type=['gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         if self.__class__._interface == "xml":
             # NOTE(sdague): not entirely accurage, but we'd need a ton of work
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index c96c4a4..82955d8 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -15,13 +15,11 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -73,20 +71,8 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
-    @skip_because(bug="1006725")
-    @attr(type=['negative', 'gate'])
+    @test.skip_because(bug="1006725")
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         if self.__class__._interface == "xml":
             raise self.skipException("Not testable in XML")
@@ -98,7 +84,7 @@
                           self.client.create_image, self.server_id,
                           invalid_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_invalid_metadata(self):
         # Return an error when creating image with invalid metadata
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -106,7 +92,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_metadata_over_limits(self):
         # Return an error when creating image with meta data over 256 chars
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -114,7 +100,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_second_image_when_first_image_is_being_saved(self):
         # Disallow creating another image when first image is being saved
 
@@ -132,7 +118,7 @@
         self.assertRaises(exceptions.Conflict, self.client.create_image,
                           self.server_id, alt_snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_name_over_256_chars(self):
         # Return an error if snapshot name over 256 characters is passed
 
@@ -140,7 +126,7 @@
         self.assertRaises(exceptions.BadRequest, self.client.create_image,
                           self.server_id, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_that_is_not_yet_active(self):
         # Return an error while trying to delete an image what is creating
 
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index f82143e..9cff3a8 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -15,9 +15,8 @@
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -34,7 +33,6 @@
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
         cls.client = cls.images_client
-        cls.image_ids = []
 
         try:
             resp, cls.server1 = cls.create_test_server()
@@ -64,13 +62,7 @@
             cls.tearDownClass()
             raise
 
-    @attr(type=['negative', 'gate'])
-    def test_get_image_not_existing(self):
-        # Check raises a NotFound
-        self.assertRaises(exceptions.NotFound, self.client.get_image,
-                          "nonexistingimageid")
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_status(self):
         # The list of images should contain only images with the
         # provided status
@@ -81,7 +73,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_name(self):
         # List of all images should contain the expected images filtered
         # by name
@@ -92,7 +84,7 @@
         self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_server_id(self):
         # The images should contain images filtered by server id
         params = {'server': self.server1['id']}
@@ -104,7 +96,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_server_ref(self):
         # The list of servers should be filtered by server ref
         server_links = self.server2['links']
@@ -121,7 +113,7 @@
             self.assertTrue(any([i for i in images
                                  if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_type(self):
         # The list of servers should be filtered by image type
         params = {'type': 'snapshot'}
@@ -132,7 +124,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_limit_results(self):
         # Verify only the expected number of results are returned
         params = {'limit': '1'}
@@ -141,7 +133,7 @@
         # ref: Question #224349
         self.assertEqual(1, len([x for x in images if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_filter_by_changes_since(self):
         # Verify only updated images are returned in the detailed list
 
@@ -152,7 +144,7 @@
         found = any([i for i in images if i['id'] == self.image3_id])
         self.assertTrue(found)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_status(self):
         # Detailed list of all images should only contain images
         # with the provided status
@@ -163,7 +155,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_name(self):
         # Detailed list of all images should contain the expected
         # images filtered by name
@@ -174,7 +166,7 @@
         self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_limit_results(self):
         # Verify only the expected number of results (with full details)
         # are returned
@@ -182,7 +174,7 @@
         resp, images = self.client.list_images_with_detail(params)
         self.assertEqual(1, len(images))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_server_ref(self):
         # Detailed list of servers should be filtered by server ref
         server_links = self.server2['links']
@@ -199,7 +191,7 @@
             self.assertTrue(any([i for i in images
                                  if i['id'] == self.image3_id]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_type(self):
         # The detailed list of servers should be filtered by image type
         params = {'type': 'snapshot'}
@@ -211,7 +203,7 @@
         self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
         self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_images_with_detail_filter_by_changes_since(self):
         # Verify an update image is returned
 
@@ -221,11 +213,6 @@
         resp, images = self.client.list_images_with_detail(params)
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
 
-    @attr(type=['negative', 'gate'])
-    def test_get_nonexistent_image(self):
-        # Negative test: GET on non-existent image should fail
-        self.assertRaises(exceptions.NotFound, self.client.get_image, 999)
-
 
 class ListImageFiltersTestXML(ListImageFiltersTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/images/test_list_image_filters_negative.py b/tempest/api/compute/images/test_list_image_filters_negative.py
new file mode 100644
index 0000000..3b19d3c
--- /dev/null
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -0,0 +1,44 @@
+# Copyright 2014 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class ListImageFiltersNegativeTestJSON(base.BaseV2ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(ListImageFiltersNegativeTestJSON, cls).setUpClass()
+        if not CONF.service_available.glance:
+            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
+            raise cls.skipException(skip_msg)
+        cls.client = cls.images_client
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_nonexistent_image(self):
+        # Check raises a NotFound
+        nonexistent_image = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound, self.client.get_image,
+                          nonexistent_image)
+
+
+class ListImageFiltersNegativeTestXML(ListImageFiltersNegativeTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index 375105e..17bb489 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -14,9 +14,8 @@
 #    under the License.
 
 from tempest.api.compute.security_groups import base
-from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -30,17 +29,13 @@
         cls.client = cls.security_groups_client
         cls.neutron_available = CONF.service_available.neutron
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_create(self):
         # Positive test: Creation of Security Group rule
         # should be successful
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        securitygroup_id = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, securitygroup_id)
+        resp, security_group = self.create_security_group()
+        securitygroup_id = security_group['id']
         # Adding rules to the created Security Group
         ip_protocol = 'tcp'
         from_port = 22
@@ -53,7 +48,7 @@
         self.addCleanup(self.client.delete_security_group_rule, rule['id'])
         self.assertEqual(200, resp.status)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_create_with_optional_arguments(self):
         # Positive test: Creation of Security Group rule
         # with optional arguments
@@ -62,19 +57,11 @@
         secgroup1 = None
         secgroup2 = None
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        secgroup1 = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, secgroup1)
+        resp, security_group = self.create_security_group()
+        secgroup1 = security_group['id']
         # Creating a Security Group so as to assign group_id to the rule
-        s_name2 = data_utils.rand_name('securitygroup-')
-        s_description2 = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name2, s_description2)
-        secgroup2 = securitygroup['id']
-        self.addCleanup(self.client.delete_security_group, secgroup2)
+        resp, security_group = self.create_security_group()
+        secgroup2 = security_group['id']
         # Adding rules to the created Security Group with optional arguments
         parent_group_id = secgroup1
         ip_protocol = 'tcp'
@@ -92,18 +79,13 @@
         self.addCleanup(self.client.delete_security_group_rule, rule['id'])
         self.assertEqual(200, resp.status)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_list(self):
         # Positive test: Created Security Group rules should be
         # in the list of all rules
         # Creating a Security Group to add rules to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        securitygroup_id = securitygroup['id']
-        # Delete the Security Group at the end of this method
-        self.addCleanup(self.client.delete_security_group, securitygroup_id)
+        resp, security_group = self.create_security_group()
+        securitygroup_id = security_group['id']
 
         # Add a first rule to the created Security Group
         ip_protocol1 = 'tcp'
@@ -135,29 +117,21 @@
         self.assertTrue(any([i for i in rules if i['id'] == rule1_id]))
         self.assertTrue(any([i for i in rules if i['id'] == rule2_id]))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_security_group_rules_delete_when_peer_group_deleted(self):
         # Positive test:rule will delete when peer group deleting
         # Creating a Security Group to add rules to it
-        s1_name = data_utils.rand_name('securitygroup1-')
-        s1_description = data_utils.rand_name('description1-')
-        resp, sg1 = \
-            self.client.create_security_group(s1_name, s1_description)
-        self.addCleanup(self.client.delete_security_group, sg1['id'])
-        self.assertEqual(200, resp.status)
+        resp, security_group = self.create_security_group()
+        sg1_id = security_group['id']
         # Creating other Security Group to access to group1
-        s2_name = data_utils.rand_name('securitygroup2-')
-        s2_description = data_utils.rand_name('description2-')
-        resp, sg2 = \
-            self.client.create_security_group(s2_name, s2_description)
-        self.assertEqual(200, resp.status)
-        sg2_id = sg2['id']
+        resp, security_group = self.create_security_group()
+        sg2_id = security_group['id']
         # Adding rules to the Group1
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 22
         resp, rule = \
-            self.client.create_security_group_rule(sg1['id'],
+            self.client.create_security_group_rule(sg1_id,
                                                    ip_protocol,
                                                    from_port,
                                                    to_port,
@@ -169,7 +143,7 @@
         self.assertEqual(202, resp.status)
         # Get rules of the Group1
         resp, rules = \
-            self.client.list_security_group_rules(sg1['id'])
+            self.client.list_security_group_rules(sg1_id)
         # The group1 has no rules because group2 has deleted
         self.assertEqual(0, len(rules))
 
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index 4831939..9c9e72c 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -13,18 +13,22 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import testtools
-
 from tempest.api.compute.security_groups import base
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
 
+def not_existing_id():
+    if CONF.service_available.neutron:
+        return data_utils.rand_uuid()
+    else:
+        return data_utils.rand_int_id(start=999)
+
+
 class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
     _interface = 'json'
 
@@ -33,14 +37,12 @@
         super(SecurityGroupRulesNegativeTestJSON, cls).setUpClass()
         cls.client = cls.security_groups_client
 
-    @skip_because(bug="1182384",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_non_existent_id(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with non existent Parent group id
         # Adding rules to the non existent Security Group id
-        parent_group_id = data_utils.rand_int_id(start=999)
+        parent_group_id = not_existing_id()
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 22
@@ -48,9 +50,7 @@
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @testtools.skipIf(CONF.service_available.neutron,
-                      "Neutron not check the security_group_id")
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_id(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with Parent group id which is not integer
@@ -63,21 +63,17 @@
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_duplicate(self):
         # Negative test: Create Security Group rule duplicate should fail
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, sg = self.client.create_security_group(s_name, s_description)
-        self.assertEqual(200, resp.status)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
         parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 22
 
-        self.addCleanup(self.client.delete_security_group, sg['id'])
         resp, rule = \
             self.client.create_security_group_rule(parent_group_id,
                                                    ip_protocol,
@@ -90,90 +86,72 @@
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_ip_protocol(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid ip_protocol
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = data_utils.rand_name('999')
         from_port = 22
         to_port = 22
 
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_from_port(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid from_port
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = data_utils.rand_int_id(start=65536)
         to_port = 22
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_to_port(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid to_port
         # Creating a Security Group to add rule to it
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding rules to the created Security Group
-        parent_group_id = securitygroup['id']
+        parent_group_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = data_utils.rand_int_id(start=65536)
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           parent_group_id, ip_protocol, from_port, to_port)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_invalid_port_range(self):
         # Negative test: Creation of Security Group rule should FAIL
         # with invalid port range.
         # Creating a Security Group to add rule to it.
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = self.client.create_security_group(s_name,
-                                                                s_description)
+        resp, sg = self.create_security_group()
         # Adding a rule to the created Security Group
-        secgroup_id = securitygroup['id']
+        secgroup_id = sg['id']
         ip_protocol = 'tcp'
         from_port = 22
         to_port = 21
-        self.addCleanup(self.client.delete_security_group, securitygroup['id'])
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group_rule,
                           secgroup_id, ip_protocol, from_port, to_port)
 
-    @skip_because(bug="1182384",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_delete_security_group_rule_with_non_existent_id(self):
         # Negative test: Deletion of Security Group rule should be FAIL
         # with non existent id
-        non_existent_rule_id = data_utils.rand_int_id(start=999)
+        non_existent_rule_id = not_existing_id()
         self.assertRaises(exceptions.NotFound,
                           self.client.delete_security_group_rule,
                           non_existent_rule_id)
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 2c67581..b376edc 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -27,68 +27,43 @@
         super(SecurityGroupsTestJSON, cls).setUpClass()
         cls.client = cls.security_groups_client
 
-    def _delete_security_group(self, securitygroup_id):
-        resp, _ = self.client.delete_security_group(securitygroup_id)
-        self.assertEqual(202, resp.status)
-
     @test.attr(type='gate')
     def test_security_groups_create_list_delete(self):
         # Positive test:Should return the list of Security Groups
         # Create 3 Security Groups
-        security_group_list = list()
         for i in range(3):
-            s_name = data_utils.rand_name('securitygroup-')
-            s_description = data_utils.rand_name('description-')
-            resp, securitygroup = \
-                self.client.create_security_group(s_name, s_description)
+            resp, securitygroup = self.create_security_group()
             self.assertEqual(200, resp.status)
-            self.addCleanup(self._delete_security_group,
-                            securitygroup['id'])
-            security_group_list.append(securitygroup)
         # Fetch all Security Groups and verify the list
         # has all created Security Groups
         resp, fetched_list = self.client.list_security_groups()
         self.assertEqual(200, resp.status)
         # Now check if all the created Security Groups are in fetched list
         missing_sgs = \
-            [sg for sg in security_group_list if sg not in fetched_list]
+            [sg for sg in self.security_groups if sg not in fetched_list]
         self.assertFalse(missing_sgs,
                          "Failed to find Security Group %s in fetched "
                          "list" % ', '.join(m_group['name']
                                             for m_group in missing_sgs))
-
-    # TODO(afazekas): scheduled for delete,
-    # test_security_group_create_get_delete covers it
-    @test.attr(type='gate')
-    def test_security_group_create_delete(self):
-        # Security Group should be created, verified and deleted
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        self.assertIn('id', securitygroup)
-        securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
-        self.assertEqual(200, resp.status)
-        self.assertFalse(securitygroup_id is None)
-        self.assertIn('name', securitygroup)
-        securitygroup_name = securitygroup['name']
-        self.assertEqual(securitygroup_name, s_name,
-                         "The created Security Group name is "
-                         "not equal to the requested name")
+        # Delete all security groups
+        for sg in self.security_groups:
+            resp, _ = self.client.delete_security_group(sg['id'])
+            self.assertEqual(202, resp.status)
+            self.client.wait_for_resource_deletion(sg['id'])
+        # Now check if all the created Security Groups are deleted
+        resp, fetched_list = self.client.list_security_groups()
+        deleted_sgs = \
+            [sg for sg in self.security_groups if sg in fetched_list]
+        self.assertFalse(deleted_sgs,
+                         "Failed to delete Security Group %s "
+                         "list" % ', '.join(m_group['name']
+                                            for m_group in deleted_sgs))
 
     @test.attr(type='gate')
     def test_security_group_create_get_delete(self):
         # Security Group should be created, fetched and deleted
         s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
-        self.addCleanup(self._delete_security_group,
-                        securitygroup['id'])
-
-        self.assertEqual(200, resp.status)
+        resp, securitygroup = self.create_security_group(name=s_name)
         self.assertIn('name', securitygroup)
         securitygroup_name = securitygroup['name']
         self.assertEqual(securitygroup_name, s_name,
@@ -108,15 +83,8 @@
         # and not deleted if the server is active.
         # Create a couple security groups that we will use
         # for the server resource this test creates
-        sg_name = data_utils.rand_name('sg')
-        sg_desc = data_utils.rand_name('sg-desc')
-        resp, sg = self.client.create_security_group(sg_name, sg_desc)
-        sg_id = sg['id']
-
-        sg2_name = data_utils.rand_name('sg')
-        sg2_desc = data_utils.rand_name('sg-desc')
-        resp, sg2 = self.client.create_security_group(sg2_name, sg2_desc)
-        sg2_id = sg2['id']
+        resp, sg = self.create_security_group()
+        resp, sg2 = self.create_security_group()
 
         # Create server and add the security group created
         # above to the server we just created
@@ -125,50 +93,44 @@
         server_id = server['id']
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         resp, body = self.servers_client.add_security_group(server_id,
-                                                            sg_name)
+                                                            sg['name'])
 
         # Check that we are not able to delete the security
         # group since it is in use by an active server
         self.assertRaises(exceptions.BadRequest,
                           self.client.delete_security_group,
-                          sg_id)
+                          sg['id'])
 
         # Reboot and add the other security group
         resp, body = self.servers_client.reboot(server_id, 'HARD')
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         resp, body = self.servers_client.add_security_group(server_id,
-                                                            sg2_name)
+                                                            sg2['name'])
 
         # Check that we are not able to delete the other security
         # group since it is in use by an active server
         self.assertRaises(exceptions.BadRequest,
                           self.client.delete_security_group,
-                          sg2_id)
+                          sg2['id'])
 
         # Shutdown the server and then verify we can destroy the
         # security groups, since no active server instance is using them
         self.servers_client.delete_server(server_id)
         self.servers_client.wait_for_server_termination(server_id)
 
-        self.client.delete_security_group(sg_id)
+        self.client.delete_security_group(sg['id'])
         self.assertEqual(202, resp.status)
-
-        self.client.delete_security_group(sg2_id)
+        self.client.delete_security_group(sg2['id'])
         self.assertEqual(202, resp.status)
 
     @test.attr(type='gate')
     def test_update_security_groups(self):
         # Update security group name and description
         # Create a security group
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update the name and description
         s_new_name = data_utils.rand_name('sg-hth-')
         s_new_des = data_utils.rand_name('description-hth-')
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index ce1eada..edf38e9 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -33,10 +33,6 @@
         cls.client = cls.security_groups_client
         cls.neutron_available = CONF.service_available.neutron
 
-    def _delete_security_group(self, securitygroup_id):
-        resp, _ = self.client.delete_security_group(securitygroup_id)
-        self.assertEqual(202, resp.status)
-
     def _generate_a_non_existent_security_group_id(self):
         security_group_id = []
         resp, body = self.client.list_security_groups()
@@ -107,11 +103,8 @@
         s_name = data_utils.rand_name('securitygroup-')
         s_description = data_utils.rand_name('description-')
         resp, security_group =\
-            self.client.create_security_group(s_name, s_description)
+            self.create_security_group(s_name, s_description)
         self.assertEqual(200, resp.status)
-
-        self.addCleanup(self.client.delete_security_group,
-                        security_group['id'])
         # Now try the Security Group with the same 'Name'
         self.assertRaises(exceptions.BadRequest,
                           self.client.create_security_group, s_name,
@@ -163,15 +156,10 @@
     @test.attr(type=['negative', 'gate'])
     def test_update_security_group_with_invalid_sg_name(self):
         # Update security_group with invalid sg_name should fail
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update Security Group with group name longer than 255 chars
         s_new_name = 'securitygroup-'.ljust(260, '0')
         self.assertRaises(exceptions.BadRequest,
@@ -183,15 +171,10 @@
     @test.attr(type=['negative', 'gate'])
     def test_update_security_group_with_invalid_sg_des(self):
         # Update security_group with invalid sg_des should fail
-        s_name = data_utils.rand_name('sg-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup = \
-            self.client.create_security_group(s_name, s_description)
+        resp, securitygroup = self.create_security_group()
         self.assertEqual(200, resp.status)
         self.assertIn('id', securitygroup)
         securitygroup_id = securitygroup['id']
-        self.addCleanup(self._delete_security_group,
-                        securitygroup_id)
         # Update Security Group with group description longer than 255 chars
         s_new_des = 'des-'.ljust(260, '0')
         self.assertRaises(exceptions.BadRequest,
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
new file mode 100644
index 0000000..748ba41
--- /dev/null
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -0,0 +1,42 @@
+# Copyright 2014 NEC Corporation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class AZTestJSON(base.BaseV2ComputeTest):
+
+    """
+    Tests Availability Zone API List
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(AZTestJSON, cls).setUpClass()
+        cls.client = cls.availability_zone_client
+
+    @test.attr(type='gate')
+    def test_get_availability_zone_list_with_non_admin_user(self):
+        # List of availability zone with non-administrator user
+        resp, availability_zone = self.client.get_availability_zone_list()
+        self.assertEqual(200, resp.status)
+        self.assertTrue(len(availability_zone) > 0)
+
+
+class AZTestXML(AZTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 887608f..f705308 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -20,9 +20,9 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -54,14 +54,14 @@
         cls.client.wait_for_server_status(cls.server_initial['id'], 'ACTIVE')
         resp, cls.server = cls.client.get_server(cls.server_initial['id'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_server_response(self):
         # Check that the required fields are returned with values
         self.assertEqual(202, self.resp.status)
         self.assertTrue(self.server_initial['id'] is not None)
         self.assertTrue(self.server_initial['adminPass'] is not None)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_verify_server_details(self):
         # Verify the specified server attributes are set correctly
         self.assertEqual(self.accessIPv4, self.server['accessIPv4'])
@@ -74,7 +74,7 @@
         self.assertEqual(self.flavor_ref, self.server['flavor']['id'])
         self.assertEqual(self.meta, self.server['metadata'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_servers(self):
         # The created server should be in the list of all servers
         resp, body = self.client.list_servers()
@@ -82,7 +82,7 @@
         found = any([i for i in servers if i['id'] == self.server['id']])
         self.assertTrue(found)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_servers_with_detail(self):
         # The created server should be in the detailed list of all servers
         resp, body = self.client.list_servers_with_detail()
@@ -91,19 +91,21 @@
         self.assertTrue(found)
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_verify_created_server_vcpus(self):
         # Verify that the number of vcpus reported by the instance matches
         # the amount stated by the flavor
         resp, flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
+                                                  self.password)
         self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_host_name_is_same_as_server_name(self):
         # Verify the instance host name is the same as the server name
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
+                                                  self.password)
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
 
@@ -136,7 +138,7 @@
         resp, cls.server = cls.client.get_server(cls.server_initial['id'])
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_verify_created_server_ephemeral_disk(self):
         # Verify that the ephemeral disk is created when creating server
 
@@ -196,12 +198,12 @@
                                       adminPass=admin_pass,
                                       flavor=flavor_with_eph_disk_id))
         # Get partition number of server without extra specs.
-        linux_client = RemoteClient(server_no_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_no_eph_disk,
+                                                  self.ssh_user, self.password)
         partition_num = len(linux_client.get_partitions())
 
-        linux_client = RemoteClient(server_with_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_with_eph_disk,
+                                                  self.ssh_user, self.password)
         self.assertEqual(partition_num + 1, linux_client.get_partitions())
 
 
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
new file mode 100644
index 0000000..6c0e37c
--- /dev/null
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -0,0 +1,128 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class DeleteServersTestJSON(base.BaseV2ComputeTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances"
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersTestJSON, cls).setUpClass()
+        cls.client = cls.servers_client
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_building_state(self):
+        # Delete a server while it's VM state is Building
+        resp, server = self.create_test_server(wait_until='BUILD')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_active_server(self):
+        # Delete a server while it's VM state is Active
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_shelved_state(self):
+        # Delete a server while it's VM state is Shelved
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.shelve_server(server['id'])
+        self.assertEqual(202, resp.status)
+
+        offload_time = CONF.compute.shelved_offload_time
+        if offload_time >= 0:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED_OFFLOADED',
+                                               extra_timeout=offload_time)
+        else:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+
+class DeleteServersAdminTestJSON(base.BaseV2ComputeAdminTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersAdminTestJSON, cls).setUpClass()
+        cls.non_admin_client = cls.servers_client
+        cls.admin_client = cls.os_adm.servers_client
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.admin_client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.non_admin_client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.non_admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'],
+                                                        ignore_error=True)
+
+    @test.attr(type='gate')
+    def test_admin_delete_servers_of_others(self):
+        # Administrator can delete servers of others
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'])
+
+
+class DeleteServersTestXML(DeleteServersTestJSON):
+    _interface = 'xml'
+
+
+class DeleteServersAdminTestXML(DeleteServersAdminTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 15b7b9e..fc0bb9f 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -18,8 +18,7 @@
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -74,7 +73,7 @@
         cls.fixed_network_name = CONF.compute.fixed_network_name
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_image(self):
         # Filter the list of servers by image
         params = {'image': self.image_ref}
@@ -85,7 +84,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_flavor(self):
         # Filter the list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -96,7 +95,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_name(self):
         # Filter the list of servers by server name
         params = {'name': self.s1_name}
@@ -107,7 +106,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_status(self):
         # Filter the list of servers by server status
         params = {'status': 'active'}
@@ -118,7 +117,7 @@
         self.assertIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_shutoff_status(self):
         # Filter the list of servers by server shutoff status
         params = {'status': 'shutoff'}
@@ -135,7 +134,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertNotIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 1}
@@ -143,14 +142,14 @@
         # when _interface='xml', one element for servers_links in servers
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_zero_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 0}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(0, len(servers['servers']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_exceed_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 100000}
@@ -160,7 +159,7 @@
                          len([x for x in servers['servers'] if 'id' in x]))
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
         # Filter the detailed list of servers by image
         params = {'image': self.image_ref}
@@ -171,7 +170,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_flavor(self):
         # Filter the detailed list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -182,7 +181,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_name(self):
         # Filter the detailed list of servers by server name
         params = {'name': self.s1_name}
@@ -193,7 +192,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_status(self):
         # Filter the detailed list of servers by server status
         params = {'status': 'active'}
@@ -205,7 +204,7 @@
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
         self.assertEqual(['ACTIVE'] * 3, [x['status'] for x in servers])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_name_wildcard(self):
         # List all servers that contains '-instance' in name
         params = {'name': '-instance'}
@@ -227,8 +226,8 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1170718")
-    @attr(type='gate')
+    @test.skip_because(bug="1170718")
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip(self):
         # Filter servers by ip
         # Here should be listed 1 server
@@ -242,9 +241,9 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1182883",
-                  condition=CONF.service_available.neutron)
-    @attr(type='gate')
+    @test.skip_because(bug="1182883",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip_regex(self):
         # Filter servers by regex ip
         # List all servers filtered by part of ip address.
@@ -259,7 +258,7 @@
         self.assertIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_limit_results(self):
         # Verify only the expected number of detailed results are returned
         params = {'limit': 1}
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index f113047..adf522b 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -20,11 +20,10 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -53,7 +52,7 @@
 
     @testtools.skipUnless(CONF.compute_feature_enabled.change_password,
                           'Change password not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_change_server_password(self):
         # The server's password should be set to the provided password
         new_password = 'Newpass1234'
@@ -64,16 +63,18 @@
         if self.run_ssh:
             # Verify that the user can authenticate with the new password
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, new_password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      new_password)
             linux_client.validate_authentication()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_reboot_server_hard(self):
         # The server should be power cycled
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -82,19 +83,21 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertTrue(new_boot_time > boot_time,
                             '%s > %s' % (new_boot_time, boot_time))
 
-    @skip_because(bug="1014647")
-    @attr(type='smoke')
+    @test.skip_because(bug="1014647")
+    @test.attr(type='smoke')
     def test_reboot_server_soft(self):
         # The server should be signaled to reboot gracefully
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'SOFT')
@@ -103,12 +106,13 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertTrue(new_boot_time > boot_time,
                             '%s > %s' % (new_boot_time, boot_time))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_rebuild_server(self):
         # The server should be rebuilt using the provided image and data
         meta = {'rebuild': 'server'}
@@ -140,10 +144,11 @@
 
         if self.run_ssh:
             # Verify that the user can authenticate with the provided password
-            linux_client = RemoteClient(server, self.ssh_user, password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      password)
             linux_client.validate_authentication()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_stop_state(self):
         # The server in stop state  should be rebuilt using the provided
         # image and remain in SHUTOFF state
@@ -181,7 +186,7 @@
         return current_flavor, new_flavor_ref
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_resize_server_confirm(self):
         # The server's RAM and disk space should be modified to that of
         # the provided flavor
@@ -200,7 +205,7 @@
         self.assertEqual(new_flavor_ref, server['flavor']['id'])
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_resize_server_revert(self):
         # The server's RAM and disk space should return to its original
         # values after a resize is reverted
@@ -228,7 +233,7 @@
                 required time (%s s).' % (self.server_id, self.build_timeout)
                 raise exceptions.TimeoutException(message)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
@@ -313,7 +318,7 @@
         lines = len(output.split('\n'))
         self.assertEqual(lines, 10)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id and number of lines
@@ -329,7 +334,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output_server_id_in_shutoff_status(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id in SHUTOFF status
@@ -346,7 +351,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_pause_unpause_server(self):
         resp, server = self.client.pause_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -355,7 +360,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_suspend_resume_server(self):
         resp, server = self.client.suspend_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -364,7 +369,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_shelve_unshelve_server(self):
         resp, server = self.client.shelve_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -389,7 +394,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_stop_start_server(self):
         resp, server = self.servers_client.stop(self.server_id)
         self.assertEqual(202, resp.status)
@@ -398,7 +403,7 @@
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_lock_unlock_server(self):
         # Lock the server,try server stop(exceptions throw),unlock it and retry
         resp, server = self.servers_client.lock_server(self.server_id)
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index 8e432c4..d5528c4 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -14,8 +14,11 @@
 #    under the License.
 
 from tempest.api.compute import base
+from tempest import config
 from tempest import test
 
+CONF = config.CONF
+
 
 class ServerAddressesTestJSON(base.BaseV2ComputeTest):
     _interface = 'json'
@@ -29,6 +32,8 @@
 
         resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
 
+    @test.skip_because(bug="1210483",
+                       condition=CONF.service_available.neutron)
     @test.attr(type='smoke')
     def test_list_server_addresses(self):
         # All public and private addresses for
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 0bf604c..826317d 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -15,8 +15,7 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class ServerRescueTestJSON(base.BaseV2ComputeTest):
@@ -26,7 +25,6 @@
     def setUpClass(cls):
         cls.set_network_resources(network=True, subnet=True, router=True)
         super(ServerRescueTestJSON, cls).setUpClass()
-        cls.device = 'vdf'
 
         # Floating IP creation
         resp, body = cls.floating_ips_client.create_floating_ip()
@@ -54,14 +52,6 @@
         cls.password = server['adminPass']
         cls.servers_client.wait_for_server_status(cls.server_id, 'ACTIVE')
 
-        # Server for negative tests
-        cls.rescue_id = resc_server['id']
-        cls.rescue_password = resc_server['adminPass']
-
-        cls.servers_client.rescue_server(
-            cls.rescue_id, adminPass=cls.rescue_password)
-        cls.servers_client.wait_for_server_status(cls.rescue_id, 'RESCUE')
-
     def setUp(self):
         super(ServerRescueTestJSON, self).setUp()
 
@@ -77,22 +67,12 @@
     def tearDown(self):
         super(ServerRescueTestJSON, self).tearDown()
 
-    def _detach(self, server_id, volume_id):
-        self.servers_client.detach_volume(server_id, volume_id)
-        self.volumes_extensions_client.wait_for_volume_status(volume_id,
-                                                              'available')
-
     def _unrescue(self, server_id):
         resp, body = self.servers_client.unrescue_server(server_id)
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
 
-    def _unpause(self, server_id):
-        resp, body = self.servers_client.unpause_server(server_id)
-        self.assertEqual(202, resp.status)
-        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
-
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_rescue_unrescue_instance(self):
         resp, body = self.servers_client.rescue_server(
             self.server_id, adminPass=self.password)
@@ -102,76 +82,7 @@
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type=['negative', 'gate'])
-    def test_rescue_paused_instance(self):
-        # Rescue a paused server
-        resp, body = self.servers_client.pause_server(
-            self.server_id)
-        self.addCleanup(self._unpause, self.server_id)
-        self.assertEqual(202, resp.status)
-        self.servers_client.wait_for_server_status(self.server_id, 'PAUSED')
-        self.assertRaises(exceptions.Conflict,
-                          self.servers_client.rescue_server,
-                          self.server_id)
-
-    @attr(type=['negative', 'gate'])
-    def test_rescued_vm_reboot(self):
-        self.assertRaises(exceptions.Conflict, self.servers_client.reboot,
-                          self.rescue_id, 'HARD')
-
-    @attr(type=['negative', 'gate'])
-    def test_rescue_non_existent_server(self):
-        # Rescue a non-existing server
-        self.assertRaises(exceptions.NotFound,
-                          self.servers_client.rescue_server,
-                          '999erra43')
-
-    @attr(type=['negative', 'gate'])
-    def test_rescued_vm_rebuild(self):
-        self.assertRaises(exceptions.Conflict,
-                          self.servers_client.rebuild,
-                          self.rescue_id,
-                          self.image_ref_alt)
-
-    @attr(type=['negative', 'gate'])
-    def test_rescued_vm_attach_volume(self):
-        # 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')
-        self.addCleanup(self._unrescue, self.server_id)
-
-        # Attach the volume to the server
-        self.assertRaises(exceptions.Conflict,
-                          self.servers_client.attach_volume,
-                          self.server_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['id'],
-                                          device='/dev/%s' % self.device)
-        self.volumes_extensions_client.wait_for_volume_status(
-            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['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['id'])
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rescued_vm_associate_dissociate_floating_ip(self):
         # Rescue the server
         self.servers_client.rescue_server(
@@ -191,7 +102,7 @@
                                                         self.server_id)
         self.assertEqual(202, resp.status)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rescued_vm_add_remove_security_group(self):
         # Rescue the server
         self.servers_client.rescue_server(
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
new file mode 100644
index 0000000..ffd79fa
--- /dev/null
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -0,0 +1,135 @@
+# Copyright 2013 Hewlett-Packard Development Company, L.P.
+# 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 ServerRescueNegativeTestJSON(base.BaseV2ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        cls.set_network_resources(network=True, subnet=True, router=True)
+        super(ServerRescueNegativeTestJSON, cls).setUpClass()
+        cls.device = 'vdf'
+
+        # Create a volume and wait for it to become ready for 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['id'], 'available')
+
+        # Server for negative tests
+        resp, server = cls.create_test_server(wait_until='BUILD')
+        resp, resc_server = cls.create_test_server(wait_until='ACTIVE')
+        cls.server_id = server['id']
+        cls.password = server['adminPass']
+        cls.rescue_id = resc_server['id']
+        rescue_password = resc_server['adminPass']
+
+        cls.servers_client.rescue_server(
+            cls.rescue_id, adminPass=rescue_password)
+        cls.servers_client.wait_for_server_status(cls.rescue_id, 'RESCUE')
+
+    def _detach(self, server_id, volume_id):
+        self.servers_client.detach_volume(server_id, volume_id)
+        self.volumes_extensions_client.wait_for_volume_status(volume_id,
+                                                              'available')
+
+    def _unrescue(self, server_id):
+        resp, body = self.servers_client.unrescue_server(server_id)
+        self.assertEqual(202, resp.status)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
+
+    def _unpause(self, server_id):
+        resp, body = self.servers_client.unpause_server(server_id)
+        self.assertEqual(202, resp.status)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_rescue_paused_instance(self):
+        # Rescue a paused server
+        resp, body = self.servers_client.pause_server(self.server_id)
+        self.addCleanup(self._unpause, self.server_id)
+        self.assertEqual(202, resp.status)
+        self.servers_client.wait_for_server_status(self.server_id, 'PAUSED')
+        self.assertRaises(exceptions.Conflict,
+                          self.servers_client.rescue_server,
+                          self.server_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_rescued_vm_reboot(self):
+        self.assertRaises(exceptions.Conflict, self.servers_client.reboot,
+                          self.rescue_id, 'HARD')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_rescue_non_existent_server(self):
+        # Rescue a non-existing server
+        non_existent_server = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.servers_client.rescue_server,
+                          non_existent_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_rescued_vm_rebuild(self):
+        self.assertRaises(exceptions.Conflict,
+                          self.servers_client.rebuild,
+                          self.rescue_id,
+                          self.image_ref_alt)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_rescued_vm_attach_volume(self):
+        # 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')
+        self.addCleanup(self._unrescue, self.server_id)
+
+        # Attach the volume to the server
+        self.assertRaises(exceptions.Conflict,
+                          self.servers_client.attach_volume,
+                          self.server_id,
+                          self.volume['id'],
+                          device='/dev/%s' % self.device)
+
+    @test.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['id'],
+                                          device='/dev/%s' % self.device)
+        self.volumes_extensions_client.wait_for_volume_status(
+            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['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['id'])
+
+
+class ServerRescueNegativeTestXML(ServerRescueNegativeTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 203832e..7167a8b 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -104,38 +104,6 @@
         self.assertEqual('::babe:202:202', server['accessIPv6'])
 
     @attr(type='gate')
-    def test_delete_server_while_in_shutoff_state(self):
-        # Delete a server while it's VM state is Shutoff
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.stop(server['id'])
-        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
-    def test_delete_server_while_in_pause_state(self):
-        # Delete a server while it's VM state is Pause
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.pause_server(server['id'])
-        self.client.wait_for_server_status(server['id'], 'PAUSED')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
-    def test_delete_server_while_in_building_state(self):
-        # Delete a server while it's VM state is Building
-        resp, server = self.create_test_server(wait_until='BUILD')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
-    def test_delete_active_server(self):
-        # Delete a server while it's VM state is Active
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
     def test_create_server_with_ipv6_addr_only(self):
         # Create a server without an IPv4 address(only IPv6 address).
         resp, server = self.create_test_server(accessIPv6='2001:2001::3')
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index fcd055b..1df4159 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -13,14 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import random
-import string
 
 import testtools
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -65,14 +62,6 @@
             if host != target_host:
                 return target_host
 
-    def _get_non_existing_host_name(self):
-        random_name = ''.join(
-            random.choice(string.ascii_uppercase) for x in range(20))
-
-        self.assertNotIn(random_name, self._get_compute_hostnames())
-
-        return random_name
-
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
@@ -110,18 +99,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @testtools.skipIf(not CONF.compute_feature_enabled.live_migration,
-                      'Live migration not available')
-    @attr(type='gate')
-    def test_invalid_host_for_migration(self):
-        # Migrating to an invalid host should not change the status
-        server_id = self._get_an_active_server()
-        target_host = self._get_non_existing_host_name()
-
-        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
-                          server_id, target_host)
-        self.assertEqual('ACTIVE', self._get_server_status(server_id))
-
     @testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
                       CONF.compute_feature_enabled.
                       block_migration_for_live_migration,
@@ -155,13 +132,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @classmethod
-    def tearDownClass(cls):
-        for server_id in cls.created_server_ids:
-            cls.servers_client.delete_server(server_id)
-
-        super(LiveBlockMigrationTestJSON, cls).tearDownClass()
-
 
 class LiveBlockMigrationTestXML(LiveBlockMigrationTestJSON):
     _host_key = (
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
new file mode 100644
index 0000000..e1a264e
--- /dev/null
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -0,0 +1,60 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
+    _host_key = 'OS-EXT-SRV-ATTR:host'
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(LiveBlockMigrationNegativeTestJSON, cls).setUpClass()
+        if not CONF.compute_feature_enabled.live_migration:
+            raise cls.skipException("Live migration is not enabled")
+        cls.admin_hosts_client = cls.os_adm.hosts_client
+        cls.admin_servers_client = cls.os_adm.servers_client
+
+    def _migrate_server_to(self, server_id, dest_host):
+        _resp, body = self.admin_servers_client.live_migrate_server(
+            server_id, dest_host,
+            CONF.compute_feature_enabled.
+            block_migration_for_live_migration)
+        return body
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_host_for_migration(self):
+        # Migrating to an invalid host should not change the status
+        target_host = data_utils.rand_name('host-')
+        _, server = self.create_test_server(wait_until="ACTIVE")
+        server_id = server['id']
+
+        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
+                          server_id, target_host)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
+
+
+class LiveBlockMigrationNegativeTestXML(LiveBlockMigrationNegativeTestJSON):
+    _host_key = (
+        '{http://docs.openstack.org/compute/ext/extended_status/api/v1.1}host')
+    _interface = 'xml'
diff --git a/tempest/api/compute/v3/admin/test_aggregates.py b/tempest/api/compute/v3/admin/test_aggregates.py
index b8b478d..a00a5b5 100644
--- a/tempest/api/compute/v3/admin/test_aggregates.py
+++ b/tempest/api/compute/v3/admin/test_aggregates.py
@@ -26,13 +26,11 @@
     """
 
     _host_key = 'os-extended-server-attributes:host'
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
         super(AggregatesAdminV3Test, cls).setUpClass()
         cls.client = cls.aggregates_admin_client
-        cls.user_client = cls.aggregates_client
         cls.aggregate_name_prefix = 'test_aggregate_'
         cls.az_name_prefix = 'test_az_'
 
diff --git a/tempest/api/compute/v3/admin/test_aggregates_negative.py b/tempest/api/compute/v3/admin/test_aggregates_negative.py
index 5700460..1505f74 100644
--- a/tempest/api/compute/v3/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/v3/admin/test_aggregates_negative.py
@@ -26,8 +26,6 @@
     Tests Aggregates API that require admin privileges
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(AggregatesAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_availability_zone.py b/tempest/api/compute/v3/admin/test_availability_zone.py
index 57ac869..9ca8953 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone.py
@@ -23,13 +23,10 @@
     Tests Availability Zone API List
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(AZAdminV3Test, cls).setUpClass()
         cls.client = cls.availability_zone_admin_client
-        cls.non_adm_client = cls.availability_zone_client
 
     @attr(type='gate')
     def test_get_availability_zone_list(self):
@@ -45,11 +42,3 @@
             self.client.get_availability_zone_list_detail()
         self.assertEqual(200, resp.status)
         self.assertTrue(len(availability_zone) > 0)
-
-    @attr(type='gate')
-    def test_get_availability_zone_list_with_non_admin_user(self):
-        # List of availability zone with non-administrator user
-        resp, availability_zone = \
-            self.non_adm_client.get_availability_zone_list()
-        self.assertEqual(200, resp.status)
-        self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/compute/v3/admin/test_availability_zone_negative.py b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
index 180f298..f3af6df 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
@@ -24,8 +24,6 @@
     Tests Availability Zone API List
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(AZAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_flavors.py b/tempest/api/compute/v3/admin/test_flavors.py
new file mode 100644
index 0000000..401eb85
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_flavors.py
@@ -0,0 +1,309 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import uuid
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class FlavorsAdminV3Test(base.BaseV3ComputeAdminTest):
+
+    """
+    Tests Flavors API Create and Delete that require admin privileges
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsAdminV3Test, cls).setUpClass()
+
+        cls.client = cls.flavors_admin_client
+        cls.user_client = cls.flavors_client
+        cls.flavor_name_prefix = 'test_flavor_'
+        cls.ram = 512
+        cls.vcpus = 1
+        cls.disk = 10
+        cls.ephemeral = 10
+        cls.swap = 1024
+        cls.rxtx = 2
+
+    def flavor_clean_up(self, flavor_id):
+        resp, body = self.client.delete_flavor(flavor_id)
+        self.assertEqual(resp.status, 204)
+        self.client.wait_for_resource_deletion(flavor_id)
+
+    def _create_flavor(self, flavor_id):
+        # Create a flavor and ensure it is listed
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(flavor['ram'], self.ram)
+        self.assertEqual(flavor['swap'], self.swap)
+        if test.is_extension_enabled("os-flavor-rxtx", "compute_v3"):
+            self.assertEqual(flavor['os-flavor-rxtx:rxtx_factor'], self.rxtx)
+        self.assertEqual(flavor['ephemeral'],
+                         self.ephemeral)
+        self.assertEqual(flavor['flavor-access:is_public'], True)
+
+        # Verify flavor is retrieved
+        resp, flavor = self.client.get_flavor_details(flavor['id'])
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+
+        return flavor['id']
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_int_id(self):
+        flavor_id = data_utils.rand_int_id(start=1000)
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, str(flavor_id))
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_uuid_id(self):
+        flavor_id = str(uuid.uuid4())
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, flavor_id)
+
+    @test.attr(type='gate')
+    def test_create_flavor_with_none_id(self):
+        # If nova receives a request with None as flavor_id,
+        # nova generates flavor_id of uuid.
+        flavor_id = None
+        new_flavor_id = self._create_flavor(flavor_id)
+        self.assertEqual(new_flavor_id, str(uuid.UUID(new_flavor_id)))
+
+    @test.attr(type='gate')
+    def test_create_flavor_verify_entry_in_list_details(self):
+        # Create a flavor and ensure it's details are listed
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        flag = False
+        # Verify flavor is retrieved
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+    @test.attr(type='gate')
+    def test_create_list_flavor_without_extra_data(self):
+        # Create a flavor and ensure it is listed
+        # This operation requires the user to have 'admin' role
+
+        def verify_flavor_response_extension(flavor):
+            # check some extensions for the flavor create/show/detail response
+            self.assertEqual(flavor['swap'], 0)
+            if test.is_extension_enabled("os-flavor-rxtx", "compute_v3"):
+                self.assertEqual(int(flavor['os-flavor-rxtx:rxtx_factor']), 1)
+            self.assertEqual(int(flavor['ephemeral']), 0)
+            self.assertEqual(flavor['flavor-access:is_public'], True)
+
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['ram'], self.ram)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(int(flavor['id']), new_flavor_id)
+        verify_flavor_response_extension(flavor)
+
+        # Verify flavor is retrieved
+        resp, flavor = self.client.get_flavor_details(new_flavor_id)
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+        verify_flavor_response_extension(flavor)
+
+        # Check if flavor is present in list
+        resp, flavors = self.user_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                verify_flavor_response_extension(flavor)
+                flag = True
+        self.assertTrue(flag)
+
+    @test.skip_because(bug="1209101")
+    @test.attr(type='gate')
+    def test_list_non_public_flavor(self):
+        # Create a flavor with os-flavor-access:is_public false should
+        # be present in list_details.
+        # This operation requires the user to have 'admin' role
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        # Verify flavor is retrieved
+        flag = False
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+        # Verify flavor is not retrieved with other user
+        flag = False
+        resp, flavors = self.user_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertFalse(flag)
+
+    @test.attr(type='gate')
+    def test_create_server_with_non_public_flavor(self):
+        # Create a flavor with os-flavor-access:is_public false
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+
+        # Verify flavor is not used by other user
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_server,
+                          'test', self.image_ref, flavor['id'])
+
+    @test.attr(type='gate')
+    def test_list_public_flavor_with_other_user(self):
+        # Create a Flavor with public access.
+        # Try to List/Get flavor with another user
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+            # Create the flavor
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 is_public="True")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        flag = False
+        self.new_client = self.flavors_client
+        # Verify flavor is retrieved with new user
+        resp, flavors = self.new_client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = True
+        self.assertTrue(flag)
+
+    @test.attr(type='gate')
+    def test_is_public_string_variations(self):
+        flavor_id_not_public = data_utils.rand_int_id(start=1000)
+        flavor_name_not_public = data_utils.rand_name(self.flavor_name_prefix)
+        flavor_id_public = data_utils.rand_int_id(start=1000)
+        flavor_name_public = data_utils.rand_name(self.flavor_name_prefix)
+
+        # Create a non public flavor
+        resp, flavor = self.client.create_flavor(flavor_name_not_public,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id_not_public,
+                                                 is_public="False")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        # Create a public flavor
+        resp, flavor = self.client.create_flavor(flavor_name_public,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 flavor_id_public,
+                                                 is_public="True")
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        def _flavor_lookup(flavors, flavor_name):
+            for flavor in flavors:
+                if flavor['name'] == flavor_name:
+                    return flavor
+            return None
+
+        def _test_string_variations(variations, flavor_name):
+            for string in variations:
+                params = {'is_public': string}
+                r, flavors = self.client.list_flavors_with_detail(params)
+                self.assertEqual(r.status, 200)
+                flavor = _flavor_lookup(flavors, flavor_name)
+                self.assertIsNotNone(flavor)
+
+        _test_string_variations(['f', 'false', 'no', '0'],
+                                flavor_name_not_public)
+
+        _test_string_variations(['t', 'true', 'yes', '1'],
+                                flavor_name_public)
+
+    @test.attr(type='gate')
+    def test_create_flavor_using_string_ram(self):
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = data_utils.rand_int_id(start=1000)
+
+        ram = " 1024 "
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+        self.assertEqual(201, resp.status)
+        self.assertEqual(flavor['name'], flavor_name)
+        self.assertEqual(flavor['vcpus'], self.vcpus)
+        self.assertEqual(flavor['disk'], self.disk)
+        self.assertEqual(flavor['ram'], int(ram))
+        self.assertEqual(int(flavor['id']), new_flavor_id)
diff --git a/tempest/api/compute/v3/admin/test_flavors_access.py b/tempest/api/compute/v3/admin/test_flavors_access.py
index 43dc726..03305ff 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access.py
@@ -25,8 +25,6 @@
     Add and remove Flavor Access require admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(FlavorsAccessV3Test, cls).setUpClass()
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 6a2e826..334d124 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
@@ -28,8 +28,6 @@
     Add and remove Flavor Access require admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(FlavorsAccessNegativeV3Test, cls).setUpClass()
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 4d22027..29cd8db 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
@@ -26,8 +26,6 @@
     GET Flavor Extra specs can be performed even by without admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(FlavorsExtraSpecsV3Test, cls).setUpClass()
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 98e6e3d..e9c04a3 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
@@ -27,8 +27,6 @@
     SET, UNSET, UPDATE Flavor Extra specs require admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(FlavorsExtraSpecsNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_flavors_negative.py b/tempest/api/compute/v3/admin/test_flavors_negative.py
new file mode 100644
index 0000000..3f8a2da
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_flavors_negative.py
@@ -0,0 +1,333 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import uuid
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class FlavorsAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
+
+    """
+    Tests Flavors API Create and Delete that require admin privileges
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsAdminNegativeV3Test, cls).setUpClass()
+
+        cls.client = cls.flavors_admin_client
+        cls.user_client = cls.flavors_client
+        cls.flavor_name_prefix = 'test_flavor_'
+        cls.ram = 512
+        cls.vcpus = 1
+        cls.disk = 10
+        cls.ephemeral = 10
+        cls.swap = 1024
+        cls.rxtx = 2
+
+    def flavor_clean_up(self, flavor_id):
+        resp, body = self.client.delete_flavor(flavor_id)
+        self.assertEqual(resp.status, 204)
+        self.client.wait_for_resource_deletion(flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_flavor_details_for_deleted_flavor(self):
+        # Delete a flavor and ensure it is not listed
+        # Create a test flavor
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+
+        # no need to specify flavor_id, we can get the flavor_id from a
+        # response of create_flavor() call.
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram,
+                                                 self.vcpus, self.disk,
+                                                 '',
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        # Delete the flavor
+        new_flavor_id = flavor['id']
+        resp_delete, body = self.client.delete_flavor(new_flavor_id)
+        self.assertEqual(201, resp.status)
+        self.assertEqual(204, resp_delete.status)
+
+        # Deleted flavors can be seen via detailed GET
+        resp, flavor = self.client.get_flavor_details(new_flavor_id)
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(flavor['name'], flavor_name)
+
+        # Deleted flavors should not show up in a list however
+        resp, flavors = self.client.list_flavors_with_detail()
+        self.assertEqual(resp.status, 200)
+        flag = True
+        for flavor in flavors:
+            if flavor['name'] == flavor_name:
+                flag = False
+        self.assertTrue(flag)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_is_public_string(self):
+        # the 'is_public' parameter can be 'none/true/false' if it exists
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.list_flavors_with_detail,
+                          {'is_public': 'invalid'})
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_as_user(self):
+        # only admin user can create a flavor
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.create_flavor,
+                          flavor_name, self.ram, self.vcpus, self.disk,
+                          new_flavor_id, ephemeral=self.ephemeral,
+                          swap=self.swap, rxtx=self.rxtx)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_flavor_as_user(self):
+        # only admin user can delete a flavor
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.delete_flavor,
+                          self.flavor_ref_alt)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_using_invalid_ram(self):
+        # the 'ram' attribute must be positive integer
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          flavor_name, -1, self.vcpus,
+                          self.disk, new_flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_using_invalid_vcpus(self):
+        # the 'vcpu' attribute must be positive integer
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          flavor_name, self.ram, -1,
+                          self.disk, new_flavor_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_name_length_less_than_1(self):
+        # ensure name length >= 1
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          '',
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_name_length_exceeds_255(self):
+        # ensure name do not exceed 255 characters
+        new_flavor_name = 'a' * 256
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_name(self):
+        # the regex of flavor_name is '^[\w\.\- ]*$'
+        invalid_flavor_name = data_utils.rand_name('invalid-!@#$%-')
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          invalid_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_flavor_id(self):
+        # the regex of flavor_id is '^[\w\.\- ]*$', and it cannot contain
+        # leading and/or trailing whitespace
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        invalid_flavor_id = '!@#$%'
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          invalid_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_id_length_exceeds_255(self):
+        # the length of flavor_id should not exceed 255 characters
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        invalid_flavor_id = 'a' * 256
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          invalid_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_root_gb(self):
+        # root_gb attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          -1,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_ephemeral_gb(self):
+        # ephemeral_gb attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=-1,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_swap(self):
+        # swap attribute should be non-negative ( >= 0) integer
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=-1,
+                          rxtx=self.rxtx,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_rxtx_factor(self):
+        # rxtx_factor attribute should be a positive float
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=-1.5,
+                          is_public='False')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_with_invalid_is_public(self):
+        # is_public attribute should be boolean
+        new_flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.BadRequest,
+                          self.client.create_flavor,
+                          new_flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx,
+                          is_public='Invalid')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_flavor_already_exists(self):
+        flavor_name = data_utils.rand_name(self.flavor_name_prefix)
+        new_flavor_id = str(uuid.uuid4())
+
+        resp, flavor = self.client.create_flavor(flavor_name,
+                                                 self.ram, self.vcpus,
+                                                 self.disk,
+                                                 new_flavor_id,
+                                                 ephemeral=self.ephemeral,
+                                                 swap=self.swap,
+                                                 rxtx=self.rxtx)
+        self.assertEqual(201, resp.status)
+        self.addCleanup(self.flavor_clean_up, flavor['id'])
+
+        self.assertRaises(exceptions.Conflict,
+                          self.client.create_flavor,
+                          flavor_name,
+                          self.ram, self.vcpus,
+                          self.disk,
+                          new_flavor_id,
+                          ephemeral=self.ephemeral,
+                          swap=self.swap,
+                          rxtx=self.rxtx)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_nonexistent_flavor(self):
+        nonexistent_flavor_id = str(uuid.uuid4())
+
+        self.assertRaises(exceptions.NotFound,
+                          self.client.delete_flavor,
+                          nonexistent_flavor_id)
diff --git a/tempest/api/compute/v3/admin/test_hosts.py b/tempest/api/compute/v3/admin/test_hosts.py
index 2c9369f..8cb1f23 100644
--- a/tempest/api/compute/v3/admin/test_hosts.py
+++ b/tempest/api/compute/v3/admin/test_hosts.py
@@ -23,8 +23,6 @@
     Tests hosts API using admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(HostsAdminV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_hosts_negative.py b/tempest/api/compute/v3/admin/test_hosts_negative.py
index ac5d7de..79cd97f 100644
--- a/tempest/api/compute/v3/admin/test_hosts_negative.py
+++ b/tempest/api/compute/v3/admin/test_hosts_negative.py
@@ -24,8 +24,6 @@
     Tests hosts API using admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(HostsAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_hypervisor.py b/tempest/api/compute/v3/admin/test_hypervisor.py
index 0f96bba..93d4441 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor.py
@@ -23,8 +23,6 @@
     Tests Hypervisors API that require admin privileges
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(HypervisorAdminV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_hypervisor_negative.py b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
index aee354a..45642b7 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
@@ -27,8 +27,6 @@
     Tests Hypervisors API that require admin privileges
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(HypervisorAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
deleted file mode 100644
index a86b7f5..0000000
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import datetime
-import urllib
-
-from tempest.api.compute import base
-from tempest import test
-
-
-class InstanceUsageAuditLogV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(InstanceUsageAuditLogV3Test, cls).setUpClass()
-        cls.adm_client = cls.instance_usages_audit_log_admin_client
-
-    @test.attr(type='gate')
-    def test_list_instance_usage_audit_logs(self):
-        # list instance usage audit logs
-        resp, body = self.adm_client.list_instance_usage_audit_logs()
-        self.assertEqual(200, resp.status)
-        expected_items = ['total_errors', 'total_instances', 'log',
-                          'num_hosts_running', 'num_hosts_done',
-                          'num_hosts', 'hosts_not_run', 'overall_status',
-                          'period_ending', 'period_beginning',
-                          'num_hosts_not_run']
-        for item in expected_items:
-            self.assertIn(item, body)
-
-    @test.attr(type='gate')
-    def test_list_instance_usage_audit_logs_with_filter_before(self):
-        # Get instance usage audit log before specified time
-        ending_time = datetime.datetime(2012, 12, 24)
-        resp, body = self.adm_client.list_instance_usage_audit_logs(
-            urllib.quote(ending_time.strftime("%Y-%m-%d %H:%M:%S")))
-
-        self.assertEqual(200, resp.status)
-        expected_items = ['total_errors', 'total_instances', 'log',
-                          'num_hosts_running', 'num_hosts_done', 'num_hosts',
-                          'hosts_not_run', 'overall_status', 'period_ending',
-                          'period_beginning', 'num_hosts_not_run']
-        for item in expected_items:
-            self.assertIn(item, body)
-        self.assertEqual(body['period_ending'], "2012-12-23 23:00:00")
diff --git a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
deleted file mode 100644
index 0438825..0000000
--- a/tempest/api/compute/v3/admin/test_instance_usage_audit_log_negative.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.api.compute import base
-from tempest import exceptions
-from tempest import test
-
-
-class InstanceUsageLogNegativeV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(InstanceUsageLogNegativeV3Test, cls).setUpClass()
-        cls.adm_client = cls.instance_usages_audit_log_admin_client
-
-    @test.attr(type=['negative', 'gate'])
-    def test_instance_usage_audit_logs_with_nonadmin_user(self):
-        # the instance_usage_audit_logs API just can be accessed by admin user
-        self.assertRaises(exceptions.Unauthorized,
-                          self.instance_usages_audit_log_client.
-                          list_instance_usage_audit_logs)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_get_instance_usage_audit_logs_with_invalid_time(self):
-        self.assertRaises(exceptions.BadRequest,
-                          self.adm_client.list_instance_usage_audit_logs,
-                          "invalid_time")
diff --git a/tempest/api/compute/v3/admin/test_quotas.py b/tempest/api/compute/v3/admin/test_quotas.py
index ccb9d8e..0c138bb 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -16,23 +16,19 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest import exceptions
 from tempest import test
 
 CONF = config.CONF
 
 
 class QuotasAdminV3Test(base.BaseV3ComputeAdminTest):
-    _interface = 'json'
     force_tenant_isolation = True
 
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminV3Test, cls).setUpClass()
-        cls.auth_url = CONF.identity.uri
         cls.client = cls.quotas_client
         cls.adm_client = cls.quotas_admin_client
-        cls.identity_admin_client = cls._get_identity_admin_client()
 
         # NOTE(afazekas): these test cases should always create and use a new
         # tenant most of them should be skipped if we can't do that
@@ -49,17 +45,33 @@
     def test_get_default_quotas(self):
         # Admin can get the default resource quota set for a tenant
         expected_quota_set = self.default_quota_set | set(['id'])
-        resp, quota_set = self.client.get_default_quota_set(
+        resp, quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(sorted(expected_quota_set),
                          sorted(quota_set.keys()))
         self.assertEqual(quota_set['id'], self.demo_tenant_id)
 
+    @test.attr(type='smoke')
+    def test_get_quota_set_detail(self):
+        # Admin can get the detail of resource quota set for a tenant
+        expected_quota_set = self.default_quota_set | set(['id'])
+        expected_detail = {'reserved', 'limit', 'in_use'}
+        resp, quota_set = self.adm_client.get_quota_set_detail(
+            self.demo_tenant_id)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(sorted(expected_quota_set), sorted(quota_set.keys()))
+        self.assertEqual(quota_set['id'], self.demo_tenant_id)
+        for quota in quota_set:
+            if quota == 'id':
+                continue
+            self.assertEqual(sorted(expected_detail),
+                             sorted(quota_set[quota].keys()))
+
     @test.attr(type='gate')
     def test_update_all_quota_resources_for_tenant(self):
         # Admin can update all the resource quota limits for a tenant
-        resp, default_quota_set = self.client.get_default_quota_set(
+        resp, default_quota_set = self.adm_client.get_default_quota_set(
             self.demo_tenant_id)
         new_quota_set = {'metadata_items': 256,
                          'ram': 10240, 'floating_ips': 20, 'fixed_ips': 10,
@@ -97,56 +109,3 @@
         resp, quota_set = self.adm_client.get_quota_set(tenant_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(quota_set['ram'], 5120)
-
-    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
-    # it can be moved into the setUpClass as well
-    @test.attr(type='gate')
-    def test_create_server_when_cpu_quota_is_full(self):
-        # Disallow server creation when tenant's vcpu quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_vcpu_quota = quota_set['cores']
-        vcpu_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
-                                                           force=True,
-                                                           cores=vcpu_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        cores=default_vcpu_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @test.attr(type='gate')
-    def test_create_server_when_memory_quota_is_full(self):
-        # Disallow server creation when tenant's memory quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_mem_quota = quota_set['ram']
-        mem_quota = 0  # Set the quota to zero to conserve resources
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         ram=mem_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        ram=default_mem_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @test.attr(type='gate')
-    def test_update_quota_normal_user(self):
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.update_quota_set,
-                          self.demo_tenant_id,
-                          ram=0)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_create_server_when_instances_quota_is_full(self):
-        # Once instances quota limit is reached, disallow server creation
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_instances_quota = quota_set['instances']
-        instances_quota = 0  # Set quota to zero to disallow server creation
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         instances=instances_quota)
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        instances=default_instances_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
diff --git a/tempest/api/compute/v3/admin/test_quotas_negative.py b/tempest/api/compute/v3/admin/test_quotas_negative.py
new file mode 100644
index 0000000..c9f14f8
--- /dev/null
+++ b/tempest/api/compute/v3/admin/test_quotas_negative.py
@@ -0,0 +1,88 @@
+# Copyright 2013 OpenStack Foundation
+# Copyright 2014 NEC Corporation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import exceptions
+from tempest import test
+
+
+class QuotasAdminNegativeV3Test(base.BaseV3ComputeAdminTest):
+    _interface = 'json'
+    force_tenant_isolation = True
+
+    @classmethod
+    def setUpClass(cls):
+        super(QuotasAdminNegativeV3Test, cls).setUpClass()
+        cls.client = cls.quotas_client
+        cls.adm_client = cls.quotas_admin_client
+
+        # NOTE(afazekas): these test cases should always create and use a new
+        # tenant most of them should be skipped if we can't do that
+        cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
+            'tenantId')
+
+    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
+    # it can be moved into the setUpClass as well
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_cpu_quota_is_full(self):
+        # Disallow server creation when tenant's vcpu quota is full
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        default_vcpu_quota = quota_set['cores']
+        vcpu_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
+                                                           force=True,
+                                                           cores=vcpu_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        cores=default_vcpu_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_memory_quota_is_full(self):
+        # Disallow server creation when tenant's memory quota is full
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        default_mem_quota = quota_set['ram']
+        mem_quota = 0  # Set the quota to zero to conserve resources
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         ram=mem_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        ram=default_mem_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_quota_normal_user(self):
+        self.assertRaises(exceptions.Unauthorized,
+                          self.client.update_quota_set,
+                          self.demo_tenant_id,
+                          ram=0)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_instances_quota_is_full(self):
+        # Once instances quota limit is reached, disallow server creation
+        resp, quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        default_instances_quota = quota_set['instances']
+        instances_quota = 0  # Set quota to zero to disallow server creation
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         instances=instances_quota)
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        instances=default_instances_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index ef9eedc..7787770 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -16,8 +16,6 @@
 from tempest.common.utils import data_utils
 from tempest import exceptions
 from tempest import test
-from tempest.test import attr
-from tempest.test import skip_because
 
 
 class ServersAdminV3Test(base.BaseV3ComputeAdminTest):
@@ -26,7 +24,7 @@
     Tests Servers API using admin privileges
     """
 
-    _interface = 'json'
+    _host_key = 'os-extended-server-attributes:host'
 
     @classmethod
     def setUpClass(cls):
@@ -55,7 +53,7 @@
             flavor_id = data_utils.rand_int_id(start=1000)
         return flavor_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin(self):
         # Listing servers by admin user returns empty list by default
         resp, body = self.client.list_servers_with_detail()
@@ -64,7 +62,7 @@
         self.assertEqual([], servers)
 
     @test.skip_because(bug='1265416')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_by_admin_with_all_tenants(self):
         # Listing servers by admin user with all tenants parameter
         # Here should be listed all servers
@@ -76,27 +74,34 @@
         self.assertIn(self.s1_name, servers_name)
         self.assertIn(self.s2_name, servers_name)
 
-    @attr(type='gate')
-    def test_admin_delete_servers_of_others(self):
-        # Administrator can delete servers of others
-        _, server = self.create_test_server()
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-        self.servers_client.wait_for_server_termination(server['id'])
+    @test.attr(type='gate')
+    def test_list_servers_filter_by_existent_host(self):
+        # Filter the list of servers by existent host
+        name = data_utils.rand_name('server')
+        flavor = self.flavor_ref
+        image_id = self.image_ref
+        resp, test_server = self.client.create_server(
+            name, image_id, flavor)
+        self.assertEqual('202', resp['status'])
+        self.addCleanup(self.client.delete_server, test_server['id'])
+        self.client.wait_for_server_status(test_server['id'], 'ACTIVE')
+        resp, server = self.client.get_server(test_server['id'])
+        self.assertEqual(server['status'], 'ACTIVE')
+        hostname = server[self._host_key]
+        params = {'host': hostname}
+        resp, body = self.client.list_servers(params)
+        self.assertEqual('200', resp['status'])
+        servers = body['servers']
+        nonexistent_params = {'host': 'nonexistent_host'}
+        resp, nonexistent_body = self.client.list_servers(
+            nonexistent_params)
+        self.assertEqual('200', resp['status'])
+        nonexistent_servers = nonexistent_body['servers']
+        self.assertIn(test_server['id'], map(lambda x: x['id'], servers))
+        self.assertNotIn(test_server['id'],
+                         map(lambda x: x['id'], nonexistent_servers))
 
-    @attr(type='gate')
-    def test_delete_server_while_in_error_state(self):
-        # Delete a server while it's VM state is error
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.reset_state(server['id'], state='error')
-        self.assertEqual(202, resp.status)
-        # Verify server's state
-        resp, server = self.client.get_server(server['id'])
-        self.assertEqual(server['status'], 'ERROR')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
@@ -114,8 +119,8 @@
         resp, server = self.client.get_server(self.s1_id)
         self.assertEqual(server['status'], 'ACTIVE')
 
-    @attr(type='gate')
-    @skip_because(bug="1240043")
+    @test.attr(type='gate')
+    @test.skip_because(bug="1240043")
     def test_get_server_diagnostics_by_admin(self):
         # Retrieve server diagnostics by admin user
         resp, diagnostic = self.client.get_server_diagnostics(self.s1_id)
@@ -126,7 +131,7 @@
         for key in basic_attrs:
             self.assertIn(key, str(diagnostic.keys()))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_error_status(self):
         # Filter the list of servers by server error status
         params = {'status': 'error'}
@@ -142,12 +147,12 @@
         self.assertIn(self.s1_id, map(lambda x: x['id'], servers))
         self.assertNotIn(self.s2_id, map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_error_state(self):
         # The server in error state should be rebuilt using the provided
         # image and changed to ACTIVE state
 
-        # resetting vm state require admin priviledge
+        # resetting vm state require admin privilege
         resp, server = self.client.reset_state(self.s1_id, state='error')
         self.assertEqual(202, resp.status)
         resp, rebuilt_server = self.non_admin_client.rebuild(
diff --git a/tempest/api/compute/v3/admin/test_servers_negative.py b/tempest/api/compute/v3/admin/test_servers_negative.py
index a6a5736..cc1be4e 100644
--- a/tempest/api/compute/v3/admin/test_servers_negative.py
+++ b/tempest/api/compute/v3/admin/test_servers_negative.py
@@ -26,8 +26,6 @@
     Tests Servers API using admin privileges
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(ServersAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_services.py b/tempest/api/compute/v3/admin/test_services.py
index 8d6e549..914a2a4 100644
--- a/tempest/api/compute/v3/admin/test_services.py
+++ b/tempest/api/compute/v3/admin/test_services.py
@@ -24,8 +24,6 @@
     Tests Services API. List and Enable/Disable require admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(ServicesAdminV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_services_negative.py b/tempest/api/compute/v3/admin/test_services_negative.py
index c270842..3168af2 100644
--- a/tempest/api/compute/v3/admin/test_services_negative.py
+++ b/tempest/api/compute/v3/admin/test_services_negative.py
@@ -25,8 +25,6 @@
     Tests Services API. List and Enable/Disable require admin privileges.
     """
 
-    _interface = 'json'
-
     @classmethod
     def setUpClass(cls):
         super(ServicesAdminNegativeV3Test, cls).setUpClass()
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
deleted file mode 100644
index e16332f..0000000
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import datetime
-
-from tempest.api.compute import base
-from tempest import test
-from tempest.test import attr
-import time
-
-
-class TenantUsagesV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(TenantUsagesV3Test, cls).setUpClass()
-        cls.adm_client = cls.tenant_usages_admin_client
-        cls.client = cls.tenant_usages_client
-        cls.identity_client = cls._get_identity_admin_client()
-
-        resp, tenants = cls.identity_client.list_tenants()
-        cls.tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
-                         cls.client.tenant_name][0]
-
-        # Create a server in the demo tenant
-        resp, server = cls.create_test_server(wait_until='ACTIVE')
-        time.sleep(2)
-
-        now = datetime.datetime.now()
-        cls.start = cls._parse_strtime(now - datetime.timedelta(days=1))
-        cls.end = cls._parse_strtime(now + datetime.timedelta(days=1))
-
-    @classmethod
-    def _parse_strtime(cls, at):
-        # Returns formatted datetime
-        return at.strftime('%Y-%m-%dT%H:%M:%S.%f')
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_list_usage_all_tenants(self):
-        # Get usage for all tenants
-        params = {'start': self.start,
-                  'end': self.end,
-                  'detailed': int(bool(True))}
-        resp, tenant_usage = self.adm_client.list_tenant_usages(params)
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_get_usage_tenant(self):
-        # Get usage for a specific tenant
-        params = {'start': self.start,
-                  'end': self.end}
-        resp, tenant_usage = self.adm_client.get_tenant_usage(
-            self.tenant_id, params)
-
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
-
-    @test.skip_because(bug='1265416')
-    @attr(type='gate')
-    def test_get_usage_tenant_with_non_admin_user(self):
-        # Get usage for a specific tenant with non admin user
-        params = {'start': self.start,
-                  'end': self.end}
-        resp, tenant_usage = self.client.get_tenant_usage(
-            self.tenant_id, params)
-
-        self.assertEqual(200, resp.status)
-        self.assertEqual(len(tenant_usage), 8)
diff --git a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
deleted file mode 100644
index 17849c5..0000000
--- a/tempest/api/compute/v3/admin/test_simple_tenant_usage_negative.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import datetime
-
-from tempest.api.compute import base
-from tempest import exceptions
-from tempest import test
-from tempest.test import attr
-
-
-class TenantUsagesNegativeV3Test(base.BaseV3ComputeAdminTest):
-
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(TenantUsagesNegativeV3Test, cls).setUpClass()
-        cls.adm_client = cls.os_adm.tenant_usages_client
-        cls.client = cls.os.tenant_usages_client
-        cls.identity_client = cls._get_identity_admin_client()
-        now = datetime.datetime.now()
-        cls.start = cls._parse_strtime(now - datetime.timedelta(days=1))
-        cls.end = cls._parse_strtime(now + datetime.timedelta(days=1))
-
-    @classmethod
-    def _parse_strtime(cls, at):
-        # Returns formatted datetime
-        return at.strftime('%Y-%m-%dT%H:%M:%S.%f')
-
-    @attr(type=['negative', 'gate'])
-    def test_get_usage_tenant_with_empty_tenant_id(self):
-        # Get usage for a specific tenant empty
-        params = {'start': self.start,
-                  'end': self.end}
-        self.assertRaises(exceptions.NotFound,
-                          self.adm_client.get_tenant_usage,
-                          '', params)
-
-    @test.skip_because(bug='1265416')
-    @attr(type=['negative', 'gate'])
-    def test_get_usage_tenant_with_invalid_date(self):
-        # Get usage for tenant with invalid date
-        params = {'start': self.end,
-                  'end': self.start}
-        resp, tenants = self.identity_client.list_tenants()
-        tenant_id = [tnt['id'] for tnt in tenants if tnt['name'] ==
-                     self.client.tenant_name][0]
-        self.assertRaises(exceptions.BadRequest,
-                          self.adm_client.get_tenant_usage,
-                          tenant_id, params)
-
-    @test.skip_because(bug='1265416')
-    @attr(type=['negative', 'gate'])
-    def test_list_usage_all_tenants_with_non_admin_user(self):
-        # Get usage for all tenants with non admin user
-        params = {'start': self.start,
-                  'end': self.end,
-                  'detailed': int(bool(True))}
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.list_tenant_usages, params)
diff --git a/tempest/api/compute/v3/certificates/test_certificates.py b/tempest/api/compute/v3/certificates/test_certificates.py
index 5c980c0..ce025fc 100644
--- a/tempest/api/compute/v3/certificates/test_certificates.py
+++ b/tempest/api/compute/v3/certificates/test_certificates.py
@@ -18,7 +18,6 @@
 
 
 class CertificatesV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @attr(type='gate')
     def test_create_and_get_root_certificate(self):
diff --git a/tempest/api/compute/v3/flavors/__init__.py b/tempest/api/compute/v3/flavors/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/__init__.py
diff --git a/tempest/api/compute/v3/flavors/test_flavors.py b/tempest/api/compute/v3/flavors/test_flavors.py
new file mode 100644
index 0000000..a0bbba6
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/test_flavors.py
@@ -0,0 +1,127 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class FlavorsV3Test(base.BaseV3ComputeTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorsV3Test, cls).setUpClass()
+        cls.client = cls.flavors_client
+
+    @test.attr(type='smoke')
+    def test_list_flavors(self):
+        # List of all flavors should contain the expected flavor
+        resp, flavors = self.client.list_flavors()
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
+                             'name': flavor['name']}
+        self.assertIn(flavor_min_detail, flavors)
+
+    @test.attr(type='smoke')
+    def test_list_flavors_with_detail(self):
+        # Detailed list of all flavors should contain the expected flavor
+        resp, flavors = self.client.list_flavors_with_detail()
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        self.assertIn(flavor, flavors)
+
+    @test.attr(type='smoke')
+    def test_get_flavor(self):
+        # The expected flavor details should be returned
+        resp, flavor = self.client.get_flavor_details(self.flavor_ref)
+        self.assertEqual(self.flavor_ref, flavor['id'])
+
+    @test.attr(type='gate')
+    def test_list_flavors_limit_results(self):
+        # Only the expected number of flavors should be returned
+        params = {'limit': 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertEqual(1, len(flavors))
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_limit_results(self):
+        # Only the expected number of flavors (detailed) should be returned
+        params = {'limit': 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertEqual(1, len(flavors))
+
+    @test.attr(type='gate')
+    def test_list_flavors_using_marker(self):
+        # The list of flavors should start from the provided marker
+        resp, flavors = self.client.list_flavors()
+        flavor_id = flavors[0]['id']
+
+        params = {'marker': flavor_id}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
+                         'The list of flavors did not start after the marker.')
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_using_marker(self):
+        # The list of flavors should start from the provided marker
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavor_id = flavors[0]['id']
+
+        params = {'marker': flavor_id}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
+                         'The list of flavors did not start after the marker.')
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_filter_by_min_disk(self):
+        # The detailed list of flavors should be filtered by disk space
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['disk'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_disk': flavors[0]['disk'] + 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_detailed_filter_by_min_ram(self):
+        # The detailed list of flavors should be filtered by RAM
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['ram'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_ram': flavors[0]['ram'] + 1}
+        resp, flavors = self.client.list_flavors_with_detail(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_filter_by_min_disk(self):
+        # The list of flavors should be filtered by disk space
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['disk'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_disk': flavors[0]['disk'] + 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
+
+    @test.attr(type='gate')
+    def test_list_flavors_filter_by_min_ram(self):
+        # The list of flavors should be filtered by RAM
+        resp, flavors = self.client.list_flavors_with_detail()
+        flavors = sorted(flavors, key=lambda k: k['ram'])
+        flavor_id = flavors[0]['id']
+
+        params = {'min_ram': flavors[0]['ram'] + 1}
+        resp, flavors = self.client.list_flavors(params)
+        self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/api/compute/v3/flavors/test_flavors_negative.py b/tempest/api/compute/v3/flavors/test_flavors_negative.py
new file mode 100644
index 0000000..346f6d6
--- /dev/null
+++ b/tempest/api/compute/v3/flavors/test_flavors_negative.py
@@ -0,0 +1,52 @@
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import testscenarios
+
+from tempest.api.compute import base
+from tempest import test
+
+
+load_tests = testscenarios.load_tests_apply_scenarios
+
+
+class FlavorsListNegativeV3Test(base.BaseV3ComputeTest,
+                                test.NegativeAutoTest):
+    _service = 'computev3'
+    _schema_file = 'compute/flavors/flavors_list_v3.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_flavors_with_detail(self):
+        self.execute(self._schema_file)
+
+
+class FlavorDetailsNegativeV3Test(base.BaseV3ComputeTest,
+                                  test.NegativeAutoTest):
+    _service = 'computev3'
+    _schema_file = 'compute/flavors/flavor_details_v3.json'
+
+    scenarios = test.NegativeAutoTest.generate_scenario(_schema_file)
+
+    @classmethod
+    def setUpClass(cls):
+        super(FlavorDetailsNegativeV3Test, cls).setUpClass()
+        cls.set_resource("flavor", cls.flavor_ref)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_flavor_details(self):
+        # flavor details are not returned for non-existent flavors
+        self.execute(self._schema_file)
diff --git a/tempest/api/compute/v3/images/test_image_metadata.py b/tempest/api/compute/v3/images/test_image_metadata.py
deleted file mode 100644
index cd4e5e7..0000000
--- a/tempest/api/compute/v3/images/test_image_metadata.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.api.compute import base
-from tempest.common.utils import data_utils
-from tempest import config
-from tempest.test import attr
-
-CONF = config.CONF
-
-
-class ImagesMetadataTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ImagesMetadataTest, cls).setUpClass()
-        if not CONF.service_available.glance:
-            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-
-        cls.servers_client = cls.servers_client
-        cls.client = cls.images_client
-
-        resp, server = cls.create_test_server(wait_until='ACTIVE')
-        cls.server_id = server['id']
-
-        # Snapshot the server once to save time
-        name = data_utils.rand_name('image')
-        resp, _ = cls.client.create_image(cls.server_id, name, {})
-        cls.image_id = resp['location'].rsplit('/', 1)[1]
-
-        cls.client.wait_for_image_status(cls.image_id, 'ACTIVE')
-
-    @classmethod
-    def tearDownClass(cls):
-        cls.client.delete_image(cls.image_id)
-        super(ImagesMetadataTest, cls).tearDownClass()
-
-    def setUp(self):
-        super(ImagesMetadataTest, self).setUp()
-        meta = {'key1': 'value1', 'key2': 'value2'}
-        resp, _ = self.client.set_image_metadata(self.image_id, meta)
-        self.assertEqual(resp.status, 200)
-
-    @attr(type='gate')
-    def test_list_image_metadata(self):
-        # All metadata key/value pairs for an image should be returned
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'value1', 'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_set_image_metadata(self):
-        # The metadata for the image should match the new values
-        req_metadata = {'meta2': 'value2', 'meta3': 'value3'}
-        resp, body = self.client.set_image_metadata(self.image_id,
-                                                    req_metadata)
-
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        self.assertEqual(req_metadata, resp_metadata)
-
-    @attr(type='gate')
-    def test_update_image_metadata(self):
-        # The metadata for the image should match the updated values
-        req_metadata = {'key1': 'alt1', 'key3': 'value3'}
-        resp, metadata = self.client.update_image_metadata(self.image_id,
-                                                           req_metadata)
-
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_get_image_metadata_item(self):
-        # The value for a specific metadata key should be returned
-        resp, meta = self.client.get_image_metadata_item(self.image_id,
-                                                         'key2')
-        self.assertEqual('value2', meta['key2'])
-
-    @attr(type='gate')
-    def test_set_image_metadata_item(self):
-        # The value provided for the given meta item should be set for
-        # the image
-        meta = {'key1': 'alt'}
-        resp, body = self.client.set_image_metadata_item(self.image_id,
-                                                         'key1', meta)
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt', 'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
-
-    @attr(type='gate')
-    def test_delete_image_metadata_item(self):
-        # The metadata value/key pair should be deleted from the image
-        resp, body = self.client.delete_image_metadata_item(self.image_id,
-                                                            'key1')
-        resp, resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key2': 'value2'}
-        self.assertEqual(expected, resp_metadata)
diff --git a/tempest/api/compute/v3/images/test_image_metadata_negative.py b/tempest/api/compute/v3/images/test_image_metadata_negative.py
deleted file mode 100644
index e76af2c..0000000
--- a/tempest/api/compute/v3/images/test_image_metadata_negative.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.api.compute import base
-from tempest.common.utils import data_utils
-from tempest import exceptions
-from tempest.test import attr
-
-
-class ImagesMetadataTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ImagesMetadataTest, cls).setUpClass()
-        cls.client = cls.images_client
-
-    @attr(type=['negative', 'gate'])
-    def test_list_nonexistent_image_metadata(self):
-        # Negative test: List on nonexistent image
-        # metadata should not happen
-        self.assertRaises(exceptions.NotFound, self.client.list_image_metadata,
-                          data_utils.rand_uuid())
-
-    @attr(type=['negative', 'gate'])
-    def test_update_nonexistent_image_metadata(self):
-        # Negative test:An update should not happen for a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.update_image_metadata,
-                          data_utils.rand_uuid(), meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_get_nonexistent_image_metadata_item(self):
-        # Negative test: Get on non-existent image should not happen
-        self.assertRaises(exceptions.NotFound,
-                          self.client.get_image_metadata_item,
-                          data_utils.rand_uuid(), 'key2')
-
-    @attr(type=['negative', 'gate'])
-    def test_set_nonexistent_image_metadata(self):
-        # Negative test: Metadata should not be set to a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
-        self.assertRaises(exceptions.NotFound, self.client.set_image_metadata,
-                          data_utils.rand_uuid(), meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_set_nonexistent_image_metadata_item(self):
-        # Negative test: Metadata item should not be set to a
-        # nonexistent image
-        meta = {'key1': 'alt'}
-        self.assertRaises(exceptions.NotFound,
-                          self.client.set_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1',
-                          meta)
-
-    @attr(type=['negative', 'gate'])
-    def test_delete_nonexistent_image_metadata_item(self):
-        # Negative test: Shouldn't be able to delete metadata
-        # item from non-existent image
-        self.assertRaises(exceptions.NotFound,
-                          self.client.delete_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1')
diff --git a/tempest/api/compute/v3/images/test_images.py b/tempest/api/compute/v3/images/test_images.py
index bbb84fb..656f7ba 100644
--- a/tempest/api/compute/v3/images/test_images.py
+++ b/tempest/api/compute/v3/images/test_images.py
@@ -13,17 +13,15 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
 
 class ImagesV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
@@ -34,18 +32,6 @@
         cls.client = cls.images_client
         cls.servers_client = cls.servers_client
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def __create_image__(self, server_id, name, meta=None):
         resp, body = self.servers_client.create_image(server_id, name, meta)
         image_id = data_utils.parse_image_id(resp['location'])
@@ -53,7 +39,7 @@
         self.client.wait_for_image_status(image_id, 'ACTIVE')
         return resp, body
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_deleted_server(self):
         # An image should not be created if the server instance is removed
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -68,7 +54,7 @@
                           self.__create_image__,
                           server['id'], name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_invalid_server(self):
         # An image should not be created with invalid server id
         # Create a new image with invalid server id
@@ -79,7 +65,7 @@
         self.assertRaises(exceptions.NotFound, self.__create_image__,
                           '!@#$%^&*()', name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_from_stopped_server(self):
         resp, server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.stop(server['id'])
@@ -93,7 +79,7 @@
         self.addCleanup(self.client.delete_image, image['id'])
         self.assertEqual(snapshot_name, image['name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_delete_queued_image(self):
         snapshot_name = data_utils.rand_name('test-snap-')
         resp, server = self.create_test_server(wait_until='ACTIVE')
@@ -104,7 +90,7 @@
         resp, body = self.client.delete_image(image['id'])
         self.assertEqual('200', resp['status'])
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_35_characters_or_less(self):
         # Return an error if Image ID passed is 35 characters or less
         snapshot_name = data_utils.rand_name('test-snap-')
@@ -113,7 +99,7 @@
                           self.servers_client.create_image,
                           test_uuid, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_uuid_37_characters_or_more(self):
         # Return an error if Image ID passed is 37 characters or more
         snapshot_name = data_utils.rand_name('test-snap-')
diff --git a/tempest/api/compute/v3/images/test_images_oneserver.py b/tempest/api/compute/v3/images/test_images_oneserver.py
index 18772df..48a885e 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver.py
@@ -16,30 +16,21 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    def tearDown(self):
-        """Terminate test instances created after a test is executed."""
-        for image_id in self.image_ids:
-            self.client.delete_image(image_id)
-            self.image_ids.remove(image_id)
-        super(ImagesOneServerTest, self).tearDown()
+class ImagesOneServerV3Test(base.BaseV3ComputeTest):
 
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
-        super(ImagesOneServerTest, self).setUp()
+        super(ImagesOneServerV3Test, self).setUp()
         # Check if the server is in a clean state after test
         try:
             self.servers_client.wait_for_server_status(self.server_id,
@@ -53,7 +44,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerTest, cls).setUpClass()
+        super(ImagesOneServerV3Test, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
@@ -66,33 +57,20 @@
             cls.tearDownClass()
             raise
 
-        cls.image_ids = []
-
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
     def _get_default_flavor_disk_size(self, flavor_id):
         resp, flavor = self.flavors_client.get_flavor_details(flavor_id)
         return flavor['disk']
 
     @testtools.skipUnless(CONF.compute_feature_enabled.create_image,
                           'Environment unable to create images.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_delete_image(self):
 
         # Create a new image
         name = data_utils.rand_name('image')
         meta = {'image_type': 'test'}
-        resp, body = self.client.create_image(self.server_id, name, meta)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      name, meta)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.client.wait_for_image_status(image_id, 'ACTIVE')
@@ -117,12 +95,13 @@
         self.assertEqual('204', resp['status'])
         self.client.wait_for_resource_deletion(image_id)
 
-    @attr(type=['gate'])
+    @test.attr(type=['gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         # prefix character is:
         # http://www.fileformat.info/info/unicode/char/1F4A9/index.htm
         utf8_name = data_utils.rand_name(u'\xF0\x9F\x92\xA9')
-        resp, body = self.client.create_image(self.server_id, utf8_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      utf8_name)
         image_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(self.client.delete_image, image_id)
         self.assertEqual('202', resp['status'])
diff --git a/tempest/api/compute/v3/images/test_images_oneserver_negative.py b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
index bc276d1..7679eee 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
@@ -15,33 +15,30 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
 LOG = logging.getLogger(__name__)
 
 
-class ImagesOneServerNegativeTest(base.BaseV2ComputeTest):
-    _interface = 'json'
+class ImagesOneServerNegativeV3Test(base.BaseV3ComputeTest):
 
     def tearDown(self):
         """Terminate test instances created after a test is executed."""
         for image_id in self.image_ids:
             self.client.delete_image(image_id)
             self.image_ids.remove(image_id)
-        super(ImagesOneServerNegativeTest, self).tearDown()
+        super(ImagesOneServerNegativeV3Test, self).tearDown()
 
     def setUp(self):
         # NOTE(afazekas): Normally we use the same server with all test cases,
         # but if it has an issue, we build a new one
-        super(ImagesOneServerNegativeTest, self).setUp()
+        super(ImagesOneServerNegativeV3Test, self).setUp()
         # Check if the server is in a clean state after test
         try:
             self.servers_client.wait_for_server_status(self.server_id,
@@ -58,7 +55,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(ImagesOneServerNegativeTest, cls).setUpClass()
+        super(ImagesOneServerNegativeV3Test, cls).setUpClass()
         cls.client = cls.images_client
         if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
@@ -73,53 +70,44 @@
 
         cls.image_ids = []
 
-        if cls.multi_user:
-            if CONF.compute.allow_tenant_isolation:
-                creds = cls.isolated_creds.get_alt_creds()
-                username, tenant_name, password = creds
-                cls.alt_manager = clients.Manager(username=username,
-                                                  password=password,
-                                                  tenant_name=tenant_name)
-            else:
-                # Use the alt_XXX credentials in the config file
-                cls.alt_manager = clients.AltManager()
-            cls.alt_client = cls.alt_manager.images_client
-
-    @skip_because(bug="1006725")
-    @attr(type=['negative', 'gate'])
+    @test.skip_because(bug="1006725")
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_multibyte_character_image_name(self):
         # invalid multibyte sequence from:
         # http://stackoverflow.com/questions/1301402/
         #     example-invalid-utf8-string
         invalid_name = data_utils.rand_name(u'\xc3\x28')
         self.assertRaises(exceptions.BadRequest,
-                          self.client.create_image, self.server_id,
+                          self.servers_client.create_image,
+                          self.server_id,
                           invalid_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_invalid_metadata(self):
         # Return an error when creating image with invalid metadata
         snapshot_name = data_utils.rand_name('test-snap-')
         meta = {'': ''}
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_metadata_over_limits(self):
         # Return an error when creating image with meta data over 256 chars
         snapshot_name = data_utils.rand_name('test-snap-')
         meta = {'a' * 260: 'b' * 260}
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name, meta)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_second_image_when_first_image_is_being_saved(self):
         # Disallow creating another image when first image is being saved
 
         # Create first snapshot
         snapshot_name = data_utils.rand_name('test-snap-')
-        resp, body = self.client.create_image(self.server_id,
-                                              snapshot_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      snapshot_name)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.image_ids.append(image_id)
@@ -127,23 +115,26 @@
 
         # Create second snapshot
         alt_snapshot_name = data_utils.rand_name('test-snap-')
-        self.assertRaises(exceptions.Conflict, self.client.create_image,
+        self.assertRaises(exceptions.Conflict,
+                          self.servers_client.create_image,
                           self.server_id, alt_snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_create_image_specify_name_over_256_chars(self):
         # Return an error if snapshot name over 256 characters is passed
 
         snapshot_name = data_utils.rand_name('a' * 260)
-        self.assertRaises(exceptions.BadRequest, self.client.create_image,
+        self.assertRaises(exceptions.BadRequest,
+                          self.servers_client.create_image,
                           self.server_id, snapshot_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_image_that_is_not_yet_active(self):
         # Return an error while trying to delete an image what is creating
 
         snapshot_name = data_utils.rand_name('test-snap-')
-        resp, body = self.client.create_image(self.server_id, snapshot_name)
+        resp, body = self.servers_client.create_image(self.server_id,
+                                                      snapshot_name)
         self.assertEqual(202, resp.status)
         image_id = data_utils.parse_image_id(resp['location'])
         self.image_ids.append(image_id)
@@ -151,7 +142,7 @@
 
         # Do not wait, attempt to delete the image, ensure it's successful
         resp, body = self.client.delete_image(image_id)
-        self.assertEqual('204', resp['status'])
+        self.assertEqual('200', resp['status'])
         self.image_ids.remove(image_id)
 
         self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
diff --git a/tempest/api/compute/v3/images/test_list_image_filters.py b/tempest/api/compute/v3/images/test_list_image_filters.py
deleted file mode 100644
index 457ca53..0000000
--- a/tempest/api/compute/v3/images/test_list_image_filters.py
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.api.compute import base
-from tempest import config
-from tempest import exceptions
-from tempest.openstack.common import log as logging
-from tempest.test import attr
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class ListImageFiltersTest(base.BaseV2ComputeTest):
-    _interface = 'json'
-
-    @classmethod
-    def setUpClass(cls):
-        super(ListImageFiltersTest, cls).setUpClass()
-        if not CONF.service_available.glance:
-            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-        cls.client = cls.images_client
-        cls.image_ids = []
-
-        try:
-            resp, cls.server1 = cls.create_test_server()
-            resp, cls.server2 = cls.create_test_server(wait_until='ACTIVE')
-            # NOTE(sdague) this is faster than doing the sync wait_util on both
-            cls.servers_client.wait_for_server_status(cls.server1['id'],
-                                                      'ACTIVE')
-
-            # Create images to be used in the filter tests
-            resp, cls.image1 = cls.create_image_from_server(
-                cls.server1['id'], wait_until='ACTIVE')
-            cls.image1_id = cls.image1['id']
-
-            # Servers have a hidden property for when they are being imaged
-            # Performing back-to-back create image calls on a single
-            # server will sometimes cause failures
-            resp, cls.image3 = cls.create_image_from_server(
-                cls.server2['id'], wait_until='ACTIVE')
-            cls.image3_id = cls.image3['id']
-
-            # Wait for the server to be active after the image upload
-            resp, cls.image2 = cls.create_image_from_server(
-                cls.server1['id'], wait_until='ACTIVE')
-            cls.image2_id = cls.image2['id']
-        except Exception:
-            LOG.exception('setUpClass failed')
-            cls.tearDownClass()
-            raise
-
-    @attr(type=['negative', 'gate'])
-    def test_get_image_not_existing(self):
-        # Check raises a NotFound
-        self.assertRaises(exceptions.NotFound, self.client.get_image,
-                          "nonexistingimageid")
-
-    @attr(type='gate')
-    def test_list_images_filter_by_status(self):
-        # The list of images should contain only images with the
-        # provided status
-        params = {'status': 'ACTIVE'}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_name(self):
-        # List of all images should contain the expected images filtered
-        # by name
-        params = {'name': self.image1['name']}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_server_id(self):
-        # The images should contain images filtered by server id
-        params = {'server': self.server1['id']}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]),
-                        "Failed to find image %s in images. Got images %s" %
-                        (self.image1_id, images))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_server_ref(self):
-        # The list of servers should be filtered by server ref
-        server_links = self.server2['links']
-
-        # Try all server link types
-        for link in server_links:
-            params = {'server': link['href']}
-            resp, images = self.client.list_images(params)
-
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image1_id]))
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image2_id]))
-            self.assertTrue(any([i for i in images
-                                 if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_type(self):
-        # The list of servers should be filtered by image type
-        params = {'type': 'snapshot'}
-        resp, images = self.client.list_images(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
-
-    @attr(type='gate')
-    def test_list_images_limit_results(self):
-        # Verify only the expected number of results are returned
-        params = {'limit': '1'}
-        resp, images = self.client.list_images(params)
-        self.assertEqual(1, len([x for x in images if 'id' in x]))
-
-    @attr(type='gate')
-    def test_list_images_filter_by_changes_since(self):
-        # Verify only updated images are returned in the detailed list
-
-        # Becoming ACTIVE will modify the updated time
-        # Filter by the image's created time
-        params = {'changes-since': self.image3['created']}
-        resp, images = self.client.list_images(params)
-        found = any([i for i in images if i['id'] == self.image3_id])
-        self.assertTrue(found)
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_status(self):
-        # Detailed list of all images should only contain images
-        # with the provided status
-        params = {'status': 'ACTIVE'}
-        resp, images = self.client.list_images_with_detail(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_name(self):
-        # Detailed list of all images should contain the expected
-        # images filtered by name
-        params = {'name': self.image1['name']}
-        resp, images = self.client.list_images_with_detail(params)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_limit_results(self):
-        # Verify only the expected number of results (with full details)
-        # are returned
-        params = {'limit': '1'}
-        resp, images = self.client.list_images_with_detail(params)
-        self.assertEqual(1, len(images))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_server_ref(self):
-        # Detailed list of servers should be filtered by server ref
-        server_links = self.server2['links']
-
-        # Try all server link types
-        for link in server_links:
-            params = {'server': link['href']}
-            resp, images = self.client.list_images_with_detail(params)
-
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image1_id]))
-            self.assertFalse(any([i for i in images
-                                  if i['id'] == self.image2_id]))
-            self.assertTrue(any([i for i in images
-                                 if i['id'] == self.image3_id]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_type(self):
-        # The detailed list of servers should be filtered by image type
-        params = {'type': 'snapshot'}
-        resp, images = self.client.list_images_with_detail(params)
-        resp, image4 = self.client.get_image(self.image_ref)
-
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image2_id]))
-        self.assertTrue(any([i for i in images if i['id'] == self.image3_id]))
-        self.assertFalse(any([i for i in images if i['id'] == self.image_ref]))
-
-    @attr(type='gate')
-    def test_list_images_with_detail_filter_by_changes_since(self):
-        # Verify an update image is returned
-
-        # Becoming ACTIVE will modify the updated time
-        # Filter by the image's created time
-        params = {'changes-since': self.image1['created']}
-        resp, images = self.client.list_images_with_detail(params)
-        self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
-
-    @attr(type=['negative', 'gate'])
-    def test_get_nonexistent_image(self):
-        # Negative test: GET on non-existent image should fail
-        self.assertRaises(exceptions.NotFound, self.client.get_image, 999)
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs.py b/tempest/api/compute/v3/keypairs/test_keypairs.py
index 8eef811..668a295 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs.py
@@ -19,7 +19,6 @@
 
 
 class KeyPairsV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
index ae22ccc..e426b85 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
@@ -21,7 +21,6 @@
 
 
 class KeyPairsNegativeV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/servers/test_attach_interfaces.py b/tempest/api/compute/v3/servers/test_attach_interfaces.py
index 272cb53..a3046c7 100644
--- a/tempest/api/compute/v3/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/v3/servers/test_attach_interfaces.py
@@ -24,7 +24,6 @@
 
 
 class AttachInterfacesV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/servers/test_attach_volume.py b/tempest/api/compute/v3/servers/test_attach_volume.py
index d693be5..8577aab 100644
--- a/tempest/api/compute/v3/servers/test_attach_volume.py
+++ b/tempest/api/compute/v3/servers/test_attach_volume.py
@@ -16,15 +16,14 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
 
 class AttachVolumeV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
     run_ssh = CONF.compute.run_ssh
 
     def __init__(self, *args, **kwargs):
@@ -78,7 +77,7 @@
         self.addCleanup(self._detach, server['id'], volume['id'])
 
     @testtools.skipIf(not run_ssh, 'SSH required for this test')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_attach_detach_volume(self):
         # Stop and Start a server with an attached volume, ensuring that
         # the volume remains attached.
@@ -92,9 +91,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user,
-                                    server['admin_password'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['admin_password'])
         partitions = linux_client.get_partitions()
         self.assertIn(self.device, partitions)
 
@@ -107,8 +105,7 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user,
-                                    server['admin_password'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['admin_password'])
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
diff --git a/tempest/api/compute/v3/servers/test_availability_zone.py b/tempest/api/compute/v3/servers/test_availability_zone.py
new file mode 100644
index 0000000..feac9a1
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_availability_zone.py
@@ -0,0 +1,38 @@
+# Copyright 2014 NEC Corporation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class AZV3Test(base.BaseV3ComputeTest):
+
+    """
+    Tests Availability Zone API List
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(AZV3Test, cls).setUpClass()
+        cls.client = cls.availability_zone_client
+
+    @test.attr(type='gate')
+    def test_get_availability_zone_list_with_non_admin_user(self):
+        # List of availability zone with non-administrator user
+        resp, availability_zone = self.client.get_availability_zone_list()
+        self.assertEqual(200, resp.status)
+        self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/compute/v3/servers/test_create_server.py b/tempest/api/compute/v3/servers/test_create_server.py
index 7a4c877..a212ca5 100644
--- a/tempest/api/compute/v3/servers/test_create_server.py
+++ b/tempest/api/compute/v3/servers/test_create_server.py
@@ -20,7 +20,7 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import test
 
@@ -28,7 +28,6 @@
 
 
 class ServersV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
     run_ssh = CONF.compute.run_ssh
     disk_config = 'AUTO'
 
@@ -95,7 +94,8 @@
     @test.attr(type='gate')
     def test_can_log_into_created_server(self):
         # Check that the user can authenticate with the generated password
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertTrue(linux_client.can_authenticate())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
@@ -104,19 +104,20 @@
         # Verify that the number of vcpus reported by the instance matches
         # the amount stated by the flavor
         resp, flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
 
     @testtools.skipIf(not run_ssh, 'Instance validation tests are disabled.')
     @test.attr(type='gate')
     def test_host_name_is_same_as_server_name(self):
         # Verify the instance host name is the same as the server name
-        linux_client = RemoteClient(self.server, self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(self.server,
+                                                  self.ssh_user, self.password)
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
 
 class ServersWithSpecificFlavorV3Test(base.BaseV3ComputeAdminTest):
-    _interface = 'json'
     run_ssh = CONF.compute.run_ssh
     disk_config = 'AUTO'
 
@@ -204,12 +205,12 @@
                                       adminPass=admin_pass,
                                       flavor=flavor_with_eph_disk_id))
         # Get partition number of server without extra specs.
-        linux_client = RemoteClient(server_no_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_no_eph_disk,
+                                                  self.ssh_user, self.password)
         partition_num = len(linux_client.get_partitions())
 
-        linux_client = RemoteClient(server_with_eph_disk,
-                                    self.ssh_user, self.password)
+        linux_client = remote_client.RemoteClient(server_with_eph_disk,
+                                                  self.ssh_user, self.password)
         self.assertEqual(partition_num + 1, linux_client.get_partitions())
 
 
diff --git a/tempest/api/compute/v3/servers/test_delete_server.py b/tempest/api/compute/v3/servers/test_delete_server.py
new file mode 100644
index 0000000..0dfe60e
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_delete_server.py
@@ -0,0 +1,120 @@
+# Copyright 2012 OpenStack Foundation
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class DeleteServersV3Test(base.BaseV3ComputeTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_building_state(self):
+        # Delete a server while it's VM state is Building
+        resp, server = self.create_test_server(wait_until='BUILD')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_active_server(self):
+        # Delete a server while it's VM state is Active
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_shelved_state(self):
+        # Delete a server while it's VM state is Shelved
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.shelve_server(server['id'])
+        self.assertEqual(202, resp.status)
+
+        offload_time = CONF.compute.shelved_offload_time
+        if offload_time >= 0:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED_OFFLOADED',
+                                               extra_timeout=offload_time)
+        else:
+            self.client.wait_for_server_status(server['id'],
+                                               'SHELVED')
+
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.client.wait_for_server_termination(server['id'])
+
+
+class DeleteServersAdminV3Test(base.BaseV3ComputeAdminTest):
+    # NOTE: Server creations of each test class should be under 10
+    # for preventing "Quota exceeded for instances".
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(DeleteServersAdminV3Test, cls).setUpClass()
+        cls.non_admin_client = cls.servers_client
+        cls.admin_client = cls.servers_admin_client
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.admin_client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.non_admin_client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.non_admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'],
+                                                        ignore_error=True)
+
+    @test.attr(type='gate')
+    def test_admin_delete_servers_of_others(self):
+        # Administrator can delete servers of others
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, _ = self.admin_client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+        self.servers_client.wait_for_server_termination(server['id'])
diff --git a/tempest/api/compute/v3/servers/test_instance_actions.py b/tempest/api/compute/v3/servers/test_instance_actions.py
index d536871..7d25100 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions.py
@@ -14,22 +14,20 @@
 #    under the License.
 
 from tempest.api.compute import base
-from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class InstanceActionsV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
         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']
+        cls.resp = resp
         cls.server_id = server['id']
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_instance_actions(self):
         # List actions of the provided server
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -41,23 +39,13 @@
         self.assertTrue(any([i for i in body if i['action'] == 'create']))
         self.assertTrue(any([i for i in body if i['action'] == 'reboot']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
+    @test.skip_because(bug="1281915")
     def test_get_instance_action(self):
         # Get the action details of the provided server
+        request_id = self.resp['x-compute-request-id']
         resp, body = self.client.get_instance_action(self.server_id,
-                                                     self.request_id)
+                                                     request_id)
         self.assertEqual(200, resp.status)
         self.assertEqual(self.server_id, body['instance_uuid'])
         self.assertEqual('create', body['action'])
-
-    @attr(type=['negative', 'gate'])
-    def test_list_instance_actions_invalid_server(self):
-        # List actions of the invalid server id
-        self.assertRaises(exceptions.NotFound,
-                          self.client.list_instance_actions, 'server-999')
-
-    @attr(type=['negative', 'gate'])
-    def test_get_instance_action_invalid_request(self):
-        # Get the action details of the provided server with invalid request
-        self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
-                          self.server_id, '999')
diff --git a/tempest/api/compute/v3/servers/test_instance_actions_negative.py b/tempest/api/compute/v3/servers/test_instance_actions_negative.py
new file mode 100644
index 0000000..bd741e0
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_instance_actions_negative.py
@@ -0,0 +1,44 @@
+# Copyright 2014 NEC Corporation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class InstanceActionsNegativeV3Test(base.BaseV3ComputeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(InstanceActionsNegativeV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+        resp, server = cls.create_test_server(wait_until='ACTIVE')
+        cls.server_id = server['id']
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_instance_actions_invalid_server(self):
+        # List actions of the invalid server id
+        invalid_server_id = data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound,
+                          self.client.list_instance_actions, invalid_server_id)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_get_instance_action_invalid_request(self):
+        # Get the action details of the provided server with invalid request
+        invalid_request_id = 'req-' + data_utils.rand_uuid()
+        self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
+                          self.server_id, invalid_request_id)
diff --git a/tempest/api/compute/v3/servers/test_list_server_filters.py b/tempest/api/compute/v3/servers/test_list_server_filters.py
index 9082eda..ec31e8e 100644
--- a/tempest/api/compute/v3/servers/test_list_server_filters.py
+++ b/tempest/api/compute/v3/servers/test_list_server_filters.py
@@ -18,14 +18,12 @@
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
 
 class ListServerFiltersV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
@@ -74,7 +72,7 @@
         cls.fixed_network_name = CONF.compute.fixed_network_name
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_image(self):
         # Filter the list of servers by image
         params = {'image': self.image_ref}
@@ -85,7 +83,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_flavor(self):
         # Filter the list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -96,7 +94,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_name(self):
         # Filter the list of servers by server name
         params = {'name': self.s1_name}
@@ -107,7 +105,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_server_status(self):
         # Filter the list of servers by server status
         params = {'status': 'active'}
@@ -118,21 +116,21 @@
         self.assertIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 1}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(1, len([x for x in servers['servers'] if 'id' in x]))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_zero_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 0}
         resp, servers = self.client.list_servers(params)
         self.assertEqual(0, len(servers['servers']))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_exceed_limit(self):
         # Verify only the expected number of servers are returned
         params = {'limit': 100000}
@@ -142,7 +140,7 @@
                          len([x for x in servers['servers'] if 'id' in x]))
 
     @utils.skip_unless_attr('multiple_images', 'Only one image found')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_image(self):
         # Filter the detailed list of servers by image
         params = {'image': self.image_ref}
@@ -153,7 +151,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_flavor(self):
         # Filter the detailed list of servers by flavor
         params = {'flavor': self.flavor_ref_alt}
@@ -164,7 +162,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_name(self):
         # Filter the detailed list of servers by server name
         params = {'name': self.s1_name}
@@ -175,7 +173,7 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_filter_by_server_status(self):
         # Filter the detailed list of servers by server status
         params = {'status': 'active'}
@@ -188,7 +186,7 @@
         self.assertIn(self.s3['id'], map(lambda x: x['id'], servers))
         self.assertEqual(['ACTIVE'] * 3, [x['status'] for x in servers])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filter_by_shutoff_status(self):
         # Filter the list of servers by server shutoff status
         params = {'status': 'shutoff'}
@@ -205,7 +203,7 @@
         self.assertNotIn(self.s2['id'], map(lambda x: x['id'], servers))
         self.assertNotIn(self.s3['id'], map(lambda x: x['id'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_name_wildcard(self):
         # List all servers that contains '-instance' in name
         params = {'name': '-instance'}
@@ -227,8 +225,8 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1170718")
-    @attr(type='gate')
+    @test.skip_because(bug="1170718")
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip(self):
         # Filter servers by ip
         # Here should be listed 1 server
@@ -242,9 +240,9 @@
         self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertNotIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @skip_because(bug="1182883",
-                  condition=CONF.service_available.neutron)
-    @attr(type='gate')
+    @test.skip_because(bug="1182883",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
     def test_list_servers_filtered_by_ip_regex(self):
         # Filter servers by regex ip
         # List all servers filtered by part of ip address.
@@ -259,7 +257,7 @@
         self.assertIn(self.s2_name, map(lambda x: x['name'], servers))
         self.assertIn(self.s3_name, map(lambda x: x['name'], servers))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_servers_detailed_limit_results(self):
         # Verify only the expected number of detailed results are returned
         params = {'limit': 1}
diff --git a/tempest/api/compute/v3/servers/test_list_servers_negative.py b/tempest/api/compute/v3/servers/test_list_servers_negative.py
index 09e1bb6..9a46193 100644
--- a/tempest/api/compute/v3/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_list_servers_negative.py
@@ -21,7 +21,6 @@
 
 
 class ListServersNegativeV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
     force_tenant_isolation = True
 
     @classmethod
diff --git a/tempest/api/compute/v3/servers/test_multiple_create.py b/tempest/api/compute/v3/servers/test_multiple_create.py
index f1ae5f8..23e0854 100644
--- a/tempest/api/compute/v3/servers/test_multiple_create.py
+++ b/tempest/api/compute/v3/servers/test_multiple_create.py
@@ -15,12 +15,10 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest import exceptions
 from tempest import test
 
 
 class MultipleCreateV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
     _name = 'multiple-create-test'
 
     def _generate_name(self):
@@ -47,38 +45,6 @@
         self.assertEqual('202', resp['status'])
         self.assertNotIn('reservation_id', body)
 
-    @test.attr(type=['negative', 'gate'])
-    def test_min_count_less_than_one(self):
-        invalid_min_count = 0
-        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
-                          min_count=invalid_min_count)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_min_count_non_integer(self):
-        invalid_min_count = 2.5
-        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
-                          min_count=invalid_min_count)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_max_count_less_than_one(self):
-        invalid_max_count = 0
-        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
-                          max_count=invalid_max_count)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_max_count_non_integer(self):
-        invalid_max_count = 2.5
-        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
-                          max_count=invalid_max_count)
-
-    @test.attr(type=['negative', 'gate'])
-    def test_max_count_less_than_min_count(self):
-        min_count = 3
-        max_count = 2
-        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
-                          min_count=min_count,
-                          max_count=max_count)
-
     @test.attr(type='gate')
     def test_multiple_create_with_reservation_return(self):
         resp, body = self._create_multiple_servers(wait_until='ACTIVE',
diff --git a/tempest/api/compute/v3/servers/test_multiple_create_negative.py b/tempest/api/compute/v3/servers/test_multiple_create_negative.py
new file mode 100644
index 0000000..57bb807
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_multiple_create_negative.py
@@ -0,0 +1,69 @@
+# Copyright 2013 IBM Corp
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class MultipleCreateV3NegativeTest(base.BaseV3ComputeTest):
+    _interface = 'json'
+    _name = 'multiple-create-negative-test'
+
+    def _generate_name(self):
+        return data_utils.rand_name(self._name)
+
+    def _create_multiple_servers(self, name=None, wait_until=None, **kwargs):
+        """
+        This is the right way to create_multiple servers and manage to get the
+        created servers into the servers list to be cleaned up after all.
+        """
+        kwargs['name'] = kwargs.get('name', self._generate_name())
+        resp, body = self.create_test_server(**kwargs)
+
+        return resp, body
+
+    @test.attr(type=['negative', 'gate'])
+    def test_min_count_less_than_one(self):
+        invalid_min_count = 0
+        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
+                          min_count=invalid_min_count)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_min_count_non_integer(self):
+        invalid_min_count = 2.5
+        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
+                          min_count=invalid_min_count)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_max_count_less_than_one(self):
+        invalid_max_count = 0
+        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
+                          max_count=invalid_max_count)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_max_count_non_integer(self):
+        invalid_max_count = 2.5
+        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
+                          max_count=invalid_max_count)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_max_count_less_than_min_count(self):
+        min_count = 3
+        max_count = 2
+        self.assertRaises(exceptions.BadRequest, self._create_multiple_servers,
+                          min_count=min_count,
+                          max_count=max_count)
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index 0dae796..e642715 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -19,17 +19,15 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
 
 class ServerActionsV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
     resize_available = CONF.compute_feature_enabled.resize
     run_ssh = CONF.compute.run_ssh
 
@@ -52,7 +50,7 @@
 
     @testtools.skipUnless(CONF.compute_feature_enabled.change_password,
                           'Change password not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_change_server_password(self):
         # The server's password should be set to the provided password
         new_password = 'Newpass1234'
@@ -63,16 +61,18 @@
         if self.run_ssh:
             # Verify that the user can authenticate with the new password
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, new_password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      new_password)
             linux_client.validate_authentication()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_reboot_server_hard(self):
         # The server should be power cycled
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'HARD')
@@ -81,18 +81,20 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertGreater(new_boot_time, boot_time)
 
-    @skip_because(bug="1014647")
-    @attr(type='smoke')
+    @test.skip_because(bug="1014647")
+    @test.attr(type='smoke')
     def test_reboot_server_soft(self):
         # The server should be signaled to reboot gracefully
         if self.run_ssh:
             # Get the time the server was last rebooted,
             resp, server = self.client.get_server(self.server_id)
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             boot_time = linux_client.get_boot_time()
 
         resp, body = self.client.reboot(self.server_id, 'SOFT')
@@ -101,11 +103,12 @@
 
         if self.run_ssh:
             # Log in and verify the boot time has changed
-            linux_client = RemoteClient(server, self.ssh_user, self.password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      self.password)
             new_boot_time = linux_client.get_boot_time()
             self.assertGreater(new_boot_time, boot_time)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_rebuild_server(self):
         # The server should be rebuilt using the provided image and data
         meta = {'rebuild': 'server'}
@@ -133,10 +136,11 @@
 
         if self.run_ssh:
             # Verify that the user can authenticate with the provided password
-            linux_client = RemoteClient(server, self.ssh_user, password)
+            linux_client = remote_client.RemoteClient(server, self.ssh_user,
+                                                      password)
             linux_client.validate_authentication()
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_rebuild_server_in_stop_state(self):
         # The server in stop state  should be rebuilt using the provided
         # image and remain in SHUTOFF state
@@ -174,7 +178,7 @@
         return current_flavor, new_flavor_ref
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_resize_server_confirm(self):
         # The server's RAM and disk space should be modified to that of
         # the provided flavor
@@ -193,7 +197,7 @@
         self.assertEqual(new_flavor_ref, server['flavor']['id'])
 
     @testtools.skipIf(not resize_available, 'Resize not available.')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_resize_server_revert(self):
         # The server's RAM and disk space should return to its original
         # values after a resize is reverted
@@ -221,7 +225,7 @@
                 required time (%s s).' % (self.server_id, self.build_timeout)
                 raise exceptions.TimeoutException(message)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
@@ -303,7 +307,7 @@
         lines = len(output.split('\n'))
         self.assertEqual(lines, 10)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id and number of lines
@@ -319,7 +323,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_console_output_server_id_in_shutoff_status(self):
         # Positive test:Should be able to GET the console output
         # for a given server_id in SHUTOFF status
@@ -336,7 +340,7 @@
 
         self.wait_for(self._get_output)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_pause_unpause_server(self):
         resp, server = self.client.pause_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -345,7 +349,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_suspend_resume_server(self):
         resp, server = self.client.suspend_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -354,7 +358,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_shelve_unshelve_server(self):
         resp, server = self.client.shelve_server(self.server_id)
         self.assertEqual(202, resp.status)
@@ -378,7 +382,7 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_stop_start_server(self):
         resp, server = self.servers_client.stop(self.server_id)
         self.assertEqual(202, resp.status)
@@ -387,7 +391,7 @@
         self.assertEqual(202, resp.status)
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_lock_unlock_server(self):
         # Lock the server,try server stop(exceptions throw),unlock it and retry
         resp, server = self.servers_client.lock_server(self.server_id)
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index bffa7c4..335bd3d 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -14,12 +14,14 @@
 #    under the License.
 
 from tempest.api.compute import base
+from tempest import config
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
+
+CONF = config.CONF
 
 
 class ServerAddressesV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
@@ -30,20 +32,22 @@
 
         resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_list_server_addresses_invalid_server_id(self):
         # List addresses request should fail if server id not in system
         self.assertRaises(exceptions.NotFound, self.client.list_addresses,
                           '999')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_list_server_addresses_by_network_neg(self):
         # List addresses by network should fail if network name not valid
         self.assertRaises(exceptions.NotFound,
                           self.client.list_addresses_by_network,
                           self.server['id'], 'invalid')
 
-    @attr(type='smoke')
+    @test.skip_because(bug="1210483",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='smoke')
     def test_list_server_addresses(self):
         # All public and private addresses for
         # a server should be returned
@@ -60,7 +64,7 @@
                 self.assertTrue(address['addr'])
                 self.assertTrue(address['version'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_server_addresses_by_network(self):
         # Providing a network type should filter
         # the addresses return by that type
diff --git a/tempest/api/compute/v3/servers/test_server_metadata.py b/tempest/api/compute/v3/servers/test_server_metadata.py
index 13c82dd..0e4ef07 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata.py
@@ -18,7 +18,6 @@
 
 
 class ServerMetadataV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/servers/test_server_metadata_negative.py b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
index ce6c340..ec2bc8c 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
@@ -19,7 +19,6 @@
 
 
 class ServerMetadataV3NegativeTest(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/servers/test_server_password.py b/tempest/api/compute/v3/servers/test_server_password.py
new file mode 100644
index 0000000..fc0b145
--- /dev/null
+++ b/tempest/api/compute/v3/servers/test_server_password.py
@@ -0,0 +1,37 @@
+# Copyright 2013 IBM Corporation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class ServerPasswordV3Test(base.BaseV3ComputeTest):
+
+    @classmethod
+    def setUpClass(cls):
+        super(ServerPasswordV3Test, cls).setUpClass()
+        cls.client = cls.servers_client
+        resp, cls.server = cls.create_test_server(wait_until="ACTIVE")
+
+    @test.attr(type='gate')
+    def test_get_server_password(self):
+        resp, body = self.client.get_password(self.server['id'])
+        self.assertEqual(200, resp.status)
+
+    @test.attr(type='gate')
+    def test_delete_server_password(self):
+        resp, body = self.client.delete_password(self.server['id'])
+        self.assertEqual(204, resp.status)
diff --git a/tempest/api/compute/v3/servers/test_server_rescue.py b/tempest/api/compute/v3/servers/test_server_rescue.py
index fa7def0..5d7f91d 100644
--- a/tempest/api/compute/v3/servers/test_server_rescue.py
+++ b/tempest/api/compute/v3/servers/test_server_rescue.py
@@ -20,7 +20,6 @@
 
 
 class ServerRescueV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index dc64c40..426ee8d 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -19,7 +19,6 @@
 
 
 class ServersV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
@@ -105,38 +104,6 @@
                          server['os-access-ips:access_ip_v6'])
 
     @test.attr(type='gate')
-    def test_delete_server_while_in_shutoff_state(self):
-        # Delete a server while it's VM state is Shutoff
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.stop(server['id'])
-        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
-    def test_delete_server_while_in_pause_state(self):
-        # Delete a server while it's VM state is Pause
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, body = self.client.pause_server(server['id'])
-        self.client.wait_for_server_status(server['id'], 'PAUSED')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
-    def test_delete_server_while_in_building_state(self):
-        # Delete a server while it's VM state is Building
-        resp, server = self.create_test_server(wait_until='BUILD')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
-    def test_delete_active_server(self):
-        # Delete a server while it's VM state is Active
-        resp, server = self.create_test_server(wait_until='ACTIVE')
-        resp, _ = self.client.delete_server(server['id'])
-        self.assertEqual('204', resp['status'])
-
-    @test.attr(type='gate')
     def test_create_server_with_ipv6_addr_only(self):
         # Create a server without an IPv4 address(only IPv6 address).
         resp, server = self.create_test_server(access_ip_v6='2001:2001::3')
diff --git a/tempest/api/compute/v3/servers/test_servers_negative.py b/tempest/api/compute/v3/servers/test_servers_negative.py
index 12e0ad8..cb5e93d 100644
--- a/tempest/api/compute/v3/servers/test_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_servers_negative.py
@@ -27,7 +27,6 @@
 
 
 class ServersNegativeV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     def setUp(self):
         super(ServersNegativeV3Test, self).setUp()
diff --git a/tempest/api/compute/v3/test_extensions.py b/tempest/api/compute/v3/test_extensions.py
index 09f5ab4..3c612df 100644
--- a/tempest/api/compute/v3/test_extensions.py
+++ b/tempest/api/compute/v3/test_extensions.py
@@ -25,7 +25,6 @@
 
 
 class ExtensionsV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @test.attr(type='gate')
     def test_list_extensions(self):
diff --git a/tempest/api/compute/v3/test_live_block_migration.py b/tempest/api/compute/v3/test_live_block_migration.py
index 144cadb..33d2bd9 100644
--- a/tempest/api/compute/v3/test_live_block_migration.py
+++ b/tempest/api/compute/v3/test_live_block_migration.py
@@ -13,14 +13,10 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import random
-import string
-
 import testtools
 
 from tempest.api.compute import base
 from tempest import config
-from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -28,7 +24,6 @@
 
 class LiveBlockMigrationV3Test(base.BaseV3ComputeAdminTest):
     _host_key = 'os-extended-server-attributes:host'
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
@@ -66,14 +61,6 @@
             if host != target_host:
                 return target_host
 
-    def _get_non_existing_host_name(self):
-        random_name = ''.join(
-            random.choice(string.ascii_uppercase) for x in range(20))
-
-        self.assertNotIn(random_name, self._get_compute_hostnames())
-
-        return random_name
-
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
@@ -111,18 +98,6 @@
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
 
-    @testtools.skipIf(not CONF.compute_feature_enabled.live_migration,
-                      'Live migration not available')
-    @attr(type='gate')
-    def test_invalid_host_for_migration(self):
-        # Migrating to an invalid host should not change the status
-        server_id = self._get_an_active_server()
-        target_host = self._get_non_existing_host_name()
-
-        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
-                          server_id, target_host)
-        self.assertEqual('ACTIVE', self._get_server_status(server_id))
-
     @testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
                       CONF.compute_feature_enabled.
                       block_migration_for_live_migration,
@@ -155,10 +130,3 @@
         self._migrate_server_to(server_id, target_host)
         self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
         self.assertEqual(target_host, self._get_host_for_server(server_id))
-
-    @classmethod
-    def tearDownClass(cls):
-        for server_id in cls.created_server_ids:
-            cls.servers_client.delete_server(server_id)
-
-        super(LiveBlockMigrationV3Test, cls).tearDownClass()
diff --git a/tempest/api/compute/v3/test_live_block_migration_negative.py b/tempest/api/compute/v3/test_live_block_migration_negative.py
new file mode 100644
index 0000000..b4ec505
--- /dev/null
+++ b/tempest/api/compute/v3/test_live_block_migration_negative.py
@@ -0,0 +1,53 @@
+# Copyright 2012 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class LiveBlockMigrationV3NegativeTest(base.BaseV3ComputeAdminTest):
+    _host_key = 'os-extended-server-attributes:host'
+
+    @classmethod
+    def setUpClass(cls):
+        super(LiveBlockMigrationV3NegativeTest, cls).setUpClass()
+        if not CONF.compute_feature_enabled.live_migration:
+            raise cls.skipException("Live migration is not enabled")
+
+        cls.admin_hosts_client = cls.hosts_admin_client
+        cls.admin_servers_client = cls.servers_admin_client
+
+    def _migrate_server_to(self, server_id, dest_host):
+        _resp, body = self.admin_servers_client.live_migrate_server(
+            server_id, dest_host,
+            CONF.compute_feature_enabled.
+            block_migration_for_live_migration)
+        return body
+
+    @test.attr(type=['negative', 'gate'])
+    def test_invalid_host_for_migration(self):
+        # Migrating to an invalid host should not change the status
+        target_host = data_utils.rand_name('host-')
+        _, server = self.create_test_server(wait_until="ACTIVE")
+        server_id = server['id']
+        self.assertRaises(exceptions.BadRequest, self._migrate_server_to,
+                          server_id, target_host)
+        self.servers_client.wait_for_server_status(server_id, 'ACTIVE')
diff --git a/tempest/api/compute/v3/test_quotas.py b/tempest/api/compute/v3/test_quotas.py
index 33b90ff..b53d9be 100644
--- a/tempest/api/compute/v3/test_quotas.py
+++ b/tempest/api/compute/v3/test_quotas.py
@@ -18,7 +18,6 @@
 
 
 class QuotasV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/api/compute/v3/test_version.py b/tempest/api/compute/v3/test_version.py
index 9161d4d..1a74e35 100644
--- a/tempest/api/compute/v3/test_version.py
+++ b/tempest/api/compute/v3/test_version.py
@@ -19,7 +19,6 @@
 
 
 class VersionV3Test(base.BaseV3ComputeTest):
-    _interface = 'json'
 
     @test.attr(type='gate')
     def test_version(self):
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 8d8e3ec..7a60196 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -16,9 +16,9 @@
 import testtools
 
 from tempest.api.compute import base
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -78,7 +78,7 @@
         self.addCleanup(self._detach, server['id'], volume['id'])
 
     @testtools.skipIf(not run_ssh, 'SSH required for this test')
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_attach_detach_volume(self):
         # Stop and Start a server with an attached volume, ensuring that
         # the volume remains attached.
@@ -92,8 +92,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user, server['adminPass'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['adminPass'])
         partitions = linux_client.get_partitions()
         self.assertIn(self.device, partitions)
 
@@ -106,8 +106,8 @@
         self.servers_client.start(server['id'])
         self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
 
-        linux_client = RemoteClient(server,
-                                    self.image_ssh_user, server['adminPass'])
+        linux_client = remote_client.RemoteClient(server, self.image_ssh_user,
+                                                  server['adminPass'])
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
 
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index bcab891..73e3b3a 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -16,8 +16,8 @@
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from testtools.matchers import ContainsAll
+from tempest import test
+from testtools import matchers
 
 CONF = config.CONF
 
@@ -34,7 +34,7 @@
             skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_create_get_delete(self):
         # CREATE, GET, DELETE Volume
         volume = None
@@ -68,7 +68,7 @@
                          'The fetched Volume is different '
                          'from the created Volume')
         self.assertThat(fetched_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
 
diff --git a/tempest/api/identity/admin/test_roles.py b/tempest/api/identity/admin/test_roles.py
index f1124e4..aa64969 100644
--- a/tempest/api/identity/admin/test_roles.py
+++ b/tempest/api/identity/admin/test_roles.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class RolesTestJSON(base.BaseIdentityAdminTest):
+class RolesTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index e5c04de..7a0bdea 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class RolesNegativeTestJSON(base.BaseIdentityAdminTest):
+class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     def _get_role_params(self):
diff --git a/tempest/api/identity/admin/test_services.py b/tempest/api/identity/admin/test_services.py
index 8ba333f..cbf6b58 100644
--- a/tempest/api/identity/admin/test_services.py
+++ b/tempest/api/identity/admin/test_services.py
@@ -20,7 +20,7 @@
 from tempest.test import attr
 
 
-class ServicesTestJSON(base.BaseIdentityAdminTest):
+class ServicesTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     def _del_service(self, service_id):
diff --git a/tempest/api/identity/admin/test_tenant_negative.py b/tempest/api/identity/admin/test_tenant_negative.py
index e9eddc8..44b54b8 100644
--- a/tempest/api/identity/admin/test_tenant_negative.py
+++ b/tempest/api/identity/admin/test_tenant_negative.py
@@ -21,7 +21,7 @@
 from tempest.test import attr
 
 
-class TenantsNegativeTestJSON(base.BaseIdentityAdminTest):
+class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type=['negative', 'gate'])
diff --git a/tempest/api/identity/admin/test_tenants.py b/tempest/api/identity/admin/test_tenants.py
index 46fa7a9..c7cacb4 100644
--- a/tempest/api/identity/admin/test_tenants.py
+++ b/tempest/api/identity/admin/test_tenants.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class TenantsTestJSON(base.BaseIdentityAdminTest):
+class TenantsTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/identity/admin/test_tokens.py b/tempest/api/identity/admin/test_tokens.py
index 620e293..239433b 100644
--- a/tempest/api/identity/admin/test_tokens.py
+++ b/tempest/api/identity/admin/test_tokens.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class TokensTestJSON(base.BaseIdentityAdminTest):
+class TokensTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index 39ef947..a4e6c17 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -13,14 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import Contains
+from testtools import matchers
 
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
-class UsersTestJSON(base.BaseIdentityAdminTest):
+class UsersTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -30,7 +30,7 @@
         cls.alt_password = data_utils.rand_name('pass_')
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_user(self):
         # Create a user
         self.data.setup_test_tenant()
@@ -41,7 +41,7 @@
         self.assertEqual('200', resp['status'])
         self.assertEqual(self.alt_user, user['name'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_user_with_enabled(self):
         # Create a user with enabled : False
         self.data.setup_test_tenant()
@@ -55,7 +55,7 @@
         self.assertEqual('false', str(user['enabled']).lower())
         self.assertEqual(self.alt_email, user['email'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_user(self):
         # Test case to check if updating of user attributes is successful.
         test_user = data_utils.rand_name('test_user_')
@@ -83,7 +83,7 @@
         self.assertEqual(u_email2, updated_user['email'])
         self.assertEqual('false', str(updated_user['enabled']).lower())
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_user(self):
         # Delete a user
         test_user = data_utils.rand_name('test_user_')
@@ -95,7 +95,7 @@
         resp, body = self.client.delete_user(user['id'])
         self.assertEqual('204', resp['status'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_user_authentication(self):
         # Valid user's token is authenticated
         self.data.setup_test_user()
@@ -108,7 +108,7 @@
                                             self.data.test_tenant)
         self.assertEqual('200', resp['status'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_authentication_request_without_token(self):
         # Request for token authentication with a valid token in header
         self.data.setup_test_user()
@@ -125,16 +125,16 @@
         self.assertEqual('200', resp['status'])
         self.client.auth_provider.clear_auth()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_users(self):
         # Get a list of users and find the test user
         self.data.setup_test_user()
         resp, users = self.client.get_users()
         self.assertThat([u['name'] for u in users],
-                        Contains(self.data.test_user),
+                        matchers.Contains(self.data.test_user),
                         "Could not find %s" % self.data.test_user)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_users_for_tenant(self):
         # Return a list of all users for a tenant
         self.data.setup_test_tenant()
@@ -167,7 +167,7 @@
                          "Failed to find user %s in fetched list" %
                          ', '.join(m_user for m_user in missing_users))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_list_users_with_roles_for_tenant(self):
         # Return list of users on tenant when roles are assigned to users
         self.data.setup_test_user()
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index 060f24a..1188325 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -20,7 +20,7 @@
 import uuid
 
 
-class UsersNegativeTestJSON(base.BaseIdentityAdminTest):
+class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 753eaa6..5f22d43 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class CredentialsTestJSON(base.BaseIdentityAdminTest):
+class CredentialsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -32,23 +32,23 @@
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
         for i in range(2):
-            resp, cls.project = cls.v3_client.create_project(
+            resp, cls.project = cls.client.create_project(
                 data_utils.rand_name('project-'),
                 description=data_utils.rand_name('project-desc-'))
             assert resp['status'] == '201', "Expected %s" % resp['status']
             cls.projects.append(cls.project['id'])
 
-        resp, cls.user_body = cls.v3_client.create_user(
+        resp, cls.user_body = cls.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=cls.projects[0])
         assert resp['status'] == '201', "Expected: %s" % resp['status']
 
     @classmethod
     def tearDownClass(cls):
-        resp, _ = cls.v3_client.delete_user(cls.user_body['id'])
+        resp, _ = cls.client.delete_user(cls.user_body['id'])
         assert resp['status'] == '204', "Expected: %s" % resp['status']
         for p in cls.projects:
-            resp, _ = cls.v3_client.delete_project(p)
+            resp, _ = cls.client.delete_project(p)
             assert resp['status'] == '204', "Expected: %s" % resp['status']
         super(CredentialsTestJSON, cls).tearDownClass()
 
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 4017b62..086d235 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -19,14 +19,14 @@
 from tempest.test import attr
 
 
-class DomainsTestJSON(base.BaseIdentityAdminTest):
+class DomainsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_domain(self, domain_id):
         # It is necessary to disable the domain before deleting,
         # or else it would result in unauthorized error
-        _, body = self.v3_client.update_domain(domain_id, enabled=False)
-        resp, _ = self.v3_client.delete_domain(domain_id)
+        _, body = self.client.update_domain(domain_id, enabled=False)
+        resp, _ = self.client.delete_domain(domain_id)
         self.assertEqual(204, resp.status)
 
     @attr(type='smoke')
@@ -35,14 +35,14 @@
         domain_ids = list()
         fetched_ids = list()
         for _ in range(3):
-            _, domain = self.v3_client.create_domain(
+            _, domain = self.client.create_domain(
                 data_utils.rand_name('domain-'),
                 description=data_utils.rand_name('domain-desc-'))
             # Delete the domain at the end of this method
             self.addCleanup(self._delete_domain, domain['id'])
             domain_ids.append(domain['id'])
         # List and Verify Domains
-        resp, body = self.v3_client.list_domains()
+        resp, body = self.client.list_domains()
         self.assertEqual(resp['status'], '200')
         for d in body:
             fetched_ids.append(d['id'])
@@ -53,7 +53,7 @@
     def test_create_update_delete_domain(self):
         d_name = data_utils.rand_name('domain-')
         d_desc = data_utils.rand_name('domain-desc-')
-        resp_1, domain = self.v3_client.create_domain(
+        resp_1, domain = self.client.create_domain(
             d_name, description=d_desc)
         self.assertEqual(resp_1['status'], '201')
         self.addCleanup(self._delete_domain, domain['id'])
@@ -72,7 +72,7 @@
         new_desc = data_utils.rand_name('new-desc-')
         new_name = data_utils.rand_name('new-name-')
 
-        resp_2, updated_domain = self.v3_client.update_domain(
+        resp_2, updated_domain = self.client.update_domain(
             domain['id'], name=new_name, description=new_desc)
         self.assertEqual(resp_2['status'], '200')
         self.assertIn('id', updated_domain)
@@ -85,7 +85,7 @@
         self.assertEqual(new_desc, updated_domain['description'])
         self.assertEqual('true', str(updated_domain['enabled']).lower())
 
-        resp_3, fetched_domain = self.v3_client.get_domain(domain['id'])
+        resp_3, fetched_domain = self.client.get_domain(domain['id'])
         self.assertEqual(resp_3['status'], '200')
         self.assertEqual(new_name, fetched_domain['name'])
         self.assertEqual(new_desc, fetched_domain['description'])
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 4ae7884..78ecf93 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class EndPointsTestJSON(base.BaseIdentityAdminTest):
+class EndPointsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -31,8 +31,8 @@
         s_type = data_utils.rand_name('type--')
         s_description = data_utils.rand_name('description-')
         resp, cls.service_data =\
-            cls.identity_client.create_service(s_name, s_type,
-                                               description=s_description)
+            cls.service_client.create_service(s_name, s_type,
+                                              description=s_description)
         cls.service_id = cls.service_data['id']
         cls.service_ids.append(cls.service_id)
         # Create endpoints so as to use for LIST and GET test cases
@@ -50,7 +50,7 @@
         for e in cls.setup_endpoints:
             cls.client.delete_endpoint(e['id'])
         for s in cls.service_ids:
-            cls.identity_client.delete_service(s)
+            cls.service_client.delete_service(s)
         super(EndPointsTestJSON, cls).tearDownClass()
 
     @attr(type='gate')
@@ -107,8 +107,8 @@
         s_type = data_utils.rand_name('type--')
         s_description = data_utils.rand_name('description-')
         resp, self.service2 =\
-            self.identity_client.create_service(s_name, s_type,
-                                                description=s_description)
+            self.service_client.create_service(s_name, s_type,
+                                               description=s_description)
         self.service_ids.append(self.service2['id'])
         # Updating endpoint with new values
         region2 = data_utils.rand_name('region')
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 70afec7..6e898b2 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -18,7 +18,7 @@
 from tempest import test
 
 
-class GroupsV3TestJSON(base.BaseIdentityAdminTest):
+class GroupsV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -29,23 +29,23 @@
     def test_group_create_update_get(self):
         name = data_utils.rand_name('Group')
         description = data_utils.rand_name('Description')
-        resp, group = self.v3_client.create_group(name,
-                                                  description=description)
-        self.addCleanup(self.v3_client.delete_group, group['id'])
+        resp, group = self.client.create_group(name,
+                                               description=description)
+        self.addCleanup(self.client.delete_group, group['id'])
         self.assertEqual(resp['status'], '201')
         self.assertEqual(group['name'], name)
         self.assertEqual(group['description'], description)
 
         new_name = data_utils.rand_name('UpdateGroup')
         new_desc = data_utils.rand_name('UpdateDescription')
-        resp, updated_group = self.v3_client.update_group(group['id'],
-                                                          name=new_name,
-                                                          description=new_desc)
+        resp, updated_group = self.client.update_group(group['id'],
+                                                       name=new_name,
+                                                       description=new_desc)
         self.assertEqual(resp['status'], '200')
         self.assertEqual(updated_group['name'], new_name)
         self.assertEqual(updated_group['description'], new_desc)
 
-        resp, new_group = self.v3_client.get_group(group['id'])
+        resp, new_group = self.client.get_group(group['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(group['id'], new_group['id'])
         self.assertEqual(new_name, new_group['name'])
@@ -54,27 +54,27 @@
     @test.attr(type='smoke')
     def test_group_users_add_list_delete(self):
         name = data_utils.rand_name('Group')
-        resp, group = self.v3_client.create_group(name)
-        self.addCleanup(self.v3_client.delete_group, group['id'])
+        resp, group = self.client.create_group(name)
+        self.addCleanup(self.client.delete_group, group['id'])
         # add user into group
         users = []
         for i in range(3):
             name = data_utils.rand_name('User')
-            resp, user = self.v3_client.create_user(name)
+            resp, user = self.client.create_user(name)
             users.append(user)
-            self.addCleanup(self.v3_client.delete_user, user['id'])
-            self.v3_client.add_group_user(group['id'], user['id'])
+            self.addCleanup(self.client.delete_user, user['id'])
+            self.client.add_group_user(group['id'], user['id'])
 
         # list users in group
-        resp, group_users = self.v3_client.list_group_users(group['id'])
+        resp, group_users = self.client.list_group_users(group['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(users.sort(), group_users.sort())
         # delete user in group
         for user in users:
-            resp, body = self.v3_client.delete_group_user(group['id'],
-                                                          user['id'])
+            resp, body = self.client.delete_group_user(group['id'],
+                                                       user['id'])
             self.assertEqual(resp['status'], '204')
-        resp, group_users = self.v3_client.list_group_users(group['id'])
+        resp, group_users = self.client.list_group_users(group['id'])
         self.assertEqual(len(group_users), 0)
 
 
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 0e8e4c3..3e04b5f 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class PoliciesTestJSON(base.BaseIdentityAdminTest):
+class PoliciesTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_policy(self, policy_id):
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 1fc5a6a..be03a03 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -16,179 +16,179 @@
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
-class ProjectsTestJSON(base.BaseIdentityAdminTest):
+class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     def _delete_project(self, project_id):
-        resp, _ = self.v3_client.delete_project(project_id)
+        resp, _ = self.client.delete_project(project_id)
         self.assertEqual(resp['status'], '204')
         self.assertRaises(
-            exceptions.NotFound, self.v3_client.get_project, project_id)
+            exceptions.NotFound, self.client.get_project, project_id)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_list_delete(self):
         # Create several projects and delete them
         for _ in xrange(3):
-            resp, project = self.v3_client.create_project(
+            resp, project = self.client.create_project(
                 data_utils.rand_name('project-new'))
             self.addCleanup(self._delete_project, project['id'])
 
-        resp, list_projects = self.v3_client.list_projects()
+        resp, list_projects = self.client.list_projects()
         self.assertEqual(resp['status'], '200')
 
-        resp, get_project = self.v3_client.get_project(project['id'])
+        resp, get_project = self.client.get_project(project['id'])
         self.assertIn(get_project, list_projects)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_create_with_description(self):
         # Create project with a description
         project_name = data_utils.rand_name('project-')
         project_desc = data_utils.rand_name('desc-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, description=project_desc)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         st1 = resp['status']
         project_id = project['id']
         desc1 = project['description']
         self.assertEqual(st1, '201')
         self.assertEqual(desc1, project_desc, 'Description should have '
                          'been sent in response for create')
-        resp, body = self.v3_client.get_project(project_id)
+        resp, body = self.client.get_project(project_id)
         desc2 = body['description']
         self.assertEqual(desc2, project_desc, 'Description does not appear'
                          'to be set')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_create_enabled(self):
         # Create a project that is enabled
         project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, enabled=True)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         project_id = project['id']
         st1 = resp['status']
         en1 = project['enabled']
         self.assertEqual(st1, '201')
         self.assertTrue(en1, 'Enable should be True in response')
-        resp, body = self.v3_client.get_project(project_id)
+        resp, body = self.client.get_project(project_id)
         en2 = body['enabled']
         self.assertTrue(en2, 'Enable should be True in lookup')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_create_not_enabled(self):
         # Create a project that is not enabled
         project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             project_name, enabled=False)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         st1 = resp['status']
         en1 = project['enabled']
         self.assertEqual(st1, '201')
         self.assertEqual('false', str(en1).lower(),
                          'Enable should be False in response')
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         en2 = body['enabled']
         self.assertEqual('false', str(en2).lower(),
                          'Enable should be False in lookup')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_update_name(self):
         # Update name attribute of a project
         p_name1 = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(p_name1)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name1)
+        self.data.projects.append(project)
 
         resp1_name = project['name']
 
         p_name2 = data_utils.rand_name('project2-')
-        resp, body = self.v3_client.update_project(project['id'], name=p_name2)
+        resp, body = self.client.update_project(project['id'], name=p_name2)
         st2 = resp['status']
         resp2_name = body['name']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_name, resp2_name)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_name = body['name']
 
         self.assertNotEqual(resp1_name, resp3_name)
         self.assertEqual(p_name1, resp1_name)
         self.assertEqual(resp2_name, resp3_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_update_desc(self):
         # Update description attribute of a project
         p_name = data_utils.rand_name('project-')
         p_desc = data_utils.rand_name('desc-')
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             p_name, description=p_desc)
-        self.v3data.projects.append(project)
+        self.data.projects.append(project)
         resp1_desc = project['description']
 
         p_desc2 = data_utils.rand_name('desc2-')
-        resp, body = self.v3_client.update_project(
+        resp, body = self.client.update_project(
             project['id'], description=p_desc2)
         st2 = resp['status']
         resp2_desc = body['description']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_desc, resp2_desc)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_desc = body['description']
 
         self.assertNotEqual(resp1_desc, resp3_desc)
         self.assertEqual(p_desc, resp1_desc)
         self.assertEqual(resp2_desc, resp3_desc)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_project_update_enable(self):
         # Update the enabled attribute of a project
         p_name = data_utils.rand_name('project-')
         p_en = False
-        resp, project = self.v3_client.create_project(p_name, enabled=p_en)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name, enabled=p_en)
+        self.data.projects.append(project)
 
         resp1_en = project['enabled']
 
         p_en2 = True
-        resp, body = self.v3_client.update_project(
+        resp, body = self.client.update_project(
             project['id'], enabled=p_en2)
         st2 = resp['status']
         resp2_en = body['enabled']
         self.assertEqual(st2, '200')
         self.assertNotEqual(resp1_en, resp2_en)
 
-        resp, body = self.v3_client.get_project(project['id'])
+        resp, body = self.client.get_project(project['id'])
         resp3_en = body['enabled']
 
         self.assertNotEqual(resp1_en, resp3_en)
         self.assertEqual('false', str(resp1_en).lower())
         self.assertEqual(resp2_en, resp3_en)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_associate_user_to_project(self):
         #Associate a user to a project
         #Create a Project
         p_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(p_name)
-        self.v3data.projects.append(project)
+        resp, project = self.client.create_project(p_name)
+        self.data.projects.append(project)
 
         #Create a User
         u_name = data_utils.rand_name('user-')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=project['id'])
         self.assertEqual(resp['status'], '201')
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
 
         # Get User To validate the user details
-        resp, new_user_get = self.v3_client.get_user(user['id'])
+        resp, new_user_get = self.client.get_user(user['id'])
         #Assert response body of GET
         self.assertEqual(u_name, new_user_get['name'])
         self.assertEqual(u_desc, new_user_get['description'])
@@ -196,59 +196,6 @@
                          new_user_get['project_id'])
         self.assertEqual(u_email, new_user_get['email'])
 
-    @attr(type=['negative', 'gate'])
-    def test_list_projects_by_unauthorized_user(self):
-        # Non-admin user should not be able to list projects
-        self.assertRaises(exceptions.Unauthorized,
-                          self.v3_non_admin_client.list_projects)
-
-    @attr(type=['negative', 'gate'])
-    def test_project_create_duplicate(self):
-        # Project names should be unique
-        project_name = data_utils.rand_name('project-dup-')
-        resp, project = self.v3_client.create_project(project_name)
-        self.v3data.projects.append(project)
-
-        self.assertRaises(
-            exceptions.Conflict, self.v3_client.create_project, project_name)
-
-    @attr(type=['negative', 'gate'])
-    def test_create_project_by_unauthorized_user(self):
-        # Non-admin user should not be authorized to create a project
-        project_name = data_utils.rand_name('project-')
-        self.assertRaises(
-            exceptions.Unauthorized, self.v3_non_admin_client.create_project,
-            project_name)
-
-    @attr(type=['negative', 'gate'])
-    def test_create_project_with_empty_name(self):
-        # Project name should not be empty
-        self.assertRaises(exceptions.BadRequest, self.v3_client.create_project,
-                          name='')
-
-    @attr(type=['negative', 'gate'])
-    def test_create_projects_name_length_over_64(self):
-        # Project name length should not be greater than 64 characters
-        project_name = 'a' * 65
-        self.assertRaises(exceptions.BadRequest, self.v3_client.create_project,
-                          project_name)
-
-    @attr(type=['negative', 'gate'])
-    def test_project_delete_by_unauthorized_user(self):
-        # Non-admin user should not be able to delete a project
-        project_name = data_utils.rand_name('project-')
-        resp, project = self.v3_client.create_project(project_name)
-        self.v3data.projects.append(project)
-        self.assertRaises(
-            exceptions.Unauthorized, self.v3_non_admin_client.delete_project,
-            project['id'])
-
-    @attr(type=['negative', 'gate'])
-    def test_delete_non_existent_project(self):
-        # Attempt to delete a non existent project should fail
-        self.assertRaises(exceptions.NotFound, self.v3_client.delete_project,
-                          'junk_Project_123456abc')
-
 
 class ProjectsTestXML(ProjectsTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
new file mode 100644
index 0000000..6b60d04
--- /dev/null
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -0,0 +1,80 @@
+# Copyright 2013 OpenStack, LLC
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.identity import base
+from tempest.common.utils import data_utils
+from tempest import exceptions
+from tempest import test
+
+
+class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest):
+    _interface = 'json'
+
+    @test.attr(type=['negative', 'gate'])
+    def test_list_projects_by_unauthorized_user(self):
+        # Non-admin user should not be able to list projects
+        self.assertRaises(exceptions.Unauthorized,
+                          self.non_admin_client.list_projects)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_project_create_duplicate(self):
+        # Project names should be unique
+        project_name = data_utils.rand_name('project-dup-')
+        resp, project = self.client.create_project(project_name)
+        self.data.projects.append(project)
+
+        self.assertRaises(
+            exceptions.Conflict, self.client.create_project, project_name)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_project_by_unauthorized_user(self):
+        # Non-admin user should not be authorized to create a project
+        project_name = data_utils.rand_name('project-')
+        self.assertRaises(
+            exceptions.Unauthorized, self.non_admin_client.create_project,
+            project_name)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_project_with_empty_name(self):
+        # Project name should not be empty
+        self.assertRaises(exceptions.BadRequest, self.client.create_project,
+                          name='')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_projects_name_length_over_64(self):
+        # Project name length should not be greater than 64 characters
+        project_name = 'a' * 65
+        self.assertRaises(exceptions.BadRequest, self.client.create_project,
+                          project_name)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_project_delete_by_unauthorized_user(self):
+        # Non-admin user should not be able to delete a project
+        project_name = data_utils.rand_name('project-')
+        resp, project = self.client.create_project(project_name)
+        self.data.projects.append(project)
+        self.assertRaises(
+            exceptions.Unauthorized, self.non_admin_client.delete_project,
+            project['id'])
+
+    @test.attr(type=['negative', 'gate'])
+    def test_delete_non_existent_project(self):
+        # Attempt to delete a non existent project should fail
+        self.assertRaises(exceptions.NotFound, self.client.delete_project,
+                          data_utils.rand_uuid_hex())
+
+
+class ProjectsNegativeTestXML(ProjectsNegativeTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index efaed39..467d28b 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class RolesV3TestJSON(base.BaseIdentityAdminTest):
+class RolesV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @classmethod
@@ -30,20 +30,20 @@
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
         resp = [None] * 5
-        resp[0], cls.project = cls.v3_client.create_project(
+        resp[0], cls.project = cls.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
-        resp[1], cls.domain = cls.v3_client.create_domain(
+        resp[1], cls.domain = cls.client.create_domain(
             data_utils.rand_name('domain-'),
             description=data_utils.rand_name('domain-desc-'))
-        resp[2], cls.group_body = cls.v3_client.create_group(
+        resp[2], cls.group_body = cls.client.create_group(
             data_utils.rand_name('Group-'), project_id=cls.project['id'],
             domain_id=cls.domain['id'])
-        resp[3], cls.user_body = cls.v3_client.create_user(
+        resp[3], cls.user_body = cls.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=cls.project['id'],
             domain_id=cls.domain['id'])
-        resp[4], cls.role = cls.v3_client.create_role(
+        resp[4], cls.role = cls.client.create_role(
             data_utils.rand_name('Role-'))
         for r in resp:
             assert r['status'] == '201', "Expected: %s" % r['status']
@@ -51,14 +51,14 @@
     @classmethod
     def tearDownClass(cls):
         resp = [None] * 5
-        resp[0], _ = cls.v3_client.delete_role(cls.role['id'])
-        resp[1], _ = cls.v3_client.delete_group(cls.group_body['id'])
-        resp[2], _ = cls.v3_client.delete_user(cls.user_body['id'])
-        resp[3], _ = cls.v3_client.delete_project(cls.project['id'])
+        resp[0], _ = cls.client.delete_role(cls.role['id'])
+        resp[1], _ = cls.client.delete_group(cls.group_body['id'])
+        resp[2], _ = cls.client.delete_user(cls.user_body['id'])
+        resp[3], _ = cls.client.delete_project(cls.project['id'])
         # NOTE(harika-vakadi): It is necessary to disable the domain
         # before deleting,or else it would result in unauthorized error
-        cls.v3_client.update_domain(cls.domain['id'], enabled=False)
-        resp[4], _ = cls.v3_client.delete_domain(cls.domain['id'])
+        cls.client.update_domain(cls.domain['id'], enabled=False)
+        resp[4], _ = cls.client.delete_domain(cls.domain['id'])
         for r in resp:
             assert r['status'] == '204', "Expected: %s" % r['status']
         super(RolesV3TestJSON, cls).tearDownClass()
@@ -71,32 +71,32 @@
     @attr(type='smoke')
     def test_role_create_update_get(self):
         r_name = data_utils.rand_name('Role-')
-        resp, role = self.v3_client.create_role(r_name)
-        self.addCleanup(self.v3_client.delete_role, role['id'])
+        resp, role = self.client.create_role(r_name)
+        self.addCleanup(self.client.delete_role, role['id'])
         self.assertEqual(resp['status'], '201')
         self.assertIn('name', role)
         self.assertEqual(role['name'], r_name)
 
         new_name = data_utils.rand_name('NewRole-')
-        resp, updated_role = self.v3_client.update_role(new_name, role['id'])
+        resp, updated_role = self.client.update_role(new_name, role['id'])
         self.assertEqual(resp['status'], '200')
         self.assertIn('name', updated_role)
         self.assertIn('id', updated_role)
         self.assertIn('links', updated_role)
         self.assertNotEqual(r_name, updated_role['name'])
 
-        resp, new_role = self.v3_client.get_role(role['id'])
+        resp, new_role = self.client.get_role(role['id'])
         self.assertEqual(resp['status'], '200')
         self.assertEqual(new_name, new_role['name'])
         self.assertEqual(updated_role['id'], new_role['id'])
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_user_on_project(self):
-        resp, _ = self.v3_client.assign_user_role_on_project(
+        resp, _ = self.client.assign_user_role_on_project(
             self.project['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_user_roles_on_project(
+        resp, roles = self.client.list_user_roles_on_project(
             self.project['id'], self.user_body['id'])
 
         for i in roles:
@@ -105,17 +105,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_user_on_project(
+        resp, _ = self.client.revoke_role_from_user_on_project(
             self.project['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_user_on_domain(self):
-        resp, _ = self.v3_client.assign_user_role_on_domain(
+        resp, _ = self.client.assign_user_role_on_domain(
             self.domain['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_user_roles_on_domain(
+        resp, roles = self.client.list_user_roles_on_domain(
             self.domain['id'], self.user_body['id'])
 
         for i in roles:
@@ -124,17 +124,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_user_on_domain(
+        resp, _ = self.client.revoke_role_from_user_on_domain(
             self.domain['id'], self.user_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_group_on_project(self):
-        resp, _ = self.v3_client.assign_group_role_on_project(
+        resp, _ = self.client.assign_group_role_on_project(
             self.project['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_group_roles_on_project(
+        resp, roles = self.client.list_group_roles_on_project(
             self.project['id'], self.group_body['id'])
 
         for i in roles:
@@ -143,17 +143,17 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_group_on_project(
+        resp, _ = self.client.revoke_role_from_group_on_project(
             self.project['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
     @attr(type='smoke')
     def test_grant_list_revoke_role_to_group_on_domain(self):
-        resp, _ = self.v3_client.assign_group_role_on_domain(
+        resp, _ = self.client.assign_group_role_on_domain(
             self.domain['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
-        resp, roles = self.v3_client.list_group_roles_on_domain(
+        resp, roles = self.client.list_group_roles_on_domain(
             self.domain['id'], self.group_body['id'])
 
         for i in roles:
@@ -162,7 +162,7 @@
         self._list_assertions(resp, roles, self.fetched_role_ids,
                               self.role['id'])
 
-        resp, _ = self.v3_client.revoke_role_from_group_on_domain(
+        resp, _ = self.client.revoke_role_from_group_on_domain(
             self.domain['id'], self.group_body['id'], self.role['id'])
         self.assertEqual(resp['status'], '204')
 
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index 4d6c22f..c5d4ddf 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -19,20 +19,20 @@
 from tempest.test import attr
 
 
-class ServicesTestJSON(base.BaseIdentityAdminTest):
+class ServicesTestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
     def test_update_service(self):
         # Update description attribute of service
         name = data_utils.rand_name('service-')
-        type = data_utils.rand_name('type--')
-        description = data_utils.rand_name('description-')
-        resp, body = self.client.create_service(
-            name, type, description=description)
-        self.assertEqual('200', resp['status'])
+        serv_type = data_utils.rand_name('type--')
+        desc = data_utils.rand_name('description-')
+        resp, body = self.service_client.create_service(name, serv_type,
+                                                        description=desc)
+        self.assertEqual('201', resp['status'])
         # Deleting the service created in this method
-        self.addCleanup(self.client.delete_service, body['id'])
+        self.addCleanup(self.service_client.delete_service, body['id'])
 
         s_id = body['id']
         resp1_desc = body['description']
@@ -45,7 +45,7 @@
         self.assertNotEqual(resp1_desc, resp2_desc)
 
         # Get service
-        resp, body = self.client.get_service(s_id)
+        resp, body = self.service_client.get_service(s_id)
         resp3_desc = body['description']
 
         self.assertNotEqual(resp1_desc, resp3_desc)
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index d17dc4a..9629213 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -19,7 +19,7 @@
 from tempest.test import attr
 
 
-class UsersTestJSON(base.BaseIdentityAdminTest):
+class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='smoke')
@@ -30,26 +30,26 @@
         u_desc = '%s-description' % u_name
         u_email = '%s@testmail.tm' % u_name
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email)
         self.assertTrue(resp['status'].startswith('2'))
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
         # Perform Authentication
-        resp, body = self.v3_token.auth(user['id'], u_password)
+        resp, body = self.token.auth(user['id'], u_password)
         self.assertEqual(resp['status'], '201')
         subject_token = resp['x-subject-token']
         # Perform GET Token
-        resp, token_details = self.v3_client.get_token(subject_token)
+        resp, token_details = self.client.get_token(subject_token)
         self.assertEqual(resp['status'], '200')
         self.assertEqual(resp['x-subject-token'], subject_token)
         self.assertEqual(token_details['user']['id'], user['id'])
         self.assertEqual(token_details['user']['name'], u_name)
         # Perform Delete Token
-        resp, _ = self.v3_client.delete_token(subject_token)
-        self.assertRaises(exceptions.NotFound, self.v3_client.get_token,
+        resp, _ = self.client.delete_token(subject_token)
+        self.assertRaises(exceptions.NotFound, self.client.get_token,
                           subject_token)
 
 
-class UsersTestXML(UsersTestJSON):
+class TokensV3TestXML(TokensV3TestJSON):
     _interface = 'xml'
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 1bebad4..cae20ad 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -14,16 +14,16 @@
 import re
 from tempest.api.identity import base
 from tempest import clients
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import timeutils
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
 
-class BaseTrustsV3Test(base.BaseIdentityAdminTest):
+class BaseTrustsV3Test(base.BaseIdentityV3AdminTest):
 
     def setUp(self):
         super(BaseTrustsV3Test, self).setUp()
@@ -43,17 +43,17 @@
 
     def create_trustor_and_roles(self):
         # Get trustor project ID, use the admin project
-        self.trustor_project_name = self.v3_client.tenant_name
+        self.trustor_project_name = self.client.tenant_name
         self.trustor_project_id = self.get_tenant_by_name(
             self.trustor_project_name)['id']
         self.assertIsNotNone(self.trustor_project_id)
 
         # Create a trustor User
-        self.trustor_username = rand_name('user-')
+        self.trustor_username = data_utils.rand_name('user-')
         u_desc = self.trustor_username + 'description'
         u_email = self.trustor_username + '@testmail.xx'
-        self.trustor_password = rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        self.trustor_password = data_utils.rand_name('pass-')
+        resp, user = self.client.create_user(
             self.trustor_username,
             description=u_desc,
             password=self.trustor_password,
@@ -63,27 +63,27 @@
         self.trustor_user_id = user['id']
 
         # And two roles, one we'll delegate and one we won't
-        self.delegated_role = rand_name('DelegatedRole-')
-        self.not_delegated_role = rand_name('NotDelegatedRole-')
+        self.delegated_role = data_utils.rand_name('DelegatedRole-')
+        self.not_delegated_role = data_utils.rand_name('NotDelegatedRole-')
 
-        resp, role = self.v3_client.create_role(self.delegated_role)
+        resp, role = self.client.create_role(self.delegated_role)
         self.assertEqual(resp['status'], '201')
         self.delegated_role_id = role['id']
 
-        resp, role = self.v3_client.create_role(self.not_delegated_role)
+        resp, role = self.client.create_role(self.not_delegated_role)
         self.assertEqual(resp['status'], '201')
         self.not_delegated_role_id = role['id']
 
         # Assign roles to trustor
-        self.v3_client.assign_user_role(self.trustor_project_id,
-                                        self.trustor_user_id,
-                                        self.delegated_role_id)
-        self.v3_client.assign_user_role(self.trustor_project_id,
-                                        self.trustor_user_id,
-                                        self.not_delegated_role_id)
+        self.client.assign_user_role(self.trustor_project_id,
+                                     self.trustor_user_id,
+                                     self.delegated_role_id)
+        self.client.assign_user_role(self.trustor_project_id,
+                                     self.trustor_user_id,
+                                     self.not_delegated_role_id)
 
         # Get trustee user ID, use the demo user
-        trustee_username = self.v3_non_admin_client.user
+        trustee_username = self.non_admin_client.user
         self.trustee_user_id = self.get_user_by_name(trustee_username)['id']
         self.assertIsNotNone(self.trustee_user_id)
 
@@ -92,19 +92,19 @@
                              password=self.trustor_password,
                              tenant_name=self.trustor_project_name,
                              interface=self._interface)
-        self.trustor_v3_client = os.identity_v3_client
+        self.trustor_client = os.identity_v3_client
 
     def cleanup_user_and_roles(self):
         if self.trustor_user_id:
-            self.v3_client.delete_user(self.trustor_user_id)
+            self.client.delete_user(self.trustor_user_id)
         if self.delegated_role_id:
-            self.v3_client.delete_role(self.delegated_role_id)
+            self.client.delete_role(self.delegated_role_id)
         if self.not_delegated_role_id:
-            self.v3_client.delete_role(self.not_delegated_role_id)
+            self.client.delete_role(self.not_delegated_role_id)
 
     def create_trust(self, impersonate=True, expires=None):
 
-        resp, trust_create = self.trustor_v3_client.create_trust(
+        resp, trust_create = self.trustor_client.create_trust(
             trustor_user_id=self.trustor_user_id,
             trustee_user_id=self.trustee_user_id,
             project_id=self.trustor_project_id,
@@ -137,7 +137,7 @@
             self.assertEqual(1, len(trust['roles']))
 
     def get_trust(self):
-        resp, trust_get = self.trustor_v3_client.get_trust(self.trust_id)
+        resp, trust_get = self.trustor_client.get_trust(self.trust_id)
         self.assertEqual('200', resp['status'])
         return trust_get
 
@@ -153,37 +153,37 @@
 
     def check_trust_roles(self):
         # Check we find the delegated role
-        resp, roles_get = self.trustor_v3_client.get_trust_roles(
+        resp, roles_get = self.trustor_client.get_trust_roles(
             self.trust_id)
         self.assertEqual('200', resp['status'])
         self.assertEqual(1, len(roles_get))
         self.validate_role(roles_get[0])
 
-        resp, role_get = self.trustor_v3_client.get_trust_role(
+        resp, role_get = self.trustor_client.get_trust_role(
             self.trust_id, self.delegated_role_id)
         self.assertEqual('200', resp['status'])
         self.validate_role(role_get)
 
-        resp, role_get = self.trustor_v3_client.check_trust_role(
+        resp, role_get = self.trustor_client.check_trust_role(
             self.trust_id, self.delegated_role_id)
         self.assertEqual('204', resp['status'])
 
         # And that we don't find not_delegated_role
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.get_trust_role,
+                          self.trustor_client.get_trust_role,
                           self.trust_id,
                           self.not_delegated_role_id)
 
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.check_trust_role,
+                          self.trustor_client.check_trust_role,
                           self.trust_id,
                           self.not_delegated_role_id)
 
     def delete_trust(self):
-        resp, trust_delete = self.trustor_v3_client.delete_trust(self.trust_id)
+        resp, trust_delete = self.trustor_client.delete_trust(self.trust_id)
         self.assertEqual('204', resp['status'])
         self.assertRaises(exceptions.NotFound,
-                          self.trustor_v3_client.get_trust,
+                          self.trustor_client.get_trust,
                           self.trust_id)
         self.trust_id = None
 
@@ -196,7 +196,7 @@
         self.create_trustor_and_roles()
         self.addCleanup(self.cleanup_user_and_roles)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_impersonate(self):
         # Test case to check we can create, get and delete a trust
         # updates are not supported for trusts
@@ -208,7 +208,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_noimpersonate(self):
         # Test case to check we can create, get and delete a trust
         # with impersonation=False
@@ -220,7 +220,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_expire(self):
         # Test case to check we can create, get and delete a trust
         # with an expiry specified
@@ -236,7 +236,7 @@
 
         self.check_trust_roles()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_trust_expire_invalid(self):
         # Test case to check we can check an invlaid expiry time
         # is rejected with the correct error
@@ -246,19 +246,19 @@
                           self.create_trust,
                           expires=expires_str)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_trusts_query(self):
         self.create_trust()
-        resp, trusts_get = self.trustor_v3_client.get_trusts(
+        resp, trusts_get = self.trustor_client.get_trusts(
             trustor_user_id=self.trustor_user_id)
         self.assertEqual('200', resp['status'])
         self.assertEqual(1, len(trusts_get))
         self.validate_trust(trusts_get[0], summary=True)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_trusts_all(self):
         self.create_trust()
-        resp, trusts_get = self.v3_client.get_trusts()
+        resp, trusts_get = self.client.get_trusts()
         self.assertEqual('200', resp['status'])
         trusts = [t for t in trusts_get
                   if t['id'] == self.trust_id]
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 7cae856..a78d542 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -18,7 +18,7 @@
 from tempest.test import attr
 
 
-class UsersV3TestJSON(base.BaseIdentityAdminTest):
+class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
     _interface = 'json'
 
     @attr(type='gate')
@@ -29,22 +29,22 @@
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        resp, user = self.v3_client.create_user(
+        resp, user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False)
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user['id'])
+        self.addCleanup(self.client.delete_user, user['id'])
         # Creating second project for updation
-        resp, project = self.v3_client.create_project(
+        resp, project = self.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
         # Delete the Project at the end of this method
-        self.addCleanup(self.v3_client.delete_project, project['id'])
+        self.addCleanup(self.client.delete_project, project['id'])
         # Updating user details with new values
         u_name2 = data_utils.rand_name('user2-')
         u_email2 = u_name2 + '@testmail.tm'
         u_description2 = u_name2 + ' description'
-        resp, update_user = self.v3_client.update_user(
+        resp, update_user = self.client.update_user(
             user['id'], name=u_name2, description=u_description2,
             project_id=project['id'],
             email=u_email2, enabled=False)
@@ -57,7 +57,7 @@
         self.assertEqual(u_email2, update_user['email'])
         self.assertEqual('false', str(update_user['enabled']).lower())
         # GET by id after updation
-        resp, new_user_get = self.v3_client.get_user(user['id'])
+        resp, new_user_get = self.client.get_user(user['id'])
         # Assert response body of GET after updation
         self.assertEqual(u_name2, new_user_get['name'])
         self.assertEqual(u_description2, new_user_get['description'])
@@ -71,43 +71,43 @@
         # List the projects that a user has access upon
         assigned_project_ids = list()
         fetched_project_ids = list()
-        _, u_project = self.v3_client.create_project(
+        _, u_project = self.client.create_project(
             data_utils.rand_name('project-'),
             description=data_utils.rand_name('project-desc-'))
         # Delete the Project at the end of this method
-        self.addCleanup(self.v3_client.delete_project, u_project['id'])
+        self.addCleanup(self.client.delete_project, u_project['id'])
         # Create a user.
         u_name = data_utils.rand_name('user-')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
         u_password = data_utils.rand_name('pass-')
-        _, user_body = self.v3_client.create_user(
+        _, user_body = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False, project_id=u_project['id'])
         # Delete the User at the end of this method
-        self.addCleanup(self.v3_client.delete_user, user_body['id'])
+        self.addCleanup(self.client.delete_user, user_body['id'])
         # Creating Role
-        _, role_body = self.v3_client.create_role(
+        _, role_body = self.client.create_role(
             data_utils.rand_name('role-'))
         # Delete the Role at the end of this method
-        self.addCleanup(self.v3_client.delete_role, role_body['id'])
+        self.addCleanup(self.client.delete_role, role_body['id'])
 
-        _, user = self.v3_client.get_user(user_body['id'])
-        _, role = self.v3_client.get_role(role_body['id'])
+        _, user = self.client.get_user(user_body['id'])
+        _, role = self.client.get_role(role_body['id'])
         for i in range(2):
             # Creating project so as to assign role
-            _, project_body = self.v3_client.create_project(
+            _, project_body = self.client.create_project(
                 data_utils.rand_name('project-'),
                 description=data_utils.rand_name('project-desc-'))
-            _, project = self.v3_client.get_project(project_body['id'])
+            _, project = self.client.get_project(project_body['id'])
             # Delete the Project at the end of this method
-            self.addCleanup(self.v3_client.delete_project, project_body['id'])
+            self.addCleanup(self.client.delete_project, project_body['id'])
             # Assigning roles to user on project
-            self.v3_client.assign_user_role(project['id'],
-                                            user['id'],
-                                            role['id'])
+            self.client.assign_user_role(project['id'],
+                                         user['id'],
+                                         role['id'])
             assigned_project_ids.append(project['id'])
-        resp, body = self.v3_client.list_user_projects(user['id'])
+        resp, body = self.client.list_user_projects(user['id'])
         self.assertEqual(200, resp.status)
         for i in body:
             fetched_project_ids.append(i['id'])
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index a3fc65a..10f5217 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -16,67 +16,98 @@
 
 from tempest import clients
 from tempest.common.utils import data_utils
+from tempest import config
 import tempest.test
 
+CONF = config.CONF
+
 
 class BaseIdentityAdminTest(tempest.test.BaseTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(BaseIdentityAdminTest, cls).setUpClass()
-        os = clients.AdminManager(interface=cls._interface)
-        cls.client = os.identity_client
-        cls.token_client = os.token_client
-        cls.endpoints_client = os.endpoints_client
-        cls.v3_client = os.identity_v3_client
-        cls.service_client = os.service_client
-        cls.policy_client = os.policy_client
-        cls.v3_token = os.token_v3_client
-        cls.creds_client = os.credentials_client
-
-        if not cls.client.has_admin_extensions():
-            raise cls.skipException("Admin extensions disabled")
-
-        cls.data = DataGenerator(cls.client)
-        cls.v3data = DataGenerator(cls.v3_client)
-
-        os = clients.Manager(interface=cls._interface)
-        cls.non_admin_client = os.identity_client
-        cls.v3_non_admin_client = os.identity_v3_client
+        cls.os_adm = clients.AdminManager(interface=cls._interface)
+        cls.os = clients.Manager(interface=cls._interface)
 
     @classmethod
-    def tearDownClass(cls):
-        cls.data.teardown_all()
-        cls.v3data.teardown_all()
-        super(BaseIdentityAdminTest, cls).tearDownClass()
+    def disable_user(cls, user_name):
+        user = cls.get_user_by_name(user_name)
+        cls.client.enable_disable_user(user['id'], False)
 
-    def disable_user(self, user_name):
-        user = self.get_user_by_name(user_name)
-        self.client.enable_disable_user(user['id'], False)
+    @classmethod
+    def disable_tenant(cls, tenant_name):
+        tenant = cls.get_tenant_by_name(tenant_name)
+        cls.client.update_tenant(tenant['id'], enabled=False)
 
-    def disable_tenant(self, tenant_name):
-        tenant = self.get_tenant_by_name(tenant_name)
-        self.client.update_tenant(tenant['id'], enabled=False)
-
-    def get_user_by_name(self, name):
-        _, users = self.client.get_users()
+    @classmethod
+    def get_user_by_name(cls, name):
+        _, users = cls.client.get_users()
         user = [u for u in users if u['name'] == name]
         if len(user) > 0:
             return user[0]
 
-    def get_tenant_by_name(self, name):
-        _, tenants = self.client.list_tenants()
+    @classmethod
+    def get_tenant_by_name(cls, name):
+        try:
+            _, tenants = cls.client.list_tenants()
+        except AttributeError:
+            _, tenants = cls.client.list_projects()
         tenant = [t for t in tenants if t['name'] == name]
         if len(tenant) > 0:
             return tenant[0]
 
-    def get_role_by_name(self, name):
-        _, roles = self.client.list_roles()
+    @classmethod
+    def get_role_by_name(cls, name):
+        _, roles = cls.client.list_roles()
         role = [r for r in roles if r['name'] == name]
         if len(role) > 0:
             return role[0]
 
 
+class BaseIdentityV2AdminTest(BaseIdentityAdminTest):
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.identity_feature_enabled.api_v2:
+            raise cls.skipException("Identity api v2 is not enabled")
+        super(BaseIdentityV2AdminTest, cls).setUpClass()
+        cls.client = cls.os_adm.identity_client
+        cls.token_client = cls.os_adm.token_client
+        if not cls.client.has_admin_extensions():
+            raise cls.skipException("Admin extensions disabled")
+        cls.data = DataGenerator(cls.client)
+        cls.non_admin_client = cls.os.identity_client
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.data.teardown_all()
+        super(BaseIdentityV2AdminTest, cls).tearDownClass()
+
+
+class BaseIdentityV3AdminTest(BaseIdentityAdminTest):
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.identity_feature_enabled.api_v3:
+            raise cls.skipException("Identity api v3 is not enabled")
+        super(BaseIdentityV3AdminTest, cls).setUpClass()
+        cls.client = cls.os_adm.identity_v3_client
+        cls.token = cls.os_adm.token_v3_client
+        cls.endpoints_client = cls.os_adm.endpoints_client
+        cls.data = DataGenerator(cls.client)
+        cls.non_admin_client = cls.os.identity_v3_client
+        cls.service_client = cls.os_adm.service_client
+        cls.policy_client = cls.os_adm.policy_client
+        cls.creds_client = cls.os_adm.credentials_client
+        cls.non_admin_client = cls.os.identity_v3_client
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.data.teardown_all()
+        super(BaseIdentityV3AdminTest, cls).tearDownClass()
+
+
 class DataGenerator(object):
 
         def __init__(self, client):
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index d8b79ca..517123d 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -16,8 +16,9 @@
 import cStringIO as StringIO
 
 from tempest.api.image import base
+from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 
@@ -25,7 +26,7 @@
 class CreateRegisterImagesTest(base.BaseV1ImageTest):
     """Here we test the registration and creation of images."""
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_then_upload(self):
         # Register, then upload an image
         properties = {'prop1': 'val1'}
@@ -48,7 +49,7 @@
         self.assertIn('size', body)
         self.assertEqual(1024, body.get('size'))
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_remote_image(self):
         # Register a new remote image
         resp, body = self.create_image(name='New Remote Image',
@@ -66,7 +67,7 @@
         self.assertEqual(properties['key1'], 'value1')
         self.assertEqual(properties['key2'], 'value2')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_http_image(self):
         resp, body = self.create_image(name='New Http Image',
                                        container_format='bare',
@@ -80,7 +81,7 @@
         resp, body = self.client.get_image(image_id)
         self.assertEqual(resp['status'], '200')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_register_image_with_min_ram(self):
         # Register an image with min ram
         properties = {'prop1': 'val1'}
@@ -110,7 +111,6 @@
     @classmethod
     def setUpClass(cls):
         super(ListImagesTest, cls).setUpClass()
-
         # We add a few images here to test the listing functionality of
         # the images API
         img1 = cls._create_remote_image('one', 'bare', 'raw')
@@ -131,7 +131,7 @@
         # 1x with size 42
         cls.size42_set = set((img5,))
         # 3x with size 142
-        cls.size142_set = set((img6, img7, img8))
+        cls.size142_set = set((img6, img7, img8,))
         # dup named
         cls.dup_set = set((img3, img4))
 
@@ -168,7 +168,7 @@
         image_id = image['id']
         return image_id
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_no_params(self):
         # Simple test to see all fixture images returned
         resp, images_list = self.client.image_list()
@@ -177,7 +177,7 @@
         for image_id in self.created_images:
             self.assertIn(image_id, image_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_disk_format(self):
         resp, images_list = self.client.image_list(disk_format='ami')
         self.assertEqual(resp['status'], '200')
@@ -187,7 +187,7 @@
         self.assertTrue(self.ami_set <= result_set)
         self.assertFalse(self.created_set - self.ami_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_container_format(self):
         resp, images_list = self.client.image_list(container_format='bare')
         self.assertEqual(resp['status'], '200')
@@ -197,7 +197,7 @@
         self.assertTrue(self.bare_set <= result_set)
         self.assertFalse(self.created_set - self.bare_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_max_size(self):
         resp, images_list = self.client.image_list(size_max=42)
         self.assertEqual(resp['status'], '200')
@@ -207,7 +207,7 @@
         self.assertTrue(self.size42_set <= result_set)
         self.assertFalse(self.created_set - self.size42_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_min_size(self):
         resp, images_list = self.client.image_list(size_min=142)
         self.assertEqual(resp['status'], '200')
@@ -217,7 +217,7 @@
         self.assertTrue(self.size142_set <= result_set)
         self.assertFalse(self.size42_set <= result_set)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_status_active_detail(self):
         resp, images_list = self.client.image_list_detail(status='active',
                                                           sort_key='size',
@@ -230,7 +230,7 @@
             top_size = size
             self.assertEqual(image['status'], 'active')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_index_name(self):
         resp, images_list = self.client.image_list_detail(
             name='New Remote Image dup')
@@ -240,3 +240,139 @@
             self.assertEqual(image['name'], 'New Remote Image dup')
         self.assertTrue(self.dup_set <= result_set)
         self.assertFalse(self.created_set - self.dup_set <= result_set)
+
+
+class ListSnapshotImagesTest(base.BaseV1ImageTest):
+    @classmethod
+    def setUpClass(cls):
+        super(ListSnapshotImagesTest, cls).setUpClass()
+        if not CONF.compute_feature_enabled.api_v3:
+            cls.servers_client = cls.os.servers_client
+        else:
+            cls.servers_client = cls.os.servers_v3_client
+        cls.servers = []
+        # We add a few images here to test the listing functionality of
+        # the images API
+        cls.snapshot = cls._create_snapshot(
+            'snapshot', CONF.compute.image_ref,
+            CONF.compute.flavor_ref)
+        cls.snapshot_set = set((cls.snapshot,))
+
+        image_file = StringIO.StringIO('*' * 42)
+        resp, image = cls.create_image(name="Standard Image",
+                                       container_format='ami',
+                                       disk_format='ami',
+                                       is_public=True, data=image_file)
+        cls.image_id = image['id']
+        cls.client.wait_for_image_status(image['id'], 'active')
+
+    @classmethod
+    def tearDownClass(cls):
+        for server in cls.servers:
+            cls.servers_client.delete_server(server['id'])
+        super(ListSnapshotImagesTest, cls).tearDownClass()
+
+    @classmethod
+    def _create_snapshot(cls, name, image_id, flavor, **kwargs):
+        resp, server = cls.servers_client.create_server(
+            name, image_id, flavor, **kwargs)
+        cls.servers.append(server)
+        cls.servers_client.wait_for_server_status(
+            server['id'], 'ACTIVE')
+        resp, image = cls.servers_client.create_image(
+            server['id'], name)
+        image_id = data_utils.parse_image_id(resp['location'])
+        cls.created_images.append(image_id)
+        cls.client.wait_for_image_status(image_id,
+                                         'active')
+        return image_id
+
+    @test.attr(type='gate')
+    def test_index_server_id(self):
+        # The images should contain images filtered by server id
+        resp, images = self.client.image_list_detail(
+            {'instance_uuid': self.servers[0]['id']})
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertEqual(self.snapshot_set, result_set)
+
+    @test.attr(type='gate')
+    def test_index_type(self):
+        # The list of servers should be filtered by image type
+        params = {'image_type': 'snapshot'}
+        resp, images = self.client.image_list_detail(params)
+
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertIn(self.snapshot, result_set)
+
+    @test.attr(type='gate')
+    def test_index_limit(self):
+        # Verify only the expected number of results are returned
+        resp, images = self.client.image_list_detail(limit=1)
+
+        self.assertEqual(200, resp.status)
+        self.assertEqual(1, len(images))
+
+    @test.attr(type='gate')
+    def test_index_by_change_since(self):
+        # Verify an update image is returned
+        # Becoming ACTIVE will modify the updated time
+        # Filter by the image's created time
+        resp, image = self.client.get_image_meta(self.snapshot)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(self.snapshot, image['id'])
+        resp, images = self.client.image_list_detail(
+            changes_since=image['updated_at'])
+
+        self.assertEqual(200, resp.status)
+        result_set = set(map(lambda x: x['id'], images))
+        self.assertIn(self.image_id, result_set)
+        self.assertNotIn(self.snapshot, result_set)
+
+
+class UpdateImageMetaTest(base.BaseV1ImageTest):
+    @classmethod
+    def setUpClass(cls):
+        super(UpdateImageMetaTest, cls).setUpClass()
+        cls.image_id = cls._create_standard_image('1', 'ami', 'ami', 42)
+
+    @classmethod
+    def _create_standard_image(cls, name, container_format,
+                               disk_format, size):
+        """
+        Create a new standard image and return the ID of the newly-registered
+        image. Note that the size of the new image is a random number between
+        1024 and 4096
+        """
+        image_file = StringIO.StringIO('*' * size)
+        name = 'New Standard Image %s' % name
+        resp, image = cls.create_image(name=name,
+                                       container_format=container_format,
+                                       disk_format=disk_format,
+                                       is_public=True, data=image_file,
+                                       properties={'key1': 'value1'})
+        image_id = image['id']
+        return image_id
+
+    @test.attr(type='gate')
+    def test_list_image_metadata(self):
+        # All metadata key/value pairs for an image should be returned
+        resp, resp_metadata = self.client.get_image_meta(self.image_id)
+        expected = {'key1': 'value1'}
+        self.assertEqual(expected, resp_metadata['properties'])
+
+    @test.attr(type='gate')
+    def test_update_image_metadata(self):
+        # The metadata for the image should match the updated values
+        req_metadata = {'key1': 'alt1', 'key2': 'value2'}
+        resp, metadata = self.client.get_image_meta(self.image_id)
+        self.assertEqual(200, resp.status)
+        self.assertEqual(metadata['properties'], {'key1': 'value1'})
+        metadata['properties'].update(req_metadata)
+        resp, metadata = self.client.update_image(
+            self.image_id, properties=metadata['properties'])
+
+        resp, resp_metadata = self.client.get_image_meta(self.image_id)
+        expected = {'key1': 'alt1', 'key2': 'value2'}
+        self.assertEqual(expected, resp_metadata['properties'])
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
new file mode 100644
index 0000000..a5ba90f
--- /dev/null
+++ b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
@@ -0,0 +1,78 @@
+# Copyright 2013 IBM Corp.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations in the Neutron API using the REST client for
+    Neutron:
+
+        List pools the given LBaaS agent is hosting.
+        Show a LBaaS agent hosting the given pool.
+
+    v2.0 of the Neutron API is assumed. It is also assumed that the following
+    options are defined in the [networki-feature-enabled] section of
+    etc/tempest.conf:
+
+        api_extensions
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(LBaaSAgentSchedulerTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
+            msg = "LBaaS Agent Scheduler Extension not enabled."
+            raise cls.skipException(msg)
+        cls.network = cls.create_network()
+        cls.subnet = cls.create_subnet(cls.network)
+        pool_name = data_utils.rand_name('pool-')
+        cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
+                                   "HTTP", cls.subnet)
+
+    @test.attr(type='smoke')
+    def test_list_pools_on_lbaas_agent(self):
+        found = False
+        resp, body = self.admin_client.list_agents(
+            agent_type="Loadbalancer agent")
+        self.assertEqual('200', resp['status'])
+        agents = body['agents']
+        for a in agents:
+            msg = 'Load Balancer agent expected'
+            self.assertEqual(a['agent_type'], 'Loadbalancer agent', msg)
+            resp, body = (
+                self.admin_client.list_pools_hosted_by_one_lbaas_agent(
+                    a['id']))
+            self.assertEqual('200', resp['status'])
+            pools = body['pools']
+            if self.pool['id'] in [p['id'] for p in pools]:
+                found = True
+        msg = 'Unable to find Load Balancer agent hosting pool'
+        self.assertTrue(found, msg)
+
+    @test.attr(type='smoke')
+    def test_show_lbaas_agent_hosting_pool(self):
+        resp, body = self.admin_client.show_lbaas_agent_hosting_pool(
+            self.pool['id'])
+        self.assertEqual('200', resp['status'])
+        self.assertEqual('Loadbalancer agent', body['agent']['agent_type'])
+
+
+class LBaaSAgentSchedulerTestXML(LBaaSAgentSchedulerTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index b129786..dd888a6 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -51,6 +51,11 @@
 
     force_tenant_isolation = False
 
+    # Default to ipv4.
+    _ip_version = 4
+    _tenant_network_cidr = CONF.network.tenant_network_cidr
+    _tenant_network_mask_bits = CONF.network.tenant_network_mask_bits
+
     @classmethod
     def setUpClass(cls):
         # Create no network resources for these test.
@@ -75,6 +80,8 @@
         cls.vpnservices = []
         cls.ikepolicies = []
         cls.floating_ips = []
+        cls.metering_labels = []
+        cls.metering_label_rules = []
 
     @classmethod
     def tearDownClass(cls):
@@ -107,6 +114,13 @@
         # Clean up pools
         for pool in cls.pools:
             cls.client.delete_pool(pool['id'])
+        # Clean up metering label rules
+        for metering_label_rule in cls.metering_label_rules:
+            cls.admin_client.delete_metering_label_rule(
+                metering_label_rule['id'])
+        # Clean up metering labels
+        for metering_label in cls.metering_labels:
+            cls.admin_client.delete_metering_label(metering_label['id'])
         # Clean up ports
         for port in cls.ports:
             cls.client.delete_port(port['id'])
@@ -130,10 +144,11 @@
         return network
 
     @classmethod
-    def create_subnet(cls, network, ip_version=4):
+    def create_subnet(cls, network):
         """Wrapper utility that returns a test subnet."""
-        cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
-        mask_bits = CONF.network.tenant_network_mask_bits
+        # The cidr and mask_bits depend on the ip version.
+        cidr = netaddr.IPNetwork(cls._tenant_network_cidr)
+        mask_bits = cls._tenant_network_mask_bits
         # Find a cidr that is not in use yet and create a subnet with it
         body = None
         failure = None
@@ -142,7 +157,7 @@
                 resp, body = cls.client.create_subnet(
                     network_id=network['id'],
                     cidr=str(subnet_cidr),
-                    ip_version=ip_version)
+                    ip_version=cls._ip_version)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -213,13 +228,22 @@
     @classmethod
     def create_vip(cls, name, protocol, protocol_port, subnet, pool):
         """Wrapper utility that returns a test vip."""
-        resp, body = cls.client.create_vip(name, protocol, protocol_port,
-                                           subnet['id'], pool['id'])
+        resp, body = cls.client.create_vip(name=name,
+                                           protocol=protocol,
+                                           protocol_port=protocol_port,
+                                           subnet_id=subnet['id'],
+                                           pool_id=pool['id'])
         vip = body['vip']
         cls.vips.append(vip)
         return vip
 
     @classmethod
+    def update_vip(cls, name):
+        resp, body = cls.client.update_vip(name=name)
+        vip = body['vip']
+        return vip
+
+    @classmethod
     def create_member(cls, protocol_port, pool):
         """Wrapper utility that returns a test member."""
         resp, body = cls.client.create_member("10.0.9.46",
@@ -232,14 +256,21 @@
     @classmethod
     def create_health_monitor(cls, delay, max_retries, Type, timeout):
         """Wrapper utility that returns a test health monitor."""
-        resp, body = cls.client.create_health_monitor(delay,
-                                                      max_retries,
-                                                      Type, timeout)
+        resp, body = cls.client.create_health_monitor(delay=delay,
+                                                      max_retries=max_retries,
+                                                      type=Type,
+                                                      timeout=timeout)
         health_monitor = body['health_monitor']
         cls.health_monitors.append(health_monitor)
         return health_monitor
 
     @classmethod
+    def update_health_monitor(cls, admin_state_up):
+        resp, body = cls.client.update_vip(admin_state_up=admin_state_up)
+        health_monitor = body['health_monitor']
+        return health_monitor
+
+    @classmethod
     def create_router_interface(cls, router_id, subnet_id):
         """Wrapper utility that returns a router interface."""
         resp, interface = cls.client.add_router_interface_with_subnet_id(
@@ -287,3 +318,24 @@
         else:
             cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
         cls.admin_client = cls.os_adm.network_client
+
+    @classmethod
+    def create_metering_label(cls, name, description):
+        """Wrapper utility that returns a test metering label."""
+        resp, body = cls.admin_client.create_metering_label(
+            description=description,
+            name=data_utils.rand_name("metering-label"))
+        metering_label = body['metering_label']
+        cls.metering_labels.append(metering_label)
+        return metering_label
+
+    @classmethod
+    def create_metering_label_rule(cls, remote_ip_prefix, direction,
+                                   metering_label_id):
+        """Wrapper utility that returns a test metering label rule."""
+        resp, body = cls.admin_client.create_metering_label_rule(
+            remote_ip_prefix=remote_ip_prefix, direction=direction,
+            metering_label_id=metering_label_id)
+        metering_label_rule = body['metering_label_rule']
+        cls.metering_label_rules.append(metering_label_rule)
+        return metering_label_rule
diff --git a/tempest/api/network/base_security_groups.py b/tempest/api/network/base_security_groups.py
index 38ae4ac..90be454 100644
--- a/tempest/api/network/base_security_groups.py
+++ b/tempest/api/network/base_security_groups.py
@@ -26,7 +26,7 @@
     def _create_security_group(self):
         # Create a security group
         name = data_utils.rand_name('secgroup-')
-        resp, group_create_body = self.client.create_security_group(name)
+        resp, group_create_body = self.client.create_security_group(name=name)
         self.assertEqual('201', resp['status'])
         self.addCleanup(self._delete_security_group,
                         group_create_body['security_group']['id'])
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
new file mode 100644
index 0000000..ed86d75
--- /dev/null
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -0,0 +1,99 @@
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations with the Extra DHCP Options Neutron API
+    extension:
+
+        port create
+        port list
+        port show
+        port update
+
+    v2.0 of the Neutron API is assumed. It is also assumed that the Extra
+    DHCP Options extension is enabled in the [network-feature-enabled]
+    section of etc/tempest.conf
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(ExtraDHCPOptionsTestJSON, cls).setUpClass()
+        if not test.is_extension_enabled('extra_dhcp_opt', 'network'):
+            msg = "Extra DHCP Options extension not enabled."
+            raise cls.skipException(msg)
+        cls.network = cls.create_network()
+        cls.subnet = cls.create_subnet(cls.network)
+        cls.port = cls.create_port(cls.network)
+
+    @test.attr(type='smoke')
+    def test_create_list_port_with_extra_dhcp_options(self):
+        # Create a port with Extra DHCP Options
+        extra_dhcp_opts = [
+            {'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
+            {'opt_value': '123.123.123.123', 'opt_name': 'tftp-server'},
+            {'opt_value': '123.123.123.45', 'opt_name': 'server-ip-address'}
+        ]
+        resp, body = self.client.create_port(
+            network_id=self.network['id'],
+            extra_dhcp_opts=extra_dhcp_opts)
+        self.assertEqual('201', resp['status'])
+        port_id = body['port']['id']
+        self.addCleanup(self.client.delete_port, port_id)
+
+        # Confirm port created has Extra DHCP Options
+        resp, body = self.client.list_ports()
+        self.assertEqual('200', resp['status'])
+        ports = body['ports']
+        port = [p for p in ports if p['id'] == port_id]
+        self.assertTrue(port)
+        self._confirm_extra_dhcp_options(port[0], extra_dhcp_opts)
+
+    @test.attr(type='smoke')
+    def test_update_show_port_with_extra_dhcp_options(self):
+        # Update port with extra dhcp options
+        extra_dhcp_opts = [
+            {'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
+            {'opt_value': '123.123.123.123', 'opt_name': 'tftp-server'},
+            {'opt_value': '123.123.123.45', 'opt_name': 'server-ip-address'}
+        ]
+        name = data_utils.rand_name('new-port-name')
+        resp, body = self.client.update_port(
+            self.port['id'], name=name, extra_dhcp_opts=extra_dhcp_opts)
+        self.assertEqual('200', resp['status'])
+
+        # Confirm extra dhcp options were added to the port
+        resp, body = self.client.show_port(self.port['id'])
+        self.assertEqual('200', resp['status'])
+        self._confirm_extra_dhcp_options(body['port'], extra_dhcp_opts)
+
+    def _confirm_extra_dhcp_options(self, port, extra_dhcp_opts):
+        retrieved = port['extra_dhcp_opts']
+        self.assertEqual(len(retrieved), len(extra_dhcp_opts))
+        for retrieved_option in retrieved:
+            for option in extra_dhcp_opts:
+                if (retrieved_option['opt_value'] == option['opt_value'] and
+                    retrieved_option['opt_name'] == option['opt_name']):
+                    break
+            else:
+                self.fail('Extra DHCP option not found in port %s' %
+                          str(retrieved_option))
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index d5f2b5b..03e095d 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -50,9 +50,16 @@
         vip_name = data_utils.rand_name('vip-')
         cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
                                    "HTTP", cls.subnet)
-        cls.vip = cls.create_vip(vip_name, "HTTP", 80, cls.subnet, cls.pool)
+        cls.vip = cls.create_vip(name=vip_name,
+                                 protocol="HTTP",
+                                 protocol_port=80,
+                                 subnet=cls.subnet,
+                                 pool=cls.pool)
         cls.member = cls.create_member(80, cls.pool)
-        cls.health_monitor = cls.create_health_monitor(4, 3, "TCP", 1)
+        cls.health_monitor = cls.create_health_monitor(delay=4,
+                                                       max_retries=3,
+                                                       Type="TCP",
+                                                       timeout=1)
 
     @test.attr(type='smoke')
     def test_list_vips(self):
@@ -76,14 +83,17 @@
             protocol='HTTP',
             subnet_id=self.subnet['id'])
         pool = body['pool']
-        resp, body = self.client.create_vip(name, "HTTP", 80,
-                                            self.subnet['id'], pool['id'])
+        resp, body = self.client.create_vip(name=name,
+                                            protocol="HTTP",
+                                            protocol_port=80,
+                                            subnet_id=self.subnet['id'],
+                                            pool_id=pool['id'])
         self.assertEqual('201', resp['status'])
         vip = body['vip']
         vip_id = vip['id']
         # Verification of vip update
         new_name = "New_vip"
-        resp, body = self.client.update_vip(vip_id, new_name)
+        resp, body = self.client.update_vip(vip_id, name=new_name)
         self.assertEqual('200', resp['status'])
         updated_vip = body['vip']
         self.assertEqual(updated_vip['name'], new_name)
@@ -143,11 +153,10 @@
         self.assertEqual('201', resp['status'])
         member = body['member']
         # Verification of member update
-        admin_state = [False, 'False']
-        resp, body = self.client.update_member(admin_state[0], member['id'])
+        resp, body = self.client.update_member(False, member['id'])
         self.assertEqual('200', resp['status'])
         updated_member = body['member']
-        self.assertIn(updated_member['admin_state_up'], admin_state)
+        self.assertFalse(updated_member['admin_state_up'])
         # Verification of member delete
         resp, body = self.client.delete_member(member['id'])
         self.assertEqual('204', resp['status'])
@@ -174,16 +183,19 @@
     @test.attr(type='smoke')
     def test_create_update_delete_health_monitor(self):
         # Creates a health_monitor
-        resp, body = self.client.create_health_monitor(4, 3, "TCP", 1)
+        resp, body = self.client.create_health_monitor(delay=4,
+                                                       max_retries=3,
+                                                       type="TCP",
+                                                       timeout=1)
         self.assertEqual('201', resp['status'])
         health_monitor = body['health_monitor']
         # Verification of health_monitor update
-        admin_state = [False, 'False']
-        resp, body = self.client.update_health_monitor(admin_state[0],
-                                                       health_monitor['id'])
+        resp, body = (self.client.update_health_monitor
+                     (health_monitor['id'],
+                      admin_state_up=False))
         self.assertEqual('200', resp['status'])
         updated_health_monitor = body['health_monitor']
-        self.assertIn(updated_health_monitor['admin_state_up'], admin_state)
+        self.assertFalse(updated_health_monitor['admin_state_up'])
         # Verification of health_monitor delete
         resp, body = self.client.delete_health_monitor(health_monitor['id'])
         self.assertEqual('204', resp['status'])
@@ -209,6 +221,17 @@
                      (self.health_monitor['id'], self.pool['id']))
         self.assertEqual('204', resp['status'])
 
+    @test.attr(type='smoke')
+    def test_get_lb_pool_stats(self):
+        # Verify the details of pool stats
+        resp, body = self.client.list_lb_pool_stats(self.pool['id'])
+        self.assertEqual('200', resp['status'])
+        stats = body['stats']
+        self.assertIn("bytes_in", stats)
+        self.assertIn("total_connections", stats)
+        self.assertIn("active_connections", stats)
+        self.assertIn("bytes_out", stats)
+
 
 class LoadBalancerTestXML(LoadBalancerTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
new file mode 100644
index 0000000..08ccbfe
--- /dev/null
+++ b/tempest/api/network/test_metering_extensions.py
@@ -0,0 +1,159 @@
+# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
+#
+# Author: Emilien Macchi <emilien.macchi@enovance.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest.openstack.common import log as logging
+from tempest import test
+
+
+LOG = logging.getLogger(__name__)
+
+
+class MeteringJSON(base.BaseAdminNetworkTest):
+    _interface = 'json'
+
+    """
+    Tests the following operations in the Neutron API using the REST client for
+    Neutron:
+
+        List, Show, Create, Delete Metering labels
+        List, Show, Create, Delete Metering labels rules
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        super(MeteringJSON, cls).setUpClass()
+        if not test.is_extension_enabled('metering', 'network'):
+            msg = "metering extension not enabled."
+            raise cls.skipException(msg)
+        description = "metering label created by tempest"
+        name = data_utils.rand_name("metering-label")
+        try:
+            cls.metering_label = cls.create_metering_label(name, description)
+            remote_ip_prefix = "10.0.0.0/24"
+            direction = "ingress"
+            cls.metering_label_rule = cls.create_metering_label_rule(
+                remote_ip_prefix, direction,
+                metering_label_id=cls.metering_label['id'])
+        except Exception:
+            LOG.exception('setUpClass failed')
+            cls.tearDownClass()
+            raise
+
+    def _delete_metering_label(self, metering_label_id):
+        # Deletes a label and verifies if it is deleted or not
+        resp, body = self.admin_client.delete_metering_label(metering_label_id)
+        self.assertEqual(204, resp.status)
+        # Asserting that the label is not found in list after deletion
+        resp, labels = (self.admin_client.list_metering_labels(
+                        id=metering_label_id))
+        self.assertEqual(len(labels['metering_labels']), 0)
+
+    def _delete_metering_label_rule(self, metering_label_rule_id):
+        # Deletes a rule and verifies if it is deleted or not
+        resp, body = (self.admin_client.delete_metering_label_rule(
+                      metering_label_rule_id))
+        self.assertEqual(204, resp.status)
+        # Asserting that the rule is not found in list after deletion
+        resp, rules = (self.admin_client.list_metering_label_rules(
+                       id=metering_label_rule_id))
+        self.assertEqual(len(rules['metering_label_rules']), 0)
+
+    @test.attr(type='smoke')
+    def test_list_metering_labels(self):
+        # Verify label filtering
+        resp, body = self.admin_client.list_metering_labels(id=33)
+        self.assertEqual('200', resp['status'])
+        metering_labels = body['metering_labels']
+        self.assertEqual(0, len(metering_labels))
+
+    @test.attr(type='smoke')
+    def test_create_delete_metering_label_with_filters(self):
+        # Creates a label
+        name = data_utils.rand_name('metering-label-')
+        description = "label created by tempest"
+        resp, body = (self.admin_client.create_metering_label(name=name,
+                      description=description))
+        self.assertEqual('201', resp['status'])
+        metering_label = body['metering_label']
+        self.addCleanup(self._delete_metering_label,
+                        metering_label['id'])
+        # Assert whether created labels are found in labels list or fail
+        # if created labels are not found in labels list
+        resp, labels = (self.admin_client.list_metering_labels(
+                        id=metering_label['id']))
+        self.assertEqual(len(labels['metering_labels']), 1)
+
+    @test.attr(type='smoke')
+    def test_show_metering_label(self):
+        # Verifies the details of a label
+        resp, body = (self.admin_client.show_metering_label(
+                      self.metering_label['id']))
+        self.assertEqual('200', resp['status'])
+        metering_label = body['metering_label']
+        self.assertEqual(self.metering_label['id'], metering_label['id'])
+        self.assertEqual(self.metering_label['tenant_id'],
+                         metering_label['tenant_id'])
+        self.assertEqual(self.metering_label['name'], metering_label['name'])
+        self.assertEqual(self.metering_label['description'],
+                         metering_label['description'])
+
+    @test.attr(type='smoke')
+    def test_list_metering_label_rules(self):
+        # Verify rule filtering
+        resp, body = self.admin_client.list_metering_label_rules(id=33)
+        self.assertEqual('200', resp['status'])
+        metering_label_rules = body['metering_label_rules']
+        self.assertEqual(0, len(metering_label_rules))
+
+    @test.attr(type='smoke')
+    def test_create_delete_metering_label_rule_with_filters(self):
+        # Creates a rule
+        resp, body = (self.admin_client.create_metering_label_rule(
+                      remote_ip_prefix="10.0.1.0/24",
+                      direction="ingress",
+                      metering_label_id=self.metering_label['id']))
+        self.assertEqual('201', resp['status'])
+        metering_label_rule = body['metering_label_rule']
+        self.addCleanup(self._delete_metering_label_rule,
+                        metering_label_rule['id'])
+        # Assert whether created rules are found in rules list or fail
+        # if created rules are not found in rules list
+        resp, rules = (self.admin_client.list_metering_label_rules(
+                       id=metering_label_rule['id']))
+        self.assertEqual(len(rules['metering_label_rules']), 1)
+
+    @test.attr(type='smoke')
+    def test_show_metering_label_rule(self):
+        # Verifies the details of a rule
+        resp, body = (self.admin_client.show_metering_label_rule(
+                      self.metering_label_rule['id']))
+        self.assertEqual('200', resp['status'])
+        metering_label_rule = body['metering_label_rule']
+        self.assertEqual(self.metering_label_rule['id'],
+                         metering_label_rule['id'])
+        self.assertEqual(self.metering_label_rule['remote_ip_prefix'],
+                         metering_label_rule['remote_ip_prefix'])
+        self.assertEqual(self.metering_label_rule['direction'],
+                         metering_label_rule['direction'])
+        self.assertEqual(self.metering_label_rule['metering_label_id'],
+                         metering_label_rule['metering_label_id'])
+        self.assertFalse(metering_label_rule['excluded'])
+
+
+class MeteringXML(MeteringJSON):
+    interface = 'xml'
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index aee2a44..aba2c8e 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -45,14 +45,20 @@
         network update
         subnet update
 
+        All subnet tests are run once with ipv4 and once with ipv6.
+
     v2.0 of the Neutron API is assumed. It is also assumed that the following
     options are defined in the [network] section of etc/tempest.conf:
 
         tenant_network_cidr with a block of cidr's from which smaller blocks
-        can be allocated for tenant networks
+        can be allocated for tenant ipv4 subnets
+
+        tenant_network_v6_cidr is the equivalent for ipv6 subnets
 
         tenant_network_mask_bits with the mask bits to be used to partition the
-        block defined by tenant-network_cidr
+        block defined by tenant_network_cidr
+
+        tenant_network_v6_mask_bits is the equivalent for ipv6 subnets
     """
 
     @classmethod
@@ -79,14 +85,14 @@
         updated_net = body['network']
         self.assertEqual(updated_net['name'], new_name)
         # Find a cidr that is not in use yet and create a subnet with it
-        cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
-        mask_bits = CONF.network.tenant_network_mask_bits
+        cidr = netaddr.IPNetwork(self._tenant_network_cidr)
+        mask_bits = self._tenant_network_mask_bits
         for subnet_cidr in cidr.subnet(mask_bits):
             try:
                 resp, body = self.client.create_subnet(
                     network_id=net_id,
                     cidr=str(subnet_cidr),
-                    ip_version=4)
+                    ip_version=self._ip_version)
                 break
             except exceptions.BadRequest as e:
                 is_overlapping_cidr = 'overlaps with another subnet' in str(e)
@@ -118,6 +124,18 @@
         self.assertEqual(self.name, network['name'])
 
     @attr(type='smoke')
+    def test_show_network_fields(self):
+        # Verifies showing some fields of a network works
+        field_list = [('fields', 'id'), ('fields', 'name'), ]
+        resp, body = self.client.show_network(self.network['id'],
+                                              field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        network = body['network']
+        self.assertEqual(len(network), 2)
+        self.assertEqual(self.network['id'], network['id'])
+        self.assertEqual(self.name, network['name'])
+
+    @attr(type='smoke')
     def test_list_networks(self):
         # Verify the network exists in the list of all networks
         resp, body = self.client.list_networks()
@@ -155,6 +173,18 @@
         self.assertEqual(self.cidr, subnet['cidr'])
 
     @attr(type='smoke')
+    def test_show_subnet_fields(self):
+        # Verifies showing some fields of a subnet works
+        field_list = [('fields', 'id'), ('fields', 'cidr'), ]
+        resp, body = self.client.show_subnet(self.subnet['id'],
+                                             field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        subnet = body['subnet']
+        self.assertEqual(len(subnet), 2)
+        self.assertEqual(self.subnet['id'], subnet['id'])
+        self.assertEqual(self.cidr, subnet['cidr'])
+
+    @attr(type='smoke')
     def test_list_subnets(self):
         # Verify the subnet exists in the list of all subnets
         resp, body = self.client.list_subnets()
@@ -189,12 +219,17 @@
             network_id=self.network['id'])
         self.assertEqual('201', resp['status'])
         port = body['port']
+        self.assertTrue(port['admin_state_up'])
         # Verification of port update
         new_port = "New_Port"
-        resp, body = self.client.update_port(port['id'], name=new_port)
+        resp, body = self.client.update_port(
+            port['id'],
+            name=new_port,
+            admin_state_up=False)
         self.assertEqual('200', resp['status'])
         updated_port = body['port']
         self.assertEqual(updated_port['name'], new_port)
+        self.assertFalse(updated_port['admin_state_up'])
         # Verification of port delete
         resp, body = self.client.delete_port(port['id'])
         self.assertEqual('204', resp['status'])
@@ -208,6 +243,17 @@
         self.assertEqual(self.port['id'], port['id'])
 
     @attr(type='smoke')
+    def test_show_port_fields(self):
+        # Verifies showing fields of a port works
+        field_list = [('fields', 'id'), ]
+        resp, body = self.client.show_port(self.port['id'],
+                                           field_list=field_list)
+        self.assertEqual('200', resp['status'])
+        port = body['port']
+        self.assertEqual(len(port), 1)
+        self.assertEqual(self.port['id'], port['id'])
+
+    @attr(type='smoke')
     def test_list_ports(self):
         # Verify the port exists in the list of all ports
         resp, body = self.client.list_ports()
@@ -220,6 +266,28 @@
         self.assertIsNotNone(found, "Port list doesn't contain created port")
 
     @attr(type='smoke')
+    def test_port_list_filter_by_router_id(self):
+        # Create a router
+        network = self.create_network()
+        self.create_subnet(network)
+        router = self.create_router(data_utils.rand_name('router-'))
+        resp, port = self.client.create_port(
+            network_id=network['id'])
+        # Add router interface to port created above
+        resp, interface = self.client.add_router_interface_with_port_id(
+            router['id'], port['port']['id'])
+        self.addCleanup(self.client.remove_router_interface_with_port_id,
+                        router['id'], port['port']['id'])
+        # list ports filtered by router_id
+        resp, port_list = self.client.list_ports(
+            device_id=router['id'])
+        self.assertEqual('200', resp['status'])
+        # Verify if only corresponding port is listed and assert router_id
+        self.assertEqual(len(port_list['ports']), 1)
+        self.assertEqual(port['port']['id'], port_list['ports'][0]['id'])
+        self.assertEqual(router['id'], port_list['ports'][0]['device_id'])
+
+    @attr(type='smoke')
     def test_list_ports_fields(self):
         # Verify listing some fields of the ports
         resp, body = self.client.list_ports(fields='id')
@@ -392,3 +460,21 @@
 
 class BulkNetworkOpsTestXML(BulkNetworkOpsTestJSON):
     _interface = 'xml'
+
+
+class NetworksIpV6TestJSON(NetworksTestJSON):
+    _ip_version = 6
+    _tenant_network_cidr = CONF.network.tenant_network_v6_cidr
+    _tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
+
+    @classmethod
+    def setUpClass(cls):
+        super(NetworksIpV6TestJSON, cls).setUpClass()
+        if not CONF.network.ipv6_enabled:
+            cls.tearDownClass()
+            skip_msg = "IPv6 Tests are disabled."
+            raise cls.skipException(skip_msg)
+
+
+class NetworksIpV6TestXML(NetworksIpV6TestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 5d3db06..2657031 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -16,6 +16,7 @@
 import netaddr
 
 from tempest.api.network import base_routers as base
+from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import test
@@ -32,6 +33,8 @@
         if not test.is_extension_enabled('router', 'network'):
             msg = "router extension not enabled."
             raise cls.skipException(msg)
+        admin_manager = clients.AdminManager()
+        cls.identity_admin_client = admin_manager.identity_client
 
     @test.attr(type='smoke')
     def test_create_show_list_update_delete_router(self):
@@ -77,6 +80,25 @@
         self.assertEqual(show_body['router']['name'], updated_name)
 
     @test.attr(type='smoke')
+    def test_create_router_setting_tenant_id(self):
+        # Test creating router from admin user setting tenant_id.
+        test_tenant = data_utils.rand_name('test_tenant_')
+        test_description = data_utils.rand_name('desc_')
+        _, tenant = self.identity_admin_client.create_tenant(
+            name=test_tenant,
+            description=test_description)
+        tenant_id = tenant['id']
+        self.addCleanup(self.identity_admin_client.delete_tenant, tenant_id)
+
+        name = data_utils.rand_name('router-')
+        resp, create_body = self.admin_client.create_router(
+            name, tenant_id=tenant_id)
+        self.assertEqual('201', resp['status'])
+        self.addCleanup(self.admin_client.delete_router,
+                        create_body['router']['id'])
+        self.assertEqual(tenant_id, create_body['router']['tenant_id'])
+
+    @test.attr(type='smoke')
     def test_add_remove_router_interface_with_subnet_id(self):
         network = self.create_network()
         subnet = self.create_subnet(network)
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index 6eebf5b..1d41cc9 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -66,8 +66,9 @@
         protocols = ['tcp', 'udp', 'icmp']
         for protocol in protocols:
             resp, rule_create_body = self.client.create_security_group_rule(
-                group_create_body['security_group']['id'],
-                protocol=protocol
+                security_group_id=group_create_body['security_group']['id'],
+                protocol=protocol,
+                direction='ingress'
             )
             self.assertEqual('201', resp['status'])
             self.addCleanup(self._delete_security_group_rule,
@@ -99,7 +100,7 @@
         port_range_min = 77
         port_range_max = 77
         resp, rule_create_body = self.client.create_security_group_rule(
-            group_create_body['security_group']['id'],
+            security_group_id=group_create_body['security_group']['id'],
             direction=direction,
             protocol=protocol,
             port_range_min=port_range_min,
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index e1f4055..0b86398 100644
--- a/tempest/api/network/test_security_groups_negative.py
+++ b/tempest/api/network/test_security_groups_negative.py
@@ -57,10 +57,10 @@
 
         #Create rule with bad protocol name
         pname = 'bad_protocol_name'
-        self.assertRaises(exceptions.BadRequest,
-                          self.client.create_security_group_rule,
-                          group_create_body['security_group']['id'],
-                          protocol=pname)
+        self.assertRaises(
+            exceptions.BadRequest, self.client.create_security_group_rule,
+            security_group_id=group_create_body['security_group']['id'],
+            protocol=pname, direction='ingress')
 
     @test.attr(type=['negative', 'gate'])
     def test_create_security_group_rule_with_invalid_ports(self):
@@ -72,12 +72,11 @@
                   (80, 65536, 'Invalid value for port 65536'),
                   (-16, 65536, 'Invalid value for port')]
         for pmin, pmax, msg in states:
-            ex = self.assertRaises(exceptions.BadRequest,
-                                   self.client.create_security_group_rule,
-                                   group_create_body['security_group']['id'],
-                                   protocol='tcp',
-                                   port_range_min=pmin,
-                                   port_range_max=pmax)
+            ex = self.assertRaises(
+                exceptions.BadRequest, self.client.create_security_group_rule,
+                security_group_id=group_create_body['security_group']['id'],
+                protocol='tcp', port_range_min=pmin, port_range_max=pmax,
+                direction='ingress')
             self.assertIn(msg, str(ex))
 
     @test.attr(type=['negative', 'smoke'])
@@ -86,7 +85,7 @@
         name = 'default'
         self.assertRaises(exceptions.Conflict,
                           self.client.create_security_group,
-                          name)
+                          name=name)
 
     @test.attr(type=['negative', 'smoke'])
     def test_create_security_group_rule_with_non_existent_security_group(self):
@@ -94,7 +93,8 @@
         non_existent_sg = str(uuid.uuid4())
         self.assertRaises(exceptions.NotFound,
                           self.client.create_security_group_rule,
-                          non_existent_sg)
+                          security_group_id=non_existent_sg,
+                          direction='ingress')
 
 
 class NegativeSecGroupTestXML(NegativeSecGroupTest):
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index ef36c3d..45c895b 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 
-from tempest.api.identity.base import DataGenerator
+from tempest.api.identity import base
 from tempest import clients
 from tempest.common import custom_matchers
 from tempest.common import isolated_creds
@@ -83,7 +83,7 @@
         cls.object_client_alt.auth_provider.clear_auth()
         cls.container_client_alt.auth_provider.clear_auth()
 
-        cls.data = DataGenerator(cls.identity_admin_client)
+        cls.data = base.DataGenerator(cls.identity_admin_client)
 
     @classmethod
     def tearDownClass(cls):
@@ -130,7 +130,10 @@
                 objlist = container_client.list_all_container_objects(cont)
                 # delete every object in the container
                 for obj in objlist:
-                    object_client.delete_object(cont, obj['name'])
+                    try:
+                        object_client.delete_object(cont, obj['name'])
+                    except exceptions.NotFound:
+                        pass
                 container_client.delete_container(cont)
             except exceptions.NotFound:
                 pass
diff --git a/tempest/api/object_storage/test_account_bulk.py b/tempest/api/object_storage/test_account_bulk.py
index 5fde76a..a94c883 100644
--- a/tempest/api/object_storage/test_account_bulk.py
+++ b/tempest/api/object_storage/test_account_bulk.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 NTT Corporation
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index 79fd99d..5456768 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class AccountTest(base.BaseObjectTest):
@@ -38,7 +37,7 @@
         cls.delete_containers(cls.containers)
         super(AccountTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers(self):
         # list of all containers should not be empty
         params = {'format': 'json'}
@@ -51,14 +50,14 @@
         for container_name in self.containers:
             self.assertIn(container_name, container_names)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_extensions(self):
         resp, extensions = self.account_client.list_extensions()
 
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertThat(resp, custom_matchers.AreAllWellFormatted())
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_limit(self):
         # list containers one of them, half of them then all of them
         for limit in (1, self.containers_count / 2, self.containers_count):
@@ -69,7 +68,7 @@
 
             self.assertEqual(len(container_list), limit)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_marker(self):
         # list containers using marker param
         # first expect to get 0 container as we specified last
@@ -89,7 +88,7 @@
 
         self.assertEqual(len(container_list), self.containers_count / 2 - 1)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_end_marker(self):
         # list containers using end_marker param
         # first expect to get 0 container as we specified first container as
@@ -107,7 +106,7 @@
         self.assertHeaders(resp, 'Account', 'GET')
         self.assertEqual(len(container_list), self.containers_count / 2)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_limit_and_marker(self):
         # list containers combining marker and limit param
         # result are always limitated by the limit whatever the marker
@@ -121,21 +120,21 @@
 
             self.assertTrue(len(container_list) <= limit, str(container_list))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_account_metadata(self):
         # list all account metadata
         resp, metadata = self.account_client.list_account_metadata()
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'HEAD')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_and_delete_account_metadata(self):
         header = 'test-account-meta'
         data = 'Meta!'
         # add metadata to account
         resp, _ = self.account_client.create_account_metadata(
             metadata={header: data})
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
@@ -147,7 +146,7 @@
         # delete metadata from account
         resp, _ = \
             self.account_client.delete_account_metadata(metadata=[header])
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index aae6b4d..085ef51 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -16,8 +16,7 @@
 from tempest.api.object_storage import base
 from tempest import clients
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTestACLs(base.BaseObjectTest):
@@ -44,7 +43,7 @@
         self.delete_containers([self.container_name])
         super(ObjectTestACLs, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_read_object_with_rights(self):
         # attempt to read object using authorized user
         # update X-Container-Read metadata ACL
@@ -53,7 +52,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -68,10 +67,10 @@
         )
         resp, _ = self.custom_object_client.get_object(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_write_object_with_rights(self):
         # attempt to write object using authorized user
         # update X-Container-Write metadata ACL
@@ -80,7 +79,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object with rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -91,5 +90,5 @@
         resp, _ = self.custom_object_client.create_object(
             self.container_name,
             object_name, 'data')
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index 1dc9bb5..a5a0950 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -18,8 +18,7 @@
 from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectACLsNegativeTest(base.BaseObjectTest):
@@ -46,7 +45,7 @@
         self.delete_containers([self.container_name])
         super(ObjectACLsNegativeTest, self).tearDown()
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_write_object_without_using_creds(self):
         # trying to create object with empty headers
         # X-Auth-Token is not provided
@@ -59,7 +58,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_object_without_using_creds(self):
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -75,7 +74,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_write_object_with_non_authorized_user(self):
         # attempt to upload another file using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -89,7 +88,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_read_object_with_non_authorized_user(self):
         # attempt to read object using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -107,7 +106,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_object_with_non_authorized_user(self):
         # attempt to delete object using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -125,7 +124,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_read_object_without_rights(self):
         # attempt to read object using non-authorized user
         # update X-Container-Read metadata ACL
@@ -133,7 +132,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -150,7 +149,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_write_object_without_rights(self):
         # attempt to write object using non-authorized user
         # update X-Container-Write metadata ACL
@@ -158,7 +157,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -171,7 +170,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_write_object_without_write_rights(self):
         # attempt to write object using non-authorized user
         # update X-Container-Read and X-Container-Write metadata ACL
@@ -181,7 +180,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without write rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -194,7 +193,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_delete_object_without_write_rights(self):
         # attempt to delete object using non-authorized user
         # update X-Container-Read and X-Container-Write metadata ACL
@@ -204,7 +203,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 84cc91e..8689d10 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -15,8 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -47,7 +46,7 @@
 
         return object_name
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container(self):
         container_name = data_utils.rand_name(name='TestContainer')
         resp, body = self.container_client.create_container(container_name)
@@ -55,7 +54,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_overwrite(self):
         # overwrite container with the same name
         container_name = data_utils.rand_name(name='TestContainer')
@@ -66,7 +65,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_key(self):
         # create container with the blank value of metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -84,7 +83,7 @@
         # in the server
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_value(self):
         # create container with metadata value
         container_name = data_utils.rand_name(name='TestContainer')
@@ -103,7 +102,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta'],
                          metadata['test-container-meta'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_key(self):
         # create container with the blank value of remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -124,7 +123,7 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_value(self):
         # create container with remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -143,18 +142,18 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_container(self):
         # create a container
         container_name = self._create_container()
         # delete container
         resp, _ = self.container_client.delete_container(container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'DELETE')
 
         self.containers.remove(container_name)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents(self):
         # get container contents list
         container_name = self._create_container()
@@ -162,22 +161,22 @@
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_no_object(self):
         # get empty container contents list
         container_name = self._create_container()
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual('', object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_delimiter(self):
         # get container contents list using delimiter param
         container_name = self._create_container()
@@ -188,11 +187,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name.split('/')[0], object_list.strip('/\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_end_marker(self):
         # get container contents list using end_marker param
         container_name = self._create_container()
@@ -202,11 +201,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_json(self):
         # get container contents list using format_json param
         container_name = self._create_container()
@@ -216,7 +215,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -226,7 +225,7 @@
         self.assertTrue([c['content_type'] for c in object_list])
         self.assertTrue([c['last_modified'] for c in object_list])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_xml(self):
         # get container contents list using format_xml param
         container_name = self._create_container()
@@ -236,7 +235,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -251,7 +250,7 @@
         self.assertEqual(object_list.find(".//last_modified").tag,
                          'last_modified')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_limit(self):
         # get container contents list using limit param
         container_name = self._create_container()
@@ -261,11 +260,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_marker(self):
         # get container contents list using marker param
         container_name = self._create_container()
@@ -275,11 +274,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_path(self):
         # get container contents list using path param
         container_name = self._create_container()
@@ -290,11 +289,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_prefix(self):
         # get container contents list using prefix param
         container_name = self._create_container()
@@ -305,11 +304,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_metadata(self):
         # List container metadata
         container_name = self._create_container()
@@ -321,23 +320,23 @@
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertIn('x-container-meta-name', resp)
         self.assertEqual(resp['x-container-meta-name'], metadata['name'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_no_container_metadata(self):
         # HEAD container without metadata
         container_name = self._create_container()
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertNotIn('x-container-meta-', str(resp))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_and_delete_matadata(self):
         # Send one request of adding and deleting metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -351,7 +350,7 @@
             container_name,
             metadata=metadata_2,
             remove_metadata=metadata_1)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -361,7 +360,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta2'],
                          metadata_2['test-container-meta2'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_metadata(self):
         # update container metadata using add metadata
         container_name = self._create_container()
@@ -370,7 +369,7 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -379,7 +378,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta1'],
                          metadata['test-container-meta1'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata(self):
         # update container metadata using delete metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -391,14 +390,14 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_matadata_key(self):
         # update container metadata with a blenk value of metadata
         container_name = self._create_container()
@@ -407,14 +406,14 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata_key(self):
         # update container metadata with a blank value of matadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -427,7 +426,7 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(container_name)
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 197e7fa..6c71340 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -49,6 +49,7 @@
         cls.data.teardown_all()
         super(StaticWebTest, cls).tearDownClass()
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_index(self):
         headers = {'web-index': self.object_name}
@@ -79,6 +80,7 @@
             self.container_name)
         self.assertNotIn('x-container-meta-web-index', body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_listing(self):
         headers = {'web-listings': 'true'}
@@ -110,6 +112,7 @@
             self.container_name)
         self.assertNotIn('x-container-meta-web-listings', body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_listing_css(self):
         headers = {'web-listings': 'true',
@@ -133,6 +136,7 @@
         css = '<link rel="stylesheet" type="text/css" href="listings.css" />'
         self.assertIn(css, body)
 
+    @test.requires_ext(extension='staticweb', service='object')
     @test.attr('gate')
     def test_web_error(self):
         headers = {'web-listings': 'true',
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index 207fced..9bd986f 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -19,8 +19,7 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 CONF = config.CONF
 
@@ -66,7 +65,7 @@
             cls.delete_containers(cls.containers, client[0], client[1])
         super(ContainerSyncTest, cls).tearDownClass()
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     def test_container_synchronization(self):
         # container to container synchronization
         # to allow/accept sync requests to/from other accounts
@@ -86,12 +85,12 @@
                        (client_base_url, str(cont[1]))}
             resp, body = \
                 cont_client[0].put(str(cont[0]), body=None, headers=headers)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             # create object in container
             object_name = data_utils.rand_name(name='TestSyncObject')
             data = object_name[::-1]  # data_utils.arbitrary_string()
             resp, _ = obj_client[0].create_object(cont[0], object_name, data)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             self.objects.append(object_name)
 
         # wait until container contents list is not empty
@@ -104,7 +103,7 @@
                     cont_client[client_index].\
                     list_container_contents(self.containers[client_index],
                                             params=params)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 object_lists.append(dict(
                     (obj['name'], obj) for obj in object_list))
             # check that containers are not empty and have equal keys()
@@ -124,5 +123,5 @@
         for obj_client, cont in obj_clients:
             for obj_name in object_lists[0]:
                 resp, object_content = obj_client.get_object(cont, obj_name)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 self.assertEqual(object_content, obj_name[::-1])
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index 35aee2a..e27c7ef 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -17,8 +17,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class HealthcheckTest(base.BaseObjectTest):
@@ -32,13 +31,13 @@
         # Turning http://.../v1/foobar into http://.../
         self.account_client.skip_path()
 
-    @attr('gate')
+    @test.attr('gate')
     def test_get_healthcheck(self):
 
         resp, _ = self.account_client.get("healthcheck", {})
 
         # The status is expected to be 200
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
 
         # The target of the request is not any Swift resource. Therefore, the
         # existence of response header is checked without a custom matcher.
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 3aae0a1..53ca20d 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -18,7 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class ObjectExpiryTest(base.BaseObjectTest):
@@ -67,12 +67,12 @@
         self.assertRaises(exceptions.NotFound, self.object_client.get_object,
                           self.container_name, self.object_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_after_expiry_time(self):
         metadata = {'X-Delete-After': '3'}
         self._test_object_expiry(metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_at_expiry_time(self):
         metadata = {'X-Delete-At': str(int(time.time()) + 3)}
         self._test_object_expiry(metadata)
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index 6f46ec9..e0d15ac 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -21,8 +21,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectFormPostTest(base.BaseObjectTest):
@@ -93,7 +92,8 @@
         content_type = 'multipart/form-data; boundary=%s' % boundary
         return body, content_type
 
-    @attr(type='gate')
+    @test.requires_ext(extension='formpost', service='object')
+    @test.attr(type='gate')
     def test_post_object_using_form(self):
         body, content_type = self.get_multipart_form()
 
@@ -107,12 +107,12 @@
         # Use a raw request, otherwise authentication headers are used
         resp, body = self.object_client.http_obj.request(url, "POST",
                                                          body, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "POST")
 
         # Ensure object is available
         resp, body = self.object_client.get("%s/%s%s" % (
             self.container_name, self.object_name, "testfile"))
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "GET")
         self.assertEqual(body, "hello world")
diff --git a/tempest/api/object_storage/test_object_formpost_negative.py b/tempest/api/object_storage/test_object_formpost_negative.py
index e02a058..a52c248 100644
--- a/tempest/api/object_storage/test_object_formpost_negative.py
+++ b/tempest/api/object_storage/test_object_formpost_negative.py
@@ -20,7 +20,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class ObjectFormPostNegativeTest(base.BaseObjectTest):
@@ -91,7 +91,8 @@
         content_type = 'multipart/form-data; boundary=%s' % boundary
         return body, content_type
 
-    @attr(type=['gate', 'negative'])
+    @test.requires_ext(extension='formpost', service='object')
+    @test.attr(type=['gate', 'negative'])
     def test_post_object_using_form_expired(self):
         body, content_type = self.get_multipart_form(expires=1)
         time.sleep(2)
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 6f349b6..33f3299 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTest(base.BaseObjectTest):
@@ -35,7 +34,7 @@
         cls.delete_containers(cls.containers)
         super(ObjectTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -50,7 +49,7 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -60,10 +59,10 @@
         # delete object
         resp, _ = self.object_client.delete_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'DELETE')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_object_metadata(self):
         # add metadata to storage object, test if metadata is retrievable
 
@@ -78,20 +77,20 @@
         orig_metadata = {meta_key: meta_value}
         resp, _ = self.object_client.update_object_metadata(
             self.container_name, object_name, orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # get object metadata
         resp, resp_metadata = self.object_client.list_object_metadata(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'HEAD')
 
         actual_meta_key = 'x-object-meta-' + meta_key
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_object(self):
         # retrieve object's data (in response body)
 
@@ -103,12 +102,12 @@
         # get object
         resp, body = self.object_client.get_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_in_same_container(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -135,7 +134,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_to_itself(self):
         # change the content type of an existing object
 
@@ -160,7 +159,7 @@
                                                           object_name)
         self.assertEqual(resp['content-type'], metadata['content-type'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_2d_way(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -195,7 +194,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_across_containers(self):
         # create a container to use as  asource container
         src_container_name = data_utils.rand_name(name='TestSourceContainer')
@@ -219,7 +218,7 @@
         resp, _ = self.object_client.update_object_metadata(src_container_name,
                                                             object_name,
                                                             orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # copy object from source container to destination container
@@ -237,7 +236,7 @@
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_object_upload_in_segments(self):
         # create object
         object_name = data_utils.rand_name(name='LObject')
@@ -280,7 +279,7 @@
             self.container_name, object_name)
         self.assertEqual(''.join(data_segments), body)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_if_different(self):
         # http://en.wikipedia.org/wiki/HTTP_ETag
         # Make a conditional request for an object using the If-None-Match
@@ -312,7 +311,7 @@
         md5 = hashlib.md5(local_data).hexdigest()
         headers = {'If-None-Match': md5}
         resp, body = self.object_client.get(url, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
 
@@ -326,7 +325,7 @@
         self.delete_containers([self.container_name])
         super(PublicObjectTest, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_container_object_without_using_creds(self):
         # make container public-readable and access an object in it object
         # anonymously, without using credentials
@@ -335,7 +334,7 @@
         cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers, metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -350,7 +349,7 @@
         # list container metadata
         resp_meta, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp_meta)
@@ -367,7 +366,7 @@
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_object_with_another_user_creds(self):
         # make container public-readable and access an object in it using
         # another user's credentials
@@ -375,7 +374,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -390,7 +389,7 @@
         # list container metadata
         resp, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp)
diff --git a/tempest/api/object_storage/test_object_version.py b/tempest/api/object_storage/test_object_version.py
index 75293d2..8d2ff9b 100644
--- a/tempest/api/object_storage/test_object_version.py
+++ b/tempest/api/object_storage/test_object_version.py
@@ -15,7 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -40,7 +40,7 @@
         header_value = resp.get('x-versions-location', 'Missing Header')
         self.assertEqual(header_value, versioned)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_versioned_container(self):
         # create container
         vers_container_name = data_utils.rand_name(name='TestVersionContainer')
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 243c3ce..3e621f4 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -17,6 +17,7 @@
 from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import config
+from tempest import exceptions
 from tempest.test import attr
 
 CONF = config.CONF
@@ -28,25 +29,28 @@
     _interface = 'json'
 
     template = """
-HeatTemplateFormatVersion: '2012-12-12'
-Description: |
+heat_template_version: '2013-05-23'
+description: |
   Template which creates single EC2 instance
-Parameters:
+parameters:
   KeyName:
-    Type: String
+    type: string
   InstanceType:
-    Type: String
+    type: string
   ImageId:
-    Type: String
+    type: string
   ExternalRouterId:
-    Type: String
-Resources:
+    type: string
+  ExternalNetworkId:
+    type: string
+resources:
   Network:
-    Type: OS::Quantum::Net
-    Properties: {name: NewNetwork}
+    type: OS::Neutron::Net
+    properties:
+      name: NewNetwork
   Subnet:
-    Type: OS::Quantum::Subnet
-    Properties:
+    type: OS::Neutron::Subnet
+    properties:
       network_id: {Ref: Network}
       name: NewSubnet
       ip_version: 4
@@ -54,39 +58,44 @@
       dns_nameservers: ["8.8.8.8"]
       allocation_pools:
       - {end: 10.0.3.150, start: 10.0.3.20}
+  Router:
+    type: OS::Neutron::Router
+    properties:
+      name: NewRouter
+      admin_state_up: false
+      external_gateway_info:
+        network: {get_param: ExternalNetworkId}
+        enable_snat: false
   RouterInterface:
-    Type: OS::Quantum::RouterInterface
-    Properties:
-      router_id: {Ref: ExternalRouterId}
-      subnet_id: {Ref: Subnet}
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: {get_param: ExternalRouterId}
+      subnet_id: {get_resource: Subnet}
   Server:
-    Type: AWS::EC2::Instance
+    type: AWS::EC2::Instance
     Metadata:
-      Name: SmokeServer
-    Properties:
-      ImageId: {Ref: ImageId}
-      InstanceType: {Ref: InstanceType}
-      KeyName: {Ref: KeyName}
-      SubnetId: {Ref: Subnet}
+      Name: SmokeServerNeutron
+    properties:
+      ImageId: {get_param: ImageId}
+      InstanceType: {get_param: InstanceType}
+      KeyName: {get_param: KeyName}
+      SubnetId: {get_resource: Subnet}
       UserData:
-        Fn::Base64:
-          Fn::Join:
-          - ''
-          - - '#!/bin/bash -v
+        str_replace:
+          template: |
+            #!/bin/bash -v
 
-              '
-            - /opt/aws/bin/cfn-signal -e 0 -r "SmokeServer created" '
-            - {Ref: WaitHandle}
-            - '''
-
-              '
-  WaitHandle:
-    Type: AWS::CloudFormation::WaitConditionHandle
+            /opt/aws/bin/cfn-signal -e 0 -r "SmokeServerNeutron created" \
+            'wait_handle'
+          params:
+            wait_handle: {get_resource: WaitHandleNeutron}
+  WaitHandleNeutron:
+    type: AWS::CloudFormation::WaitConditionHandle
   WaitCondition:
-    Type: AWS::CloudFormation::WaitCondition
+    type: AWS::CloudFormation::WaitCondition
     DependsOn: Server
-    Properties:
-      Handle: {Ref: WaitHandle}
+    properties:
+      Handle: {get_resource: WaitHandleNeutron}
       Timeout: '600'
 """
 
@@ -104,6 +113,7 @@
         cls.keypair_name = (CONF.orchestration.keypair_name or
                             cls._create_keypair()['name'])
         cls.external_router_id = cls._get_external_router_id()
+        cls.external_network_id = CONF.network.public_network_id
 
         # create the stack
         cls.stack_identifier = cls.create_stack(
@@ -113,11 +123,26 @@
                 'KeyName': cls.keypair_name,
                 'InstanceType': CONF.orchestration.instance_type,
                 'ImageId': CONF.orchestration.image_ref,
-                'ExternalRouterId': cls.external_router_id
+                'ExternalRouterId': cls.external_router_id,
+                'ExternalNetworkId': cls.external_network_id
             })
         cls.stack_id = cls.stack_identifier.split('/')[1]
-        cls.client.wait_for_stack_status(cls.stack_id, 'CREATE_COMPLETE')
-        _, resources = cls.client.list_resources(cls.stack_identifier)
+        try:
+            cls.client.wait_for_stack_status(cls.stack_id, 'CREATE_COMPLETE')
+            _, resources = cls.client.list_resources(cls.stack_identifier)
+        except exceptions.TimeoutException as e:
+            # attempt to log the server console to help with debugging
+            # the cause of the server not signalling the waitcondition
+            # to heat.
+            resp, body = cls.client.get_resource(cls.stack_identifier,
+                                                 'SmokeServerNeutron')
+            server_id = body['physical_resource_id']
+            LOG.debug('Console output for %s', server_id)
+            resp, output = cls.servers_client.get_console_output(
+                server_id, None)
+            LOG.debug(output)
+            raise e
+
         cls.test_resources = {}
         for resource in resources:
             cls.test_resources[resource['logical_resource_id']] = resource
@@ -133,9 +158,9 @@
     @attr(type='slow')
     def test_created_resources(self):
         """Verifies created neutron resources."""
-        resources = [('Network', 'OS::Quantum::Net'),
-                     ('Subnet', 'OS::Quantum::Subnet'),
-                     ('RouterInterface', 'OS::Quantum::RouterInterface'),
+        resources = [('Network', 'OS::Neutron::Net'),
+                     ('Subnet', 'OS::Neutron::Subnet'),
+                     ('RouterInterface', 'OS::Neutron::RouterInterface'),
                      ('Server', 'AWS::EC2::Instance')]
         for resource_name, resource_type in resources:
             resource = self.test_resources.get(resource_name, None)
@@ -173,6 +198,20 @@
         self.assertEqual('10.0.3.0/24', subnet['cidr'])
 
     @attr(type='slow')
+    def test_created_router(self):
+        """Verifies created router."""
+        router_id = self.test_resources.get('Router')['physical_resource_id']
+        resp, body = self.network_client.show_router(router_id)
+        self.assertEqual('200', resp['status'])
+        router = body['router']
+        self.assertEqual('NewRouter', router['name'])
+        self.assertEqual(self.external_network_id,
+                         router['external_gateway_info']['network_id'])
+        self.assertEqual(False,
+                         router['external_gateway_info']['enable_snat'])
+        self.assertEqual(False, router['admin_state_up'])
+
+    @attr(type='slow')
     def test_created_router_interface(self):
         """Verifies created router interface."""
         network_id = self.test_resources.get('Network')['physical_resource_id']
diff --git a/tempest/api/orchestration/stacks/test_server_cfn_init.py b/tempest/api/orchestration/stacks/test_server_cfn_init.py
index 4267c1d..5130f87 100644
--- a/tempest/api/orchestration/stacks/test_server_cfn_init.py
+++ b/tempest/api/orchestration/stacks/test_server_cfn_init.py
@@ -15,10 +15,10 @@
 
 from tempest.api.orchestration import base
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
+from tempest import test
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -147,7 +147,7 @@
                 'network': cls._get_default_network()['id']
             })
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     @testtools.skipIf(existing_keypair, 'Server ssh tests are disabled.')
     def test_can_log_into_created_server(self):
 
@@ -166,11 +166,12 @@
             body['physical_resource_id'])
 
         # Check that the user can authenticate with the generated password
-        linux_client = RemoteClient(server, 'ec2-user',
-                                    pkey=self.keypair['private_key'])
+        linux_client = remote_client.RemoteClient(server, 'ec2-user',
+                                                  pkey=self.keypair[
+                                                      'private_key'])
         linux_client.validate_authentication()
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     def test_stack_wait_condition_data(self):
 
         sid = self.stack_identifier
diff --git a/tempest/api/orchestration/stacks/test_swift_resources.py b/tempest/api/orchestration/stacks/test_swift_resources.py
new file mode 100644
index 0000000..5921a7a
--- /dev/null
+++ b/tempest/api/orchestration/stacks/test_swift_resources.py
@@ -0,0 +1,125 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
+#
+# Author: Chmouel Boudjnah <chmouel@enovance.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+from tempest.api.orchestration import base
+from tempest import clients
+from tempest.common.utils import data_utils
+from tempest import config
+
+
+CONF = config.CONF
+
+
+class SwiftResourcesTestJSON(base.BaseOrchestrationTest):
+    _interface = 'json'
+    template = """
+heat_template_version: 2013-05-23
+description: Template which creates a Swift container ressource
+
+resources:
+  SwiftContainerWebsite:
+    DeletionPolicy: "Delete"
+    Type: OS::Swift::Container
+    Properties:
+      X-Container-Read: ".r:*"
+      X-Container-Meta:
+        web-index: "index.html"
+        web-error: "error.html"
+
+  SwiftContainer:
+    Type: OS::Swift::Container
+
+outputs:
+  WebsiteURL:
+    description: "URL for website hosted on S3"
+    value: { get_attr: [SwiftContainer, WebsiteURL] }
+  DomainName:
+    description: "Domain of Swift host"
+    value: { get_attr: [SwiftContainer, DomainName] }
+
+"""
+
+    @classmethod
+    def setUpClass(cls):
+        super(SwiftResourcesTestJSON, cls).setUpClass()
+        cls.client = cls.orchestration_client
+        cls.stack_name = data_utils.rand_name('heat')
+        os = clients.Manager()
+        if not CONF.service_available.swift:
+            raise cls.skipException("Swift support is required")
+        cls.account_client = os.account_client
+        cls.container_client = os.container_client
+        # create the stack
+        cls.stack_identifier = cls.create_stack(
+            cls.stack_name,
+            cls.template)
+        cls.stack_id = cls.stack_identifier.split('/')[1]
+        cls.client.wait_for_stack_status(cls.stack_id, 'CREATE_COMPLETE')
+        cls.test_resources = {}
+        _, resources = cls.client.list_resources(cls.stack_identifier)
+        for resource in resources:
+            cls.test_resources[resource['logical_resource_id']] = resource
+
+    def test_created_resources(self):
+        """Created stack should be on the list of existing stacks."""
+        resources = [('SwiftContainer', 'OS::Swift::Container'),
+                     ('SwiftContainerWebsite', 'OS::Swift::Container')]
+        for resource_name, resource_type in resources:
+            resource = self.test_resources.get(resource_name)
+            self.assertIsInstance(resource, dict)
+            self.assertEqual(resource_type, resource['resource_type'])
+            self.assertEqual(resource_name, resource['logical_resource_id'])
+            self.assertEqual('CREATE_COMPLETE', resource['resource_status'])
+
+    def test_created_containers(self):
+        params = {'format': 'json'}
+        resp, container_list = \
+            self.account_client.list_account_containers(params=params)
+        self.assertEqual('200', resp['status'])
+        self.assertEqual(2, len(container_list))
+        for cont in container_list:
+            self.assertTrue(cont['name'].startswith(self.stack_name))
+
+    def test_acl(self):
+        acl_headers = ('x-container-meta-web-index', 'x-container-read')
+
+        swcont = self.test_resources.get(
+            'SwiftContainer')['physical_resource_id']
+        swcont_website = self.test_resources.get(
+            'SwiftContainerWebsite')['physical_resource_id']
+
+        headers, _ = self.container_client.list_container_metadata(swcont)
+        for h in acl_headers:
+            self.assertNotIn(h, headers)
+        headers, _ = self.container_client.list_container_metadata(
+            swcont_website)
+        for h in acl_headers:
+            self.assertIn(h, headers)
+
+    def test_metadata(self):
+        metadatas = {
+            "web-index": "index.html",
+            "web-error": "error.html"
+        }
+        swcont_website = self.test_resources.get(
+            'SwiftContainerWebsite')['physical_resource_id']
+        headers, _ = self.container_client.list_container_metadata(
+            swcont_website)
+
+        for meta in metadatas:
+            header_meta = "x-container-meta-%s" % meta
+            self.assertIn(header_meta, headers)
+            self.assertEqual(headers[header_meta], metadatas[meta])
diff --git a/tempest/api/utils.py b/tempest/api/utils.py
index c62dc8d..00c93b7 100644
--- a/tempest/api/utils.py
+++ b/tempest/api/utils.py
@@ -15,7 +15,7 @@
 
 """Common utilities used in testing."""
 
-from tempest.test import BaseTestCase
+from tempest import test
 
 
 class skip_unless_attr(object):
@@ -30,7 +30,7 @@
             """Wrapped skipper function."""
             testobj = args[0]
             if not getattr(testobj, self.attr, False):
-                raise BaseTestCase.skipException(self.message)
+                raise test.BaseTestCase.skipException(self.message)
             func(*args, **kw)
         _skipper.__name__ = func.__name__
         _skipper.__doc__ = func.__doc__
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
new file mode 100644
index 0000000..47094f0
--- /dev/null
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -0,0 +1,67 @@
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.volume.base import BaseVolumeV1AdminTest
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest.openstack.common import log as logging
+from tempest import test
+
+CONF = config.CONF
+LOG = logging.getLogger(__name__)
+
+
+class VolumesBackupsTest(BaseVolumeV1AdminTest):
+    _interface = "json"
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesBackupsTest, cls).setUpClass()
+
+        if not CONF.volume_feature_enabled.backup:
+            raise cls.skipException("Cinder backup feature disabled")
+
+        cls.volumes_adm_client = cls.os_adm.volumes_client
+        cls.backups_adm_client = cls.os_adm.backups_client
+        cls.volume = cls.create_volume()
+
+    @test.attr(type='smoke')
+    def test_volume_backup_create_get_restore_delete(self):
+        backup_name = data_utils.rand_name('Backup')
+        create_backup = self.backups_adm_client.create_backup
+        resp, backup = create_backup(self.volume['id'],
+                                     name=backup_name)
+        self.assertEqual(202, resp.status)
+        self.addCleanup(self.backups_adm_client.delete_backup,
+                        backup['id'])
+        self.assertEqual(backup['name'], backup_name)
+        self.volumes_adm_client.wait_for_volume_status(self.volume['id'],
+                                                       'available')
+        self.backups_adm_client.wait_for_backup_status(backup['id'],
+                                                       'available')
+
+        resp, backup = self.backups_adm_client.get_backup(backup['id'])
+        self.assertEqual(200, resp.status)
+        self.assertEqual(backup['name'], backup_name)
+
+        resp, restore = self.backups_adm_client.restore_backup(backup['id'])
+        self.assertEqual(202, resp.status)
+        self.addCleanup(self.volumes_adm_client.delete_volume,
+                        restore['volume_id'])
+        self.assertEqual(restore['backup_id'], backup['id'])
+        self.backups_adm_client.wait_for_backup_status(backup['id'],
+                                                       'available')
+        self.volumes_adm_client.wait_for_volume_status(restore['volume_id'],
+                                                       'available')
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index de2b240..8824977 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -69,18 +69,6 @@
     # only in a single location in the source, and could be more general.
 
     @classmethod
-    def create_volume(cls, size=1, **kwargs):
-        """Wrapper utility that returns a test volume."""
-        vol_name = data_utils.rand_name('Volume')
-        resp, volume = cls.volumes_client.create_volume(size,
-                                                        display_name=vol_name,
-                                                        **kwargs)
-        assert 200 == resp.status
-        cls.volumes.append(volume)
-        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
-        return volume
-
-    @classmethod
     def clear_volumes(cls):
         for volume in cls.volumes:
             try:
@@ -118,8 +106,21 @@
         super(BaseVolumeV1Test, cls).setUpClass()
         cls.snapshots_client = cls.os.snapshots_client
         cls.volumes_client = cls.os.volumes_client
+        cls.backups_client = cls.os.backups_client
         cls.volumes_extension_client = cls.os.volumes_extension_client
 
+    @classmethod
+    def create_volume(cls, size=1, **kwargs):
+        """Wrapper utility that returns a test volume."""
+        vol_name = data_utils.rand_name('Volume')
+        resp, volume = cls.volumes_client.create_volume(size,
+                                                        display_name=vol_name,
+                                                        **kwargs)
+        assert 200 == resp.status
+        cls.volumes.append(volume)
+        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
+        return volume
+
 
 class BaseVolumeV1AdminTest(BaseVolumeV1Test):
     """Base test case class for all Volume Admin API tests."""
@@ -144,3 +145,25 @@
             cls.os_adm = clients.AdminManager(interface=cls._interface)
         cls.client = cls.os_adm.volume_types_client
         cls.hosts_client = cls.os_adm.volume_hosts_client
+
+
+class BaseVolumeV2Test(BaseVolumeTest):
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.volume_feature_enabled.api_v2:
+            msg = "Volume API v2 not supported"
+            raise cls.skipException(msg)
+        super(BaseVolumeV2Test, cls).setUpClass()
+        cls.volumes_client = cls.os.volumes_v2_client
+
+    @classmethod
+    def create_volume(cls, size=1, **kwargs):
+        """Wrapper utility that returns a test volume."""
+        vol_name = data_utils.rand_name('Volume')
+        resp, volume = cls.volumes_client.create_volume(size,
+                                                        name=vol_name,
+                                                        **kwargs)
+        assert 202 == resp.status
+        cls.volumes.append(volume)
+        cls.volumes_client.wait_for_volume_status(volume['id'], 'available')
+        return volume
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index ec732d1..e94c700 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -13,7 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import ContainsAll
+from testtools import matchers
 
 from tempest.api.volume import base
 from tempest import test
@@ -43,7 +43,8 @@
         # Create metadata for the volume
         metadata = {"key1": "value1",
                     "key2": "value2",
-                    "key3": "value3"}
+                    "key3": "value3",
+                    "key4": "<value&special_chars>"}
 
         rsp, body = self.volumes_client.create_volume_metadata(self.volume_id,
                                                                metadata)
@@ -51,7 +52,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Delete one item metadata of the volume
         rsp, body = self.volumes_client.delete_volume_metadata_item(
             self.volume_id,
@@ -59,6 +60,8 @@
         self.assertEqual(200, rsp.status)
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertNotIn("key1", body)
+        del metadata["key1"]
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
 
     @test.attr(type='gate')
     def test_update_volume_metadata(self):
@@ -78,7 +81,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Update metadata
         resp, body = self.volumes_client.update_volume_metadata(
             self.volume_id,
@@ -87,7 +90,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(update.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(update.items()))
 
     @test.attr(type='gate')
     def test_update_volume_metadata_item(self):
@@ -104,7 +107,7 @@
             self.volume_id,
             metadata)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(metadata.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
         # Update metadata item
         resp, body = self.volumes_client.update_volume_metadata_item(
             self.volume_id,
@@ -114,7 +117,7 @@
         # Get the metadata of the volume
         resp, body = self.volumes_client.get_volume_metadata(self.volume_id)
         self.assertEqual(200, resp.status)
-        self.assertThat(body.items(), ContainsAll(expect.items()))
+        self.assertThat(body.items(), matchers.ContainsAll(expect.items()))
 
 
 class VolumeMetadataTestXML(VolumeMetadataTest):
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index cf4e052..f4b2d4c 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -49,7 +49,7 @@
                                          interface=cls._interface)
         else:
             cls.os_alt = clients.AltManager()
-            alt_tenant_name = cls.os_alt.tenant_name
+            alt_tenant_name = cls.os_alt.credentials['tenant_name']
             identity_client = cls._get_identity_admin_client()
             _, tenants = identity_client.list_tenants()
             cls.alt_tenant_id = [tnt['id'] for tnt in tenants
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 5924c7e..a22ad32 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -16,9 +16,7 @@
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import services
-from tempest.test import stresstest
+from tempest import test
 
 CONF = config.CONF
 
@@ -50,9 +48,9 @@
 
         super(VolumesActionsTest, cls).tearDownClass()
 
-    @stresstest(class_setup_per='process')
-    @attr(type='smoke')
-    @services('compute')
+    @test.stresstest(class_setup_per='process')
+    @test.attr(type='smoke')
+    @test.services('compute')
     def test_attach_detach_volume_to_instance(self):
         # Volume is attached and detached successfully from an instance
         mountpoint = '/dev/vdc'
@@ -65,9 +63,9 @@
         self.assertEqual(202, resp.status)
         self.client.wait_for_volume_status(self.volume['id'], 'available')
 
-    @stresstest(class_setup_per='process')
-    @attr(type='gate')
-    @services('compute')
+    @test.stresstest(class_setup_per='process')
+    @test.attr(type='gate')
+    @test.services('compute')
     def test_get_volume_attachment(self):
         # Verify that a volume's attachment information is retrieved
         mountpoint = '/dev/vdc'
@@ -91,8 +89,8 @@
         self.assertEqual(self.volume['id'], attachment['id'])
         self.assertEqual(self.volume['id'], attachment['volume_id'])
 
-    @attr(type='gate')
-    @services('image')
+    @test.attr(type='gate')
+    @test.services('image')
     def test_volume_upload(self):
         # NOTE(gfidente): the volume uploaded in Glance comes from setUpClass,
         # it is shared with the other tests. After it is uploaded in Glance,
@@ -108,7 +106,7 @@
         self.image_client.wait_for_image_status(image_id, 'active')
         self.client.wait_for_volume_status(self.volume['id'], 'available')
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_extend(self):
         # Extend Volume Test.
         extend_size = int(self.volume['size']) + 1
@@ -119,7 +117,7 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(int(volume['size']), extend_size)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_reserve_unreserve_volume(self):
         # Mark volume as reserved.
         resp, body = self.client.reserve_volume(self.volume['id'])
@@ -139,7 +137,7 @@
     def _is_true(self, val):
         return val in ['true', 'True', True]
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_readonly_update(self):
         # Update volume readonly true
         readonly = True
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 6d89e5b..175da01 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -13,13 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from testtools.matchers import ContainsAll
+from testtools import matchers
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -78,7 +77,7 @@
                          'The fetched Volume id is different '
                          'from the created Volume')
         self.assertThat(fetched_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
 
@@ -91,6 +90,12 @@
             self.assertEqual(boot_flag, False)
 
         # Update Volume
+        # Test volume update when display_name is same with original value
+        resp, update_volume = \
+            self.client.update_volume(volume['id'],
+                                      display_name=v_name)
+        self.assertEqual(200, resp.status)
+        # Test volume update when display_name is new
         new_v_name = data_utils.rand_name('new-Volume')
         new_desc = 'This is the new description of volume'
         resp, update_volume = \
@@ -108,9 +113,29 @@
         self.assertEqual(new_v_name, updated_volume['display_name'])
         self.assertEqual(new_desc, updated_volume['display_description'])
         self.assertThat(updated_volume['metadata'].items(),
-                        ContainsAll(metadata.items()),
+                        matchers.ContainsAll(metadata.items()),
                         'The fetched Volume metadata misses data '
                         'from the created Volume')
+        # Test volume create when display_name is none and display_description
+        # contains specific characters,
+        # then test volume update if display_name is duplicated
+        new_volume = {}
+        new_v_desc = data_utils.rand_name('@#$%^* description')
+        resp, new_volume = \
+            self.client.create_volume(size=1,
+                                      display_description=new_v_desc,
+                                      availability_zone=volume[
+                                      'availability_zone'])
+        self.assertEqual(200, resp.status)
+        self.assertIn('id', new_volume)
+        self.addCleanup(self._delete_volume, new_volume['id'])
+        self.client.wait_for_volume_status(new_volume['id'], 'available')
+        resp, update_volume = \
+            self.client.update_volume(new_volume['id'],
+                                      display_name=volume['display_name'],
+                                      display_description=volume[
+                                      'display_description'])
+        self.assertEqual(200, resp.status)
 
         # NOTE(jdg): Revert back to strict true/false checking
         # after fix for bug #1227837 merges
@@ -120,16 +145,16 @@
         if 'imageRef' not in kwargs:
             self.assertEqual(boot_flag, False)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_create_get_update_delete(self):
         self._volume_create_get_update_delete()
 
-    @attr(type='smoke')
-    @services('image')
+    @test.attr(type='smoke')
+    @test.services('image')
     def test_volume_create_get_update_delete_from_image(self):
         self._volume_create_get_update_delete(imageRef=CONF.compute.image_ref)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_create_get_update_delete_as_clone(self):
         origin = self.create_volume()
         self._volume_create_get_update_delete(source_volid=origin['id'])
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 049544d..c356342 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -18,8 +18,8 @@
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from testtools.matchers import ContainsAll
+from tempest import test
+from testtools import matchers
 
 LOG = logging.getLogger(__name__)
 
@@ -111,12 +111,12 @@
                       ('details' if with_detail else '', key)
                 if key == 'metadata':
                     self.assertThat(volume[key].items(),
-                                    ContainsAll(params[key].items()),
+                                    matchers.ContainsAll(params[key].items()),
                                     msg)
                 else:
                     self.assertEqual(params[key], volume[key], msg)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_volume_list(self):
         # Get a list of Volumes
         # Fetch all volumes
@@ -125,7 +125,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_details(self):
         # Get a list of Volumes with details
         # Fetch all Volumes
@@ -133,7 +133,7 @@
         self.assertEqual(200, resp.status)
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_by_name(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'display_name': volume['display_name']}
@@ -143,7 +143,7 @@
         self.assertEqual(fetched_vol[0]['display_name'],
                          volume['display_name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_details_by_name(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'display_name': volume['display_name']}
@@ -153,7 +153,7 @@
         self.assertEqual(fetched_vol[0]['display_name'],
                          volume['display_name'])
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_by_status(self):
         params = {'status': 'available'}
         resp, fetched_list = self.client.list_volumes(params)
@@ -163,7 +163,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_details_by_status(self):
         params = {'status': 'available'}
         resp, fetched_list = self.client.list_volumes_with_detail(params)
@@ -172,7 +172,7 @@
             self.assertEqual('available', volume['status'])
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
@@ -184,7 +184,7 @@
         self.assertVolumesIn(fetched_list, self.volume_list,
                              fields=VOLUME_FIELDS)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volumes_list_details_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
@@ -195,19 +195,19 @@
             self.assertEqual(zone, volume['availability_zone'])
         self.assertVolumesIn(fetched_list, self.volume_list)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_param_metadata(self):
         # Test to list volumes when metadata param is given
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_detail_param_metadata(self):
         # Test to list volumes details when metadata param is given
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params, with_detail=True)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_param_display_name_and_status(self):
         # Test to list volume when display name and status param is given
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
@@ -215,7 +215,7 @@
                   'status': 'available'}
         self._list_by_param_value_and_assert(params)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_volume_list_with_detail_param_display_name_and_status(self):
         # Test to list volume when name and status param is given
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 487ada6..56915e6 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -12,10 +12,12 @@
 
 from tempest.api.volume import base
 from tempest.common.utils import data_utils
+from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.test import attr
 
 LOG = logging.getLogger(__name__)
+CONF = config.CONF
 
 
 class VolumesSnapshotTest(base.BaseVolumeV1Test):
@@ -35,6 +37,11 @@
     def tearDownClass(cls):
         super(VolumesSnapshotTest, cls).tearDownClass()
 
+    def _detach(self, volume_id):
+        """Detach volume."""
+        self.volumes_client.detach_volume(volume_id)
+        self.volumes_client.wait_for_volume_status(volume_id, 'available')
+
     def _list_by_param_values_and_assert(self, params, with_detail=False):
         """
         Perform list or list_details action with given params
@@ -57,6 +64,32 @@
                 self.assertEqual(params[key], snap[key], msg)
 
     @attr(type='gate')
+    def test_snapshot_create_with_volume_in_use(self):
+        # Create a snapshot when volume status is in-use
+        # Create a test instance
+        server_name = data_utils.rand_name('instance-')
+        resp, server = self.servers_client.create_server(server_name,
+                                                         self.image_ref,
+                                                         self.flavor_ref)
+        self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
+        self.addCleanup(self.servers_client.delete_server, server['id'])
+        mountpoint = '/dev/%s' % CONF.compute.volume_device_name
+        resp, body = self.volumes_client.attach_volume(
+            self.volume_origin['id'], server['id'], mountpoint)
+        self.assertEqual(202, resp.status)
+        self.volumes_client.wait_for_volume_status(self.volume_origin['id'],
+                                                   'in-use')
+        self.addCleanup(self._detach, self.volume_origin['id'])
+        # Snapshot a volume even if it's attached to an instance
+        snapshot = self.create_snapshot(self.volume_origin['id'],
+                                        force=True)
+        # Delete the snapshot
+        self.snapshots_client.delete_snapshot(snapshot['id'])
+        self.assertEqual(202, resp.status)
+        self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
+        self.snapshots.remove(snapshot)
+
+    @attr(type='gate')
     def test_snapshot_create_get_list_update_delete(self):
         # Create a snapshot
         s_name = data_utils.rand_name('snap')
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index 049544d..d0e8b99 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -23,10 +23,10 @@
 
 LOG = logging.getLogger(__name__)
 
-VOLUME_FIELDS = ('id', 'display_name')
+VOLUME_FIELDS = ('id', 'name')
 
 
-class VolumesListTest(base.BaseVolumeV1Test):
+class VolumesV2ListTestJSON(base.BaseVolumeV2Test):
 
     """
     This test creates a number of 1G volumes. To run successfully,
@@ -48,7 +48,7 @@
             return
 
         def str_vol(vol):
-            return "%s:%s" % (vol['id'], vol['display_name'])
+            return "%s:%s" % (vol['id'], vol['name'])
 
         raw_msg = "Could not find volumes %s in expected list %s; fetched %s"
         self.fail(raw_msg % ([str_vol(v) for v in missing_vols],
@@ -57,7 +57,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(VolumesListTest, cls).setUpClass()
+        super(VolumesV2ListTestJSON, cls).setUpClass()
         cls.client = cls.volumes_client
 
         # Create 3 test volumes
@@ -67,7 +67,6 @@
         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'])
@@ -90,9 +89,10 @@
         for volid in cls.volume_id_list:
             resp, _ = cls.client.delete_volume(volid)
             cls.client.wait_for_resource_deletion(volid)
-        super(VolumesListTest, cls).tearDownClass()
+        super(VolumesV2ListTestJSON, cls).tearDownClass()
 
-    def _list_by_param_value_and_assert(self, params, with_detail=False):
+    def _list_by_param_value_and_assert(self, params, expected_list=None,
+                                        with_detail=False):
         """
         Perform list or list_details action with given params
         and validates result.
@@ -104,17 +104,22 @@
             resp, fetched_vol_list = self.client.list_volumes(params=params)
 
         self.assertEqual(200, resp.status)
+        if expected_list is None:
+            expected_list = self.volume_list
+        self.assertVolumesIn(fetched_vol_list, expected_list,
+                             fields=VOLUME_FIELDS)
         # Validating params of fetched volumes
-        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)
+        if with_detail:
+            for volume in fetched_vol_list:
+                for key in params:
+                    msg = "Failed to list volumes %s by %s" % \
+                          ('details' if with_detail else '', key)
+                    if key == 'metadata':
+                        self.assertThat(volume[key].items(),
+                                        ContainsAll(params[key].items()),
+                                        msg)
+                    else:
+                        self.assertEqual(params[key], volume[key], msg)
 
     @attr(type='smoke')
     def test_volume_list(self):
@@ -136,64 +141,44 @@
     @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']}
+        params = {'name': volume['name']}
         resp, fetched_vol = self.client.list_volumes(params)
         self.assertEqual(200, resp.status)
         self.assertEqual(1, len(fetched_vol), str(fetched_vol))
-        self.assertEqual(fetched_vol[0]['display_name'],
-                         volume['display_name'])
+        self.assertEqual(fetched_vol[0]['name'], volume['name'])
 
     @attr(type='gate')
     def test_volume_list_details_by_name(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
-        params = {'display_name': volume['display_name']}
+        params = {'name': volume['name']}
         resp, fetched_vol = self.client.list_volumes_with_detail(params)
         self.assertEqual(200, resp.status)
         self.assertEqual(1, len(fetched_vol), str(fetched_vol))
-        self.assertEqual(fetched_vol[0]['display_name'],
-                         volume['display_name'])
+        self.assertEqual(fetched_vol[0]['name'], volume['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)
+        self._list_by_param_value_and_assert(params)
 
     @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)
+        self._list_by_param_value_and_assert(params, with_detail=True)
 
     @attr(type='gate')
     def test_volumes_list_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
         params = {'availability_zone': zone}
-        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)
+        self._list_by_param_value_and_assert(params)
 
     @attr(type='gate')
     def test_volumes_list_details_by_availability_zone(self):
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
         params = {'availability_zone': zone}
-        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)
+        self._list_by_param_value_and_assert(params, with_detail=True)
 
     @attr(type='gate')
     def test_volume_list_with_param_metadata(self):
@@ -211,18 +196,19 @@
     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'],
+        params = {'name': volume['name'],
                   'status': 'available'}
-        self._list_by_param_value_and_assert(params)
+        self._list_by_param_value_and_assert(params, expected_list=[volume])
 
     @attr(type='gate')
     def test_volume_list_with_detail_param_display_name_and_status(self):
         # Test to list volume when name and status param is given
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
-        params = {'display_name': volume['display_name'],
+        params = {'name': volume['name'],
                   'status': 'available'}
-        self._list_by_param_value_and_assert(params, with_detail=True)
+        self._list_by_param_value_and_assert(params, expected_list=[volume],
+                                             with_detail=True)
 
 
-class VolumeListTestXML(VolumesListTest):
+class VolumesV2ListTestXML(VolumesV2ListTestJSON):
     _interface = 'xml'
diff --git a/tempest/auth.py b/tempest/auth.py
index 582cfdd..8cb3b2c 100644
--- a/tempest/auth.py
+++ b/tempest/auth.py
@@ -177,7 +177,7 @@
         base_url = self.base_url(filters=filters, auth_data=auth_data)
         # build authenticated request
         # returns new request, it does not touch the original values
-        _headers = copy.deepcopy(headers)
+        _headers = copy.deepcopy(headers) if headers is not None else {}
         _headers['X-Auth-Token'] = token
         if url is None or url == "":
             _url = base_url
@@ -371,7 +371,7 @@
                             ep['region'] == region]
         if len(filtered_catalog) == 0:
             # No matching region, take the first endpoint
-            filtered_catalog = [filtered_catalog[0]]
+            filtered_catalog = [service_catalog[0]]
         # There should be only one match. If not take the first.
         _base_url = filtered_catalog[0].get('url', None)
         if _base_url is None:
@@ -382,7 +382,7 @@
             path = "/" + filters['api_version']
             noversion_path = "/".join(parts.path.split("/")[2:])
             if noversion_path != "":
-                path += noversion_path
+                path += "/" + noversion_path
             _base_url = _base_url.replace(parts.path, path)
         if filters.get('skip_path', None) is not None:
             _base_url = _base_url.replace(parts.path, "/")
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index a5e0447..8c4ec45 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -83,6 +83,11 @@
         return self.cmd_with_auth(
             'neutron', action, flags, params, admin, fail_ok)
 
+    def savanna(self, action, flags='', params='', admin=True, fail_ok=False):
+        """Executes savanna command for the given action."""
+        return self.cmd_with_auth(
+            'savanna', action, flags, params, admin, fail_ok)
+
     def cmd_with_auth(self, cmd, action, flags='', params='',
                       admin=True, fail_ok=False):
         """Executes given command with auth attributes appended."""
diff --git a/tempest/cli/simple_read_only/test_neutron.py b/tempest/cli/simple_read_only/test_neutron.py
index cd81378..c1d58b5 100644
--- a/tempest/cli/simple_read_only/test_neutron.py
+++ b/tempest/cli/simple_read_only/test_neutron.py
@@ -74,13 +74,11 @@
     def test_neutron_floatingip_list(self):
         self.neutron('floatingip-list')
 
-    @test.skip_because(bug="1240694")
     @test.attr(type='smoke')
     @test.requires_ext(extension='metering', service='network')
     def test_neutron_meter_label_list(self):
         self.neutron('meter-label-list')
 
-    @test.skip_because(bug="1240694")
     @test.attr(type='smoke')
     @test.requires_ext(extension='metering', service='network')
     def test_neutron_meter_label_rule_list(self):
diff --git a/tempest/cli/simple_read_only/test_nova_manage.py b/tempest/cli/simple_read_only/test_nova_manage.py
index 13a1589..f1fee2e 100644
--- a/tempest/cli/simple_read_only/test_nova_manage.py
+++ b/tempest/cli/simple_read_only/test_nova_manage.py
@@ -41,6 +41,10 @@
         if not CONF.service_available.nova:
             msg = ("%s skipped as Nova is not available" % cls.__name__)
             raise cls.skipException(msg)
+        if not CONF.cli.has_manage:
+            msg = ("%s skipped as *-manage commands not available"
+                   % cls.__name__)
+            raise cls.skipException(msg)
         super(SimpleReadOnlyNovaManageTest, cls).setUpClass()
 
     def test_admin_fake_action(self):
diff --git a/tempest/cli/simple_read_only/test_savanna.py b/tempest/cli/simple_read_only/test_savanna.py
new file mode 100644
index 0000000..1e30978
--- /dev/null
+++ b/tempest/cli/simple_read_only/test_savanna.py
@@ -0,0 +1,70 @@
+# Copyright (c) 2013 Mirantis Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import logging
+import subprocess
+
+from tempest import cli
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+LOG = logging.getLogger(__name__)
+
+
+class SimpleReadOnlySavannaClientTest(cli.ClientTestBase):
+    """Basic, read-only tests for Savanna CLI client.
+
+    Checks return values and output of read-only commands.
+    These tests do not presume any content, nor do they create
+    their own. They only verify the structure of output if present.
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.service_available.savanna:
+            msg = "Skipping all Savanna cli tests because it is not available"
+            raise cls.skipException(msg)
+        super(SimpleReadOnlySavannaClientTest, cls).setUpClass()
+
+    @test.attr(type='negative')
+    def test_savanna_fake_action(self):
+        self.assertRaises(subprocess.CalledProcessError,
+                          self.savanna,
+                          'this-does-not-exist')
+
+    def test_savanna_plugins_list(self):
+        plugins = self.parser.listing(self.savanna('plugin-list'))
+        self.assertTableStruct(plugins, ['name', 'versions', 'title'])
+
+    def test_savanna_plugins_show(self):
+        plugin = self.parser.listing(self.savanna('plugin-show',
+                                                  params='--name vanilla'))
+        self.assertTableStruct(plugin, ['Property', 'Value'])
+
+    def test_savanna_node_group_template_list(self):
+        plugins = self.parser.listing(self.savanna('node-group-template-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'plugin_name',
+                                         'node_processes', 'description'])
+
+    def test_savanna_cluster_template_list(self):
+        plugins = self.parser.listing(self.savanna('cluster-template-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'plugin_name',
+                                         'node_groups', 'description'])
+
+    def test_savanna_cluster_list(self):
+        plugins = self.parser.listing(self.savanna('cluster-list'))
+        self.assertTableStruct(plugins, ['name', 'id', 'status', 'node_count'])
diff --git a/tempest/clients.py b/tempest/clients.py
index 9c1a0f1..8db399a 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -13,10 +13,20 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest import auth
+# Default client libs
+import cinderclient.client
+import glanceclient
+import heatclient.client
+import keystoneclient.exceptions
+import keystoneclient.v2_0.client
+import neutronclient.v2_0.client
+import novaclient.client
+import swiftclient
+
 from tempest.common.rest_client import NegativeRestClient
 from tempest import config
 from tempest import exceptions
+from tempest import manager
 from tempest.openstack.common import log as logging
 from tempest.services.baremetal.v1.client_json import BaremetalClientJSON
 from tempest.services import botoclients
@@ -63,8 +73,6 @@
 from tempest.services.compute.v3.json.hosts_client import HostsV3ClientJSON
 from tempest.services.compute.v3.json.hypervisor_client import \
     HypervisorV3ClientJSON
-from tempest.services.compute.v3.json.instance_usage_audit_log_client import \
-    InstanceUsagesAuditLogV3ClientJSON
 from tempest.services.compute.v3.json.interfaces_client import \
     InterfacesV3ClientJSON
 from tempest.services.compute.v3.json.keypairs_client import \
@@ -75,8 +83,6 @@
     ServersV3ClientJSON
 from tempest.services.compute.v3.json.services_client import \
     ServicesV3ClientJSON
-from tempest.services.compute.v3.json.tenant_usages_client import \
-    TenantUsagesV3ClientJSON
 from tempest.services.compute.v3.json.version_client import \
     VersionV3ClientJSON
 from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
@@ -152,14 +158,18 @@
     VolumeHostsClientJSON
 from tempest.services.volume.json.admin.volume_types_client import \
     VolumeTypesClientJSON
+from tempest.services.volume.json.backups_client import BackupsClientJSON
 from tempest.services.volume.json.extensions_client import \
     ExtensionsClientJSON as VolumeExtensionClientJSON
 from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
 from tempest.services.volume.json.volumes_client import VolumesClientJSON
+from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
+from tempest.services.volume.v2.xml.volumes_client import VolumesV2ClientXML
 from tempest.services.volume.xml.admin.volume_hosts_client import \
     VolumeHostsClientXML
 from tempest.services.volume.xml.admin.volume_types_client import \
     VolumeTypesClientXML
+from tempest.services.volume.xml.backups_client import BackupsClientXML
 from tempest.services.volume.xml.extensions_client import \
     ExtensionsClientXML as VolumeExtensionClientXML
 from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
@@ -169,10 +179,10 @@
 LOG = logging.getLogger(__name__)
 
 
-class Manager(object):
+class Manager(manager.Manager):
 
     """
-    Top level manager for OpenStack Compute clients
+    Top level manager for OpenStack tempest clients
     """
 
     def __init__(self, username=None, password=None, tenant_name=None,
@@ -187,153 +197,145 @@
         :param tenant_name: Override of the tenant name
         """
         self.interface = interface
-        self.auth_version = CONF.identity.auth_version
-        # FIXME(andreaf) Change Manager __init__ to accept a credentials dict
-        if username is None or password is None:
-            # Tenant None is a valid use case
-            self.credentials = self.get_default_credentials()
-        else:
-            self.credentials = dict(username=username, password=password,
-                                    tenant_name=tenant_name)
-        if self.auth_version == 'v3':
-            self.credentials['domain_name'] = 'Default'
-        # Setup an auth provider
-        auth_provider = self.get_auth_provider(self.credentials)
+        self.client_type = 'tempest'
+        # super cares for credentials validation
+        super(Manager, self).__init__(
+            username=username, password=password, tenant_name=tenant_name)
 
         if self.interface == 'xml':
             self.certificates_client = CertificatesClientXML(
-                auth_provider)
-            self.servers_client = ServersClientXML(auth_provider)
-            self.limits_client = LimitsClientXML(auth_provider)
-            self.images_client = ImagesClientXML(auth_provider)
-            self.keypairs_client = KeyPairsClientXML(auth_provider)
-            self.quotas_client = QuotasClientXML(auth_provider)
-            self.flavors_client = FlavorsClientXML(auth_provider)
-            self.extensions_client = ExtensionsClientXML(auth_provider)
+                self.auth_provider)
+            self.servers_client = ServersClientXML(self.auth_provider)
+            self.limits_client = LimitsClientXML(self.auth_provider)
+            self.images_client = ImagesClientXML(self.auth_provider)
+            self.keypairs_client = KeyPairsClientXML(self.auth_provider)
+            self.quotas_client = QuotasClientXML(self.auth_provider)
+            self.flavors_client = FlavorsClientXML(self.auth_provider)
+            self.extensions_client = ExtensionsClientXML(self.auth_provider)
             self.volumes_extensions_client = VolumesExtensionsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.floating_ips_client = FloatingIPsClientXML(
-                auth_provider)
-            self.snapshots_client = SnapshotsClientXML(auth_provider)
-            self.volumes_client = VolumesClientXML(auth_provider)
+                self.auth_provider)
+            self.backups_client = BackupsClientXML(self.auth_provider)
+            self.snapshots_client = SnapshotsClientXML(self.auth_provider)
+            self.volumes_client = VolumesClientXML(self.auth_provider)
+            self.volumes_v2_client = VolumesV2ClientXML(self.auth_provider)
             self.volume_types_client = VolumeTypesClientXML(
-                auth_provider)
-            self.identity_client = IdentityClientXML(auth_provider)
+                self.auth_provider)
+            self.identity_client = IdentityClientXML(self.auth_provider)
             self.identity_v3_client = IdentityV3ClientXML(
-                auth_provider)
+                self.auth_provider)
             self.security_groups_client = SecurityGroupsClientXML(
-                auth_provider)
-            self.interfaces_client = InterfacesClientXML(auth_provider)
-            self.endpoints_client = EndPointClientXML(auth_provider)
-            self.fixed_ips_client = FixedIPsClientXML(auth_provider)
+                self.auth_provider)
+            self.interfaces_client = InterfacesClientXML(self.auth_provider)
+            self.endpoints_client = EndPointClientXML(self.auth_provider)
+            self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
             self.availability_zone_client = AvailabilityZoneClientXML(
-                auth_provider)
-            self.service_client = ServiceClientXML(auth_provider)
-            self.aggregates_client = AggregatesClientXML(auth_provider)
-            self.services_client = ServicesClientXML(auth_provider)
+                self.auth_provider)
+            self.service_client = ServiceClientXML(self.auth_provider)
+            self.aggregates_client = AggregatesClientXML(self.auth_provider)
+            self.services_client = ServicesClientXML(self.auth_provider)
             self.tenant_usages_client = TenantUsagesClientXML(
-                auth_provider)
-            self.policy_client = PolicyClientXML(auth_provider)
-            self.hosts_client = HostsClientXML(auth_provider)
-            self.hypervisor_client = HypervisorClientXML(auth_provider)
-            self.network_client = NetworkClientXML(auth_provider)
+                self.auth_provider)
+            self.policy_client = PolicyClientXML(self.auth_provider)
+            self.hosts_client = HostsClientXML(self.auth_provider)
+            self.hypervisor_client = HypervisorClientXML(self.auth_provider)
+            self.network_client = NetworkClientXML(self.auth_provider)
             self.credentials_client = CredentialsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientXML(auth_provider)
+                InstanceUsagesAuditLogClientXML(self.auth_provider)
             self.volume_hosts_client = VolumeHostsClientXML(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extension_client = VolumeExtensionClientXML(
-                auth_provider)
+                self.auth_provider)
             if CONF.service_available.ceilometer:
                 self.telemetry_client = TelemetryClientXML(
-                    auth_provider)
+                    self.auth_provider)
             self.token_client = TokenClientXML()
             self.token_v3_client = V3TokenClientXML()
 
         elif self.interface == 'json':
             self.certificates_client = CertificatesClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.certificates_v3_client = CertificatesV3ClientJSON(
-                auth_provider)
-            self.baremetal_client = BaremetalClientJSON(auth_provider)
-            self.servers_client = ServersClientJSON(auth_provider)
-            self.servers_v3_client = ServersV3ClientJSON(auth_provider)
-            self.limits_client = LimitsClientJSON(auth_provider)
-            self.images_client = ImagesClientJSON(auth_provider)
+                self.auth_provider)
+            self.baremetal_client = BaremetalClientJSON(self.auth_provider)
+            self.servers_client = ServersClientJSON(self.auth_provider)
+            self.servers_v3_client = ServersV3ClientJSON(self.auth_provider)
+            self.limits_client = LimitsClientJSON(self.auth_provider)
+            self.images_client = ImagesClientJSON(self.auth_provider)
             self.keypairs_v3_client = KeyPairsV3ClientJSON(
-                auth_provider)
-            self.keypairs_client = KeyPairsClientJSON(auth_provider)
+                self.auth_provider)
+            self.keypairs_client = KeyPairsClientJSON(self.auth_provider)
             self.keypairs_v3_client = KeyPairsV3ClientJSON(
-                auth_provider)
-            self.quotas_client = QuotasClientJSON(auth_provider)
-            self.quotas_v3_client = QuotasV3ClientJSON(auth_provider)
-            self.flavors_client = FlavorsClientJSON(auth_provider)
-            self.flavors_v3_client = FlavorsV3ClientJSON(auth_provider)
+                self.auth_provider)
+            self.quotas_client = QuotasClientJSON(self.auth_provider)
+            self.quotas_v3_client = QuotasV3ClientJSON(self.auth_provider)
+            self.flavors_client = FlavorsClientJSON(self.auth_provider)
+            self.flavors_v3_client = FlavorsV3ClientJSON(self.auth_provider)
             self.extensions_v3_client = ExtensionsV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.extensions_client = ExtensionsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extensions_client = VolumesExtensionsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.floating_ips_client = FloatingIPsClientJSON(
-                auth_provider)
-            self.snapshots_client = SnapshotsClientJSON(auth_provider)
-            self.volumes_client = VolumesClientJSON(auth_provider)
+                self.auth_provider)
+            self.backups_client = BackupsClientJSON(self.auth_provider)
+            self.snapshots_client = SnapshotsClientJSON(self.auth_provider)
+            self.volumes_client = VolumesClientJSON(self.auth_provider)
+            self.volumes_v2_client = VolumesV2ClientJSON(self.auth_provider)
             self.volume_types_client = VolumeTypesClientJSON(
-                auth_provider)
-            self.identity_client = IdentityClientJSON(auth_provider)
+                self.auth_provider)
+            self.identity_client = IdentityClientJSON(self.auth_provider)
             self.identity_v3_client = IdentityV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.security_groups_client = SecurityGroupsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.interfaces_v3_client = InterfacesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.interfaces_client = InterfacesClientJSON(
-                auth_provider)
-            self.endpoints_client = EndPointClientJSON(auth_provider)
-            self.fixed_ips_client = FixedIPsClientJSON(auth_provider)
+                self.auth_provider)
+            self.endpoints_client = EndPointClientJSON(self.auth_provider)
+            self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider)
             self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.availability_zone_client = AvailabilityZoneClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.services_v3_client = ServicesV3ClientJSON(
-                auth_provider)
-            self.service_client = ServiceClientJSON(auth_provider)
+                self.auth_provider)
+            self.service_client = ServiceClientJSON(self.auth_provider)
             self.aggregates_v3_client = AggregatesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.aggregates_client = AggregatesClientJSON(
-                auth_provider)
-            self.services_client = ServicesClientJSON(auth_provider)
-            self.tenant_usages_v3_client = TenantUsagesV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
+            self.services_client = ServicesClientJSON(self.auth_provider)
             self.tenant_usages_client = TenantUsagesClientJSON(
-                auth_provider)
-            self.version_v3_client = VersionV3ClientJSON(auth_provider)
-            self.policy_client = PolicyClientJSON(auth_provider)
-            self.hosts_client = HostsClientJSON(auth_provider)
+                self.auth_provider)
+            self.version_v3_client = VersionV3ClientJSON(self.auth_provider)
+            self.policy_client = PolicyClientJSON(self.auth_provider)
+            self.hosts_client = HostsClientJSON(self.auth_provider)
             self.hypervisor_v3_client = HypervisorV3ClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.hypervisor_client = HypervisorClientJSON(
-                auth_provider)
-            self.network_client = NetworkClientJSON(auth_provider)
+                self.auth_provider)
+            self.network_client = NetworkClientJSON(self.auth_provider)
             self.credentials_client = CredentialsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.instance_usages_audit_log_client = \
-                InstanceUsagesAuditLogClientJSON(auth_provider)
-            self.instance_usages_audit_log_v3_client = \
-                InstanceUsagesAuditLogV3ClientJSON(auth_provider)
+                InstanceUsagesAuditLogClientJSON(self.auth_provider)
             self.volume_hosts_client = VolumeHostsClientJSON(
-                auth_provider)
+                self.auth_provider)
             self.volumes_extension_client = VolumeExtensionClientJSON(
-                auth_provider)
-            self.hosts_v3_client = HostsV3ClientJSON(auth_provider)
+                self.auth_provider)
+            self.hosts_v3_client = HostsV3ClientJSON(self.auth_provider)
             if CONF.service_available.ceilometer:
                 self.telemetry_client = TelemetryClientJSON(
-                    auth_provider)
+                    self.auth_provider)
             self.token_client = TokenClientJSON()
             self.token_v3_client = V3TokenClientJSON()
-            self.negative_client = NegativeRestClient(auth_provider)
+            self.negative_client = NegativeRestClient(self.auth_provider)
             self.negative_client.service = service
 
         else:
@@ -347,47 +349,22 @@
                            self.credentials.get('tenant_name'))
 
         # common clients
-        self.account_client = AccountClient(auth_provider)
+        self.account_client = AccountClient(self.auth_provider)
         if CONF.service_available.glance:
-            self.image_client = ImageClientJSON(auth_provider)
-            self.image_client_v2 = ImageClientV2JSON(auth_provider)
-        self.container_client = ContainerClient(auth_provider)
-        self.object_client = ObjectClient(auth_provider)
+            self.image_client = ImageClientJSON(self.auth_provider)
+            self.image_client_v2 = ImageClientV2JSON(self.auth_provider)
+        self.container_client = ContainerClient(self.auth_provider)
+        self.object_client = ObjectClient(self.auth_provider)
         self.orchestration_client = OrchestrationClient(
-            auth_provider)
+            self.auth_provider)
         self.ec2api_client = botoclients.APIClientEC2(*ec2_client_args)
         self.s3_client = botoclients.ObjectClientS3(*ec2_client_args)
         self.custom_object_client = ObjectClientCustomizedHeader(
-            auth_provider)
+            self.auth_provider)
         self.custom_account_client = \
-            AccountClientCustomizedHeader(auth_provider)
+            AccountClientCustomizedHeader(self.auth_provider)
         self.data_processing_client = DataProcessingClient(
-            auth_provider)
-
-    @classmethod
-    def get_auth_provider_class(cls, auth_version):
-        if auth_version == 'v2':
-            return auth.KeystoneV2AuthProvider
-        else:
-            return auth.KeystoneV3AuthProvider
-
-    def get_default_credentials(self):
-        return dict(
-            username=CONF.identity.username,
-            password=CONF.identity.password,
-            tenant_name=CONF.identity.tenant_name
-        )
-
-    def get_auth_provider(self, credentials=None):
-        auth_params = dict(client_type='tempest',
-                           interface=self.interface)
-        auth_provider_class = self.get_auth_provider_class(self.auth_version)
-        # If invalid / incomplete credentials are provided, use default ones
-        if credentials is None or \
-                not auth_provider_class.check_credentials(credentials):
-            credentials = self.credentials
-        auth_params['credentials'] = credentials
-        return auth_provider_class(**auth_params)
+            self.auth_provider)
 
 
 class AltManager(Manager):
@@ -443,8 +420,196 @@
     """
     def __init__(self, interface='json', service=None):
         base = super(OrchestrationManager, self)
+        # heat currently needs an admin user so that stacks can create users
+        # however the tests need the demo tenant so that the neutron
+        # private network is the default. DO NOT change this auth combination
+        # until heat can run with the demo user.
         base.__init__(CONF.identity.admin_username,
                       CONF.identity.admin_password,
-                      CONF.identity.admin_tenant_name,
+                      CONF.identity.tenant_name,
                       interface=interface,
                       service=service)
+
+
+class OfficialClientManager(manager.Manager):
+    """
+    Manager that provides access to the official python clients for
+    calling various OpenStack APIs.
+    """
+
+    NOVACLIENT_VERSION = '2'
+    CINDERCLIENT_VERSION = '1'
+    HEATCLIENT_VERSION = '1'
+
+    def __init__(self, username, password, tenant_name):
+        # FIXME(andreaf) Auth provider for client_type 'official' is
+        # not implemented yet, setting to 'tempest' for now.
+        self.client_type = 'tempest'
+        self.interface = None
+        # super cares for credentials validation
+        super(OfficialClientManager, self).__init__(
+            username=username, password=password, tenant_name=tenant_name)
+        self.compute_client = self._get_compute_client(username,
+                                                       password,
+                                                       tenant_name)
+        self.identity_client = self._get_identity_client(username,
+                                                         password,
+                                                         tenant_name)
+        self.image_client = self._get_image_client()
+        self.network_client = self._get_network_client()
+        self.volume_client = self._get_volume_client(username,
+                                                     password,
+                                                     tenant_name)
+        self.object_storage_client = self._get_object_storage_client(
+            username,
+            password,
+            tenant_name)
+        self.orchestration_client = self._get_orchestration_client(
+            username,
+            password,
+            tenant_name)
+
+    def _get_compute_client(self, username, password, tenant_name):
+        # Novaclient will not execute operations for anyone but the
+        # identified user, so a new client needs to be created for
+        # each user that operations need to be performed for.
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        region = CONF.identity.region
+
+        client_args = (username, password, tenant_name, auth_url)
+
+        # Create our default Nova client to use in testing
+        service_type = CONF.compute.catalog_type
+        endpoint_type = CONF.compute.endpoint_type
+        return novaclient.client.Client(self.NOVACLIENT_VERSION,
+                                        *client_args,
+                                        service_type=service_type,
+                                        endpoint_type=endpoint_type,
+                                        region_name=region,
+                                        no_cache=True,
+                                        insecure=dscv,
+                                        http_log_debug=True)
+
+    def _get_image_client(self):
+        token = self.identity_client.auth_token
+        region = CONF.identity.region
+        endpoint_type = CONF.image.endpoint_type
+        endpoint = self.identity_client.service_catalog.url_for(
+            attr='region', filter_value=region,
+            service_type=CONF.image.catalog_type, endpoint_type=endpoint_type)
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        return glanceclient.Client('1', endpoint=endpoint, token=token,
+                                   insecure=dscv)
+
+    def _get_volume_client(self, username, password, tenant_name):
+        auth_url = CONF.identity.uri
+        region = CONF.identity.region
+        endpoint_type = CONF.volume.endpoint_type
+        return cinderclient.client.Client(self.CINDERCLIENT_VERSION,
+                                          username,
+                                          password,
+                                          tenant_name,
+                                          auth_url,
+                                          region_name=region,
+                                          endpoint_type=endpoint_type,
+                                          http_log_debug=True)
+
+    def _get_object_storage_client(self, username, password, tenant_name):
+        auth_url = CONF.identity.uri
+        # add current tenant to swift operator role group.
+        keystone_admin = self._get_identity_client(
+            CONF.identity.admin_username,
+            CONF.identity.admin_password,
+            CONF.identity.admin_tenant_name)
+
+        # enable test user to operate swift by adding operator role to him.
+        roles = keystone_admin.roles.list()
+        operator_role = CONF.object_storage.operator_role
+        member_role = [role for role in roles if role.name == operator_role][0]
+        # NOTE(maurosr): This is surrounded in the try-except block cause
+        # neutron tests doesn't have tenant isolation.
+        try:
+            keystone_admin.roles.add_user_role(self.identity_client.user_id,
+                                               member_role.id,
+                                               self.identity_client.tenant_id)
+        except keystoneclient.exceptions.Conflict:
+            pass
+
+        endpoint_type = CONF.object_storage.endpoint_type
+        os_options = {'endpoint_type': endpoint_type}
+        return swiftclient.Connection(auth_url, username, password,
+                                      tenant_name=tenant_name,
+                                      auth_version='2',
+                                      os_options=os_options)
+
+    def _get_orchestration_client(self, username=None, password=None,
+                                  tenant_name=None):
+        if not username:
+            username = CONF.identity.admin_username
+        if not password:
+            password = CONF.identity.admin_password
+        if not tenant_name:
+            tenant_name = CONF.identity.tenant_name
+
+        self._validate_credentials(username, password, tenant_name)
+
+        keystone = self._get_identity_client(username, password, tenant_name)
+        region = CONF.identity.region
+        endpoint_type = CONF.orchestration.endpoint_type
+        token = keystone.auth_token
+        service_type = CONF.orchestration.catalog_type
+        try:
+            endpoint = keystone.service_catalog.url_for(
+                attr='region',
+                filter_value=region,
+                service_type=service_type,
+                endpoint_type=endpoint_type)
+        except keystoneclient.exceptions.EndpointNotFound:
+            return None
+        else:
+            return heatclient.client.Client(self.HEATCLIENT_VERSION,
+                                            endpoint,
+                                            token=token,
+                                            username=username,
+                                            password=password)
+
+    def _get_identity_client(self, username, password, tenant_name):
+        # This identity client is not intended to check the security
+        # of the identity service, so use admin credentials by default.
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+
+        return keystoneclient.v2_0.client.Client(username=username,
+                                                 password=password,
+                                                 tenant_name=tenant_name,
+                                                 auth_url=auth_url,
+                                                 insecure=dscv)
+
+    def _get_network_client(self):
+        # The intended configuration is for the network client to have
+        # admin privileges and indicate for whom resources are being
+        # created via a 'tenant_id' parameter.  This will often be
+        # preferable to authenticating as a specific user because
+        # working with certain resources (public routers and networks)
+        # often requires admin privileges anyway.
+        username = CONF.identity.admin_username
+        password = CONF.identity.admin_password
+        tenant_name = CONF.identity.admin_tenant_name
+
+        self._validate_credentials(username, password, tenant_name)
+
+        auth_url = CONF.identity.uri
+        dscv = CONF.identity.disable_ssl_certificate_validation
+        endpoint_type = CONF.network.endpoint_type
+
+        return neutronclient.v2_0.client.Client(username=username,
+                                                password=password,
+                                                tenant_name=tenant_name,
+                                                endpoint_type=endpoint_type,
+                                                auth_url=auth_url,
+                                                insecure=dscv)
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 212d41d..03dccd4 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -58,16 +58,11 @@
     def __init__(self, auth_provider):
         self.auth_provider = auth_provider
 
-        self.endpoint_url = 'publicURL'
+        self.endpoint_url = None
         self.service = None
         # The version of the API this client implements
         self.api_version = None
         self._skip_path = False
-        # 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
         self.build_timeout = CONF.compute.build_timeout
         self.general_header_lc = set(('cache-control', 'connection',
@@ -86,8 +81,6 @@
         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:
@@ -121,6 +114,28 @@
             service_region = CONF.identity.region
         return service_region
 
+    def _get_endpoint_type(self, service):
+        """
+        Returns the endpoint type for a specific service
+        """
+        # If the client requests a specific endpoint type, then be it
+        if self.endpoint_url:
+            return self.endpoint_url
+        endpoint_type = None
+        for cfgname in dir(CONF._config):
+            # Find all config.FOO.catalog_type and assume FOO is a service.
+            cfg = getattr(CONF, cfgname)
+            catalog_type = getattr(cfg, 'catalog_type', None)
+            if catalog_type == service:
+                endpoint_type = getattr(cfg, 'endpoint_type', 'publicURL')
+                break
+        # Special case for compute v3 service which hasn't its own
+        # configuration group
+        else:
+            if service == CONF.compute.catalog_v3_type:
+                endpoint_type = CONF.compute.endpoint_type
+        return endpoint_type
+
     @property
     def user(self):
         return self.auth_provider.credentials.get('username', None)
@@ -145,7 +160,7 @@
     def filters(self):
         _filters = dict(
             service=self.service,
-            endpoint_type=self.endpoint_url,
+            endpoint_type=self._get_endpoint_type(self.service),
             region=self._get_region(self.service)
         )
         if self.api_version is not None:
@@ -204,7 +219,6 @@
     def get_versions(self):
         resp, body = self.get('')
         body = self._parse_resp(body)
-        body = body['versions']
         versions = map(lambda x: x['id'], body)
         return resp, versions
 
@@ -232,10 +246,10 @@
         headers = resp.copy()
         del headers['status']
         if headers.get('x-compute-request-id'):
-            self.LOG.info("Nova request id: %s" %
+            self.LOG.info("Nova/Cinder request id: %s" %
                           headers.pop('x-compute-request-id'))
         elif headers.get('x-openstack-request-id'):
-            self.LOG.info("Glance request id %s" %
+            self.LOG.info("OpenStack request id %s" %
                           headers.pop('x-openstack-request-id'))
         if len(headers):
             self.LOG.debug('Response Headers: ' + str(headers))
@@ -488,24 +502,6 @@
         raise NotImplementedError(message)
 
 
-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):
-        return xml_to_json(etree.fromstring(body))
-
-    def is_absolute_limit(self, resp, resp_body):
-        if (not isinstance(resp_body, collections.Mapping) or
-                'retry-after' not in resp):
-            return True
-        return 'exceed' in resp_body.get('message', 'blabla')
-
-
 class NegativeRestClient(RestClient):
     """
     Version of RestClient that does not raise exceptions.
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index c772ce9..b6fa0a0 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -72,7 +72,7 @@
                             look_for_keys=self.look_for_keys,
                             key_filename=self.key_filename,
                             timeout=self.channel_timeout, pkey=self.pkey)
-                LOG.info("ssh connection to %s@%s sucessfuly created",
+                LOG.info("ssh connection to %s@%s successfuly created",
                          self.username, self.host)
                 return ssh
             except (socket.error,
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index bb2fcfb..94fc23c 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -13,9 +13,9 @@
 import re
 import time
 
-from tempest.common.ssh import Client
+from tempest.common import ssh
 from tempest import config
-from tempest.exceptions import ServerUnreachable
+from tempest import exceptions
 
 CONF = config.CONF
 
@@ -37,10 +37,10 @@
                     ip_address = address['addr']
                     break
             else:
-                raise ServerUnreachable()
-        self.ssh_client = Client(ip_address, username, password, ssh_timeout,
-                                 pkey=pkey,
-                                 channel_timeout=ssh_channel_timeout)
+                raise exceptions.ServerUnreachable()
+        self.ssh_client = ssh.Client(ip_address, username, password,
+                                     ssh_timeout, pkey=pkey,
+                                     channel_timeout=ssh_channel_timeout)
 
     def validate_authentication(self):
         """Validate ssh connection and authentication
diff --git a/tempest/common/utils/test_utils.py b/tempest/common/utils/test_utils.py
index eca716e..cc0d831 100644
--- a/tempest/common/utils/test_utils.py
+++ b/tempest/common/utils/test_utils.py
@@ -12,9 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import clients
 from tempest.common.utils import misc
 from tempest import config
-from tempest.scenario import manager
 
 import json
 import re
@@ -35,7 +35,7 @@
         self.non_ssh_image_pattern = \
             CONF.input_scenario.non_ssh_image_regex
         # Setup clients
-        ocm = manager.OfficialClientManager(CONF.identity.username,
+        ocm = clients.OfficialClientManager(CONF.identity.username,
                                             CONF.identity.password,
                                             CONF.identity.tenant_name)
         self.client = ocm.compute_client
@@ -95,7 +95,7 @@
                                             digit=string.digits)
 
     def __init__(self):
-        ocm = manager.OfficialClientManager(CONF.identity.username,
+        ocm = clients.OfficialClientManager(CONF.identity.username,
                                             CONF.identity.password,
                                             CONF.identity.tenant_name)
         self.client = ocm.compute_client
@@ -112,6 +112,8 @@
         """
         :return: a scenario with name and uuid of images
         """
+        if not CONF.service_available.glance:
+            return []
         if not hasattr(self, '_scenario_images'):
             images = self.client.images.list(detailed=False)
             self._scenario_images = [
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index dbeba8f..8e6b9fb 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -42,7 +42,7 @@
     timeout = client.build_timeout + extra_timeout
     while True:
         # NOTE(afazekas): Now the BUILD status only reached
-        # between the UNKOWN->ACTIVE transition.
+        # between the UNKNOWN->ACTIVE transition.
         # TODO(afazekas): enumerate and validate the stable status set
         if status == 'BUILD' and server_status != 'UNKNOWN':
             return
diff --git a/tempest/config.py b/tempest/config.py
index d24ab34..05a493c 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -15,6 +15,7 @@
 
 from __future__ import print_function
 
+import logging as std_logging
 import os
 
 from oslo.config import cfg
@@ -53,6 +54,11 @@
                     "services' region name unless they are set explicitly. "
                     "If no such region is found in the service catalog, the "
                     "first found one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the identity service."),
     cfg.StrOpt('username',
                default='demo',
                help="Username to use for Nova API requests."),
@@ -99,7 +105,13 @@
     cfg.BoolOpt('trust',
                 default=True,
                 help='Does the identity service have delegation and '
-                     'impersonation enabled')
+                     'impersonation enabled'),
+    cfg.BoolOpt('api_v2',
+                default=True,
+                help='Is the v2 identity API enabled'),
+    cfg.BoolOpt('api_v3',
+                default=True,
+                help='Is the v3 identity API enabled'),
 ]
 
 compute_group = cfg.OptGroup(name='compute',
@@ -187,6 +199,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the compute service."),
     cfg.StrOpt('catalog_v3_type',
                default='computev3',
                help="Catalog type of the Compute v3 service."),
@@ -219,8 +236,8 @@
                 help="If false, skip disk config tests"),
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled compute extensions with a special '
+                     'entry all which indicates every extension is enabled'),
     cfg.ListOpt('api_v3_extensions',
                 default=['all'],
                 help='A list of enabled v3 extensions with a special entry all'
@@ -280,6 +297,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the image service."),
     cfg.StrOpt('http_image',
                default='http://download.cirros-cloud.net/0.3.1/'
                'cirros-0.3.1-x86_64-uec.tar.gz',
@@ -311,12 +333,26 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the network service."),
     cfg.StrOpt('tenant_network_cidr',
                default="10.100.0.0/16",
-               help="The cidr block to allocate tenant networks from"),
+               help="The cidr block to allocate tenant ipv4 subnets from"),
     cfg.IntOpt('tenant_network_mask_bits',
                default=28,
-               help="The mask bits for tenant networks"),
+               help="The mask bits for tenant ipv4 subnets"),
+    cfg.BoolOpt('ipv6_enabled',
+                default=True,
+                help="Allow the execution of IPv6 tests"),
+    cfg.StrOpt('tenant_network_v6_cidr',
+               default="2003::/64",
+               help="The cidr block to allocate tenant ipv6 subnets from"),
+    cfg.IntOpt('tenant_network_v6_mask_bits',
+               default=96,
+               help="The mask bits for tenant ipv6 subnets"),
     cfg.BoolOpt('tenant_networks_reachable',
                 default=False,
                 help="Whether tenant network connectivity should be "
@@ -337,8 +373,8 @@
 NetworkFeaturesGroup = [
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled network extensions with a special '
+                     'entry all which indicates every extension is enabled'),
 ]
 
 volume_group = cfg.OptGroup(name='volume',
@@ -361,6 +397,11 @@
                     "of identity.region is used instead. If no such region "
                     "is found in the service catalog, the first found one is "
                     "used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the volume service."),
     cfg.StrOpt('backend1_name',
                default='BACKEND_1',
                help="Name of the backend1 (must be declared in cinder.conf)"),
@@ -385,13 +426,19 @@
     cfg.BoolOpt('multi_backend',
                 default=False,
                 help="Runs Cinder multi-backend test (requires 2 backends)"),
+    cfg.BoolOpt('backup',
+                default=True,
+                help='Runs Cinder volumes backup test'),
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled extensions with a special entry all '
-                     'which indicates every extension is enabled'),
+                help='A list of enabled volume extensions with a special '
+                     'entry all which indicates every extension is enabled'),
     cfg.BoolOpt('api_v1',
                 default=True,
                 help="Is the v1 volume API enabled"),
+    cfg.BoolOpt('api_v2',
+                default=True,
+                help="Is the v2 volume API enabled"),
 ]
 
 
@@ -408,6 +455,11 @@
                     "value of identity.region is used instead. If no such "
                     "region is found in the service catalog, the first found "
                     "one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the object-store service."),
     cfg.IntOpt('container_sync_timeout',
                default=120,
                help="Number of seconds to time on waiting for a container "
@@ -448,6 +500,11 @@
                     "value of identity.region is used instead. If no such "
                     "region is found in the service catalog, the first found "
                     "one is used."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the orchestration service."),
     cfg.BoolOpt('allow_tenant_isolation',
                 default=False,
                 help="Allows test cases to create/destroy tenants and "
@@ -484,6 +541,11 @@
     cfg.StrOpt('catalog_type',
                default='metering',
                help="Catalog type of the Telemetry service."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the telemetry service."),
 ]
 
 
@@ -506,7 +568,13 @@
 DataProcessingGroup = [
     cfg.StrOpt('catalog_type',
                default='data_processing',
-               help="Catalog type of the data processing service.")
+               help="Catalog type of the data processing service."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the data processing "
+                    "service."),
 ]
 
 
@@ -591,7 +659,12 @@
                 default=False,
                 help='Prevent the cleaning (tearDownClass()) between'
                      ' each stress test run if an exception occurs'
-                     ' during this run.')
+                     ' during this run.'),
+    cfg.BoolOpt('full_clean_stack',
+                default=False,
+                help='Allows a full cleaning process after a stress test.'
+                     ' Caution : this cleanup will remove every objects of'
+                     ' every tenant.')
 ]
 
 
@@ -602,6 +675,9 @@
                default='/opt/stack/new/devstack/files/images/'
                'cirros-0.3.1-x86_64-uec',
                help='Directory containing image files'),
+    cfg.StrOpt('qcow2_img_file',
+               default='cirros-0.3.1-x86_64-disk.img',
+               help='QCOW2 image file name'),
     cfg.StrOpt('ami_img_file',
                default='cirros-0.3.1-x86_64-blank.img',
                help='AMI image file name'),
@@ -696,6 +772,12 @@
     cfg.StrOpt('catalog_type',
                default='baremetal',
                help="Catalog type of the baremetal provisioning service."),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               choices=['public', 'admin', 'internal',
+                        'publicURL', 'adminURL', 'internalURL'],
+               help="The endpoint type to use for the baremetal provisioning "
+                    "service."),
 ]
 
 cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
@@ -707,6 +789,11 @@
     cfg.StrOpt('cli_dir',
                default='/usr/local/bin',
                help="directory where python client binaries are located"),
+    cfg.BoolOpt('has_manage',
+                default=True,
+                help=("Whether the tempest run location has access to the "
+                      "*-manage commands. In a pure blackbox environment "
+                      "it will not.")),
     cfg.IntOpt('timeout',
                default=15,
                help="Number of seconds to wait on a CLI timeout"),
@@ -812,6 +899,9 @@
             self.compute_admin.password = self.identity.admin_password
             self.compute_admin.tenant_name = self.identity.admin_tenant_name
 
+        if parse_conf:
+            cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
+
 
 class TempestConfigProxy(object):
     _config = None
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 3b3f3eb..ac88faa 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -100,6 +100,10 @@
     message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
 
 
+class VolumeBackupException(TempestException):
+    message = "Volume backup %(backup_id)s failed and is in ERROR status"
+
+
 class StackBuildErrorException(TempestException):
     message = ("Stack %(stack_identifier)s is in %(stack_status)s status "
                "due to '%(stack_status_reason)s'")
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index 2e499a2..55be60a 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -21,6 +21,7 @@
 TEST_DEFINITION = re.compile(r'^\s*def test.*')
 SETUPCLASS_DEFINITION = re.compile(r'^\s*def setUpClass')
 SCENARIO_DECORATOR = re.compile(r'\s*@.*services\(')
+VI_HEADER_RE = re.compile(r"^#\s+vim?:.+")
 
 
 def import_no_clients_in_api(physical_line, filename):
@@ -58,7 +59,22 @@
                     "T105: setUpClass can not be used with unit tests")
 
 
+def no_vi_headers(physical_line, line_number, lines):
+    """Check for vi editor configuration in source files.
+
+    By default vi modelines can only appear in the first or
+    last 5 lines of a source file.
+
+    T106
+    """
+    # NOTE(gilliard): line_number is 1-indexed
+    if line_number <= 5 or line_number > len(lines) - 5:
+        if VI_HEADER_RE.match(physical_line):
+            return 0, "T106: Don't put vi configuration in source files"
+
+
 def factory(register):
     register(import_no_clients_in_api)
     register(scenario_tests_need_service_tags)
     register(no_setupclass_for_unit_tests)
+    register(no_vi_headers)
diff --git a/tempest/manager.py b/tempest/manager.py
index 93ff10f..708447e 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -13,8 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import auth
+from tempest import config
 from tempest import exceptions
 
+CONF = config.CONF
+
 
 class Manager(object):
 
@@ -25,7 +29,27 @@
     and a client object for a test case to use in performing actions.
     """
 
-    def __init__(self):
+    def __init__(self, username=None, password=None, tenant_name=None):
+        """
+        We allow overriding of the credentials used within the various
+        client classes managed by the Manager object. Left as None, the
+        standard username/password/tenant_name[/domain_name] is used.
+
+        :param credentials: Override of the credentials
+        """
+        self.auth_version = CONF.identity.auth_version
+        # FIXME(andreaf) Change Manager __init__ to accept a credentials dict
+        if username is None or password is None:
+            # Tenant None is a valid use case
+            self.credentials = self.get_default_credentials()
+        else:
+            self.credentials = dict(username=username, password=password,
+                                    tenant_name=tenant_name)
+        if self.auth_version == 'v3':
+            self.credentials['domain_name'] = 'Default'
+        # Creates an auth provider for the credentials
+        self.auth_provider = self.get_auth_provider(self.credentials)
+        # FIXME(andreaf) unused
         self.client_attr_names = []
 
     # we do this everywhere, have it be part of the super class
@@ -36,3 +60,28 @@
                    "tenant_name: %(t)s" %
                    {'u': username, 'p': password, 't': tenant_name})
             raise exceptions.InvalidConfiguration(msg)
+
+    @classmethod
+    def get_auth_provider_class(cls, auth_version):
+        if auth_version == 'v2':
+            return auth.KeystoneV2AuthProvider
+        else:
+            return auth.KeystoneV3AuthProvider
+
+    def get_default_credentials(self):
+        return dict(
+            username=CONF.identity.username,
+            password=CONF.identity.password,
+            tenant_name=CONF.identity.tenant_name
+        )
+
+    def get_auth_provider(self, credentials=None):
+        auth_params = dict(client_type=getattr(self, 'client_type', None),
+                           interface=getattr(self, 'interface', None))
+        auth_provider_class = self.get_auth_provider_class(self.auth_version)
+        # If invalid / incomplete credentials are provided, use default ones
+        if credentials is None or \
+                not auth_provider_class.check_credentials(credentials):
+            credentials = self.credentials
+        auth_params['credentials'] = credentials
+        return auth_provider_class(**auth_params)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 0fc304a..4c3a01c 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -18,26 +18,17 @@
 import os
 import subprocess
 
-# Default client libs
-import cinderclient.client
-import glanceclient
-import heatclient.client
-import keystoneclient.exceptions
-import keystoneclient.v2_0.client
 import netaddr
 from neutronclient.common import exceptions as exc
-import neutronclient.v2_0.client
-import novaclient.client
 from novaclient import exceptions as nova_exceptions
-import swiftclient
 
 from tempest.api.network import common as net_common
+from tempest import clients
 from tempest.common import isolated_creds
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
-import tempest.manager
 from tempest.openstack.common import log
 import tempest.test
 
@@ -53,173 +44,6 @@
 LOG_cinder_client.addHandler(log.NullHandler())
 
 
-class OfficialClientManager(tempest.manager.Manager):
-    """
-    Manager that provides access to the official python clients for
-    calling various OpenStack APIs.
-    """
-
-    NOVACLIENT_VERSION = '2'
-    CINDERCLIENT_VERSION = '1'
-    HEATCLIENT_VERSION = '1'
-
-    def __init__(self, username, password, tenant_name):
-        super(OfficialClientManager, self).__init__()
-        self.compute_client = self._get_compute_client(username,
-                                                       password,
-                                                       tenant_name)
-        self.identity_client = self._get_identity_client(username,
-                                                         password,
-                                                         tenant_name)
-        self.image_client = self._get_image_client()
-        self.network_client = self._get_network_client()
-        self.volume_client = self._get_volume_client(username,
-                                                     password,
-                                                     tenant_name)
-        self.object_storage_client = self._get_object_storage_client(
-            username,
-            password,
-            tenant_name)
-        self.orchestration_client = self._get_orchestration_client(
-            username,
-            password,
-            tenant_name)
-
-    def _get_compute_client(self, username, password, tenant_name):
-        # Novaclient will not execute operations for anyone but the
-        # identified user, so a new client needs to be created for
-        # each user that operations need to be performed for.
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        region = CONF.identity.region
-
-        client_args = (username, password, tenant_name, auth_url)
-
-        # Create our default Nova client to use in testing
-        service_type = CONF.compute.catalog_type
-        return novaclient.client.Client(self.NOVACLIENT_VERSION,
-                                        *client_args,
-                                        service_type=service_type,
-                                        region_name=region,
-                                        no_cache=True,
-                                        insecure=dscv,
-                                        http_log_debug=True)
-
-    def _get_image_client(self):
-        token = self.identity_client.auth_token
-        region = CONF.identity.region
-        endpoint = self.identity_client.service_catalog.url_for(
-            attr='region', filter_value=region,
-            service_type=CONF.image.catalog_type, endpoint_type='publicURL')
-        dscv = CONF.identity.disable_ssl_certificate_validation
-        return glanceclient.Client('1', endpoint=endpoint, token=token,
-                                   insecure=dscv)
-
-    def _get_volume_client(self, username, password, tenant_name):
-        auth_url = CONF.identity.uri
-        region = CONF.identity.region
-        return cinderclient.client.Client(self.CINDERCLIENT_VERSION,
-                                          username,
-                                          password,
-                                          tenant_name,
-                                          auth_url,
-                                          region_name=region,
-                                          http_log_debug=True)
-
-    def _get_object_storage_client(self, username, password, tenant_name):
-        auth_url = CONF.identity.uri
-        # add current tenant to swift operator role group.
-        keystone_admin = self._get_identity_client(
-            CONF.identity.admin_username,
-            CONF.identity.admin_password,
-            CONF.identity.admin_tenant_name)
-
-        # enable test user to operate swift by adding operator role to him.
-        roles = keystone_admin.roles.list()
-        operator_role = CONF.object_storage.operator_role
-        member_role = [role for role in roles if role.name == operator_role][0]
-        # NOTE(maurosr): This is surrounded in the try-except block cause
-        # neutron tests doesn't have tenant isolation.
-        try:
-            keystone_admin.roles.add_user_role(self.identity_client.user_id,
-                                               member_role.id,
-                                               self.identity_client.tenant_id)
-        except keystoneclient.exceptions.Conflict:
-            pass
-
-        return swiftclient.Connection(auth_url, username, password,
-                                      tenant_name=tenant_name,
-                                      auth_version='2')
-
-    def _get_orchestration_client(self, username=None, password=None,
-                                  tenant_name=None):
-        if not username:
-            username = CONF.identity.admin_username
-        if not password:
-            password = CONF.identity.admin_password
-        if not tenant_name:
-            tenant_name = CONF.identity.tenant_name
-
-        self._validate_credentials(username, password, tenant_name)
-
-        keystone = self._get_identity_client(username, password, tenant_name)
-        region = CONF.identity.region
-        token = keystone.auth_token
-        service_type = CONF.orchestration.catalog_type
-        try:
-            endpoint = keystone.service_catalog.url_for(
-                attr='region',
-                filter_value=region,
-                service_type=service_type,
-                endpoint_type='publicURL')
-        except keystoneclient.exceptions.EndpointNotFound:
-            return None
-        else:
-            return heatclient.client.Client(self.HEATCLIENT_VERSION,
-                                            endpoint,
-                                            token=token,
-                                            username=username,
-                                            password=password)
-
-    def _get_identity_client(self, username, password, tenant_name):
-        # This identity client is not intended to check the security
-        # of the identity service, so use admin credentials by default.
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-
-        return keystoneclient.v2_0.client.Client(username=username,
-                                                 password=password,
-                                                 tenant_name=tenant_name,
-                                                 auth_url=auth_url,
-                                                 insecure=dscv)
-
-    def _get_network_client(self):
-        # The intended configuration is for the network client to have
-        # admin privileges and indicate for whom resources are being
-        # created via a 'tenant_id' parameter.  This will often be
-        # preferable to authenticating as a specific user because
-        # working with certain resources (public routers and networks)
-        # often requires admin privileges anyway.
-        username = CONF.identity.admin_username
-        password = CONF.identity.admin_password
-        tenant_name = CONF.identity.admin_tenant_name
-
-        self._validate_credentials(username, password, tenant_name)
-
-        auth_url = CONF.identity.uri
-        dscv = CONF.identity.disable_ssl_certificate_validation
-
-        return neutronclient.v2_0.client.Client(username=username,
-                                                password=password,
-                                                tenant_name=tenant_name,
-                                                auth_url=auth_url,
-                                                insecure=dscv)
-
-
 class OfficialClientTest(tempest.test.BaseTestCase):
     """
     Official Client test base class for scenario testing.
@@ -242,7 +66,8 @@
 
         username, password, tenant_name = cls.credentials()
 
-        cls.manager = OfficialClientManager(username, password, tenant_name)
+        cls.manager = clients.OfficialClientManager(
+            username, password, tenant_name)
         cls.compute_client = cls.manager.compute_client
         cls.image_client = cls.manager.image_client
         cls.identity_client = cls.manager.identity_client
@@ -276,6 +101,41 @@
         return cls._get_credentials(cls.isolated_creds.get_admin_creds,
                                     'admin_')
 
+    @staticmethod
+    def cleanup_resource(resource, test_name):
+
+        LOG.debug("Deleting %r from shared resources of %s" %
+                  (resource, test_name))
+        try:
+            # OpenStack resources are assumed to have a delete()
+            # method which destroys the resource...
+            resource.delete()
+        except Exception as e:
+            # If the resource is already missing, mission accomplished.
+            # add status code as workaround for bug 1247568
+            if (e.__class__.__name__ == 'NotFound' or
+                    (hasattr(e, 'status_code') and e.status_code == 404)):
+                return
+            raise
+
+        def is_deletion_complete():
+            # Deletion testing is only required for objects whose
+            # existence cannot be checked via retrieval.
+            if isinstance(resource, dict):
+                return True
+            try:
+                resource.get()
+            except Exception as e:
+                # Clients are expected to return an exception
+                # called 'NotFound' if retrieval fails.
+                if e.__class__.__name__ == 'NotFound':
+                    return True
+                raise
+            return False
+
+        # Block until resource deletion has completed or timed-out
+        tempest.test.call_until_true(is_deletion_complete, 10, 1)
+
     @classmethod
     def tearDownClass(cls):
         # NOTE(jaypipes): Because scenario tests are typically run in a
@@ -285,38 +145,7 @@
         # the scenario test class object
         while cls.os_resources:
             thing = cls.os_resources.pop()
-            LOG.debug("Deleting %r from shared resources of %s" %
-                      (thing, cls.__name__))
-
-            try:
-                # OpenStack resources are assumed to have a delete()
-                # method which destroys the resource...
-                thing.delete()
-            except Exception as e:
-                # If the resource is already missing, mission accomplished.
-                # add status code as workaround for bug 1247568
-                if (e.__class__.__name__ == 'NotFound' or
-                    hasattr(e, 'status_code') and e.status_code == 404):
-                    continue
-                raise
-
-            def is_deletion_complete():
-                # Deletion testing is only required for objects whose
-                # existence cannot be checked via retrieval.
-                if isinstance(thing, dict):
-                    return True
-                try:
-                    thing.get()
-                except Exception as e:
-                    # Clients are expected to return an exception
-                    # called 'NotFound' if retrieval fails.
-                    if e.__class__.__name__ == 'NotFound':
-                        return True
-                    raise
-                return False
-
-            # Block until resource deletion has completed or timed-out
-            tempest.test.call_until_true(is_deletion_complete, 10, 1)
+            cls.cleanup_resource(thing, cls.__name__)
         cls.isolated_creds.clear_isolated_creds()
         super(OfficialClientTest, cls).tearDownClass()
 
@@ -396,8 +225,9 @@
             # so case sensitive comparisons can really mess things
             # up.
             if new_status.lower() == error_status.lower():
-                message = ("%s failed to get to expected status. "
-                           "In %s state.") % (thing, new_status)
+                message = ("%s failed to get to expected status (%s). "
+                           "In %s state.") % (thing, expected_status,
+                                              new_status)
                 raise exceptions.BuildErrorException(message,
                                                      server_id=thing_id)
             elif new_status == expected_status and expected_status is not None:
@@ -461,6 +291,27 @@
             image = CONF.compute.image_ref
         if flavor is None:
             flavor = CONF.compute.flavor_ref
+
+        fixed_network_name = CONF.compute.fixed_network_name
+        if 'nics' not in create_kwargs and fixed_network_name:
+            networks = client.networks.list()
+            # If several networks found, set the NetID on which to connect the
+            # server to avoid the following error "Multiple possible networks
+            # found, use a Network ID to be more specific."
+            # See Tempest #1250866
+            if len(networks) > 1:
+                for network in networks:
+                    if network.label == fixed_network_name:
+                        create_kwargs['nics'] = [{'net-id': network.id}]
+                        break
+                # If we didn't find the network we were looking for :
+                else:
+                    msg = ("The network on which the NIC of the server must "
+                           "be connected can not be found : "
+                           "fixed_network_name=%s. Starting instance without "
+                           "specifying a network.") % fixed_network_name
+                    LOG.info(msg)
+
         LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
                   name, image, flavor)
         server = client.servers.create(name, image, flavor, **create_kwargs)
@@ -529,7 +380,7 @@
             username = CONF.scenario.ssh_user
         if private_key is None:
             private_key = self.keypair.private_key
-        return RemoteClient(ip, username, pkey=private_key)
+        return remote_client.RemoteClient(ip, username, pkey=private_key)
 
     def _log_console_output(self, servers=None):
         if not servers:
@@ -538,6 +389,54 @@
             LOG.debug('Console output for %s', server.id)
             LOG.debug(server.get_console_output())
 
+    def wait_for_volume_status(self, status):
+        volume_id = self.volume.id
+        self.status_timeout(
+            self.volume_client.volumes, volume_id, status)
+
+    def _image_create(self, name, fmt, path, properties={}):
+        name = data_utils.rand_name('%s-' % name)
+        image_file = open(path, 'rb')
+        self.addCleanup(image_file.close)
+        params = {
+            'name': name,
+            'container_format': fmt,
+            'disk_format': fmt,
+            'is_public': 'True',
+        }
+        params.update(properties)
+        image = self.image_client.images.create(**params)
+        self.addCleanup(self.image_client.images.delete, image)
+        self.assertEqual("queued", image.status)
+        image.update(data=image_file)
+        return image.id
+
+    def glance_image_create(self):
+        qcow2_img_path = (CONF.scenario.img_dir + "/" +
+                          CONF.scenario.qcow2_img_file)
+        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
+        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
+        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
+        LOG.debug("paths: img: %s, ami: %s, ari: %s, aki: %s"
+                  % (qcow2_img_path, ami_img_path, ari_img_path, aki_img_path))
+        try:
+            self.image = self._image_create('scenario-img',
+                                            'bare',
+                                            qcow2_img_path,
+                                            properties={'disk_format':
+                                                        'qcow2'})
+        except IOError:
+            LOG.debug("A qcow2 image was not found. Try to get a uec image.")
+            kernel = self._image_create('scenario-aki', 'aki', aki_img_path)
+            ramdisk = self._image_create('scenario-ari', 'ari', ari_img_path)
+            properties = {
+                'properties': {'kernel_id': kernel, 'ramdisk_id': ramdisk}
+            }
+            self.image = self._image_create('scenario-ami', 'ami',
+                                            path=ami_img_path,
+                                            properties=properties)
+        LOG.debug("image:%s" % self.image)
+
 
 class NetworkScenarioTest(OfficialClientTest):
     """
@@ -585,56 +484,65 @@
         self.set_resource(name, network)
         return network
 
-    def _list_networks(self):
-        nets = self.network_client.list_networks()
+    def _list_networks(self, **kwargs):
+        nets = self.network_client.list_networks(**kwargs)
         return nets['networks']
 
-    def _list_subnets(self):
-        subnets = self.network_client.list_subnets()
+    def _list_subnets(self, **kwargs):
+        subnets = self.network_client.list_subnets(**kwargs)
         return subnets['subnets']
 
-    def _list_routers(self):
-        routers = self.network_client.list_routers()
+    def _list_routers(self, **kwargs):
+        routers = self.network_client.list_routers(**kwargs)
         return routers['routers']
 
-    def _list_ports(self):
-        ports = self.network_client.list_ports()
+    def _list_ports(self, **kwargs):
+        ports = self.network_client.list_ports(**kwargs)
         return ports['ports']
 
     def _get_tenant_own_network_num(self, tenant_id):
-        nets = self._list_networks()
-        ownnets = [value for value in nets if tenant_id == value['tenant_id']]
-        return len(ownnets)
+        nets = self._list_networks(tenant_id=tenant_id)
+        return len(nets)
 
     def _get_tenant_own_subnet_num(self, tenant_id):
-        subnets = self._list_subnets()
-        ownsubnets = ([value for value in subnets
-                      if tenant_id == value['tenant_id']])
-        return len(ownsubnets)
+        subnets = self._list_subnets(tenant_id=tenant_id)
+        return len(subnets)
 
     def _get_tenant_own_port_num(self, tenant_id):
-        ports = self._list_ports()
-        ownports = ([value for value in ports
-                    if tenant_id == value['tenant_id']])
-        return len(ownports)
+        ports = self._list_ports(tenant_id=tenant_id)
+        return len(ports)
 
     def _create_subnet(self, network, namestart='subnet-smoke-'):
         """
         Create a subnet for the given network within the cidr block
         configured for tenant networks.
         """
+
+        def cidr_in_use(cidr, tenant_id):
+            """
+            :return True if subnet with cidr already exist in tenant
+                False else
+            """
+            cidr_in_use = self._list_subnets(tenant_id=tenant_id, cidr=cidr)
+            return len(cidr_in_use) != 0
+
         tenant_cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
         result = None
         # Repeatedly attempt subnet creation with sequential cidr
         # blocks until an unallocated block is found.
         for subnet_cidr in tenant_cidr.subnet(
             CONF.network.tenant_network_mask_bits):
+            str_cidr = str(subnet_cidr)
+            if cidr_in_use(str_cidr, tenant_id=network.tenant_id):
+                continue
+
             body = dict(
                 subnet=dict(
+                    name=data_utils.rand_name(namestart),
                     ip_version=4,
                     network_id=network.id,
                     tenant_id=network.tenant_id,
-                    cidr=str(subnet_cidr),
+                    cidr=str_cidr,
                 ),
             )
             try:
@@ -647,7 +555,7 @@
         self.assertIsNotNone(result, 'Unable to allocate tenant network')
         subnet = net_common.DeletableSubnet(client=self.network_client,
                                             **result['subnet'])
-        self.assertEqual(subnet.cidr, str(subnet_cidr))
+        self.assertEqual(subnet.cidr, str_cidr)
         self.set_resource(data_utils.rand_name(namestart), subnet)
         return subnet
 
@@ -664,19 +572,15 @@
         self.set_resource(name, port)
         return port
 
-    def _get_server_port_id(self, server):
-        result = self.network_client.list_ports(device_id=server.id)
-        ports = result.get('ports', [])
+    def _get_server_port_id(self, server, ip_addr=None):
+        ports = self._list_ports(device_id=server.id, fixed_ip=ip_addr)
         self.assertEqual(len(ports), 1,
                          "Unable to determine which port to target.")
         return ports[0]['id']
 
-    def _create_floating_ip(self, thing, external_network_id,
-                            port_filters=None):
-        if port_filters is None:
+    def _create_floating_ip(self, thing, external_network_id, port_id=None):
+        if not port_id:
             port_id = self._get_server_port_id(thing)
-        else:
-            port_id = port_filters
         body = dict(
             floatingip=dict(
                 floating_network_id=external_network_id,
@@ -1030,9 +934,6 @@
         router = self._get_router(tenant_id)
         subnet = self._create_subnet(network)
         subnet.add_to_router(router.id)
-        self.networks.append(network)
-        self.subnets.append(subnet)
-        self.routers.append(router)
         return network, subnet, router
 
 
diff --git a/tempest/scenario/orchestration/test_autoscaling.py b/tempest/scenario/orchestration/test_autoscaling.py
index cd7a2b2..82ba3c5 100644
--- a/tempest/scenario/orchestration/test_autoscaling.py
+++ b/tempest/scenario/orchestration/test_autoscaling.py
@@ -15,10 +15,7 @@
 
 from tempest import config
 from tempest.scenario import manager
-from tempest.test import attr
-from tempest.test import call_until_true
-from tempest.test import services
-from tempest.test import skip_because
+from tempest import test
 
 CONF = config.CONF
 
@@ -64,9 +61,9 @@
         if not CONF.orchestration.keypair_name:
             self.set_resource('stack', self.stack)
 
-    @skip_because(bug="1257575")
-    @attr(type='slow')
-    @services('orchestration', 'compute')
+    @test.skip_because(bug="1257575")
+    @test.attr(type='slow')
+    @test.services('orchestration', 'compute')
     def test_scale_up_then_down(self):
 
         self.assign_keypair()
@@ -98,8 +95,8 @@
             return self.server_count
 
         def assertScale(from_servers, to_servers):
-            call_until_true(lambda: server_count() == to_servers,
-                            timeout, interval)
+            test.call_until_true(lambda: server_count() == to_servers,
+                                 timeout, interval)
             self.assertEqual(to_servers, self.server_count,
                              'Failed scaling from %d to %d servers. '
                              'Current server count: %s' % (
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index f2b681e..8e34c16 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 from tempest.common import tempest_fixtures as fixtures
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
 from tempest import test
@@ -107,7 +107,7 @@
     def test_aggregate_basic_ops(self):
         self.useFixture(fixtures.LockFixture('availability_zone'))
         az = 'foo_zone'
-        aggregate_name = rand_name('aggregate-scenario')
+        aggregate_name = data_utils.rand_name('aggregate-scenario')
         aggregate = self._create_aggregate(name=aggregate_name,
                                            availability_zone=az)
 
@@ -119,7 +119,7 @@
         self._check_aggregate_details(aggregate, aggregate_name, az, [host],
                                       metadata)
 
-        aggregate_name = rand_name('renamed-aggregate-scenario')
+        aggregate_name = data_utils.rand_name('renamed-aggregate-scenario')
         aggregate = self._update_aggregate(aggregate, aggregate_name, None)
 
         additional_metadata = {'foo': 'bar'}
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 19996e5..6418a73 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -19,7 +19,7 @@
 
 from tempest import config
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -69,7 +69,7 @@
         response = self.opener.open(CONF.dashboard.dashboard_url)
         self.assertIn('Overview', response.read())
 
-    @services('dashboard')
+    @test.services('dashboard')
     def test_basic_scenario(self):
         self.check_login_page()
         self.user_login()
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index e8030c9..b7a30f8 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -17,7 +17,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -47,43 +47,6 @@
             self.status_timeout(
                 self.compute_client.servers, server.id, status)
 
-    def _wait_for_volume_status(self, status):
-        volume_id = self.volume.id
-        self.status_timeout(
-            self.volume_client.volumes, volume_id, status)
-
-    def _image_create(self, name, fmt, path, properties={}):
-        name = data_utils.rand_name('%s-' % name)
-        image_file = open(path, 'rb')
-        self.addCleanup(image_file.close)
-        params = {
-            'name': name,
-            'container_format': fmt,
-            'disk_format': fmt,
-            'is_public': 'True',
-        }
-        params.update(properties)
-        image = self.image_client.images.create(**params)
-        self.addCleanup(self.image_client.images.delete, image)
-        self.assertEqual("queued", image.status)
-        image.update(data=image_file)
-        return image.id
-
-    def glance_image_create(self):
-        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
-        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
-        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
-        LOG.debug("paths: ami: %s, ari: %s, aki: %s"
-                  % (ami_img_path, ari_img_path, aki_img_path))
-        kernel_id = self._image_create('scenario-aki', 'aki', aki_img_path)
-        ramdisk_id = self._image_create('scenario-ari', 'ari', ari_img_path)
-        properties = {
-            'properties': {'kernel_id': kernel_id, 'ramdisk_id': ramdisk_id}
-        }
-        self.image = self._image_create('scenario-ami', 'ami',
-                                        path=ami_img_path,
-                                        properties=properties)
-
     def nova_boot(self):
         name = data_utils.rand_name('scenario-server-')
         client = self.compute_client
@@ -100,7 +63,7 @@
             self.set_resource(server.name, server)
         self._wait_for_server_status('ACTIVE')
 
-    @services('compute', 'image')
+    @test.services('compute', 'image')
     def test_large_ops_scenario(self):
         if CONF.scenario.large_ops_number < 1:
             return
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 68f6e62..5bcdacd 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -61,12 +61,8 @@
         super(TestLoadBalancerBasic, cls).setUpClass()
         cls.check_preconditions()
         cls.security_groups = {}
-        cls.networks = []
-        cls.subnets = []
         cls.servers_keypairs = {}
-        cls.pools = []
         cls.members = []
-        cls.vips = []
         cls.floating_ips = {}
         cls.port1 = 80
         cls.port2 = 88
@@ -80,21 +76,19 @@
         name = data_utils.rand_name("smoke_server-")
         keypair = self.create_keypair(name='keypair-%s' % name)
         security_groups = [self.security_groups[tenant_id].name]
-        nets = self.network_client.list_networks()
-        for net in nets['networks']:
-            if net['tenant_id'] == self.tenant_id:
-                self.networks.append(net)
-                create_kwargs = {
-                    'nics': [
-                        {'net-id': net['id']},
-                    ],
-                    'key_name': keypair.name,
-                    'security_groups': security_groups,
-                }
-                server = self.create_server(name=name,
-                                            create_kwargs=create_kwargs)
-                self.servers_keypairs[server] = keypair
-                break
+        net = self.list_networks(tenant_id=self.tenant_id)[0]
+        self.network = net_common.DeletableNetwork(client=self.network_client,
+                                                   **net['network'])
+        create_kwargs = {
+            'nics': [
+                {'net-id': self.network.id},
+            ],
+            'key_name': keypair.name,
+            'security_groups': security_groups,
+        }
+        server = self.create_server(name=name,
+                                    create_kwargs=create_kwargs)
+        self.servers_keypairs[server] = keypair
         self.assertTrue(self.servers_keypairs)
 
     def _start_servers(self):
@@ -105,7 +99,7 @@
         for server in self.servers_keypairs.keys():
             ssh_login = config.compute.image_ssh_user
             private_key = self.servers_keypairs[server].private_key
-            network_name = self.networks[0]['name']
+            network_name = self.network.name
 
             ip_address = server.networks[network_name][0]
             ssh_client = ssh.Client(ip_address, ssh_login,
@@ -138,17 +132,15 @@
 
     def _create_pool(self):
         """Create a pool with ROUND_ROBIN algorithm."""
-        subnets = self.network_client.list_subnets()
-        for subnet in subnets['subnets']:
-            if subnet['tenant_id'] == self.tenant_id:
-                self.subnets.append(subnet)
-                pool = super(TestLoadBalancerBasic, self)._create_pool(
-                    'ROUND_ROBIN',
-                    'HTTP',
-                    subnet['id'])
-                self.pools.append(pool)
-                break
-        self.assertTrue(self.pools)
+        # get tenant subnet and verify there's only one
+        subnet = self._list_subnets(tenant_id=self.tenant_id)[0]
+        self.subnet = net_common.DeletableSubnet(client=self.network_client,
+                                                 **subnet['subnet'])
+        self.pool = super(TestLoadBalancerBasic, self)._create_pool(
+            'ROUND_ROBIN',
+            'HTTP',
+            self.subnet.id)
+        self.assertTrue(self.pool)
 
     def _create_members(self, network_name, server_ids):
         """
@@ -161,7 +153,7 @@
         for server in servers:
             if server.id in server_ids:
                 ip = server.networks[network_name][0]
-                pool_id = self.pools[0]['id']
+                pool_id = self.pool.id
                 if len(set(server_ids)) == 1 or len(servers) == 1:
                     member1 = self._create_member(ip, self.port1, pool_id)
                     member2 = self._create_member(ip, self.port2, pool_id)
@@ -173,29 +165,27 @@
 
     def _assign_floating_ip_to_vip(self, vip):
         public_network_id = config.network.public_network_id
-        port_id = vip['port_id']
-        floating_ip = self._create_floating_ip(vip,
-                                               public_network_id,
-                                               port_filters=port_id)
-        self.floating_ips.setdefault(vip['id'], [])
-        self.floating_ips[vip['id']].append(floating_ip)
+        port_id = vip.port_id
+        floating_ip = self._create_floating_ip(vip, public_network_id,
+                                               port_id=port_id)
+        self.floating_ips.setdefault(vip.id, [])
+        self.floating_ips[vip.id].append(floating_ip)
 
     def _create_load_balancer(self):
         self._create_pool()
-        self._create_members(self.networks[0]['name'],
+        self._create_members(self.network.name,
                              [self.servers_keypairs.keys()[0].id])
-        subnet_id = self.subnets[0]['id']
-        pool_id = self.pools[0]['id']
-        vip = super(TestLoadBalancerBasic, self)._create_vip('HTTP', 80,
-                                                             subnet_id,
-                                                             pool_id)
-        self.vips.append(vip)
+        subnet_id = self.subnet.id
+        pool_id = self.pool.id
+        self.vip = super(TestLoadBalancerBasic, self)._create_vip('HTTP', 80,
+                                                                  subnet_id,
+                                                                  pool_id)
         self._status_timeout(NeutronRetriever(self.network_client,
                                               self.network_client.vip_path,
                                               net_common.DeletableVip),
-                             self.vips[0]['id'],
+                             self.vip.id,
                              expected_status='ACTIVE')
-        self._assign_floating_ip_to_vip(self.vips[0])
+        self._assign_floating_ip_to_vip(self.vip)
 
     def _check_load_balancing(self):
         """
@@ -205,9 +195,8 @@
            of the requests
         """
 
-        vip = self.vips[0]
-        floating_ip_vip = self.floating_ips[
-            vip['id']][0]['floating_ip_address']
+        vip = self.vip
+        floating_ip_vip = self.floating_ips[vip.id][0]['floating_ip_address']
         self._check_connection(floating_ip_vip)
         resp = []
         for count in range(10):
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 846e0cc..39b7760 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -13,11 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.common.utils import data_utils
+from tempest.common import debug
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -42,43 +42,6 @@
         self.status_timeout(
             self.compute_client.servers, server_id, status)
 
-    def _wait_for_volume_status(self, status):
-        volume_id = self.volume.id
-        self.status_timeout(
-            self.volume_client.volumes, volume_id, status)
-
-    def _image_create(self, name, fmt, path, properties={}):
-        name = data_utils.rand_name('%s-' % name)
-        image_file = open(path, 'rb')
-        self.addCleanup(image_file.close)
-        params = {
-            'name': name,
-            'container_format': fmt,
-            'disk_format': fmt,
-            'is_public': 'True',
-        }
-        params.update(properties)
-        image = self.image_client.images.create(**params)
-        self.addCleanup(self.image_client.images.delete, image)
-        self.assertEqual("queued", image.status)
-        image.update(data=image_file)
-        return image.id
-
-    def glance_image_create(self):
-        aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
-        ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
-        ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
-        LOG.debug("paths: ami: %s, ari: %s, aki: %s"
-                  % (ami_img_path, ari_img_path, aki_img_path))
-        kernel_id = self._image_create('scenario-aki', 'aki', aki_img_path)
-        ramdisk_id = self._image_create('scenario-ari', 'ari', ari_img_path)
-        properties = {
-            'properties': {'kernel_id': kernel_id, 'ramdisk_id': ramdisk_id}
-        }
-        self.image = self._image_create('scenario-ami', 'ami',
-                                        path=ami_img_path,
-                                        properties=properties)
-
     def nova_keypair_add(self):
         self.keypair = self.create_keypair()
 
@@ -114,7 +77,7 @@
                                       self.volume.id,
                                       '/dev/vdb')
         self.assertEqual(self.volume.id, volume.id)
-        self._wait_for_volume_status('in-use')
+        self.wait_for_volume_status('in-use')
 
     def nova_reboot(self):
         self.server.reboot()
@@ -130,9 +93,11 @@
     def ssh_to_server(self):
         try:
             self.linux_client = self.get_remote_client(self.floating_ip.ip)
+            self.linux_client.validate_authentication()
         except Exception:
             LOG.exception('ssh to server failed')
             self._log_console_output()
+            debug.log_ip_ns()
             raise
 
     def check_partitions(self):
@@ -142,12 +107,12 @@
     def nova_volume_detach(self):
         detach_volume_client = self.compute_client.volumes.delete_server_volume
         detach_volume_client(self.server.id, self.volume.id)
-        self._wait_for_volume_status('available')
+        self.wait_for_volume_status('available')
 
         volume = self.volume_client.volumes.get(self.volume.id)
         self.assertEqual('available', volume.status)
 
-    @services('compute', 'volume', 'image', 'network')
+    @test.services('compute', 'volume', 'image', 'network')
     def test_minimum_basic_scenario(self):
         self.glance_image_create()
         self.nova_keypair_add()
@@ -160,10 +125,11 @@
         self.nova_volume_attach()
         self.addCleanup(self.nova_volume_detach)
         self.cinder_show()
-        self.nova_reboot()
 
         self.nova_floating_ip_create()
         self.nova_floating_ip_add()
         self._create_loginable_secgroup_rule_nova()
         self.ssh_to_server()
+        self.nova_reboot()
+        self.ssh_to_server()
         self.check_partitions()
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 0c0234f..998a474 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -13,6 +13,7 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+import collections
 
 from tempest.common import debug
 from tempest.common.utils import data_utils
@@ -24,6 +25,9 @@
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
+Floating_IP_tuple = collections.namedtuple('Floating_IP_tuple',
+                                           ['floating_ip', 'server'])
+
 
 class TestNetworkBasicOps(manager.NetworkScenarioTest):
 
@@ -116,46 +120,57 @@
                 msg = "%s extension not enabled." % ext
                 raise cls.skipException(msg)
         cls.check_preconditions()
-        # TODO(mnewby) Consider looking up entities as needed instead
-        # of storing them as collections on the class.
-        cls.security_groups = {}
-        cls.networks = []
-        cls.subnets = []
-        cls.routers = []
-        cls.servers = {}
-        cls.floating_ips = {}
 
-    def _create_security_groups(self):
-        self.security_groups[self.tenant_id] =\
+    def cleanup_wrapper(self, resource):
+        self.cleanup_resource(resource, self.__class__.__name__)
+
+    def setUp(self):
+        super(TestNetworkBasicOps, self).setUp()
+        self.security_group = \
             self._create_security_group_neutron(tenant_id=self.tenant_id)
+        self.addCleanup(self.cleanup_wrapper, self.security_group)
+        self.network, self.subnet, self.router = self._create_networks()
+        for r in [self.network, self.router, self.subnet]:
+            self.addCleanup(self.cleanup_wrapper, r)
+        self.check_networks()
+        self.servers = {}
+        name = data_utils.rand_name('server-smoke')
+        serv_dict = self._create_server(name, self.network)
+        self.servers[serv_dict['server']] = serv_dict['keypair']
+        self._check_tenant_network_connectivity()
 
-    def _check_networks(self):
-        # Checks that we see the newly created network/subnet/router via
-        # checking the result of list_[networks,routers,subnets]
+        self._create_and_associate_floating_ips()
+
+    def check_networks(self):
+        """
+        Checks that we see the newly created network/subnet/router via
+        checking the result of list_[networks,routers,subnets]
+        """
+
         seen_nets = self._list_networks()
         seen_names = [n['name'] for n in seen_nets]
         seen_ids = [n['id'] for n in seen_nets]
-        for mynet in self.networks:
-            self.assertIn(mynet.name, seen_names)
-            self.assertIn(mynet.id, seen_ids)
+        self.assertIn(self.network.name, seen_names)
+        self.assertIn(self.network.id, seen_ids)
+
         seen_subnets = self._list_subnets()
         seen_net_ids = [n['network_id'] for n in seen_subnets]
         seen_subnet_ids = [n['id'] for n in seen_subnets]
-        for mynet in self.networks:
-            self.assertIn(mynet.id, seen_net_ids)
-        for mysubnet in self.subnets:
-            self.assertIn(mysubnet.id, seen_subnet_ids)
+        self.assertIn(self.network.id, seen_net_ids)
+        self.assertIn(self.subnet.id, seen_subnet_ids)
+
         seen_routers = self._list_routers()
         seen_router_ids = [n['id'] for n in seen_routers]
         seen_router_names = [n['name'] for n in seen_routers]
-        for myrouter in self.routers:
-            self.assertIn(myrouter.name, seen_router_names)
-            self.assertIn(myrouter.id, seen_router_ids)
+        self.assertIn(self.router.name,
+                      seen_router_names)
+        self.assertIn(self.router.id,
+                      seen_router_ids)
 
     def _create_server(self, name, network):
-        tenant_id = network.tenant_id
         keypair = self.create_keypair(name='keypair-%s' % name)
-        security_groups = [self.security_groups[tenant_id].name]
+        self.addCleanup(self.cleanup_wrapper, keypair)
+        security_groups = [self.security_group.name]
         create_kwargs = {
             'nics': [
                 {'net-id': network.id},
@@ -164,13 +179,8 @@
             'security_groups': security_groups,
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
-        self.servers[server] = keypair
-        return server
-
-    def _create_servers(self):
-        for i, network in enumerate(self.networks):
-            name = data_utils.rand_name('server-smoke-%d-' % i)
-            self._create_server(name, network)
+        self.addCleanup(self.cleanup_wrapper, server)
+        return dict(server=server, keypair=keypair)
 
     def _check_tenant_network_connectivity(self):
         if not CONF.network.tenant_networks_reachable:
@@ -181,7 +191,7 @@
         # key-based authentication by cloud-init.
         ssh_login = CONF.compute.image_ssh_user
         try:
-            for server, key in self.servers.items():
+            for server, key in self.servers.iteritems():
                 for net_name, ip_addresses in server.networks.iteritems():
                     for ip_address in ip_addresses:
                         self._check_vm_connectivity(ip_address, ssh_login,
@@ -196,7 +206,8 @@
         public_network_id = CONF.network.public_network_id
         for server in self.servers.keys():
             floating_ip = self._create_floating_ip(server, public_network_id)
-            self.floating_ips[floating_ip] = server
+            self.floating_ip_tuple = Floating_IP_tuple(floating_ip, server)
+            self.addCleanup(self.cleanup_wrapper, floating_ip)
 
     def _check_public_network_connectivity(self, should_connect=True,
                                            msg=None):
@@ -204,16 +215,16 @@
         # key-based authentication by cloud-init.
         ssh_login = CONF.compute.image_ssh_user
         LOG.debug('checking network connections')
+        floating_ip, server = self.floating_ip_tuple
+        ip_address = floating_ip.floating_ip_address
+        private_key = None
+        if should_connect:
+            private_key = self.servers[server].private_key
         try:
-            for floating_ip, server in self.floating_ips.iteritems():
-                ip_address = floating_ip.floating_ip_address
-                private_key = None
-                if should_connect:
-                    private_key = self.servers[server].private_key
-                self._check_vm_connectivity(ip_address,
-                                            ssh_login,
-                                            private_key,
-                                            should_connect=should_connect)
+            self._check_vm_connectivity(ip_address,
+                                        ssh_login,
+                                        private_key,
+                                        should_connect=should_connect)
         except Exception:
             ex_msg = 'Public network connectivity check failed'
             if msg:
@@ -224,28 +235,24 @@
             raise
 
     def _disassociate_floating_ips(self):
-        for floating_ip, server in self.floating_ips.iteritems():
-            self._disassociate_floating_ip(floating_ip)
-            self.floating_ips[floating_ip] = None
+        floating_ip, server = self.floating_ip_tuple
+        self._disassociate_floating_ip(floating_ip)
+        self.floating_ip_tuple = Floating_IP_tuple(
+            floating_ip, None)
 
     def _reassociate_floating_ips(self):
-        network = self.networks[0]
-        for floating_ip in self.floating_ips.keys():
-            name = data_utils.rand_name('new_server-smoke-')
-            # create a new server for the floating ip
-            server = self._create_server(name, network)
-            self._associate_floating_ip(floating_ip, server)
-            self.floating_ips[floating_ip] = server
+        floating_ip, server = self.floating_ip_tuple
+        name = data_utils.rand_name('new_server-smoke-')
+        # create a new server for the floating ip
+        serv_dict = self._create_server(name, self.network)
+        self.servers[serv_dict['server']] = serv_dict['keypair']
+        self._associate_floating_ip(floating_ip, serv_dict['server'])
+        self.floating_ip_tuple = Floating_IP_tuple(
+            floating_ip, serv_dict['server'])
 
     @test.attr(type='smoke')
     @test.services('compute', 'network')
     def test_network_basic_ops(self):
-        self._create_security_groups()
-        self._create_networks()
-        self._check_networks()
-        self._create_servers()
-        self._create_and_associate_floating_ips()
-        self._check_tenant_network_connectivity()
         self._check_public_network_connectivity(should_connect=True)
         self._disassociate_floating_ips()
         self._check_public_network_connectivity(should_connect=False,
diff --git a/tempest/scenario/test_cross_tenant_connectivity.py b/tempest/scenario/test_security_groups_basic_ops.py
similarity index 77%
rename from tempest/scenario/test_cross_tenant_connectivity.py
rename to tempest/scenario/test_security_groups_basic_ops.py
index edcf091..a26e0cf 100644
--- a/tempest/scenario/test_cross_tenant_connectivity.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -13,23 +13,21 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import clients
 from tempest.common import debug
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.scenario.manager import OfficialClientManager
-from tempest.test import attr
-from tempest.test import call_until_true
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
 LOG = logging.getLogger(__name__)
 
 
-class TestNetworkCrossTenant(manager.NetworkScenarioTest):
+class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
 
     """
     This test suite assumes that Nova has been configured to
@@ -50,7 +48,7 @@
     failure - ping_timeout reached
 
     setup:
-        for each tenant (demo and alt):
+        for primary tenant:
             1. create a network&subnet
             2. create a router (if public router isn't configured)
             3. connect tenant network to public network via router
@@ -59,8 +57,6 @@
                 b. a VM with a floating ip
             5. create a general empty security group (same as "default", but
             without rules allowing in-tenant traffic)
-            6. for demo tenant - create another server to test in-tenant
-            connections
 
     tests:
         1. _verify_network_details
@@ -80,7 +76,7 @@
             been created on source tenant
 
     assumptions:
-        1. alt_tenant/user existed and is different from demo_tenant/user
+        1. alt_tenant/user existed and is different from primary_tenant/user
         2. Public network is defined and reachable from the Tempest host
         3. Public router can either be:
             * defined, in which case all tenants networks can connect directly
@@ -92,7 +88,7 @@
     """
 
     class TenantProperties():
-        '''
+        """
         helper class to save tenant details
             id
             credentials
@@ -101,14 +97,15 @@
             security groups
             servers
             access point
-        '''
+        """
 
         def __init__(self, tenant_id, tenant_user, tenant_pass, tenant_name):
-            self.manager = OfficialClientManager(
+            self.manager = clients.OfficialClientManager(
                 tenant_user,
                 tenant_pass,
                 tenant_name
             )
+            self.keypair = None
             self.tenant_id = tenant_id
             self.tenant_name = tenant_name
             self.tenant_user = tenant_user
@@ -119,7 +116,7 @@
             self.security_groups = {}
             self.servers = list()
 
-        def _set_network(self, network, subnet, router):
+        def set_network(self, network, subnet, router):
             self.network = network
             self.subnet = subnet
             self.router = router
@@ -129,7 +126,7 @@
 
     @classmethod
     def check_preconditions(cls):
-        super(TestNetworkCrossTenant, cls).check_preconditions()
+        super(TestSecurityGroupsBasicOps, cls).check_preconditions()
         if (cls.alt_tenant_id is None) or (cls.tenant_id is cls.alt_tenant_id):
             msg = 'No alt_tenant defined'
             cls.enabled = False
@@ -143,7 +140,7 @@
 
     @classmethod
     def setUpClass(cls):
-        super(TestNetworkCrossTenant, cls).setUpClass()
+        super(TestSecurityGroupsBasicOps, cls).setUpClass()
         alt_creds = cls.alt_credentials()
         cls.alt_tenant_id = cls.manager._get_identity_client(
             *alt_creds
@@ -151,48 +148,44 @@
         cls.check_preconditions()
         # TODO(mnewby) Consider looking up entities as needed instead
         # of storing them as collections on the class.
-        cls.keypairs = {}
-        cls.security_groups = {}
-        cls.networks = []
-        cls.subnets = []
-        cls.routers = []
-        cls.servers = []
         cls.floating_ips = {}
         cls.tenants = {}
-        cls.demo_tenant = cls.TenantProperties(
-            cls.tenant_id,
-            *cls.credentials()
-        )
-        cls.alt_tenant = cls.TenantProperties(
-            cls.alt_tenant_id,
-            *alt_creds
-        )
-        for tenant in [cls.demo_tenant, cls.alt_tenant]:
+        cls.primary_tenant = cls.TenantProperties(cls.tenant_id,
+                                                  *cls.credentials())
+        cls.alt_tenant = cls.TenantProperties(cls.alt_tenant_id,
+                                              *alt_creds)
+        for tenant in [cls.primary_tenant, cls.alt_tenant]:
             cls.tenants[tenant.tenant_id] = tenant
-        if not CONF.network.public_router_id:
-            cls.floating_ip_access = True
-        else:
-            cls.floating_ip_access = False
+        cls.floating_ip_access = not CONF.network.public_router_id
 
-    @classmethod
-    def tearDownClass(cls):
-        super(TestNetworkCrossTenant, cls).tearDownClass()
+    def cleanup_wrapper(self, resource):
+        self.cleanup_resource(resource, self.__class__.__name__)
+
+    def setUp(self):
+        super(TestSecurityGroupsBasicOps, self).setUp()
+        self._deploy_tenant(self.primary_tenant)
+        self._verify_network_details(self.primary_tenant)
+        self._verify_mac_addr(self.primary_tenant)
 
     def _create_tenant_keypairs(self, tenant_id):
-        self.keypairs[tenant_id] = self.create_keypair(
+        keypair = self.create_keypair(
             name=data_utils.rand_name('keypair-smoke-'))
+        self.addCleanup(self.cleanup_wrapper, keypair)
+        self.tenants[tenant_id].keypair = keypair
 
     def _create_tenant_security_groups(self, tenant):
-        self.security_groups.setdefault(self.tenant_id, [])
         access_sg = self._create_empty_security_group(
             namestart='secgroup_access-',
             tenant_id=tenant.tenant_id
         )
+        self.addCleanup(self.cleanup_wrapper, access_sg)
+
         # don't use default secgroup since it allows in-tenant traffic
         def_sg = self._create_empty_security_group(
             namestart='secgroup_general-',
             tenant_id=tenant.tenant_id
         )
+        self.addCleanup(self.cleanup_wrapper, def_sg)
         tenant.security_groups.update(access=access_sg, default=def_sg)
         ssh_rule = dict(
             protocol='tcp',
@@ -200,9 +193,9 @@
             port_range_max=22,
             direction='ingress',
         )
-        self._create_security_group_rule(secgroup=access_sg,
-                                         **ssh_rule
-                                         )
+        rule = self._create_security_group_rule(secgroup=access_sg,
+                                                **ssh_rule)
+        self.addCleanup(self.cleanup_wrapper, rule)
 
     def _verify_network_details(self, tenant):
         # Checks that we see the newly created network/subnet/router via
@@ -245,11 +238,12 @@
             'nics': [
                 {'net-id': tenant.network.id},
             ],
-            'key_name': self.keypairs[tenant.tenant_id].name,
+            'key_name': tenant.keypair.name,
             'security_groups': security_groups,
             'tenant_id': tenant.tenant_id
         }
         server = self.create_server(name=name, create_kwargs=create_kwargs)
+        self.addCleanup(self.cleanup_wrapper, server)
         return server
 
     def _create_tenant_servers(self, tenant, num=1):
@@ -260,7 +254,6 @@
             )
             name = data_utils.rand_name(name)
             server = self._create_server(name, tenant)
-            self.servers.append(server)
             tenant.servers.append(server)
 
     def _set_access_point(self, tenant):
@@ -275,17 +268,20 @@
         name = data_utils.rand_name(name)
         server = self._create_server(name, tenant,
                                      security_groups=secgroups)
-        self.servers.append(server)
         tenant.access_point = server
         self._assign_floating_ips(server)
 
     def _assign_floating_ips(self, server):
         public_network_id = CONF.network.public_network_id
         floating_ip = self._create_floating_ip(server, public_network_id)
+        self.addCleanup(self.cleanup_wrapper, floating_ip)
         self.floating_ips.setdefault(server, floating_ip)
 
     def _create_tenant_network(self, tenant):
-        tenant._set_network(*self._create_networks(tenant.tenant_id))
+        network, subnet, router = self._create_networks(tenant.tenant_id)
+        for r in [network, router, subnet]:
+            self.addCleanup(self.cleanup_wrapper, r)
+        tenant.set_network(network, subnet, router)
 
     def _set_compute_context(self, tenant):
         self.compute_client = tenant.manager.compute_client
@@ -299,8 +295,6 @@
             router (if public not defined)
             access security group
             access-point server
-            for demo_tenant:
-                creates general server to test against
         """
         if not isinstance(tenant_or_id, self.TenantProperties):
             tenant = self.tenants[tenant_or_id]
@@ -312,19 +306,20 @@
         self._create_tenant_keypairs(tenant_id)
         self._create_tenant_network(tenant)
         self._create_tenant_security_groups(tenant)
-        if tenant is self.demo_tenant:
-            self._create_tenant_servers(tenant, num=1)
         self._set_access_point(tenant)
 
     def _get_server_ip(self, server, floating=False):
-        '''
+        """
         returns the ip (floating/internal) of a server
-        '''
+        """
         if floating:
-            return self.floating_ips[server].floating_ip_address
+            server_ip = self.floating_ips[server].floating_ip_address
         else:
+            server_ip = None
             network_name = self.tenants[server.tenant_id].network.name
-            return server.networks[network_name][0]
+            if network_name in server.networks:
+                server_ip = server.networks[network_name][0]
+        return server_ip
 
     def _connect_to_access_point(self, tenant):
         """
@@ -332,7 +327,7 @@
         """
         access_point_ssh = \
             self.floating_ips[tenant.access_point].floating_ip_address
-        private_key = self.keypairs[tenant.tenant_id].private_key
+        private_key = tenant.keypair.private_key
         access_point_ssh = self._ssh_to_server(access_point_ssh,
                                                private_key=private_key)
         return access_point_ssh
@@ -355,9 +350,9 @@
                 return not should_succeed
             return should_succeed
 
-        return call_until_true(ping_remote,
-                               CONF.compute.ping_timeout,
-                               1)
+        return test.call_until_true(ping_remote,
+                                    CONF.compute.ping_timeout,
+                                    1)
 
     def _check_connectivity(self, access_point, ip, should_succeed=True):
         if should_succeed:
@@ -391,17 +386,17 @@
             secgroup=tenant.security_groups['default'],
             **ruleset
         )
+        self.addCleanup(self.cleanup_wrapper, rule)
         access_point_ssh = self._connect_to_access_point(tenant)
         for server in tenant.servers:
             self._check_connectivity(access_point=access_point_ssh,
                                      ip=self._get_server_ip(server))
-        rule.delete()
 
     def _test_cross_tenant_block(self, source_tenant, dest_tenant):
-        '''
+        """
         if public router isn't defined, then dest_tenant access is via
         floating-ip
-        '''
+        """
         access_point_ssh = self._connect_to_access_point(source_tenant)
         ip = self._get_server_ip(dest_tenant.access_point,
                                  floating=self.floating_ip_access)
@@ -409,10 +404,10 @@
                                  should_succeed=False)
 
     def _test_cross_tenant_allow(self, source_tenant, dest_tenant):
-        '''
+        """
         check for each direction:
         creating rule for tenant incoming traffic enables only 1way traffic
-        '''
+        """
         ruleset = dict(
             protocol='icmp',
             direction='ingress'
@@ -421,37 +416,26 @@
             secgroup=dest_tenant.security_groups['default'],
             **ruleset
         )
-        try:
-            access_point_ssh = self._connect_to_access_point(source_tenant)
-            ip = self._get_server_ip(dest_tenant.access_point,
-                                     floating=self.floating_ip_access)
-            self._check_connectivity(access_point_ssh, ip)
+        self.addCleanup(self.cleanup_wrapper, rule_s2d)
+        access_point_ssh = self._connect_to_access_point(source_tenant)
+        ip = self._get_server_ip(dest_tenant.access_point,
+                                 floating=self.floating_ip_access)
+        self._check_connectivity(access_point_ssh, ip)
 
-            # test that reverse traffic is still blocked
-            self._test_cross_tenant_block(dest_tenant, source_tenant)
+        # test that reverse traffic is still blocked
+        self._test_cross_tenant_block(dest_tenant, source_tenant)
 
-            # allow reverse traffic and check
-            rule_d2s = self._create_security_group_rule(
-                secgroup=source_tenant.security_groups['default'],
-                **ruleset
-            )
-            try:
-                access_point_ssh_2 = self._connect_to_access_point(dest_tenant)
-                ip = self._get_server_ip(source_tenant.access_point,
-                                         floating=self.floating_ip_access)
-                self._check_connectivity(access_point_ssh_2, ip)
+        # allow reverse traffic and check
+        rule_d2s = self._create_security_group_rule(
+            secgroup=source_tenant.security_groups['default'],
+            **ruleset
+        )
+        self.addCleanup(self.cleanup_wrapper, rule_d2s)
 
-                # clean_rules
-                rule_s2d.delete()
-                rule_d2s.delete()
-
-            except Exception as e:
-                rule_d2s.delete()
-                raise e
-
-        except Exception as e:
-            rule_s2d.delete()
-            raise e
+        access_point_ssh_2 = self._connect_to_access_point(dest_tenant)
+        ip = self._get_server_ip(source_tenant.access_point,
+                                 floating=self.floating_ip_access)
+        self._check_connectivity(access_point_ssh_2, ip)
 
     def _verify_mac_addr(self, tenant):
         """
@@ -471,24 +455,36 @@
         subnet_id = tenant.subnet.id
         self.assertIn((subnet_id, server_ip, mac_addr), port_detail_list)
 
-    @attr(type='smoke')
-    @services('compute', 'network')
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
     def test_cross_tenant_traffic(self):
         try:
-            for tenant_id in self.tenants.keys():
-                self._deploy_tenant(tenant_id)
-                self._verify_network_details(self.tenants[tenant_id])
-                self._verify_mac_addr(self.tenants[tenant_id])
-
-            # in-tenant check
-            self._test_in_tenant_block(self.demo_tenant)
-            self._test_in_tenant_allow(self.demo_tenant)
+            # deploy new tenant
+            self._deploy_tenant(self.alt_tenant)
+            self._verify_network_details(self.alt_tenant)
+            self._verify_mac_addr(self.alt_tenant)
 
             # cross tenant check
-            source_tenant = self.demo_tenant
+            source_tenant = self.primary_tenant
             dest_tenant = self.alt_tenant
             self._test_cross_tenant_block(source_tenant, dest_tenant)
             self._test_cross_tenant_allow(source_tenant, dest_tenant)
         except Exception:
-            self._log_console_output(servers=self.servers)
+            for tenant in self.tenants.values():
+                self._log_console_output(servers=tenant.servers)
+            raise
+
+    @test.attr(type='smoke')
+    @test.services('compute', 'network')
+    def test_in_tenant_traffic(self):
+        try:
+            self._create_tenant_servers(self.primary_tenant, num=1)
+
+            # in-tenant check
+            self._test_in_tenant_block(self.primary_tenant)
+            self._test_in_tenant_allow(self.primary_tenant)
+
+        except Exception:
+            for tenant in self.tenants.values():
+                self._log_console_output(servers=tenant.servers)
             raise
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index 9626157..c0eb6e7 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -16,7 +16,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -47,7 +47,7 @@
             msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
             raise cls.skipException(msg)
 
-    @services('compute')
+    @test.services('compute')
     def test_resize_server_confirm(self):
         # We create an instance for use in this test
         instance = self.create_server()
@@ -65,7 +65,7 @@
         self.status_timeout(
             self.compute_client.servers, instance_id, 'ACTIVE')
 
-    @services('compute')
+    @test.services('compute')
     def test_server_sequence_suspend_resume(self):
         # We create an instance for use in this test
         instance = self.create_server()
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 73ff6b4..d369f12 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -18,7 +18,7 @@
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 import testscenarios
 
@@ -26,10 +26,6 @@
 
 LOG = logging.getLogger(__name__)
 
-# NOTE(andreaf) - nose does not honour the load_tests protocol
-# however it's test discovery regex will match anything
-# which includes _tests. So nose would require some further
-# investigation to be supported with this
 load_tests = testscenarios.load_tests_apply_scenarios
 
 
@@ -162,7 +158,7 @@
                 self._log_console_output()
                 raise
 
-    @services('compute', 'network')
+    @test.services('compute', 'network')
     def test_server_basicops(self):
         self.add_keypair()
         self.create_security_group()
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 2bb3d84..37beb07 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -16,7 +16,7 @@
 from tempest import config
 from tempest.openstack.common import log
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -69,7 +69,7 @@
     def _set_floating_ip_to_server(self, server, floating_ip):
         server.add_floating_ip(floating_ip)
 
-    @services('compute', 'network', 'image')
+    @test.services('compute', 'network', 'image')
     def test_snapshot_pattern(self):
         # prepare for booting a instance
         self._add_keypair()
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 8d043ae..841f9e1 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -114,7 +114,7 @@
         detach_volume_client(server.id, volume.id)
         self._wait_for_volume_status(volume, 'available')
 
-    def _wait_for_volume_availible_on_the_system(self, server_or_ip):
+    def _wait_for_volume_available_on_the_system(self, server_or_ip):
         ssh = self.get_remote_client(server_or_ip)
 
         def _func():
@@ -161,7 +161,7 @@
             ip_for_server = server
 
         self._attach_volume(server, volume)
-        self._wait_for_volume_availible_on_the_system(ip_for_server)
+        self._wait_for_volume_available_on_the_system(ip_for_server)
         self._create_timestamp(ip_for_server)
         self._detach_volume(server, volume)
 
@@ -189,7 +189,7 @@
 
         # attach volume2 to instance2
         self._attach_volume(server_from_snapshot, volume_from_snapshot)
-        self._wait_for_volume_availible_on_the_system(ip_for_snapshot)
+        self._wait_for_volume_available_on_the_system(ip_for_snapshot)
 
         # check the existence of the timestamp file in the volume2
         self._check_timestamp(ip_for_snapshot)
diff --git a/tempest/scenario/test_swift_basic_ops.py b/tempest/scenario/test_swift_basic_ops.py
index 60df606..86e0867 100644
--- a/tempest/scenario/test_swift_basic_ops.py
+++ b/tempest/scenario/test_swift_basic_ops.py
@@ -14,11 +14,11 @@
 #    under the License.
 
 
-from tempest.common.utils.data_utils import rand_name
+from tempest.common.utils import data_utils
 from tempest import config
 from tempest.openstack.common import log as logging
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -53,7 +53,8 @@
         LOG.debug('Swift status information obtained successfully')
 
     def _create_container(self, container_name=None):
-        name = container_name or rand_name('swift-scenario-container')
+        name = container_name or data_utils.rand_name(
+            'swift-scenario-container')
         self.object_storage_client.put_container(name)
         # look for the container to assure it is created
         self._list_and_check_container_objects(name)
@@ -65,9 +66,9 @@
         LOG.debug('Container %s deleted' % (container_name))
 
     def _upload_object_to_container(self, container_name, obj_name=None):
-        obj_name = obj_name or rand_name('swift-scenario-object')
+        obj_name = obj_name or data_utils.rand_name('swift-scenario-object')
         self.object_storage_client.put_object(container_name, obj_name,
-                                              rand_name('obj_data'),
+                                              data_utils.rand_name('obj_data'),
                                               content_type='text/plain')
         return obj_name
 
@@ -93,7 +94,7 @@
             for obj in not_present_obj:
                 self.assertNotIn(obj, object_list)
 
-    @services('object_storage')
+    @test.services('object_storage')
     def test_swift_basic_ops(self):
         self._get_swift_stat()
         container_name = self._create_container()
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 7b002eb..9a250d7 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -14,7 +14,7 @@
 from tempest import config
 from tempest.openstack.common import log
 from tempest.scenario import manager
-from tempest.test import services
+from tempest import test
 
 CONF = config.CONF
 
@@ -127,7 +127,7 @@
         actual = self._get_content(ssh_client)
         self.assertEqual(expected, actual)
 
-    @services('compute', 'volume', 'image')
+    @test.services('compute', 'volume', 'image')
     def test_volume_boot_pattern(self):
         keypair = self.create_keypair()
         self._create_loginable_secgroup_rule_nova()
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 6e86466..5f6b513 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -114,7 +114,7 @@
         """
         uri = self._get_uri(resource, permanent=permanent)
 
-        resp, body = self.get(uri, self.headers)
+        resp, body = self.get(uri)
 
         return resp, self.deserialize(body)
 
@@ -127,7 +127,7 @@
 
         """
         uri = self._get_uri(resource, uuid=uuid, permanent=permanent)
-        resp, body = self.get(uri, self.headers)
+        resp, body = self.get(uri)
 
         return resp, self.deserialize(body)
 
@@ -145,7 +145,7 @@
         body = self.serialize(object_type, object_dict)
         uri = self._get_uri(resource)
 
-        resp, body = self.post(uri, headers=self.headers, body=body)
+        resp, body = self.post(uri, body=body)
 
         return resp, self.deserialize(body)
 
@@ -160,7 +160,7 @@
         """
         uri = self._get_uri(resource, uuid)
 
-        resp, body = self.delete(uri, self.headers)
+        resp, body = self.delete(uri)
         return resp, body
 
     def _patch_request(self, resource, uuid, patch_object):
@@ -176,7 +176,7 @@
         uri = self._get_uri(resource, uuid)
         patch_body = json.dumps(patch_object)
 
-        resp, body = self.patch(uri, headers=self.headers, body=patch_body)
+        resp, body = self.patch(uri, body=patch_body)
         return resp, self.deserialize(body)
 
     @handle_errors
diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py
index 03e87b1..b52d48c 100644
--- a/tempest/services/botoclients.py
+++ b/tempest/services/botoclients.py
@@ -35,6 +35,7 @@
     def __init__(self, username=None, password=None,
                  auth_url=None, tenant_name=None,
                  *args, **kwargs):
+        # FIXME(andreaf) replace credentials and auth_url with auth_provider
 
         self.connection_timeout = str(CONF.boto.http_socket_timeout)
         self.num_retries = str(CONF.boto.num_retries)
@@ -45,6 +46,7 @@
                         "tenant_name": tenant_name}
 
     def _keystone_aws_get(self):
+        # FIXME(andreaf) Move EC2 credentials to AuthProvider
         import keystoneclient.v2_0.client
 
         keystone = keystoneclient.v2_0.client.Client(**self.ks_cred)
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index aa52081..e26f570 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -43,7 +43,7 @@
     def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
         post_body = json.dumps({'aggregate': kwargs})
-        resp, body = self.post('os-aggregates', post_body, self.headers)
+        resp, body = self.post('os-aggregates', post_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -55,8 +55,7 @@
             'availability_zone': availability_zone
         }
         put_body = json.dumps({'aggregate': put_body})
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              put_body, self.headers)
+        resp, body = self.put('os-aggregates/%s' % str(aggregate_id), put_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -79,7 +78,7 @@
         }
         post_body = json.dumps({'add_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -90,7 +89,7 @@
         }
         post_body = json.dumps({'remove_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -101,6 +100,6 @@
         }
         post_body = json.dumps({'set_metadata': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index b7135f6..de0f1a8 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -36,6 +36,6 @@
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = json.loads(body)
         return resp, body['certificate']
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 144b7dc..af750a3 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -36,5 +36,5 @@
     def reserve_fixed_ip(self, ip, body):
         """This reserves and unreserves fixed ips."""
         url = "os-fixed-ips/%s/action" % (ip)
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 96ab6d7..289b09e 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -69,7 +69,7 @@
         if kwargs.get('is_public'):
             post_body['os-flavor-access:is_public'] = kwargs.get('is_public')
         post_body = json.dumps({'flavor': post_body})
-        resp, body = self.post('flavors', post_body, self.headers)
+        resp, body = self.post('flavors', post_body)
 
         body = json.loads(body)
         return resp, body['flavor']
@@ -92,7 +92,7 @@
         """Sets extra Specs to the mentioned flavor."""
         post_body = json.dumps({'extra_specs': specs})
         resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -112,8 +112,7 @@
     def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
         """Update specified extra Specs of the mentioned flavor and key."""
         resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key),
-                              json.dumps(kwargs), self.headers)
+                              (flavor_id, key), json.dumps(kwargs))
         body = json.loads(body)
         return resp, body
 
@@ -124,8 +123,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -137,8 +135,7 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -150,7 +147,6 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 2bf5241..0385160 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -52,7 +52,7 @@
         url = 'os-floating-ips'
         post_body = {'pool': pool_name}
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['floating_ip']
 
@@ -72,7 +72,7 @@
         }
 
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def disassociate_floating_ip_from_server(self, floating_ip, server_id):
@@ -85,7 +85,7 @@
         }
 
         post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def is_resource_deleted(self, id):
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index aa63927..d826a78 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -55,8 +55,7 @@
         request_body.update(**kwargs)
         request_body = json.dumps(request_body)
 
-        resp, body = self.put("os-hosts/%s" % str(hostname), request_body,
-                              self.headers)
+        resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 7324d84..b3d8c35 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -46,7 +46,7 @@
 
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def list_images(self, params=None):
@@ -93,16 +93,14 @@
     def set_image_metadata(self, image_id, meta):
         """Sets the metadata for an image."""
         post_body = json.dumps({'metadata': meta})
-        resp, body = self.put('images/%s/metadata' % str(image_id),
-                              post_body, self.headers)
+        resp, body = self.put('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_image_metadata(self, image_id, meta):
         """Updates the metadata for an image."""
         post_body = json.dumps({'metadata': meta})
-        resp, body = self.post('images/%s/metadata' % str(image_id),
-                               post_body, self.headers)
+        resp, body = self.post('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -116,7 +114,7 @@
         """Sets the value for a specific image metadata key."""
         post_body = json.dumps({'meta': meta})
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['meta']
 
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index d9a2030..f4c4c64 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -46,7 +46,6 @@
             post_body['interfaceAttachment']['fixed_ips'] = [fip]
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/os-interface' % server,
-                               headers=self.headers,
                                body=post_body)
         body = json.loads(body)
         return resp, body['interfaceAttachment']
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index 3e2d4a7..356c2e6 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -47,8 +47,7 @@
         if pub_key:
             post_body['keypair']['public_key'] = pub_key
         post_body = json.dumps(post_body)
-        resp, body = self.post("os-keypairs",
-                               headers=self.headers, body=post_body)
+        resp, body = self.post("os-keypairs", body=post_body)
         body = json.loads(body)
         return resp, body['keypair']
 
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 2007d4e..7607cc0 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -96,8 +96,7 @@
             post_body['security_groups'] = security_groups
 
         post_body = json.dumps({'quota_set': post_body})
-        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body,
-                              self.headers)
+        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body)
 
         body = json.loads(body)
         return resp, body['quota_set']
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index edaf4a3..2cd2d2e 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -58,7 +58,7 @@
             'description': description,
         }
         post_body = json.dumps({'security_group': post_body})
-        resp, body = self.post('os-security-groups', post_body, self.headers)
+        resp, body = self.post('os-security-groups', post_body)
         body = json.loads(body)
         return resp, body['security_group']
 
@@ -77,7 +77,7 @@
             post_body['description'] = description
         post_body = json.dumps({'security_group': post_body})
         resp, body = self.put('os-security-groups/%s' % str(security_group_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['security_group']
 
@@ -107,7 +107,7 @@
         }
         post_body = json.dumps({'security_group_rule': post_body})
         url = 'os-security-group-rules'
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['security_group_rule']
 
@@ -123,3 +123,10 @@
             if sg['id'] == security_group_id:
                 return resp, sg['rules']
         raise exceptions.NotFound('No such Security Group')
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_security_group(id)
+        except exceptions.NotFound:
+            return True
+        return False
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 371a59c..025c4e5 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -78,7 +78,7 @@
             if value is not None:
                 post_body[post_param] = value
         post_body = json.dumps({'server': post_body})
-        resp, body = self.post('servers', post_body, self.headers)
+        resp, body = self.post('servers', post_body)
 
         body = json.loads(body)
         # NOTE(maurosr): this deals with the case of multiple server create
@@ -116,8 +116,7 @@
             post_body['OS-DCF:diskConfig'] = disk_config
 
         post_body = json.dumps({'server': post_body})
-        resp, body = self.put("servers/%s" % str(server_id),
-                              post_body, self.headers)
+        resp, body = self.put("servers/%s" % str(server_id), post_body)
         body = json.loads(body)
         return resp, body['server']
 
@@ -194,7 +193,7 @@
     def action(self, server_id, action_name, response_key, **kwargs):
         post_body = json.dumps({action_name: kwargs})
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         if response_key is not None:
             body = json.loads(body)[response_key]
         return resp, body
@@ -269,14 +268,14 @@
         else:
             post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_server_metadata(self, server_id, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.post('servers/%s/metadata' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -288,7 +287,7 @@
     def set_server_metadata_item(self, server_id, key, meta):
         post_body = json.dumps({'meta': meta})
         resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['meta']
 
@@ -312,7 +311,7 @@
             }
         })
         resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def detach_volume(self, server_id, volume_id):
@@ -340,8 +339,7 @@
 
         req_body = json.dumps({'os-migrateLive': migrate_params})
 
-        resp, body = self.post("servers/%s/action" % str(server_id),
-                               req_body, self.headers)
+        resp, body = self.post("servers/%s/action" % str(server_id), req_body)
         return resp, body
 
     def migrate_server(self, server_id, **kwargs):
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 4abee47..8380dc2 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -45,7 +45,7 @@
         binary: Service binary
         """
         post_body = json.dumps({'binary': binary, 'host': host_name})
-        resp, body = self.put('os-services/enable', post_body, self.headers)
+        resp, body = self.put('os-services/enable', post_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -56,6 +56,6 @@
         binary: Service binary
         """
         post_body = json.dumps({'binary': binary, 'host': host_name})
-        resp, body = self.put('os-services/disable', post_body, self.headers)
+        resp, body = self.put('os-services/disable', post_body)
         body = json.loads(body)
         return resp, body['service']
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index ba7b5df..4b9dc0b 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -75,7 +75,7 @@
         }
 
         post_body = json.dumps({'volume': post_body})
-        resp, body = self.post('os-volumes', post_body, self.headers)
+        resp, body = self.post('os-volumes', post_body)
         body = json.loads(body)
         return resp, body['volume']
 
diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py
index 6bc758c..20ce87b 100644
--- a/tempest/services/compute/v3/json/aggregates_client.py
+++ b/tempest/services/compute/v3/json/aggregates_client.py
@@ -43,7 +43,7 @@
     def create_aggregate(self, **kwargs):
         """Creates a new aggregate."""
         post_body = json.dumps({'aggregate': kwargs})
-        resp, body = self.post('os-aggregates', post_body, self.headers)
+        resp, body = self.post('os-aggregates', post_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -55,8 +55,7 @@
             'availability_zone': availability_zone
         }
         put_body = json.dumps({'aggregate': put_body})
-        resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              put_body, self.headers)
+        resp, body = self.put('os-aggregates/%s' % str(aggregate_id), put_body)
 
         body = json.loads(body)
         return resp, body['aggregate']
@@ -79,7 +78,7 @@
         }
         post_body = json.dumps({'add_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -90,7 +89,7 @@
         }
         post_body = json.dumps({'remove_host': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
 
@@ -101,6 +100,6 @@
         }
         post_body = json.dumps({'set_metadata': post_body})
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['aggregate']
diff --git a/tempest/services/compute/v3/json/certificates_client.py b/tempest/services/compute/v3/json/certificates_client.py
index 0c9f9ac..620eedf 100644
--- a/tempest/services/compute/v3/json/certificates_client.py
+++ b/tempest/services/compute/v3/json/certificates_client.py
@@ -36,6 +36,6 @@
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = json.loads(body)
         return resp, body['certificate']
diff --git a/tempest/services/compute/v3/json/flavors_client.py b/tempest/services/compute/v3/json/flavors_client.py
index df3d0c1..f9df2b8 100644
--- a/tempest/services/compute/v3/json/flavors_client.py
+++ b/tempest/services/compute/v3/json/flavors_client.py
@@ -69,7 +69,7 @@
         if kwargs.get('is_public'):
             post_body['flavor-access:is_public'] = kwargs.get('is_public')
         post_body = json.dumps({'flavor': post_body})
-        resp, body = self.post('flavors', post_body, self.headers)
+        resp, body = self.post('flavors', post_body)
 
         body = json.loads(body)
         return resp, body['flavor']
@@ -92,7 +92,7 @@
         """Sets extra Specs to the mentioned flavor."""
         post_body = json.dumps({'extra_specs': specs})
         resp, body = self.post('flavors/%s/flavor-extra-specs' % flavor_id,
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -112,8 +112,7 @@
     def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
         """Update specified extra Specs of the mentioned flavor and key."""
         resp, body = self.put('flavors/%s/flavor-extra-specs/%s' %
-                              (flavor_id, key),
-                              json.dumps(kwargs), self.headers)
+                              (flavor_id, key), json.dumps(kwargs))
         body = json.loads(body)
         return resp, body
 
@@ -124,8 +123,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/flavor-access' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/flavor-access' % flavor_id)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -137,8 +135,7 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
 
@@ -150,7 +147,6 @@
             }
         }
         post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id,
-                               post_body, self.headers)
+        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
         body = json.loads(body)
         return resp, body['flavor_access']
diff --git a/tempest/services/compute/v3/json/hosts_client.py b/tempest/services/compute/v3/json/hosts_client.py
index e33dd5f..76af626 100644
--- a/tempest/services/compute/v3/json/hosts_client.py
+++ b/tempest/services/compute/v3/json/hosts_client.py
@@ -55,8 +55,7 @@
         request_body.update(**kwargs)
         request_body = json.dumps({'host': request_body})
 
-        resp, body = self.put("os-hosts/%s" % str(hostname), request_body,
-                              self.headers)
+        resp, body = self.put("os-hosts/%s" % str(hostname), request_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py b/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
deleted file mode 100644
index 3a6ac5f..0000000
--- a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 IBM Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import json
-
-from tempest.common.rest_client import RestClient
-from tempest import config
-
-CONF = config.CONF
-
-
-class InstanceUsagesAuditLogV3ClientJSON(RestClient):
-
-    def __init__(self, auth_provider):
-        super(InstanceUsagesAuditLogV3ClientJSON, self).__init__(
-            auth_provider)
-        self.service = CONF.compute.catalog_v3_type
-
-    def list_instance_usage_audit_logs(self, time_before=None):
-        if time_before:
-            url = 'os-instance-usage-audit-log?before=%s' % time_before
-        else:
-            url = 'os-instance-usage-audit-log'
-        resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body["instance_usage_audit_log"]
diff --git a/tempest/services/compute/v3/json/interfaces_client.py b/tempest/services/compute/v3/json/interfaces_client.py
index 053b9af..c167520 100644
--- a/tempest/services/compute/v3/json/interfaces_client.py
+++ b/tempest/services/compute/v3/json/interfaces_client.py
@@ -45,7 +45,6 @@
             post_body['fixed_ips'] = [dict(ip_address=fixed_ip)]
         post_body = json.dumps({'interface_attachment': post_body})
         resp, body = self.post('servers/%s/os-attach-interfaces' % server,
-                               headers=self.headers,
                                body=post_body)
         body = json.loads(body)
         return resp, body['interface_attachment']
diff --git a/tempest/services/compute/v3/json/keypairs_client.py b/tempest/services/compute/v3/json/keypairs_client.py
index 05dbe25..821b86f 100644
--- a/tempest/services/compute/v3/json/keypairs_client.py
+++ b/tempest/services/compute/v3/json/keypairs_client.py
@@ -47,8 +47,7 @@
         if pub_key:
             post_body['keypair']['public_key'] = pub_key
         post_body = json.dumps(post_body)
-        resp, body = self.post("keypairs",
-                               headers=self.headers, body=post_body)
+        resp, body = self.post("keypairs", body=post_body)
         body = json.loads(body)
         return resp, body['keypair']
 
diff --git a/tempest/services/compute/v3/json/quotas_client.py b/tempest/services/compute/v3/json/quotas_client.py
index 1ec8651..aa8bfaf 100644
--- a/tempest/services/compute/v3/json/quotas_client.py
+++ b/tempest/services/compute/v3/json/quotas_client.py
@@ -35,6 +35,14 @@
         body = json.loads(body)
         return resp, body['quota_set']
 
+    def get_quota_set_detail(self, tenant_id):
+        """Get the quota set detail for a tenant."""
+
+        url = 'os-quota-sets/%s/detail' % str(tenant_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['quota_set']
+
     def get_default_quota_set(self, tenant_id):
         """List the default quota set for a tenant."""
 
@@ -84,8 +92,7 @@
             post_body['security_groups'] = security_groups
 
         post_body = json.dumps({'quota_set': post_body})
-        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body,
-                              self.headers)
+        resp, body = self.put('os-quota-sets/%s' % str(tenant_id), post_body)
 
         body = json.loads(body)
         return resp, body['quota_set']
diff --git a/tempest/services/compute/v3/json/servers_client.py b/tempest/services/compute/v3/json/servers_client.py
index 11538f5..840e914 100644
--- a/tempest/services/compute/v3/json/servers_client.py
+++ b/tempest/services/compute/v3/json/servers_client.py
@@ -84,7 +84,7 @@
             if value is not None:
                 post_body[post_param] = value
         post_body = json.dumps({'server': post_body})
-        resp, body = self.post('servers', post_body, self.headers)
+        resp, body = self.post('servers', post_body)
 
         body = json.loads(body)
         # NOTE(maurosr): this deals with the case of multiple server create
@@ -121,8 +121,7 @@
             post_body['os-disk-config:disk_config'] = disk_config
 
         post_body = json.dumps({'server': post_body})
-        resp, body = self.put("servers/%s" % str(server_id),
-                              post_body, self.headers)
+        resp, body = self.put("servers/%s" % str(server_id), post_body)
         body = json.loads(body)
         return resp, body['server']
 
@@ -199,7 +198,7 @@
     def action(self, server_id, action_name, response_key, **kwargs):
         post_body = json.dumps({action_name: kwargs})
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         if response_key is not None:
             body = json.loads(body)[response_key]
         return resp, body
@@ -216,6 +215,21 @@
         return self.action(server_id, 'change_password', None,
                            admin_password=admin_password)
 
+    def get_password(self, server_id):
+        resp, body = self.get("servers/%s/os-server-password" %
+                              str(server_id))
+        body = json.loads(body)
+        return resp, body
+
+    def delete_password(self, server_id):
+        """
+        Removes the encrypted server password from the metadata server
+        Note that this does not actually change the instance server
+        password.
+        """
+        return self.delete("servers/%s/os-server-password" %
+                           str(server_id))
+
     def reboot(self, server_id, reboot_type):
         """Reboots a server."""
         return self.action(server_id, 'reboot', None, type=reboot_type)
@@ -258,7 +272,7 @@
 
         post_body = json.dumps(post_body)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         return resp, body
 
     def list_server_metadata(self, server_id):
@@ -272,14 +286,14 @@
         else:
             post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def update_server_metadata(self, server_id, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.post('servers/%s/metadata' % str(server_id),
-                               post_body, self.headers)
+                               post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -291,7 +305,7 @@
     def set_server_metadata_item(self, server_id, key, meta):
         post_body = json.dumps({'metadata': meta})
         resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -327,7 +341,7 @@
         req_body = json.dumps({'migrate_live': migrate_params})
 
         resp, body = self.post("servers/%s/action" % str(server_id),
-                               req_body, self.headers)
+                               req_body)
         return resp, body
 
     def migrate_server(self, server_id, **kwargs):
diff --git a/tempest/services/compute/v3/json/services_client.py b/tempest/services/compute/v3/json/services_client.py
index 1082ea9..e20dfde 100644
--- a/tempest/services/compute/v3/json/services_client.py
+++ b/tempest/services/compute/v3/json/services_client.py
@@ -50,7 +50,7 @@
                 'host': host_name
             }
         })
-        resp, body = self.put('os-services/enable', post_body, self.headers)
+        resp, body = self.put('os-services/enable', post_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -66,6 +66,6 @@
                 'host': host_name
             }
         })
-        resp, body = self.put('os-services/disable', post_body, self.headers)
+        resp, body = self.put('os-services/disable', post_body)
         body = json.loads(body)
         return resp, body['service']
diff --git a/tempest/services/compute/v3/json/tenant_usages_client.py b/tempest/services/compute/v3/json/tenant_usages_client.py
deleted file mode 100644
index 6d59e20..0000000
--- a/tempest/services/compute/v3/json/tenant_usages_client.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2013 NEC Corporation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import json
-import urllib
-
-from tempest.common.rest_client import RestClient
-from tempest import config
-
-CONF = config.CONF
-
-
-class TenantUsagesV3ClientJSON(RestClient):
-
-    def __init__(self, auth_provider):
-        super(TenantUsagesV3ClientJSON, self).__init__(auth_provider)
-        self.service = CONF.compute.catalog_v3_type
-
-    def list_tenant_usages(self, params=None):
-        url = 'os-simple-tenant-usage'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body['tenant_usages'][0]
-
-    def get_tenant_usage(self, tenant_id, params=None):
-        url = 'os-simple-tenant-usage/%s' % tenant_id
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body['tenant_usage']
diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py
index ba08f58..5b250ee 100644
--- a/tempest/services/compute/xml/aggregates_client.py
+++ b/tempest/services/compute/xml/aggregates_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -26,7 +26,8 @@
 CONF = config.CONF
 
 
-class AggregatesClientXML(RestClientXML):
+class AggregatesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(AggregatesClientXML, self).__init__(auth_provider)
@@ -51,14 +52,13 @@
 
     def list_aggregates(self):
         """Get aggregate list."""
-        resp, body = self.get("os-aggregates", self.headers)
+        resp, body = self.get("os-aggregates")
         aggregates = self._parse_array(etree.fromstring(body))
         return resp, aggregates
 
     def get_aggregate(self, aggregate_id):
         """Get details of the given aggregate."""
-        resp, body = self.get("os-aggregates/%s" % str(aggregate_id),
-                              self.headers)
+        resp, body = self.get("os-aggregates/%s" % str(aggregate_id))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -68,8 +68,7 @@
                             name=name,
                             availability_zone=availability_zone)
         resp, body = self.post('os-aggregates',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -79,15 +78,13 @@
                            name=name,
                            availability_zone=availability_zone)
         resp, body = self.put('os-aggregates/%s' % str(aggregate_id),
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
     def delete_aggregate(self, aggregate_id):
         """Deletes the given aggregate."""
-        return self.delete("os-aggregates/%s" % str(aggregate_id),
-                           self.headers)
+        return self.delete("os-aggregates/%s" % str(aggregate_id))
 
     def is_resource_deleted(self, id):
         try:
@@ -100,8 +97,7 @@
         """Adds a host to the given aggregate."""
         post_body = Element("add_host", host=host)
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -109,8 +105,7 @@
         """Removes a host from the given aggregate."""
         post_body = Element("remove_host", host=host)
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
 
@@ -124,7 +119,6 @@
             meta.append(Text(v))
             metadata.append(meta)
         resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         aggregate = self._format_aggregate(etree.fromstring(body))
         return resp, aggregate
diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py
index 38280b5..4d71186 100644
--- a/tempest/services/compute/xml/availability_zone_client.py
+++ b/tempest/services/compute/xml/availability_zone_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class AvailabilityZoneClientXML(RestClientXML):
+class AvailabilityZoneClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(AvailabilityZoneClientXML, self).__init__(
@@ -33,11 +34,11 @@
         return [xml_to_json(x) for x in node]
 
     def get_availability_zone_list(self):
-        resp, body = self.get('os-availability-zone', self.headers)
+        resp, body = self.get('os-availability-zone')
         availability_zone = self._parse_array(etree.fromstring(body))
         return resp, availability_zone
 
     def get_availability_zone_list_detail(self):
-        resp, body = self.get('os-availability-zone/detail', self.headers)
+        resp, body = self.get('os-availability-zone/detail')
         availability_zone = self._parse_array(etree.fromstring(body))
         return resp, availability_zone
diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py
index aad20a4..24ffca8 100644
--- a/tempest/services/compute/xml/certificates_client.py
+++ b/tempest/services/compute/xml/certificates_client.py
@@ -14,13 +14,14 @@
 #    under the License.
 
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 
 CONF = config.CONF
 
 
-class CertificatesClientXML(RestClientXML):
+class CertificatesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(CertificatesClientXML, self).__init__(auth_provider)
@@ -28,13 +29,13 @@
 
     def get_certificate(self, id):
         url = "os-certificates/%s" % (id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_resp(body)
         return resp, body
 
     def create_certificate(self):
         """create certificates."""
         url = "os-certificates"
-        resp, body = self.post(url, None, self.headers)
+        resp, body = self.post(url, None)
         body = self._parse_resp(body)
         return resp, body
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
index 9753ca8..3e8254c 100644
--- a/tempest/services/compute/xml/extensions_client.py
+++ b/tempest/services/compute/xml/extensions_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class ExtensionsClientXML(RestClientXML):
+class ExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ExtensionsClientXML, self).__init__(auth_provider)
@@ -36,7 +37,7 @@
 
     def list_extensions(self):
         url = 'extensions'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -46,6 +47,6 @@
         return any([e for e in exts if e['name'] == extension])
 
     def get_extension(self, extension_alias):
-        resp, body = self.get('extensions/%s' % extension_alias, self.headers)
+        resp, body = self.get('extensions/%s' % extension_alias)
         body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py
index 599e168..0475530 100644
--- a/tempest/services/compute/xml/fixed_ips_client.py
+++ b/tempest/services/compute/xml/fixed_ips_client.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -23,7 +23,8 @@
 CONF = config.CONF
 
 
-class FixedIPsClientXML(RestClientXML):
+class FixedIPsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(FixedIPsClientXML, self).__init__(auth_provider)
@@ -31,7 +32,7 @@
 
     def get_fixed_ip_details(self, fixed_ip):
         url = "os-fixed-ips/%s" % (fixed_ip)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_resp(body)
         return resp, body
 
@@ -44,5 +45,5 @@
         key, value = body.popitem()
         xml_body = Element(key)
         xml_body.append(Text(value))
-        resp, body = self.post(url, str(Document(xml_body)), self.headers)
+        resp, body = self.post(url, str(Document(xml_body)))
         return resp, body
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index fb16d20..68a27c9 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -33,7 +33,8 @@
     "http://docs.openstack.org/compute/ext/flavor_access/api/v2"
 
 
-class FlavorsClientXML(RestClientXML):
+class FlavorsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(FlavorsClientXML, self).__init__(auth_provider)
@@ -81,7 +82,7 @@
         if params:
             url += "?%s" % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         flavors = self._parse_array(etree.fromstring(body))
         return resp, flavors
 
@@ -94,7 +95,7 @@
         return self._list_flavors(url, params)
 
     def get_flavor_details(self, flavor_id):
-        resp, body = self.get("flavors/%s" % str(flavor_id), self.headers)
+        resp, body = self.get("flavors/%s" % str(flavor_id))
         body = xml_to_json(etree.fromstring(body))
         flavor = self._format_flavor(body)
         return resp, flavor
@@ -120,14 +121,14 @@
                             kwargs.get('is_public'))
         flavor.add_attr('xmlns:OS-FLV-EXT-DATA', XMLNS_OS_FLV_EXT_DATA)
         flavor.add_attr('xmlns:os-flavor-access', XMLNS_OS_FLV_ACCESS)
-        resp, body = self.post('flavors', str(Document(flavor)), self.headers)
+        resp, body = self.post('flavors', str(Document(flavor)))
         body = xml_to_json(etree.fromstring(body))
         flavor = self._format_flavor(body)
         return resp, flavor
 
     def delete_flavor(self, flavor_id):
         """Deletes the given flavor."""
-        return self.delete("flavors/%s" % str(flavor_id), self.headers)
+        return self.delete("flavors/%s" % str(flavor_id))
 
     def is_resource_deleted(self, id):
         # Did not use get_flavor_details(id) for verification as it gives
@@ -145,21 +146,20 @@
         for key in specs.keys():
             extra_specs.add_attr(key, specs[key])
         resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               str(Document(extra_specs)), self.headers)
+                               str(Document(extra_specs)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
     def get_flavor_extra_spec(self, flavor_id):
         """Gets extra Specs of the mentioned flavor."""
-        resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id,
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
     def get_flavor_extra_spec_with_key(self, flavor_id, key):
         """Gets extra Specs key-value of the mentioned flavor and key."""
         resp, xml_body = self.get('flavors/%s/os-extra_specs/%s' %
-                                  (str(flavor_id), key), self.headers)
+                                  (str(flavor_id), key))
         body = {}
         element = etree.fromstring(xml_body)
         key = element.get('key')
@@ -176,8 +176,7 @@
             element.append(value)
 
         resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key),
-                              str(doc), self.headers)
+                              (flavor_id, key), str(doc))
         body = xml_to_json(etree.fromstring(body))
         return resp, {key: body}
 
@@ -191,8 +190,7 @@
 
     def list_flavor_access(self, flavor_id):
         """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % str(flavor_id),
-                              self.headers)
+        resp, body = self.get('flavors/%s/os-flavor-access' % str(flavor_id))
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -202,8 +200,7 @@
         server = Element("addTenantAccess")
         doc.append(server)
         server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
+        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
         body = self._parse_array_access(etree.fromstring(body))
         return resp, body
 
@@ -213,7 +210,6 @@
         server = Element("removeTenantAccess")
         doc.append(server)
         server.add_attr("tenant", tenant_id)
-        resp, body = self.post('flavors/%s/action' % str(flavor_id),
-                               str(doc), self.headers)
+        resp, body = self.post('flavors/%s/action' % str(flavor_id), str(doc))
         body = self._parse_array_access(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
index 0119d8a..be54753 100644
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 import urllib
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -27,7 +27,9 @@
 CONF = config.CONF
 
 
-class FloatingIPsClientXML(RestClientXML):
+class FloatingIPsClientXML(rest_client.RestClient):
+    TYPE = "xml"
+
     def __init__(self, auth_provider):
         super(FloatingIPsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
@@ -48,14 +50,14 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_floating_ip_details(self, floating_ip_id):
         """Get the details of a floating IP."""
         url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_floating_ip(etree.fromstring(body))
         if resp.status == 404:
             raise exceptions.NotFound(body)
@@ -69,16 +71,16 @@
             pool = Element("pool")
             pool.append(Text(pool_name))
             doc.append(pool)
-            resp, body = self.post(url, str(doc), self.headers)
+            resp, body = self.post(url, str(doc))
         else:
-            resp, body = self.post(url, None, self.headers)
+            resp, body = self.post(url, None)
         body = self._parse_floating_ip(etree.fromstring(body))
         return resp, body
 
     def delete_floating_ip(self, floating_ip_id):
         """Deletes the provided floating IP from the project."""
         url = "os-floating-ips/%s" % str(floating_ip_id)
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
 
     def associate_floating_ip_to_server(self, floating_ip, server_id):
@@ -88,7 +90,7 @@
         server = Element("addFloatingIp")
         doc.append(server)
         server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc), self.headers)
+        resp, body = self.post(url, str(doc))
         return resp, body
 
     def disassociate_floating_ip_from_server(self, floating_ip, server_id):
@@ -98,7 +100,7 @@
         server = Element("removeFloatingIp")
         doc.append(server)
         server.add_attr("address", floating_ip)
-        resp, body = self.post(url, str(doc), self.headers)
+        resp, body = self.post(url, str(doc))
         return resp, body
 
     def is_resource_deleted(self, id):
@@ -114,6 +116,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py
index daa83c9..b74cd04 100644
--- a/tempest/services/compute/xml/hosts_client.py
+++ b/tempest/services/compute/xml/hosts_client.py
@@ -15,7 +15,7 @@
 import urllib
 
 from lxml import etree
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -24,7 +24,8 @@
 CONF = config.CONF
 
 
-class HostsClientXML(RestClientXML):
+class HostsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(HostsClientXML, self).__init__(auth_provider)
@@ -37,7 +38,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -45,7 +46,7 @@
     def show_host_detail(self, hostname):
         """Show detail information for the host."""
 
-        resp, body = self.get("os-hosts/%s" % str(hostname), self.headers)
+        resp, body = self.get("os-hosts/%s" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(node)]
         return resp, body
@@ -58,8 +59,7 @@
             for k, v in kwargs.iteritems():
                 request_body.append(Element(k, v))
         resp, body = self.put("os-hosts/%s" % str(hostname),
-                              str(Document(request_body)),
-                              self.headers)
+                              str(Document(request_body)))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -67,8 +67,7 @@
     def startup_host(self, hostname):
         """Startup a host."""
 
-        resp, body = self.get("os-hosts/%s/startup" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/startup" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -76,8 +75,7 @@
     def shutdown_host(self, hostname):
         """Shutdown a host."""
 
-        resp, body = self.get("os-hosts/%s/shutdown" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/shutdown" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -85,8 +83,7 @@
     def reboot_host(self, hostname):
         """Reboot a host."""
 
-        resp, body = self.get("os-hosts/%s/reboot" % str(hostname),
-                              self.headers)
+        resp, body = self.get("os-hosts/%s/reboot" % str(hostname))
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py
index 5abaad8..ecd7541 100644
--- a/tempest/services/compute/xml/hypervisor_client.py
+++ b/tempest/services/compute/xml/hypervisor_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class HypervisorClientXML(RestClientXML):
+class HypervisorClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(HypervisorClientXML, self).__init__(auth_provider)
@@ -33,46 +34,42 @@
 
     def get_hypervisor_list(self):
         """List hypervisors information."""
-        resp, body = self.get('os-hypervisors', self.headers)
+        resp, body = self.get('os-hypervisors')
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_list_details(self):
         """Show detailed hypervisors information."""
-        resp, body = self.get('os-hypervisors/detail', self.headers)
+        resp, body = self.get('os-hypervisors/detail')
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_show_details(self, hyper_id):
         """Display the details of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s' % hyper_id,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s' % hyper_id)
         hypervisor = xml_to_json(etree.fromstring(body))
         return resp, hypervisor
 
     def get_hypervisor_servers(self, hyper_name):
         """List instances belonging to the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/servers' % hyper_name,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s/servers' % hyper_name)
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
 
     def get_hypervisor_stats(self):
         """Get hypervisor statistics over all compute nodes."""
-        resp, body = self.get('os-hypervisors/statistics', self.headers)
+        resp, body = self.get('os-hypervisors/statistics')
         stats = xml_to_json(etree.fromstring(body))
         return resp, stats
 
     def get_hypervisor_uptime(self, hyper_id):
         """Display the uptime of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
         uptime = xml_to_json(etree.fromstring(body))
         return resp, uptime
 
     def search_hypervisor(self, hyper_name):
         """Search specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/search' % hyper_name,
-                              self.headers)
+        resp, body = self.get('os-hypervisors/%s/search' % hyper_name)
         hypervisors = self._parse_array(etree.fromstring(body))
         return resp, hypervisors
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
index d90a7d8..9d529be 100644
--- a/tempest/services/compute/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest.common import waiters
 from tempest import config
 from tempest import exceptions
@@ -30,7 +30,8 @@
 CONF = config.CONF
 
 
-class ImagesClientXML(RestClientXML):
+class ImagesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ImagesClientXML, self).__init__(auth_provider)
@@ -102,7 +103,7 @@
                 data.append(Text(v))
                 metadata.append(data)
         resp, body = self.post('servers/%s/action' % str(server_id),
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         return resp, body
 
     def list_images(self, params=None):
@@ -111,7 +112,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_images(etree.fromstring(body))
         return resp, body['images']
 
@@ -123,20 +124,20 @@
 
             url = "images/detail?" + param_list
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_images(etree.fromstring(body))
         return resp, body['images']
 
     def get_image(self, image_id):
         """Returns the details of a single image."""
-        resp, body = self.get("images/%s" % str(image_id), self.headers)
+        resp, body = self.get("images/%s" % str(image_id))
         self.expected_success(200, resp)
         body = self._parse_image(etree.fromstring(body))
         return resp, body
 
     def delete_image(self, image_id):
         """Deletes the provided image."""
-        return self.delete("images/%s" % str(image_id), self.headers)
+        return self.delete("images/%s" % str(image_id))
 
     def wait_for_image_status(self, image_id, status):
         """Waits for an image to reach a given status."""
@@ -152,8 +153,7 @@
 
     def list_image_metadata(self, image_id):
         """Lists all metadata items for an image."""
-        resp, body = self.get("images/%s/metadata" % str(image_id),
-                              self.headers)
+        resp, body = self.get("images/%s/metadata" % str(image_id))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -161,7 +161,7 @@
         """Sets the metadata for an image."""
         post_body = self._metadata_body(meta)
         resp, body = self.put('images/%s/metadata' % image_id,
-                              str(Document(post_body)), self.headers)
+                              str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -169,14 +169,14 @@
         """Updates the metadata for an image."""
         post_body = self._metadata_body(meta)
         resp, body = self.post('images/%s/metadata' % str(image_id),
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_image_metadata_item(self, image_id, key):
         """Returns the value for a specific image metadata key."""
         resp, body = self.get("images/%s/metadata/%s.xml" %
-                              (str(image_id), key), self.headers)
+                              (str(image_id), key))
         body = self._parse_metadata(etree.fromstring(body))
         return resp, body
 
@@ -186,7 +186,7 @@
             post_body = Element('meta', key=key)
             post_body.append(Text(v))
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              str(Document(post_body)), self.headers)
+                              str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -194,14 +194,13 @@
         """Sets the value for a specific image metadata key."""
         post_body = Document('meta', Text(meta), key=key)
         resp, body = self.put('images/%s/metadata/%s' % (str(image_id), key),
-                              post_body, self.headers)
+                              post_body)
         body = xml_to_json(etree.fromstring(body))
         return resp, body['meta']
 
     def delete_image_metadata_item(self, image_id, key):
         """Deletes a single image metadata key/value pair."""
-        return self.delete("images/%s/metadata/%s" % (str(image_id), key),
-                           self.headers)
+        return self.delete("images/%s/metadata/%s" % (str(image_id), key))
 
     def is_resource_deleted(self, id):
         try:
diff --git a/tempest/services/compute/xml/instance_usage_audit_log_client.py b/tempest/services/compute/xml/instance_usage_audit_log_client.py
index 562774b..1cd8c07 100644
--- a/tempest/services/compute/xml/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/xml/instance_usage_audit_log_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class InstanceUsagesAuditLogClientXML(RestClientXML):
+class InstanceUsagesAuditLogClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(InstanceUsagesAuditLogClientXML, self).__init__(
@@ -31,12 +32,12 @@
 
     def list_instance_usage_audit_logs(self):
         url = 'os-instance_usage_audit_log'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         instance_usage_audit_logs = xml_to_json(etree.fromstring(body))
         return resp, instance_usage_audit_logs
 
     def get_instance_usage_audit_log(self, time_before):
         url = 'os-instance_usage_audit_log/%s' % time_before
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         instance_usage_audit_log = xml_to_json(etree.fromstring(body))
         return resp, instance_usage_audit_log
diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py
index 4194d7d..5df6187 100644
--- a/tempest/services/compute/xml/interfaces_client.py
+++ b/tempest/services/compute/xml/interfaces_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -28,7 +28,8 @@
 CONF = config.CONF
 
 
-class InterfacesClientXML(RestClientXML):
+class InterfacesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(InterfacesClientXML, self).__init__(auth_provider)
@@ -42,7 +43,7 @@
         return iface
 
     def list_interfaces(self, server):
-        resp, body = self.get('servers/%s/os-interface' % server, self.headers)
+        resp, body = self.get('servers/%s/os-interface' % server)
         node = etree.fromstring(body)
         interfaces = [self._process_xml_interface(x)
                       for x in node.getchildren()]
@@ -70,14 +71,12 @@
             iface.append(_fixed_ips)
         doc.append(iface)
         resp, body = self.post('servers/%s/os-interface' % server,
-                               headers=self.headers,
                                body=str(doc))
         body = self._process_xml_interface(etree.fromstring(body))
         return resp, body
 
     def show_interface(self, server, port_id):
-        resp, body = self.get('servers/%s/os-interface/%s' % (server, port_id),
-                              self.headers)
+        resp, body = self.get('servers/%s/os-interface/%s' % (server, port_id))
         body = self._process_xml_interface(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
index 92fade4..fb498c0 100644
--- a/tempest/services/compute/xml/keypairs_client.py
+++ b/tempest/services/compute/xml/keypairs_client.py
@@ -16,7 +16,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -26,20 +26,21 @@
 CONF = config.CONF
 
 
-class KeyPairsClientXML(RestClientXML):
+class KeyPairsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(KeyPairsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def list_keypairs(self):
-        resp, body = self.get("os-keypairs", self.headers)
+        resp, body = self.get("os-keypairs")
         node = etree.fromstring(body)
         body = [{'keypair': xml_to_json(x)} for x in node.getchildren()]
         return resp, body
 
     def get_keypair(self, key_name):
-        resp, body = self.get("os-keypairs/%s" % str(key_name), self.headers)
+        resp, body = self.get("os-keypairs/%s" % str(key_name))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -61,8 +62,7 @@
 
         doc.append(keypair_element)
 
-        resp, body = self.post("os-keypairs",
-                               headers=self.headers, body=str(doc))
+        resp, body = self.post("os-keypairs", body=str(doc))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
index 2a8fbec..2327626 100644
--- a/tempest/services/compute/xml/limits_client.py
+++ b/tempest/services/compute/xml/limits_client.py
@@ -15,7 +15,7 @@
 
 from lxml import objectify
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 
 CONF = config.CONF
@@ -23,14 +23,15 @@
 NS = "{http://docs.openstack.org/common/api/v1.0}"
 
 
-class LimitsClientXML(RestClientXML):
+class LimitsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(LimitsClientXML, self).__init__(auth_provider)
         self.service = CONF.compute.catalog_type
 
     def get_absolute_limits(self):
-        resp, body = self.get("limits", self.headers)
+        resp, body = self.get("limits")
         body = objectify.fromstring(body)
         lim = NS + 'absolute'
         ret = {}
@@ -41,7 +42,7 @@
         return resp, ret
 
     def get_specific_absolute_limit(self, absolute_limit):
-        resp, body = self.get("limits", self.headers)
+        resp, body = self.get("limits")
         body = objectify.fromstring(body)
         lim = NS + 'absolute'
         ret = {}
diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py
index f1041f0..b8b759f 100644
--- a/tempest/services/compute/xml/quotas_client.py
+++ b/tempest/services/compute/xml/quotas_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -25,7 +25,8 @@
 CONF = config.CONF
 
 
-class QuotasClientXML(RestClientXML):
+class QuotasClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(QuotasClientXML, self).__init__(auth_provider)
@@ -43,14 +44,11 @@
 
         return quota
 
-    def _parse_array(self, node):
-        return [self._format_quota(xml_to_json(x)) for x in node]
-
     def get_quota_set(self, tenant_id):
         """List the quota set for a tenant."""
 
         url = 'os-quota-sets/%s' % str(tenant_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
@@ -59,7 +57,7 @@
         """List the default quota set for a tenant."""
 
         url = 'os-quota-sets/%s/defaults' % str(tenant_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
@@ -119,8 +117,7 @@
             post_body.add_attr('security_groups', security_groups)
 
         resp, body = self.put('os-quota-sets/%s' % str(tenant_id),
-                              str(Document(post_body)),
-                              self.headers)
+                              str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         body = self._format_quota(body)
         return resp, body
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index 83072be..d53e8da 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 import urllib
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -28,7 +28,8 @@
 CONF = config.CONF
 
 
-class SecurityGroupsClientXML(RestClientXML):
+class SecurityGroupsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(SecurityGroupsClientXML, self).__init__(auth_provider)
@@ -51,14 +52,14 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_security_group(self, security_group_id):
         """Get the details of a Security Group."""
         url = "os-security-groups/%s" % str(security_group_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -73,8 +74,7 @@
         des.append(Text(content=description))
         security_group.append(des)
         resp, body = self.post('os-security-groups',
-                               str(Document(security_group)),
-                               self.headers)
+                               str(Document(security_group)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -97,15 +97,13 @@
             security_group.append(des)
         resp, body = self.put('os-security-groups/%s' %
                               str(security_group_id),
-                              str(Document(security_group)),
-                              self.headers)
+                              str(Document(security_group)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_security_group(self, security_group_id):
         """Deletes the provided Security Group."""
-        return self.delete('os-security-groups/%s' %
-                           str(security_group_id), self.headers)
+        return self.delete('os-security-groups/%s' % str(security_group_id))
 
     def create_security_group_rule(self, parent_group_id, ip_proto, from_port,
                                    to_port, **kwargs):
@@ -136,19 +134,19 @@
                 group_rule.append(element)
 
         url = 'os-security-group-rules'
-        resp, body = self.post(url, str(Document(group_rule)), self.headers)
+        resp, body = self.post(url, str(Document(group_rule)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_security_group_rule(self, group_rule_id):
         """Deletes the provided Security Group rule."""
         return self.delete('os-security-group-rules/%s' %
-                           str(group_rule_id), self.headers)
+                           str(group_rule_id))
 
     def list_security_group_rules(self, security_group_id):
         """List all rules for a security group."""
         url = "os-security-groups"
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         secgroups = body.getchildren()
         for secgroup in secgroups:
@@ -157,3 +155,10 @@
                 rules = [xml_to_json(x) for x in node.getchildren()]
                 return resp, rules
         raise exceptions.NotFound('No such Security Group')
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_security_group(id)
+        except exceptions.NotFound:
+            return True
+        return False
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index 37980c9..da01b83 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -19,7 +19,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest.common import waiters
 from tempest import config
 from tempest import exceptions
@@ -139,7 +139,8 @@
     return json
 
 
-class ServersClientXML(RestClientXML):
+class ServersClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServersClientXML, self).__init__(auth_provider)
@@ -186,7 +187,7 @@
 
     def get_server(self, server_id):
         """Returns the details of an existing server."""
-        resp, body = self.get("servers/%s" % str(server_id), self.headers)
+        resp, body = self.get("servers/%s" % str(server_id))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -245,7 +246,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         servers = self._parse_array(etree.fromstring(body))
         return resp, {"servers": servers}
 
@@ -254,7 +255,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         servers = self._parse_array(etree.fromstring(body))
         return resp, {"servers": servers}
 
@@ -282,8 +283,7 @@
                 meta.append(Text(v))
                 metadata.append(meta)
 
-        resp, body = self.put('servers/%s' % str(server_id),
-                              str(doc), self.headers)
+        resp, body = self.put('servers/%s' % str(server_id), str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def create_server(self, name, image_ref, flavor_ref, **kwargs):
@@ -356,7 +356,7 @@
                 temp.append(Text(k['contents']))
                 personality.append(temp)
 
-        resp, body = self.post('servers', str(Document(server)), self.headers)
+        resp, body = self.post('servers', str(Document(server)))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -394,7 +394,7 @@
 
     def list_addresses(self, server_id):
         """Lists all addresses for a server."""
-        resp, body = self.get("servers/%s/ips" % str(server_id), self.headers)
+        resp, body = self.get("servers/%s/ips" % str(server_id))
 
         networks = {}
         xml_list = etree.fromstring(body)
@@ -407,8 +407,7 @@
     def list_addresses_by_network(self, server_id, network_id):
         """Lists all addresses of a specific network type for a server."""
         resp, body = self.get("servers/%s/ips/%s" % (str(server_id),
-                                                     network_id),
-                              self.headers)
+                                                     network_id))
         network = self._parse_network(etree.fromstring(body))
 
         return resp, network
@@ -417,8 +416,7 @@
         if 'xmlns' not in kwargs:
             kwargs['xmlns'] = XMLNS_11
         doc = Document((Element(action_name, **kwargs)))
-        resp, body = self.post("servers/%s/action" % server_id,
-                               str(doc), self.headers)
+        resp, body = self.post("servers/%s/action" % server_id, str(doc))
         if response_key is not None:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -435,8 +433,7 @@
                            adminPass=password)
 
     def get_password(self, server_id):
-        resp, body = self.get("servers/%s/os-server-password" %
-                              str(server_id), self.headers)
+        resp, body = self.get("servers/%s/os-server-password" % str(server_id))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -446,8 +443,7 @@
         Note that this does not actually change the instance server
         password.
         """
-        return self.delete("servers/%s/os-server-password" %
-                           str(server_id))
+        return self.delete("servers/%s/os-server-password" % str(server_id))
 
     def reboot(self, server_id, reboot_type):
         return self.action(server_id, "reboot", None, type=reboot_type)
@@ -478,7 +474,7 @@
                 metadata.append(meta)
 
         resp, body = self.post('servers/%s/action' % server_id,
-                               str(Document(rebuild)), self.headers)
+                               str(Document(rebuild)))
         server = self._parse_server(etree.fromstring(body))
         return resp, server
 
@@ -523,12 +519,11 @@
                            host=dest_host)
 
         resp, body = self.post("servers/%s/action" % str(server_id),
-                               str(Document(req_body)), self.headers)
+                               str(Document(req_body)))
         return resp, body
 
     def list_server_metadata(self, server_id):
-        resp, body = self.get("servers/%s/metadata" % str(server_id),
-                              self.headers)
+        resp, body = self.get("servers/%s/metadata" % str(server_id))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -541,8 +536,7 @@
                 meta_element = Element("meta", key=k)
                 meta_element.append(Text(v))
                 metadata.append(meta_element)
-        resp, body = self.put('servers/%s/metadata' % str(server_id),
-                              str(doc), self.headers)
+        resp, body = self.put('servers/%s/metadata' % str(server_id), str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def update_server_metadata(self, server_id, meta):
@@ -554,13 +548,12 @@
             meta_element.append(Text(v))
             metadata.append(meta_element)
         resp, body = self.post("/servers/%s/metadata" % str(server_id),
-                               str(doc), headers=self.headers)
+                               str(doc))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
     def get_server_metadata_item(self, server_id, key):
-        resp, body = self.get("servers/%s/metadata/%s" % (str(server_id), key),
-                              headers=self.headers)
+        resp, body = self.get("servers/%s/metadata/%s" % (str(server_id), key))
         return resp, dict([(etree.fromstring(body).attrib['key'],
                             xml_to_json(etree.fromstring(body)))])
 
@@ -571,7 +564,7 @@
             meta_element.append(Text(v))
             doc.append(meta_element)
         resp, body = self.put('servers/%s/metadata/%s' % (str(server_id), key),
-                              str(doc), self.headers)
+                              str(doc))
         return resp, xml_to_json(etree.fromstring(body))
 
     def delete_server_metadata_item(self, server_id, key):
@@ -588,7 +581,7 @@
         List the virtual interfaces used in an instance.
         """
         resp, body = self.get('/'.join(['servers', server_id,
-                              'os-virtual-interfaces']), self.headers)
+                              'os-virtual-interfaces']))
         virt_int = self._parse_xml_virtual_interfaces(etree.fromstring(body))
         return resp, virt_int
 
@@ -604,7 +597,7 @@
         post_body = Element("volumeAttachment", volumeId=volume_id,
                             device=device)
         resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
-                               str(Document(post_body)), self.headers)
+                               str(Document(post_body)))
         return resp, body
 
     def detach_volume(self, server_id, volume_id):
@@ -616,22 +609,20 @@
 
     def get_server_diagnostics(self, server_id):
         """Get the usage data for a server."""
-        resp, body = self.get("servers/%s/diagnostics" % server_id,
-                              self.headers)
+        resp, body = self.get("servers/%s/diagnostics" % server_id)
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
     def list_instance_actions(self, server_id):
         """List the provided server action."""
-        resp, body = self.get("servers/%s/os-instance-actions" % server_id,
-                              self.headers)
+        resp, body = self.get("servers/%s/os-instance-actions" % server_id)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_instance_action(self, server_id, request_id):
         """Returns the action details of the provided server."""
         resp, body = self.get("servers/%s/os-instance-actions/%s" %
-                              (server_id, request_id), self.headers)
+                              (server_id, request_id))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py
index c28dc12..d7b8a60 100644
--- a/tempest/services/compute/xml/services_client.py
+++ b/tempest/services/compute/xml/services_client.py
@@ -18,7 +18,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 CONF = config.CONF
 
 
-class ServicesClientXML(RestClientXML):
+class ServicesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServicesClientXML, self).__init__(auth_provider)
@@ -38,7 +39,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         node = etree.fromstring(body)
         body = [xml_to_json(x) for x in node.getchildren()]
         return resp, body
@@ -53,8 +54,7 @@
         post_body.add_attr('binary', binary)
         post_body.add_attr('host', host_name)
 
-        resp, body = self.put('os-services/enable', str(Document(post_body)),
-                              self.headers)
+        resp, body = self.put('os-services/enable', str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -68,7 +68,6 @@
         post_body.add_attr('binary', binary)
         post_body.add_attr('host', host_name)
 
-        resp, body = self.put('os-services/disable', str(Document(post_body)),
-                              self.headers)
+        resp, body = self.put('os-services/disable', str(Document(post_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py
index 93eeb00..79f0ac9 100644
--- a/tempest/services/compute/xml/tenant_usages_client.py
+++ b/tempest/services/compute/xml/tenant_usages_client.py
@@ -17,14 +17,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class TenantUsagesClientXML(RestClientXML):
+class TenantUsagesClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(TenantUsagesClientXML, self).__init__(auth_provider)
@@ -39,7 +40,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         tenant_usage = self._parse_array(etree.fromstring(body))
         return resp, tenant_usage['tenant_usage']
 
@@ -48,6 +49,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         tenant_usage = self._parse_array(etree.fromstring(body))
         return resp, tenant_usage
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
index 941cd69..570b715 100644
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -18,7 +18,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -30,7 +30,8 @@
 CONF = config.CONF
 
 
-class VolumesExtensionsClientXML(RestClientXML):
+class VolumesExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumesExtensionsClientXML, self).__init__(
@@ -60,7 +61,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -74,7 +75,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -84,7 +85,7 @@
     def get_volume(self, volume_id):
         """Returns the details of a single volume."""
         url = "os-volumes/%s" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume(body)
 
@@ -110,8 +111,7 @@
                 meta.append(Text(value))
                 _metadata.append(meta)
 
-        resp, body = self.post('os-volumes', str(Document(volume)),
-                               self.headers)
+        resp, body = self.post('os-volumes', str(Document(volume)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index a0fbb76..5d6632a 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -40,8 +40,7 @@
             "user_id": user_id
         }
         post_body = json.dumps({'credential': post_body})
-        resp, body = self.post('credentials', post_body,
-                               self.headers)
+        resp, body = self.post('credentials', post_body)
         body = json.loads(body)
         body['credential']['blob'] = json.loads(body['credential']['blob'])
         return resp, body['credential']
@@ -63,8 +62,7 @@
             "user_id": user_id
         }
         post_body = json.dumps({'credential': post_body})
-        resp, body = self.patch('credentials/%s' % credential_id, post_body,
-                                self.headers)
+        resp, body = self.patch('credentials/%s' % credential_id, post_body)
         body = json.loads(body)
         body['credential']['blob'] = json.loads(body['credential']['blob'])
         return resp, body['credential']
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index 1b78115..652c345 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -47,7 +47,7 @@
             'enabled': enabled
         }
         post_body = json.dumps({'endpoint': post_body})
-        resp, body = self.post('endpoints', post_body, self.headers)
+        resp, body = self.post('endpoints', post_body)
         body = json.loads(body)
         return resp, body['endpoint']
 
@@ -66,8 +66,7 @@
         if enabled is not None:
             post_body['enabled'] = enabled
         post_body = json.dumps({'endpoint': post_body})
-        resp, body = self.patch('endpoints/%s' % endpoint_id, post_body,
-                                self.headers)
+        resp, body = self.patch('endpoints/%s' % endpoint_id, post_body)
         body = json.loads(body)
         return resp, body['endpoint']
 
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index ab1dc94..b044e4d 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -14,7 +14,6 @@
 #    under the License.
 
 import json
-import urlparse
 
 from tempest.common.rest_client import RestClient
 from tempest import config
@@ -49,8 +48,7 @@
             'password': password
         }
         post_body = json.dumps({'user': post_body})
-        resp, body = self.post('users', post_body,
-                               self.headers)
+        resp, body = self.post('users', post_body)
         body = json.loads(body)
         return resp, body['user']
 
@@ -72,14 +70,13 @@
             'description': description
         }
         post_body = json.dumps({'user': post_body})
-        resp, body = self.patch('users/%s' % user_id, post_body,
-                                self.headers)
+        resp, body = self.patch('users/%s' % user_id, post_body)
         body = json.loads(body)
         return resp, body['user']
 
     def list_user_projects(self, user_id):
         """Lists the projects on which a user has roles assigned."""
-        resp, body = self.get('users/%s/projects' % user_id, self.headers)
+        resp, body = self.get('users/%s/projects' % user_id)
         body = json.loads(body)
         return resp, body['projects']
 
@@ -112,7 +109,7 @@
             'name': name
         }
         post_body = json.dumps({'project': post_body})
-        resp, body = self.post('projects', post_body, self.headers)
+        resp, body = self.post('projects', post_body)
         body = json.loads(body)
         return resp, body['project']
 
@@ -135,8 +132,7 @@
             'domain_id': domain_id,
         }
         post_body = json.dumps({'project': post_body})
-        resp, body = self.patch('projects/%s' % project_id, post_body,
-                                self.headers)
+        resp, body = self.patch('projects/%s' % project_id, post_body)
         body = json.loads(body)
         return resp, body['project']
 
@@ -157,7 +153,7 @@
             'name': name
         }
         post_body = json.dumps({'role': post_body})
-        resp, body = self.post('roles', post_body, self.headers)
+        resp, body = self.post('roles', post_body)
         body = json.loads(body)
         return resp, body['role']
 
@@ -173,8 +169,7 @@
             'name': name
         }
         post_body = json.dumps({'role': post_body})
-        resp, body = self.patch('roles/%s' % str(role_id), post_body,
-                                self.headers)
+        resp, body = self.patch('roles/%s' % str(role_id), post_body)
         body = json.loads(body)
         return resp, body['role']
 
@@ -186,8 +181,7 @@
     def assign_user_role(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), None,
-                              self.headers)
+                              (project_id, user_id, role_id), None)
         return resp, body
 
     def create_domain(self, name, **kwargs):
@@ -200,7 +194,7 @@
             'name': name
         }
         post_body = json.dumps({'domain': post_body})
-        resp, body = self.post('domains', post_body, self.headers)
+        resp, body = self.post('domains', post_body)
         body = json.loads(body)
         return resp, body['domain']
 
@@ -227,8 +221,7 @@
             'name': name
         }
         post_body = json.dumps({'domain': post_body})
-        resp, body = self.patch('domains/%s' % domain_id, post_body,
-                                self.headers)
+        resp, body = self.patch('domains/%s' % domain_id, post_body)
         body = json.loads(body)
         return resp, body['domain']
 
@@ -263,13 +256,13 @@
             'name': name
         }
         post_body = json.dumps({'group': post_body})
-        resp, body = self.post('groups', post_body, self.headers)
+        resp, body = self.post('groups', post_body)
         body = json.loads(body)
         return resp, body['group']
 
     def get_group(self, group_id):
         """Get group details."""
-        resp, body = self.get('groups/%s' % group_id, self.headers)
+        resp, body = self.get('groups/%s' % group_id)
         body = json.loads(body)
         return resp, body['group']
 
@@ -283,8 +276,7 @@
             'description': description
         }
         post_body = json.dumps({'group': post_body})
-        resp, body = self.patch('groups/%s' % group_id, post_body,
-                                self.headers)
+        resp, body = self.patch('groups/%s' % group_id, post_body)
         body = json.loads(body)
         return resp, body['group']
 
@@ -296,33 +288,30 @@
     def add_group_user(self, group_id, user_id):
         """Add user into group."""
         resp, body = self.put('groups/%s/users/%s' % (group_id, user_id),
-                              None, self.headers)
+                              None)
         return resp, body
 
     def list_group_users(self, group_id):
         """List users in group."""
-        resp, body = self.get('groups/%s/users' % group_id, self.headers)
+        resp, body = self.get('groups/%s/users' % group_id)
         body = json.loads(body)
         return resp, body['users']
 
     def delete_group_user(self, group_id, user_id):
         """Delete user in group."""
-        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id),
-                                 self.headers)
+        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id))
         return resp, body
 
     def assign_user_role_on_project(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), None,
-                              self.headers)
+                              (project_id, user_id, role_id), None)
         return resp, body
 
     def assign_user_role_on_domain(self, domain_id, user_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/users/%s/roles/%s' %
-                              (domain_id, user_id, role_id), None,
-                              self.headers)
+                              (domain_id, user_id, role_id), None)
         return resp, body
 
     def list_user_roles_on_project(self, project_id, user_id):
@@ -354,15 +343,13 @@
     def assign_group_role_on_project(self, project_id, group_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/groups/%s/roles/%s' %
-                              (project_id, group_id, role_id), None,
-                              self.headers)
+                              (project_id, group_id, role_id), None)
         return resp, body
 
     def assign_group_role_on_domain(self, domain_id, group_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/groups/%s/roles/%s' %
-                              (domain_id, group_id, role_id), None,
-                              self.headers)
+                              (domain_id, group_id, role_id), None)
         return resp, body
 
     def list_group_roles_on_project(self, project_id, group_id):
@@ -404,7 +391,7 @@
             'expires_at': expires_at
         }
         post_body = json.dumps({'trust': post_body})
-        resp, body = self.post('OS-TRUST/trusts', post_body, self.headers)
+        resp, body = self.post('OS-TRUST/trusts', post_body)
         body = json.loads(body)
         return resp, body['trust']
 
@@ -457,11 +444,10 @@
     def __init__(self):
         super(V3TokenClientJSON, self).__init__(None)
         auth_url = CONF.identity.uri_v3
-        # If the v3 url is not set, get it from the v2 one
-        if auth_url is None:
-            auth_url = CONF.identity.uri.replace(urlparse.urlparse(
-                CONF.identity.uri).path, "/v3")
-
+        if not auth_url and CONF.identity_feature_enabled.api_v3:
+            raise exceptions.InvalidConfiguration('you must specify a v3 uri '
+                                                  'if using the v3 identity '
+                                                  'api')
         if 'auth/tokens' not in auth_url:
             auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
@@ -507,11 +493,16 @@
             creds['auth']['scope'] = scope
 
         body = json.dumps(creds)
-        resp, body = self.post(self.auth_url, headers=self.headers, body=body)
+        resp, body = self.post(self.auth_url, body=body)
         return resp, body
 
     def request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
+        if headers is None:
+            # Always accept 'json', for xml token client too.
+            # Because XML response is not easily
+            # converted to the corresponding JSON one
+            headers = self.get_headers(accept_type="json")
         self._log_request(method, url, headers, body)
         resp, resp_body = self.http_obj.request(url, method,
                                                 headers=headers, body=body)
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index c376979..5a3f891 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -36,7 +36,7 @@
             "type": type
         }
         post_body = json.dumps({'policy': post_body})
-        resp, body = self.post('policies', post_body, self.headers)
+        resp, body = self.post('policies', post_body)
         body = json.loads(body)
         return resp, body['policy']
 
@@ -62,8 +62,7 @@
         }
         post_body = json.dumps({'policy': post_body})
         url = 'policies/%s' % policy_id
-        resp, body = self.patch(url, post_body,
-                                self.headers)
+        resp, body = self.patch(url, post_body)
         body = json.loads(body)
         return resp, body['policy']
 
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index 92f7629..c1faebb 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -41,8 +41,7 @@
             'name': name
         }
         patch_body = json.dumps({'service': patch_body})
-        resp, body = self.patch('services/%s' % service_id,
-                                patch_body, self.headers)
+        resp, body = self.patch('services/%s' % service_id, patch_body)
         body = json.loads(body)
         return resp, body['service']
 
@@ -52,3 +51,21 @@
         resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['service']
+
+    def create_service(self, serv_type, name=None, description=None,
+                       enabled=True):
+        body_dict = {
+            "name": name,
+            'type': serv_type,
+            'enabled': enabled,
+            "description": description,
+        }
+        body = json.dumps({'service': body_dict})
+        resp, body = self.post("services", body)
+        body = json.loads(body)
+        return resp, body["service"]
+
+    def delete_service(self, serv_id):
+        url = "services/" + serv_id
+        resp, body = self.delete(url)
+        return resp, body
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
index eca86ab..22ed44d 100644
--- a/tempest/services/identity/v3/xml/credentials_client.py
+++ b/tempest/services/identity/v3/xml/credentials_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -29,7 +29,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class CredentialsClientXML(RestClientXML):
+class CredentialsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(CredentialsClientXML, self).__init__(auth_provider)
@@ -61,8 +62,7 @@
         credential = Element('credential', project_id=project_id,
                              type=cred_type, user_id=user_id)
         credential.append(blob)
-        resp, body = self.post('credentials', str(Document(credential)),
-                               self.headers)
+        resp, body = self.post('credentials', str(Document(credential)))
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
@@ -85,27 +85,25 @@
                              type=cred_type, user_id=user_id)
         credential.append(blob)
         resp, body = self.patch('credentials/%s' % credential_id,
-                                str(Document(credential)),
-                                self.headers)
+                                str(Document(credential)))
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
 
     def get_credential(self, credential_id):
         """To GET Details of a credential."""
-        resp, body = self.get('credentials/%s' % credential_id, self.headers)
+        resp, body = self.get('credentials/%s' % credential_id)
         body = self._parse_body(etree.fromstring(body))
         body['blob'] = json.loads(body['blob'])
         return resp, body
 
     def list_credentials(self):
         """Lists out all the available credentials."""
-        resp, body = self.get('credentials', self.headers)
+        resp, body = self.get('credentials')
         body = self._parse_creds(etree.fromstring(body))
         return resp, body
 
     def delete_credential(self, credential_id):
         """Deletes a credential."""
-        resp, body = self.delete('credentials/%s' % credential_id,
-                                 self.headers)
+        resp, body = self.delete('credentials/%s' % credential_id)
         return resp, body
diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py
index a20a9f5..a32eede 100644
--- a/tempest/services/identity/v3/xml/endpoints_client.py
+++ b/tempest/services/identity/v3/xml/endpoints_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 
 from tempest.common import http
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class EndPointClientXML(RestClientXML):
+class EndPointClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(EndPointClientXML, self).__init__(auth_provider)
@@ -58,7 +59,7 @@
 
     def list_endpoints(self):
         """Get the list of endpoints."""
-        resp, body = self.get("endpoints", self.headers)
+        resp, body = self.get("endpoints")
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
@@ -72,8 +73,7 @@
                                   interface=interface,
                                   url=url, region=region,
                                   enabled=enabled)
-        resp, body = self.post('endpoints', str(Document(create_endpoint)),
-                               self.headers)
+        resp, body = self.post('endpoints', str(Document(create_endpoint)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -94,8 +94,7 @@
             endpoint.add_attr("region", region)
         if enabled is not None:
             endpoint.add_attr("enabled", enabled)
-        resp, body = self.patch('endpoints/%s' % str(endpoint_id),
-                                str(doc), self.headers)
+        resp, body = self.patch('endpoints/%s' % str(endpoint_id), str(doc))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py
index e7b85c1..e8e70d8 100644
--- a/tempest/services/identity/v3/xml/identity_client.py
+++ b/tempest/services/identity/v3/xml/identity_client.py
@@ -14,11 +14,10 @@
 #    under the License.
 
 import json
-import urlparse
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -31,7 +30,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class IdentityV3ClientXML(RestClientXML):
+class IdentityV3ClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(IdentityV3ClientXML, self).__init__(auth_provider)
@@ -98,8 +98,7 @@
                             enabled=str(en).lower(),
                             project_id=project_id,
                             domain_id=domain_id)
-        resp, body = self.post('users', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('users', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -120,32 +119,31 @@
                               description=description,
                               enabled=str(en).lower())
         resp, body = self.patch('users/%s' % user_id,
-                                str(Document(update_user)),
-                                self.headers)
+                                str(Document(update_user)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_user_projects(self, user_id):
         """Lists the projects on which a user has roles assigned."""
-        resp, body = self.get('users/%s/projects' % user_id, self.headers)
+        resp, body = self.get('users/%s/projects' % user_id)
         body = self._parse_projects(etree.fromstring(body))
         return resp, body
 
     def get_users(self):
         """Get the list of users."""
-        resp, body = self.get("users", self.headers)
+        resp, body = self.get("users")
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_user(self, user_id):
         """GET a user."""
-        resp, body = self.get("users/%s" % user_id, self.headers)
+        resp, body = self.get("users/%s" % user_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_user(self, user_id):
         """Deletes a User."""
-        resp, body = self.delete("users/%s" % user_id, self.headers)
+        resp, body = self.delete("users/%s" % user_id)
         return resp, body
 
     def create_project(self, name, **kwargs):
@@ -160,14 +158,13 @@
                             enabled=str(en).lower(),
                             name=name)
         resp, body = self.post('projects',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_projects(self):
         """Get the list of projects."""
-        resp, body = self.get("projects", self.headers)
+        resp, body = self.get("projects")
         body = self._parse_projects(etree.fromstring(body))
         return resp, body
 
@@ -185,14 +182,13 @@
                             enabled=str(en).lower(),
                             domain_id=domain_id)
         resp, body = self.patch('projects/%s' % project_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_project(self, project_id):
         """GET a Project."""
-        resp, body = self.get("projects/%s" % project_id, self.headers)
+        resp, body = self.get("projects/%s" % project_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -206,15 +202,13 @@
         post_body = Element("role",
                             xmlns=XMLNS,
                             name=name)
-        resp, body = self.post('roles',
-                               str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('roles', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_role(self, role_id):
         """GET a Role."""
-        resp, body = self.get('roles/%s' % str(role_id), self.headers)
+        resp, body = self.get('roles/%s' % str(role_id))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -224,21 +218,19 @@
                             xmlns=XMLNS,
                             name=name)
         resp, body = self.patch('roles/%s' % str(role_id),
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_role(self, role_id):
         """Delete a role."""
-        resp, body = self.delete('roles/%s' % str(role_id),
-                                 self.headers)
+        resp, body = self.delete('roles/%s' % str(role_id))
         return resp, body
 
     def assign_user_role(self, project_id, user_id, role_id):
         """Add roles to a user on a tenant."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '', self.headers)
+                              (project_id, user_id, role_id), '')
         return resp, body
 
     def create_domain(self, name, **kwargs):
@@ -250,20 +242,19 @@
                             name=name,
                             description=description,
                             enabled=str(en).lower())
-        resp, body = self.post('domains', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('domains', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_domains(self):
         """Get the list of domains."""
-        resp, body = self.get("domains", self.headers)
+        resp, body = self.get("domains")
         body = self._parse_domains(etree.fromstring(body))
         return resp, body
 
     def delete_domain(self, domain_id):
         """Delete a domain."""
-        resp, body = self.delete('domains/%s' % domain_id, self.headers)
+        resp, body = self.delete('domains/%s' % domain_id)
         return resp, body
 
     def update_domain(self, domain_id, **kwargs):
@@ -278,14 +269,13 @@
                             description=description,
                             enabled=str(en).lower())
         resp, body = self.patch('domains/%s' % domain_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_domain(self, domain_id):
         """Get Domain details."""
-        resp, body = self.get('domains/%s' % domain_id, self.headers)
+        resp, body = self.get('domains/%s' % domain_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -315,14 +305,13 @@
                             description=description,
                             domain_id=domain_id,
                             project_id=project_id)
-        resp, body = self.post('groups', str(Document(post_body)),
-                               self.headers)
+        resp, body = self.post('groups', str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_group(self, group_id):
         """Get group details."""
-        resp, body = self.get('groups/%s' % group_id, self.headers)
+        resp, body = self.get('groups/%s' % group_id)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -336,124 +325,118 @@
                             name=name,
                             description=description)
         resp, body = self.patch('groups/%s' % group_id,
-                                str(Document(post_body)),
-                                self.headers)
+                                str(Document(post_body)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def delete_group(self, group_id):
         """Delete a group."""
-        resp, body = self.delete('groups/%s' % group_id, self.headers)
+        resp, body = self.delete('groups/%s' % group_id)
         return resp, body
 
     def add_group_user(self, group_id, user_id):
         """Add user into group."""
-        resp, body = self.put('groups/%s/users/%s' % (group_id, user_id),
-                              '', self.headers)
+        resp, body = self.put('groups/%s/users/%s' % (group_id, user_id), '')
         return resp, body
 
     def list_group_users(self, group_id):
         """List users in group."""
-        resp, body = self.get('groups/%s/users' % group_id, self.headers)
+        resp, body = self.get('groups/%s/users' % group_id)
         body = self._parse_group_users(etree.fromstring(body))
         return resp, body
 
     def delete_group_user(self, group_id, user_id):
         """Delete user in group."""
-        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id),
-                                 self.headers)
+        resp, body = self.delete('groups/%s/users/%s' % (group_id, user_id))
         return resp, body
 
     def assign_user_role_on_project(self, project_id, user_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/users/%s/roles/%s' %
-                              (project_id, user_id, role_id), '',
-                              self.headers)
+                              (project_id, user_id, role_id), '')
         return resp, body
 
     def assign_user_role_on_domain(self, domain_id, user_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/users/%s/roles/%s' %
-                              (domain_id, user_id, role_id), '',
-                              self.headers)
+                              (domain_id, user_id, role_id), '')
         return resp, body
 
     def list_user_roles_on_project(self, project_id, user_id):
         """list roles of a user on a project."""
         resp, body = self.get('projects/%s/users/%s/roles' %
-                              (project_id, user_id), self.headers)
+                              (project_id, user_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def list_user_roles_on_domain(self, domain_id, user_id):
         """list roles of a user on a domain."""
         resp, body = self.get('domains/%s/users/%s/roles' %
-                              (domain_id, user_id), self.headers)
+                              (domain_id, user_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def revoke_role_from_user_on_project(self, project_id, user_id, role_id):
         """Delete role of a user on a project."""
         resp, body = self.delete('projects/%s/users/%s/roles/%s' %
-                                 (project_id, user_id, role_id), self.headers)
+                                 (project_id, user_id, role_id))
         return resp, body
 
     def revoke_role_from_user_on_domain(self, domain_id, user_id, role_id):
         """Delete role of a user on a domain."""
         resp, body = self.delete('domains/%s/users/%s/roles/%s' %
-                                 (domain_id, user_id, role_id), self.headers)
+                                 (domain_id, user_id, role_id))
         return resp, body
 
     def assign_group_role_on_project(self, project_id, group_id, role_id):
         """Add roles to a user on a project."""
         resp, body = self.put('projects/%s/groups/%s/roles/%s' %
-                              (project_id, group_id, role_id), '',
-                              self.headers)
+                              (project_id, group_id, role_id), '')
         return resp, body
 
     def assign_group_role_on_domain(self, domain_id, group_id, role_id):
         """Add roles to a user on a domain."""
         resp, body = self.put('domains/%s/groups/%s/roles/%s' %
-                              (domain_id, group_id, role_id), '',
-                              self.headers)
+                              (domain_id, group_id, role_id), '')
         return resp, body
 
     def list_group_roles_on_project(self, project_id, group_id):
         """list roles of a user on a project."""
         resp, body = self.get('projects/%s/groups/%s/roles' %
-                              (project_id, group_id), self.headers)
+                              (project_id, group_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def list_group_roles_on_domain(self, domain_id, group_id):
         """list roles of a user on a domain."""
         resp, body = self.get('domains/%s/groups/%s/roles' %
-                              (domain_id, group_id), self.headers)
+                              (domain_id, group_id))
         body = self._parse_roles(etree.fromstring(body))
         return resp, body
 
     def revoke_role_from_group_on_project(self, project_id, group_id, role_id):
         """Delete role of a user on a project."""
         resp, body = self.delete('projects/%s/groups/%s/roles/%s' %
-                                 (project_id, group_id, role_id), self.headers)
+                                 (project_id, group_id, role_id))
         return resp, body
 
     def revoke_role_from_group_on_domain(self, domain_id, group_id, role_id):
         """Delete role of a user on a domain."""
         resp, body = self.delete('domains/%s/groups/%s/roles/%s' %
-                                 (domain_id, group_id, role_id), self.headers)
+                                 (domain_id, group_id, role_id))
         return resp, body
 
 
-class V3TokenClientXML(RestClientXML):
+class V3TokenClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self):
         super(V3TokenClientXML, self).__init__(None)
         auth_url = CONF.identity.uri_v3
-        # If the v3 url is not set, get it from the v2 one
-        if auth_url is None:
-            auth_url = CONF.identity.uri.replace(urlparse.urlparse(
-                CONF.identity.uri).path, "/v3")
+        if not auth_url and CONF.identity_feature_enabled.api_v3:
+            raise exceptions.InvalidConfiguration('you must specify a v3 uri '
+                                                  'if using the v3 identity '
+                                                  'api')
         if 'auth/tokens' not in auth_url:
             auth_url = auth_url.rstrip('/') + '/auth/tokens'
 
@@ -501,15 +484,16 @@
             scope.append(project)
             auth.append(scope)
 
-        resp, body = self.post(self.auth_url, headers=self.headers,
-                               body=str(Document(auth)))
+        resp, body = self.post(self.auth_url, body=str(Document(auth)))
         return resp, body
 
     def request(self, method, url, headers=None, body=None):
         """A simple HTTP request interface."""
-        # Send XML, accept JSON. XML response is not easily
-        # converted to the corresponding JSON one
-        headers['Accept'] = 'application/json'
+        if headers is None:
+            # Always accept 'json', for xml token client too.
+            # Because XML response is not easily
+            # converted to the corresponding JSON one
+            headers = self.get_headers(accept_type="json")
         self._log_request(method, url, headers, body)
         resp, resp_body = self.http_obj.request(url, method,
                                                 headers=headers, body=body)
diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py
index 429c6a4..c12018a 100644
--- a/tempest/services/identity/v3/xml/policy_client.py
+++ b/tempest/services/identity/v3/xml/policy_client.py
@@ -16,7 +16,7 @@
 from lxml import etree
 
 from tempest.common import http
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -27,7 +27,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class PolicyClientXML(RestClientXML):
+class PolicyClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(PolicyClientXML, self).__init__(auth_provider)
@@ -59,21 +60,20 @@
     def create_policy(self, blob, type):
         """Creates a Policy."""
         create_policy = Element("policy", xmlns=XMLNS, blob=blob, type=type)
-        resp, body = self.post('policies', str(Document(create_policy)),
-                               self.headers)
+        resp, body = self.post('policies', str(Document(create_policy)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def list_policies(self):
         """Lists the policies."""
-        resp, body = self.get('policies', self.headers)
+        resp, body = self.get('policies')
         body = self._parse_array(etree.fromstring(body))
         return resp, body
 
     def get_policy(self, policy_id):
         """Lists out the given policy."""
         url = 'policies/%s' % policy_id
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
@@ -83,8 +83,7 @@
         type = kwargs.get('type')
         update_policy = Element("policy", xmlns=XMLNS, type=type)
         url = 'policies/%s' % policy_id
-        resp, body = self.patch(url, str(Document(update_policy)),
-                                self.headers)
+        resp, body = self.patch(url, str(Document(update_policy)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py
index df9b234..d4a5877 100644
--- a/tempest/services/identity/v3/xml/service_client.py
+++ b/tempest/services/identity/v3/xml/service_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import Element
@@ -26,7 +26,8 @@
 XMLNS = "http://docs.openstack.org/identity/api/v3"
 
 
-class ServiceClientXML(RestClientXML):
+class ServiceClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ServiceClientXML, self).__init__(auth_provider)
@@ -34,12 +35,6 @@
         self.endpoint_url = 'adminURL'
         self.api_version = "v3"
 
-    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
@@ -57,14 +52,28 @@
                                  description=description,
                                  type=type)
         resp, body = self.patch('services/%s' % service_id,
-                                str(Document(update_service)),
-                                self.headers)
+                                str(Document(update_service)))
         body = self._parse_body(etree.fromstring(body))
         return resp, body
 
     def get_service(self, service_id):
         """Get Service."""
         url = 'services/%s' % service_id
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_body(etree.fromstring(body))
         return resp, body
+
+    def create_service(self, serv_type, name=None, description=None):
+        post_body = Element("service",
+                            xmlns=XMLNS,
+                            name=name,
+                            description=description,
+                            type=serv_type)
+        resp, body = self.post("services", str(Document(post_body)))
+        body = self._parse_body(etree.fromstring(body))
+        return resp, body
+
+    def delete_service(self, serv_id):
+        url = "services/" + serv_id
+        resp, body = self.delete(url)
+        return resp, body
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
index 81846da..50403fb 100644
--- a/tempest/services/identity/xml/identity_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -97,7 +97,7 @@
         """Enables or disables a user."""
         enable_user = xml.Element("user", enabled=str(enabled).lower())
         resp, body = self.put('users/%s/enabled' % user_id,
-                              str(xml.Document(enable_user)), self.headers)
+                              str(xml.Document(enable_user)))
         return resp, self._parse_resp(body)
 
     def create_service(self, name, service_type, **kwargs):
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index bc9db38..932fa14 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -157,7 +157,7 @@
         return resp, body['image']
 
     def update_image(self, image_id, name=None, container_format=None,
-                     data=None):
+                     data=None, properties=None):
         params = {}
         headers = {}
         if name is not None:
@@ -166,6 +166,9 @@
         if container_format is not None:
             params['container_format'] = container_format
 
+        if properties is not None:
+            params['properties'] = properties
+
         headers.update(self._image_meta_to_headers(params))
 
         if data is not None:
@@ -190,7 +193,8 @@
         body = json.loads(body)
         return resp, body['images']
 
-    def image_list_detail(self, properties=dict(), **kwargs):
+    def image_list_detail(self, properties=dict(), changes_since=None,
+                          **kwargs):
         url = 'v1/images/detail'
 
         params = {}
@@ -199,6 +203,9 @@
 
         kwargs.update(params)
 
+        if changes_since is not None:
+            kwargs['changes-since'] = changes_since
+
         if len(kwargs) > 0:
             url += '?%s' % urllib.urlencode(kwargs)
 
@@ -241,7 +248,7 @@
         body = None
         if can_share:
             body = json.dumps({'member': {'can_share': True}})
-        resp, __ = self.put(url, body, self.headers)
+        resp, __ = self.put(url, body)
         return resp
 
     def delete_member(self, member_id, image_id):
@@ -252,7 +259,7 @@
     def replace_membership_list(self, image_id, member_list):
         url = 'v1/images/%s/members' % image_id
         body = json.dumps({'membership': member_list})
-        resp, data = self.put(url, body, self.headers)
+        resp, data = self.put(url, body)
         data = json.loads(data)
         return resp, data
 
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index b825519..58819d0 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -86,7 +86,7 @@
         data = json.dumps(params)
         self._validate_schema(data)
 
-        resp, body = self.post('v2/images', data, self.headers)
+        resp, body = self.post('v2/images', data)
         body = json.loads(body)
         return resp, body
 
@@ -132,7 +132,7 @@
 
     def add_image_tag(self, image_id, tag):
         url = 'v2/images/%s/tags/%s' % (image_id, tag)
-        resp, body = self.put(url, body=None, headers=self.headers)
+        resp, body = self.put(url, body=None)
         return resp, body
 
     def delete_image_tag(self, image_id, tag):
@@ -150,7 +150,7 @@
     def add_member(self, image_id, member_id):
         url = 'v2/images/%s/members' % image_id
         data = json.dumps({'member': member_id})
-        resp, body = self.post(url, data, self.headers)
+        resp, body = self.post(url, data)
         body = json.loads(body)
         self.expected_success(200, resp)
         return resp, body
@@ -159,7 +159,7 @@
         """Valid status are: ``pending``, ``accepted``,  ``rejected``."""
         url = 'v2/images/%s/members/%s' % (image_id, member_id)
         data = json.dumps({'status': status})
-        resp, body = self.put(url, data, self.headers)
+        resp, body = self.put(url, data)
         body = json.loads(body)
         self.expected_success(200, resp)
         return resp, body
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 1458c7b..366ccee 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -154,20 +154,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_security_group(self, name, **kwargs):
-        post_body = {
-            'security_group': {
-                'name': name,
-            }
-        }
-        for key, value in kwargs.iteritems():
-            post_body['security_group'][str(key)] = value
-        body = json.dumps(post_body)
-        uri = '%s/security-groups' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def update_floating_ip(self, floating_ip_id, **kwargs):
         post_body = {
             'floatingip': kwargs}
@@ -177,50 +163,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_security_group_rule(self, secgroup_id,
-                                   direction='ingress', **kwargs):
-        post_body = {
-            'security_group_rule': {
-                'direction': direction,
-                'security_group_id': secgroup_id
-            }
-        }
-        for key, value in kwargs.iteritems():
-            post_body['security_group_rule'][str(key)] = value
-        body = json.dumps(post_body)
-        uri = '%s/security-group-rules' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
-        post_body = {
-            "vip": {
-                "protocol": protocol,
-                "name": name,
-                "subnet_id": subnet_id,
-                "pool_id": pool_id,
-                "protocol_port": protocol_port
-            }
-        }
-        body = json.dumps(post_body)
-        uri = '%s/lb/vips' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_vip(self, vip_id, new_name):
-        put_body = {
-            "vip": {
-                "name": new_name,
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/lb/vips/%s' % (self.uri_prefix, vip_id)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def create_member(self, address, protocol_port, pool_id):
         post_body = {
             "member": {
@@ -247,33 +189,6 @@
         body = json.loads(body)
         return resp, body
 
-    def create_health_monitor(self, delay, max_retries, Type, timeout):
-        post_body = {
-            "health_monitor": {
-                "delay": delay,
-                "max_retries": max_retries,
-                "type": Type,
-                "timeout": timeout
-            }
-        }
-        body = json.dumps(post_body)
-        uri = '%s/lb/health_monitors' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        body = json.loads(body)
-        return resp, body
-
-    def update_health_monitor(self, admin_state_up, uuid):
-        put_body = {
-            "health_monitor": {
-                "admin_state_up": admin_state_up
-            }
-        }
-        body = json.dumps(put_body)
-        uri = '%s/lb/health_monitors/%s' % (self.uri_prefix, uuid)
-        resp, body = self.put(uri, body)
-        body = json.loads(body)
-        return resp, body
-
     def associate_health_monitor_with_pool(self, health_monitor_id,
                                            pool_id):
         post_body = {
@@ -340,6 +255,19 @@
         body = json.loads(body)
         return resp, body
 
+    def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
+        uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
+
+    def show_lbaas_agent_hosting_pool(self, pool_id):
+        uri = ('%s/lb/pools/%s/loadbalancer-agent' %
+               (self.uri_prefix, pool_id))
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
+
     def list_routers_on_l3_agent(self, agent_id):
         uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
         resp, body = self.get(uri)
@@ -417,3 +345,9 @@
         resp, body = self.put(uri, body)
         body = json.loads(body)
         return resp, body
+
+    def list_lb_pool_stats(self, pool_id):
+        uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
+        resp, body = self.get(uri)
+        body = json.loads(body)
+        return resp, body
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index 96b9b1d..f1bf548 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -27,7 +27,9 @@
     'health_monitors': 'lb',
     'members': 'lb',
     'vpnservices': 'vpn',
-    'ikepolicies': 'vpn'
+    'ikepolicies': 'vpn',
+    'metering_labels': 'metering',
+    'metering_label_rules': 'metering'
 }
 
 # The following list represents resource names that do not require
@@ -57,19 +59,15 @@
         raise NotImplementedError
 
     def post(self, uri, body, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.post(uri, body, headers)
 
     def put(self, uri, body, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.put(uri, body, headers)
 
     def get(self, uri, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.get(uri, headers)
 
     def delete(self, uri, headers=None):
-        headers = headers or self.rest_client.headers
         return self.rest_client.delete(uri, headers)
 
     def deserialize_list(self, body):
@@ -115,9 +113,14 @@
         return _delete
 
     def _shower(self, resource_name):
-        def _show(resource_id):
+        def _show(resource_id, field_list=[]):
+            # field_list is a sequence of two-element tuples, with the
+            # first element being 'fields'. An example:
+            # [('fields', 'id'), ('fields', 'name')]
             plural = self.pluralize(resource_name)
             uri = '%s/%s' % (self.get_uri(plural), resource_id)
+            if field_list:
+                uri += '?' + urllib.urlencode(field_list)
             resp, body = self.get(uri)
             body = self.deserialize_single(body)
             return resp, body
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
index 720c842..c520018 100644
--- a/tempest/services/network/xml/network_client.py
+++ b/tempest/services/network/xml/network_client.py
@@ -13,32 +13,25 @@
 from lxml import etree
 import xml.etree.ElementTree as ET
 
-from tempest.common.rest_client import RestClientXML
-from tempest.services.compute.xml.common import deep_dict_to_xml
-from tempest.services.compute.xml.common import Document
-from tempest.services.compute.xml.common import Element
-from tempest.services.compute.xml.common import parse_array
-from tempest.services.compute.xml.common import xml_to_json
+from tempest.common import rest_client
+from tempest.services.compute.xml import common
 from tempest.services.network import network_client_base as client_base
 
 
 class NetworkClientXML(client_base.NetworkClientBase):
+    TYPE = "xml"
 
     # list of plurals used for xml serialization
     PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools',
-               'fixed_ips', 'extensions']
+               'fixed_ips', 'extensions', 'extra_dhcp_opts']
 
     def get_rest_client(self, auth_provider):
-        return RestClientXML(auth_provider)
-
-    def _parse_array(self, node):
-        array = []
-        for child in node.getchildren():
-            array.append(xml_to_json(child))
-        return array
+        rc = rest_client.RestClient(auth_provider)
+        rc.TYPE = self.TYPE
+        return rc
 
     def deserialize_list(self, body):
-        return parse_array(etree.fromstring(body), self.PLURALS)
+        return common.parse_array(etree.fromstring(body), self.PLURALS)
 
     def deserialize_single(self, body):
         return _root_tag_fetcher_and_xml_to_json_parse(body)
@@ -47,129 +40,67 @@
         #TODO(enikanorov): implement better json to xml conversion
         # expecting the dict with single key
         root = body.keys()[0]
-        post_body = Element(root)
+        post_body = common.Element(root)
         post_body.add_attr('xmlns:xsi',
                            'http://www.w3.org/2001/XMLSchema-instance')
         for name, attr in body[root].items():
             elt = self._get_element(name, attr)
             post_body.append(elt)
-        return str(Document(post_body))
+        return str(common.Document(post_body))
 
     def serialize_list(self, body, root_name=None, item_name=None):
         # expecting dict in form
         # body = {'resources': [res_dict1, res_dict2, ...]
-        post_body = Element(root_name)
+        post_body = common.Element(root_name)
         post_body.add_attr('xmlns:xsi',
                            'http://www.w3.org/2001/XMLSchema-instance')
         for item in body[body.keys()[0]]:
-            elt = Element(item_name)
+            elt = common.Element(item_name)
             for name, attr in item.items():
                 elt_content = self._get_element(name, attr)
                 elt.append(elt_content)
             post_body.append(elt)
-        return str(Document(post_body))
+        return str(common.Document(post_body))
 
     def _get_element(self, name, value):
         if value is None:
-            xml_elem = Element(name)
+            xml_elem = common.Element(name)
             xml_elem.add_attr("xsi:nil", "true")
             return xml_elem
+        elif isinstance(value, dict):
+            dict_element = common.Element(name)
+            for key, value in value.iteritems():
+                elem = self._get_element(key, value)
+                dict_element.append(elem)
+            return dict_element
+        elif isinstance(value, list):
+            list_element = common.Element(name)
+            for element in value:
+                elem = self._get_element(name[:-1], element)
+                list_element.append(elem)
+            return list_element
         else:
-            return Element(name, value)
-
-    def create_security_group(self, name):
-        uri = '%s/security-groups' % (self.uri_prefix)
-        post_body = Element("security_group")
-        p2 = Element("name", name)
-        post_body.append(p2)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_security_group_rule(self, secgroup_id,
-                                   direction='ingress', **kwargs):
-        uri = '%s/security-group-rules' % (self.uri_prefix)
-        rule = Element("security_group_rule")
-        p1 = Element('security_group_id', secgroup_id)
-        p2 = Element('direction', direction)
-        rule.append(p1)
-        rule.append(p2)
-        for key, val in kwargs.items():
-            key = Element(key, val)
-            rule.append(key)
-        resp, body = self.post(uri, str(Document(rule)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_vip(self, name, protocol, protocol_port, subnet_id, pool_id):
-        uri = '%s/lb/vips' % (self.uri_prefix)
-        post_body = Element("vip")
-        p1 = Element("name", name)
-        p2 = Element("protocol", protocol)
-        p3 = Element("protocol_port", protocol_port)
-        p4 = Element("subnet_id", subnet_id)
-        p5 = Element("pool_id", pool_id)
-        post_body.append(p1)
-        post_body.append(p2)
-        post_body.append(p3)
-        post_body.append(p4)
-        post_body.append(p5)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_vip(self, vip_id, new_name):
-        uri = '%s/lb/vips/%s' % (self.uri_prefix, str(vip_id))
-        put_body = Element("vip")
-        p2 = Element("name", new_name)
-        put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
+            return common.Element(name, value)
 
     def create_member(self, address, protocol_port, pool_id):
         uri = '%s/lb/members' % (self.uri_prefix)
-        post_body = Element("member")
-        p1 = Element("address", address)
-        p2 = Element("protocol_port", protocol_port)
-        p3 = Element("pool_id", pool_id)
+        post_body = common.Element("member")
+        p1 = common.Element("address", address)
+        p2 = common.Element("protocol_port", protocol_port)
+        p3 = common.Element("pool_id", pool_id)
         post_body.append(p1)
         post_body.append(p2)
         post_body.append(p3)
-        resp, body = self.post(uri, str(Document(post_body)))
+        resp, body = self.post(uri, str(common.Document(post_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_member(self, admin_state_up, member_id):
         uri = '%s/lb/members/%s' % (self.uri_prefix, str(member_id))
-        put_body = Element("member")
-        p2 = Element("admin_state_up", admin_state_up)
+        put_body = common.Element("member")
+        p2 = common.Element("admin_state_up", admin_state_up)
         put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def create_health_monitor(self, delay, max_retries, Type, timeout):
-        uri = '%s/lb/health_monitors' % (self.uri_prefix)
-        post_body = Element("health_monitor")
-        p1 = Element("delay", delay)
-        p2 = Element("max_retries", max_retries)
-        p3 = Element("type", Type)
-        p4 = Element("timeout", timeout)
-        post_body.append(p1)
-        post_body.append(p2)
-        post_body.append(p3)
-        post_body.append(p4)
-        resp, body = self.post(uri, str(Document(post_body)))
-        body = _root_tag_fetcher_and_xml_to_json_parse(body)
-        return resp, body
-
-    def update_health_monitor(self, admin_state_up, uuid):
-        uri = '%s/lb/health_monitors/%s' % (self.uri_prefix, str(uuid))
-        put_body = Element("health_monitor")
-        p2 = Element("admin_state_up", admin_state_up)
-        put_body.append(p2)
-        resp, body = self.put(uri, str(Document(put_body)))
+        resp, body = self.put(uri, str(common.Document(put_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -177,10 +108,10 @@
                                            pool_id):
         uri = '%s/lb/pools/%s/health_monitors' % (self.uri_prefix,
                                                   pool_id)
-        post_body = Element("health_monitor")
-        p1 = Element("id", health_monitor_id,)
+        post_body = common.Element("health_monitor")
+        p1 = common.Element("id", health_monitor_id,)
         post_body.append(p1)
-        resp, body = self.post(uri, str(Document(post_body)))
+        resp, body = self.post(uri, str(common.Document(post_body)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -198,94 +129,109 @@
 
     def create_router(self, name, **kwargs):
         uri = '%s/routers' % (self.uri_prefix)
-        router = Element("router")
-        router.append(Element("name", name))
-        deep_dict_to_xml(router, kwargs)
-        resp, body = self.post(uri, str(Document(router)))
+        router = common.Element("router")
+        router.append(common.Element("name", name))
+        common.deep_dict_to_xml(router, kwargs)
+        resp, body = self.post(uri, str(common.Document(router)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_router(self, router_id, **kwargs):
         uri = '%s/routers/%s' % (self.uri_prefix, router_id)
-        router = Element("router")
+        router = common.Element("router")
         for element, content in kwargs.iteritems():
-            router.append(Element(element, content))
-        resp, body = self.put(uri, str(Document(router)))
+            router.append(common.Element(element, content))
+        resp, body = self.put(uri, str(common.Document(router)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def add_router_interface_with_subnet_id(self, router_id, subnet_id):
         uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
               router_id)
-        subnet = Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(Document(subnet)))
+        subnet = common.Element("subnet_id", subnet_id)
+        resp, body = self.put(uri, str(common.Document(subnet)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def add_router_interface_with_port_id(self, router_id, port_id):
         uri = '%s/routers/%s/add_router_interface' % (self.uri_prefix,
               router_id)
-        port = Element("port_id", port_id)
-        resp, body = self.put(uri, str(Document(port)))
+        port = common.Element("port_id", port_id)
+        resp, body = self.put(uri, str(common.Document(port)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def remove_router_interface_with_subnet_id(self, router_id, subnet_id):
         uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
               router_id)
-        subnet = Element("subnet_id", subnet_id)
-        resp, body = self.put(uri, str(Document(subnet)))
+        subnet = common.Element("subnet_id", subnet_id)
+        resp, body = self.put(uri, str(common.Document(subnet)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def remove_router_interface_with_port_id(self, router_id, port_id):
         uri = '%s/routers/%s/remove_router_interface' % (self.uri_prefix,
               router_id)
-        port = Element("port_id", port_id)
-        resp, body = self.put(uri, str(Document(port)))
+        port = common.Element("port_id", port_id)
+        resp, body = self.put(uri, str(common.Document(port)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def create_floating_ip(self, ext_network_id, **kwargs):
         uri = '%s/floatingips' % (self.uri_prefix)
-        floatingip = Element('floatingip')
-        floatingip.append(Element("floating_network_id", ext_network_id))
+        floatingip = common.Element('floatingip')
+        floatingip.append(common.Element("floating_network_id",
+                                         ext_network_id))
         for element, content in kwargs.iteritems():
-            floatingip.append(Element(element, content))
-        resp, body = self.post(uri, str(Document(floatingip)))
+            floatingip.append(common.Element(element, content))
+        resp, body = self.post(uri, str(common.Document(floatingip)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def update_floating_ip(self, floating_ip_id, **kwargs):
         uri = '%s/floatingips/%s' % (self.uri_prefix, floating_ip_id)
-        floatingip = Element('floatingip')
+        floatingip = common.Element('floatingip')
         floatingip.add_attr('xmlns:xsi',
                             'http://www.w3.org/2001/XMLSchema-instance')
         for element, content in kwargs.iteritems():
             if content is None:
-                xml_elem = Element(element)
+                xml_elem = common.Element(element)
                 xml_elem.add_attr("xsi:nil", "true")
                 floatingip.append(xml_elem)
             else:
-                floatingip.append(Element(element, content))
-        resp, body = self.put(uri, str(Document(floatingip)))
+                floatingip.append(common.Element(element, content))
+        resp, body = self.put(uri, str(common.Document(floatingip)))
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
     def list_router_interfaces(self, uuid):
         uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
         resp, body = self.get(uri)
-        ports = parse_array(etree.fromstring(body), self.PLURALS)
+        ports = common.parse_array(etree.fromstring(body), self.PLURALS)
         ports = {"ports": ports}
         return resp, ports
 
     def update_agent(self, agent_id, agent_info):
         uri = '%s/agents/%s' % (self.uri_prefix, agent_id)
-        agent = Element('agent')
+        agent = common.Element('agent')
         for (key, value) in agent_info.items():
-            p = Element(key, value)
+            p = common.Element(key, value)
             agent.append(p)
-        resp, body = self.put(uri, str(Document(agent)))
+        resp, body = self.put(uri, str(common.Document(agent)))
+        body = _root_tag_fetcher_and_xml_to_json_parse(body)
+        return resp, body
+
+    def list_pools_hosted_by_one_lbaas_agent(self, agent_id):
+        uri = '%s/agents/%s/loadbalancer-pools' % (self.uri_prefix, agent_id)
+        resp, body = self.get(uri)
+        pools = common.parse_array(etree.fromstring(body))
+        body = {'pools': pools}
+        return resp, body
+
+    def show_lbaas_agent_hosting_pool(self, pool_id):
+        uri = ('%s/lb/pools/%s/loadbalancer-agent' %
+               (self.uri_prefix, pool_id))
+        resp, body = self.get(uri)
         body = _root_tag_fetcher_and_xml_to_json_parse(body)
         return resp, body
 
@@ -304,14 +250,14 @@
     def list_dhcp_agent_hosting_network(self, network_id):
         uri = '%s/networks/%s/dhcp-agents' % (self.uri_prefix, network_id)
         resp, body = self.get(uri)
-        agents = parse_array(etree.fromstring(body))
+        agents = common.parse_array(etree.fromstring(body))
         body = {'agents': agents}
         return resp, body
 
     def list_networks_hosted_by_one_dhcp_agent(self, agent_id):
         uri = '%s/agents/%s/dhcp-networks' % (self.uri_prefix, agent_id)
         resp, body = self.get(uri)
-        networks = parse_array(etree.fromstring(body))
+        networks = common.parse_array(etree.fromstring(body))
         body = {'networks': networks}
         return resp, body
 
@@ -321,14 +267,20 @@
         resp, body = self.delete(uri)
         return resp, body
 
+    def list_lb_pool_stats(self, pool_id):
+        uri = '%s/lb/pools/%s/stats' % (self.uri_prefix, pool_id)
+        resp, body = self.get(uri)
+        body = _root_tag_fetcher_and_xml_to_json_parse(body)
+        return resp, body
+
 
 def _root_tag_fetcher_and_xml_to_json_parse(xml_returned_body):
     body = ET.fromstring(xml_returned_body)
     root_tag = body.tag
     if root_tag.startswith("{"):
         ns, root_tag = root_tag.split("}", 1)
-    body = xml_to_json(etree.fromstring(xml_returned_body),
-                       NetworkClientXML.PLURALS)
+    body = common.xml_to_json(etree.fromstring(xml_returned_body),
+                              NetworkClientXML.PLURALS)
     nil = '{http://www.w3.org/2001/XMLSchema-instance}nil'
     for key, val in body.iteritems():
         if isinstance(val, dict):
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 79c5719..09e484e 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -32,7 +32,7 @@
     def create_object(self, container, object_name, data, params=None):
         """Create storage object."""
 
-        headers = dict(self.headers)
+        headers = self.get_headers()
         if not data:
             headers['content-length'] = '0'
         url = "%s/%s" % (str(container), str(object_name))
@@ -131,7 +131,7 @@
     def create_object_segments(self, container, object_name, segment, data):
         """Creates object segments."""
         url = "{0}/{1}/{2}".format(container, object_name, segment)
-        resp, body = self.put(url, data, self.headers)
+        resp, body = self.put(url, data)
         return resp, body
 
 
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index b70b2e8..113003c 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -90,7 +90,7 @@
 
         # Password must be provided on stack create so that heat
         # can perform future operations on behalf of the user
-        headers = dict(self.headers)
+        headers = self.get_headers()
         headers['X-Auth-Key'] = self.password
         headers['X-Auth-User'] = self.user
         return headers, body
@@ -106,14 +106,14 @@
         """Suspend a stack."""
         url = 'stacks/%s/actions' % stack_identifier
         body = {'suspend': None}
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
 
     def resume_stack(self, stack_identifier):
         """Resume a stack."""
         url = 'stacks/%s/actions' % stack_identifier
         body = {'resume': None}
-        resp, body = self.post(url, json.dumps(body), self.headers)
+        resp, body = self.post(url, json.dumps(body))
         return resp, body
 
     def list_resources(self, stack_identifier):
@@ -232,7 +232,7 @@
     def _validate_template(self, post_body):
         """Returns the validation request result."""
         post_body = json.dumps(post_body)
-        resp, body = self.post('validate', post_body, self.headers)
+        resp, body = self.post('validate', post_body)
         body = json.loads(body)
         return resp, body
 
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
index a35a1ab..610f07b 100644
--- a/tempest/services/telemetry/telemetry_client_base.py
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -38,7 +38,6 @@
     def __init__(self, auth_provider):
         self.rest_client = self.get_rest_client(auth_provider)
         self.rest_client.service = CONF.telemetry.catalog_type
-        self.headers = self.rest_client.headers
         self.version = '2'
         self.uri_prefix = "v%s" % self.version
 
@@ -69,15 +68,15 @@
 
     def post(self, uri, body):
         body = self.serialize(body)
-        resp, body = self.rest_client.post(uri, body, self.headers)
+        resp, body = self.rest_client.post(uri, body)
         body = self.deserialize(body)
         return resp, body
 
     def put(self, uri, body):
-        return self.rest_client.put(uri, body, self.headers)
+        return self.rest_client.put(uri, body)
 
     def get(self, uri):
-        resp, body = self.rest_client.get(uri, self.headers)
+        resp, body = self.rest_client.get(uri)
         body = self.deserialize(body)
         return resp, body
 
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
index f29fe22..165f29a 100644
--- a/tempest/services/telemetry/xml/telemetry_client.py
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -15,16 +15,19 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest.services.compute.xml.common import Document
 from tempest.services.compute.xml.common import xml_to_json
 import tempest.services.telemetry.telemetry_client_base as client
 
 
 class TelemetryClientXML(client.TelemetryClientBase):
+    TYPE = "xml"
 
     def get_rest_client(self, auth_provider):
-        return RestClientXML(auth_provider)
+        rc = rest_client.RestClient(auth_provider)
+        rc.TYPE = self.TYPE
+        return rc
 
     def _parse_array(self, body):
         array = []
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index 653532e..0d50524 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -64,7 +64,7 @@
         }
 
         post_body = json.dumps({'volume_type': post_body})
-        resp, body = self.post('types', post_body, self.headers)
+        resp, body = self.post('types', post_body)
         body = json.loads(body)
         return resp, body['volume_type']
 
@@ -98,7 +98,7 @@
         """
         url = "types/%s/extra_specs" % str(vol_type_id)
         post_body = json.dumps({'extra_specs': extra_spec})
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['extra_specs']
 
@@ -119,6 +119,6 @@
         url = "types/%s/extra_specs/%s" % (str(vol_type_id),
                                            str(extra_spec_name))
         put_body = json.dumps(extra_spec)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
new file mode 100644
index 0000000..baaf5a0
--- /dev/null
+++ b/tempest/services/volume/json/backups_client.py
@@ -0,0 +1,89 @@
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import json
+import time
+
+from tempest.common import rest_client
+from tempest import config
+from tempest import exceptions
+
+CONF = config.CONF
+
+
+class BackupsClientJSON(rest_client.RestClient):
+    """
+    Client class to send CRUD Volume backup API requests to a Cinder endpoint
+    """
+
+    def __init__(self, auth_provider):
+        super(BackupsClientJSON, self).__init__(auth_provider)
+        self.service = CONF.volume.catalog_type
+        self.build_interval = CONF.volume.build_interval
+        self.build_timeout = CONF.volume.build_timeout
+
+    def create_backup(self, volume_id, container=None, name=None,
+                      description=None):
+        """Creates a backup of volume."""
+        post_body = {'volume_id': volume_id}
+        if container:
+            post_body['container'] = container
+        if name:
+            post_body['name'] = name
+        if description:
+            post_body['description'] = description
+        post_body = json.dumps({'backup': post_body})
+        resp, body = self.post('backups', post_body)
+        body = json.loads(body)
+        return resp, body['backup']
+
+    def restore_backup(self, backup_id, volume_id=None):
+        """Restore volume from backup."""
+        post_body = {'volume_id': volume_id}
+        post_body = json.dumps({'restore': post_body})
+        resp, body = self.post('backups/%s/restore' % (backup_id), post_body)
+        body = json.loads(body)
+        return resp, body['restore']
+
+    def delete_backup(self, backup_id):
+        """Delete a backup of volume."""
+        resp, body = self.delete('backups/%s' % (str(backup_id)))
+        return resp, body
+
+    def get_backup(self, backup_id):
+        """Returns the details of a single backup."""
+        url = "backups/%s" % str(backup_id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body['backup']
+
+    def wait_for_backup_status(self, backup_id, status):
+        """Waits for a Backup to reach a given status."""
+        resp, body = self.get_backup(backup_id)
+        backup_status = body['status']
+        start = int(time.time())
+
+        while backup_status != status:
+            time.sleep(self.build_interval)
+            resp, body = self.get_backup(backup_id)
+            backup_status = body['status']
+            if backup_status == 'error':
+                raise exceptions.VolumeBackupException(backup_id=backup_id)
+
+            if int(time.time()) - start >= self.build_timeout:
+                message = ('Volume backup %s failed to reach %s status within '
+                           'the required time (%s s).' %
+                           (backup_id, status, self.build_timeout))
+                raise exceptions.TimeoutException(message)
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index 0a79469..ba33c49 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -72,15 +72,14 @@
         post_body = {'volume_id': volume_id}
         post_body.update(kwargs)
         post_body = json.dumps({'snapshot': post_body})
-        resp, body = self.post('snapshots', post_body, self.headers)
+        resp, body = self.post('snapshots', post_body)
         body = json.loads(body)
         return resp, body['snapshot']
 
     def update_snapshot(self, snapshot_id, **kwargs):
         """Updates a snapshot."""
         put_body = json.dumps({'snapshot': kwargs})
-        resp, body = self.put('snapshots/%s' % snapshot_id, put_body,
-                              self.headers)
+        resp, body = self.put('snapshots/%s' % snapshot_id, put_body)
         body = json.loads(body)
         return resp, body['snapshot']
 
@@ -135,8 +134,7 @@
     def reset_snapshot_status(self, snapshot_id, status):
         """Reset the specified snapshot's status."""
         post_body = json.dumps({'os-reset_status': {"status": status}})
-        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body,
-                               self.headers)
+        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body)
         return resp, body
 
     def update_snapshot_status(self, snapshot_id, status, progress):
@@ -147,21 +145,21 @@
         }
         post_body = json.dumps({'os-update_snapshot_status': post_body})
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def create_snapshot_metadata(self, snapshot_id, metadata):
         """Create metadata for the snapshot."""
         put_body = json.dumps({'metadata': metadata})
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.post(url, put_body, self.headers)
+        resp, body = self.post(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def get_snapshot_metadata(self, snapshot_id):
         """Get metadata of the snapshot."""
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -169,7 +167,7 @@
         """Update metadata for the snapshot."""
         put_body = json.dumps({'metadata': metadata})
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -177,19 +175,18 @@
         """Update metadata item for the snapshot."""
         put_body = json.dumps({'meta': meta_item})
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['meta']
 
     def delete_snapshot_metadata_item(self, snapshot_id, id):
         """Delete metadata item for the snapshot."""
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
 
     def force_delete_snapshot(self, snapshot_id):
         """Force Delete Snapshot."""
         post_body = json.dumps({'os-force_delete': {}})
-        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body,
-                               self.headers)
+        resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body)
         return resp, body
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 0524212..2183c56 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -81,15 +81,14 @@
         post_body = {'size': size}
         post_body.update(kwargs)
         post_body = json.dumps({'volume': post_body})
-        resp, body = self.post('volumes', post_body, self.headers)
+        resp, body = self.post('volumes', post_body)
         body = json.loads(body)
         return resp, body['volume']
 
     def update_volume(self, volume_id, **kwargs):
         """Updates the Specified Volume."""
         put_body = json.dumps({'volume': kwargs})
-        resp, body = self.put('volumes/%s' % volume_id, put_body,
-                              self.headers)
+        resp, body = self.put('volumes/%s' % volume_id, put_body)
         body = json.loads(body)
         return resp, body['volume']
 
@@ -105,7 +104,7 @@
         }
         post_body = json.dumps({'os-volume_upload_image': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['os-volume_upload_image']
 
@@ -117,7 +116,7 @@
         }
         post_body = json.dumps({'os-attach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def detach_volume(self, volume_id):
@@ -125,7 +124,7 @@
         post_body = {}
         post_body = json.dumps({'os-detach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reserve_volume(self, volume_id):
@@ -133,7 +132,7 @@
         post_body = {}
         post_body = json.dumps({'os-reserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def unreserve_volume(self, volume_id):
@@ -141,7 +140,7 @@
         post_body = {}
         post_body = json.dumps({'os-unreserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def wait_for_volume_status(self, volume_id, status):
@@ -178,28 +177,25 @@
         }
         post_body = json.dumps({'os-extend': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reset_volume_status(self, volume_id, status):
         """Reset the Specified Volume's Status."""
         post_body = json.dumps({'os-reset_status': {"status": status}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_begin_detaching(self, volume_id):
         """Volume Begin Detaching."""
         post_body = json.dumps({'os-begin_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_roll_detaching(self, volume_id):
         """Volume Roll Detaching."""
         post_body = json.dumps({'os-roll_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def create_volume_transfer(self, vol_id, display_name=None):
@@ -210,16 +206,14 @@
         if display_name:
             post_body['name'] = display_name
         post_body = json.dumps({'transfer': post_body})
-        resp, body = self.post('os-volume-transfer',
-                               post_body,
-                               self.headers)
+        resp, body = self.post('os-volume-transfer', post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -243,7 +237,7 @@
         }
         url = 'os-volume-transfer/%s/accept' % transfer_id
         post_body = json.dumps({'accept': post_body})
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -254,28 +248,27 @@
         }
         post_body = json.dumps({'os-update_readonly_flag': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def force_delete_volume(self, volume_id):
         """Force Delete Volume."""
         post_body = json.dumps({'os-force_delete': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def create_volume_metadata(self, volume_id, metadata):
         """Create metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.post(url, put_body, self.headers)
+        resp, body = self.post(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -283,7 +276,7 @@
         """Update metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -291,12 +284,12 @@
         """Update metadata item for the volume."""
         put_body = json.dumps({'meta': meta_item})
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['meta']
 
     def delete_volume_metadata_item(self, volume_id, id):
         """Delete metadata item for the volume."""
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
diff --git a/tempest/services/volume/v2/json/volumes_client.py b/tempest/services/volume/v2/json/volumes_client.py
index 0524212..bd98402 100644
--- a/tempest/services/volume/v2/json/volumes_client.py
+++ b/tempest/services/volume/v2/json/volumes_client.py
@@ -24,14 +24,15 @@
 CONF = config.CONF
 
 
-class VolumesClientJSON(RestClient):
+class VolumesV2ClientJSON(RestClient):
     """
-    Client class to send CRUD Volume API requests to a Cinder endpoint
+    Client class to send CRUD Volume V2 API requests to a Cinder endpoint
     """
 
     def __init__(self, auth_provider):
-        super(VolumesClientJSON, self).__init__(auth_provider)
+        super(VolumesV2ClientJSON, self).__init__(auth_provider)
 
+        self.api_version = "v2"
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.volume.build_interval
         self.build_timeout = CONF.volume.build_timeout
@@ -72,7 +73,7 @@
         Creates a new Volume.
         size(Required): Size of volume in GB.
         Following optional keyword arguments are accepted:
-        display_name: Optional Volume Name.
+        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
@@ -81,15 +82,14 @@
         post_body = {'size': size}
         post_body.update(kwargs)
         post_body = json.dumps({'volume': post_body})
-        resp, body = self.post('volumes', post_body, self.headers)
+        resp, body = self.post('volumes', post_body)
         body = json.loads(body)
         return resp, body['volume']
 
     def update_volume(self, volume_id, **kwargs):
         """Updates the Specified Volume."""
         put_body = json.dumps({'volume': kwargs})
-        resp, body = self.put('volumes/%s' % volume_id, put_body,
-                              self.headers)
+        resp, body = self.put('volumes/%s' % volume_id, put_body)
         body = json.loads(body)
         return resp, body['volume']
 
@@ -105,7 +105,7 @@
         }
         post_body = json.dumps({'os-volume_upload_image': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['os-volume_upload_image']
 
@@ -117,7 +117,7 @@
         }
         post_body = json.dumps({'os-attach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def detach_volume(self, volume_id):
@@ -125,7 +125,7 @@
         post_body = {}
         post_body = json.dumps({'os-detach': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reserve_volume(self, volume_id):
@@ -133,7 +133,7 @@
         post_body = {}
         post_body = json.dumps({'os-reserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def unreserve_volume(self, volume_id):
@@ -141,13 +141,13 @@
         post_body = {}
         post_body = json.dumps({'os-unreserve': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def wait_for_volume_status(self, volume_id, status):
         """Waits for a Volume to reach a given status."""
         resp, body = self.get_volume(volume_id)
-        volume_name = body['display_name']
+        volume_name = body['name']
         volume_status = body['status']
         start = int(time.time())
 
@@ -178,48 +178,43 @@
         }
         post_body = json.dumps({'os-extend': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def reset_volume_status(self, volume_id, status):
         """Reset the Specified Volume's Status."""
         post_body = json.dumps({'os-reset_status': {"status": status}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_begin_detaching(self, volume_id):
         """Volume Begin Detaching."""
         post_body = json.dumps({'os-begin_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def volume_roll_detaching(self, volume_id):
         """Volume Roll Detaching."""
         post_body = json.dumps({'os-roll_detaching': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
-    def create_volume_transfer(self, vol_id, display_name=None):
+    def create_volume_transfer(self, vol_id, name=None):
         """Create a volume transfer."""
         post_body = {
             'volume_id': vol_id
         }
-        if display_name:
-            post_body['name'] = display_name
+        if name:
+            post_body['name'] = name
         post_body = json.dumps({'transfer': post_body})
-        resp, body = self.post('os-volume-transfer',
-                               post_body,
-                               self.headers)
+        resp, body = self.post('os-volume-transfer', post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -243,7 +238,7 @@
         }
         url = 'os-volume-transfer/%s/accept' % transfer_id
         post_body = json.dumps({'accept': post_body})
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         body = json.loads(body)
         return resp, body['transfer']
 
@@ -254,28 +249,27 @@
         }
         post_body = json.dumps({'os-update_readonly_flag': post_body})
         url = 'volumes/%s/action' % (volume_id)
-        resp, body = self.post(url, post_body, self.headers)
+        resp, body = self.post(url, post_body)
         return resp, body
 
     def force_delete_volume(self, volume_id):
         """Force Delete Volume."""
         post_body = json.dumps({'os-force_delete': {}})
-        resp, body = self.post('volumes/%s/action' % volume_id, post_body,
-                               self.headers)
+        resp, body = self.post('volumes/%s/action' % volume_id, post_body)
         return resp, body
 
     def create_volume_metadata(self, volume_id, metadata):
         """Create metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.post(url, put_body, self.headers)
+        resp, body = self.post(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -283,7 +277,7 @@
         """Update metadata for the volume."""
         put_body = json.dumps({'metadata': metadata})
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['metadata']
 
@@ -291,12 +285,12 @@
         """Update metadata item for the volume."""
         put_body = json.dumps({'meta': meta_item})
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, put_body, self.headers)
+        resp, body = self.put(url, put_body)
         body = json.loads(body)
         return resp, body['meta']
 
     def delete_volume_metadata_item(self, volume_id, id):
         """Delete metadata item for the volume."""
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.delete(url, self.headers)
+        resp, body = self.delete(url)
         return resp, body
diff --git a/tempest/services/volume/v2/xml/volumes_client.py b/tempest/services/volume/v2/xml/volumes_client.py
index deb56fd..bc57842 100644
--- a/tempest/services/volume/v2/xml/volumes_client.py
+++ b/tempest/services/volume/v2/xml/volumes_client.py
@@ -18,7 +18,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -30,13 +30,16 @@
 CONF = config.CONF
 
 
-class VolumesClientXML(RestClientXML):
+class VolumesV2ClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
-        super(VolumesClientXML, self).__init__(auth_provider)
+        super(VolumesV2ClientXML, self).__init__(auth_provider)
+
+        self.api_version = "v2"
         self.service = CONF.volume.catalog_type
         self.build_interval = CONF.compute.build_interval
         self.build_timeout = CONF.compute.build_timeout
@@ -87,13 +90,11 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
             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):
@@ -103,7 +104,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -115,7 +116,7 @@
     def get_volume(self, volume_id):
         """Returns the details of a single volume."""
         url = "volumes/%s" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_volume(etree.fromstring(body))
         body = self._check_if_bootable(body)
         return resp, body
@@ -124,7 +125,7 @@
         """Creates a new Volume.
 
         :param size: Size of volume in GB. (Required)
-        :param display_name: Optional Volume Name.
+        :param name: Optional Volume Name.
         :param metadata: An optional dictionary of values for metadata.
         :param volume_type: Optional Name of volume_type for the volume
         :param snapshot_id: When specified the volume is created from
@@ -151,8 +152,7 @@
         for key, value in attr_to_add.items():
             volume.add_attr(key, value)
 
-        resp, body = self.post('volumes', str(Document(volume)),
-                               self.headers)
+        resp, body = self.post('volumes', str(Document(volume)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -161,8 +161,7 @@
         put_body = Element("volume", xmlns=XMLNS_11, **kwargs)
 
         resp, body = self.put('volumes/%s' % volume_id,
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -204,7 +203,7 @@
                             mountpoint=mountpoint
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -213,7 +212,7 @@
         """Detaches a volume from an instance."""
         post_body = Element("os-detach")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -224,7 +223,7 @@
                             image_name=image_name,
                             disk_format=disk_format)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -233,7 +232,7 @@
         post_body = Element("os-extend",
                             new_size=extend_size)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -244,7 +243,7 @@
                             status=status
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -253,7 +252,7 @@
         """Volume Begin Detaching."""
         post_body = Element("os-begin_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -262,7 +261,7 @@
         """Volume Roll Detaching."""
         post_body = Element("os-roll_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -271,7 +270,7 @@
         """Reserves a volume."""
         post_body = Element("os-reserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -280,27 +279,26 @@
         """Restore a reserved volume ."""
         post_body = Element("os-unreserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
 
-    def create_volume_transfer(self, vol_id, display_name=None):
+    def create_volume_transfer(self, vol_id, name=None):
         """Create a volume transfer."""
         post_body = Element("transfer",
                             volume_id=vol_id)
-        if display_name:
-            post_body.add_attr('name', display_name)
+        if name:
+            post_body.add_attr('name', name)
         resp, body = self.post('os-volume-transfer',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -310,7 +308,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -334,7 +332,7 @@
         """Accept a volume transfer."""
         post_body = Element("accept", auth_key=transfer_auth_key)
         url = 'os-volume-transfer/%s/accept' % transfer_id
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -343,7 +341,7 @@
         post_body = Element("os-update_readonly_flag",
                             readonly=readonly)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -352,7 +350,7 @@
         """Force Delete Volume."""
         post_body = Element("os-force_delete")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -376,15 +374,14 @@
         """Create metadata for the volume."""
         post_body = self._metadata_body(metadata)
         resp, body = self.post('volumes/%s/metadata' % volume_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -392,7 +389,7 @@
         """Update metadata for the volume."""
         put_body = self._metadata_body(metadata)
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -402,7 +399,7 @@
             put_body = Element('meta', key=k)
             put_body.append(Text(v))
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py
index 7278fd9..fb84c83 100644
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ b/tempest/services/volume/xml/admin/volume_hosts_client.py
@@ -1,4 +1,4 @@
-# Copyright 2013 Openstack Foundation.
+# Copyright 2013 OpenStack Foundation.
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -17,17 +17,18 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class VolumeHostsClientXML(RestClientXML):
+class VolumeHostsClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumeHostsClientXML, self).__init__(auth_provider)
@@ -67,6 +68,6 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 29ba431..77bafec 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -29,10 +29,11 @@
 CONF = config.CONF
 
 
-class VolumeTypesClientXML(RestClientXML):
+class VolumeTypesClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume Types API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumeTypesClientXML, self).__init__(auth_provider)
@@ -72,7 +73,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volume_types = []
         if body is not None:
@@ -83,7 +84,7 @@
     def get_volume_type(self, type_id):
         """Returns the details of a single volume_type."""
         url = "types/%s" % str(type_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume_type(body)
 
@@ -108,8 +109,7 @@
                 spec.append(Text(value))
                 _extra_specs.append(spec)
 
-        resp, body = self.post('types', str(Document(vol_type)),
-                               self.headers)
+        resp, body = self.post('types', str(Document(vol_type)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -124,7 +124,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         extra_specs = []
         if body is not None:
@@ -136,7 +136,7 @@
         """Returns the details of a single volume_type extra spec."""
         url = "types/%s/extra_specs/%s" % (str(vol_type_id),
                                            str(extra_spec_name))
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, self._parse_volume_type_extra_specs(body)
 
@@ -160,8 +160,7 @@
         else:
             extra_specs = None
 
-        resp, body = self.post(url, str(Document(extra_specs)),
-                               self.headers)
+        resp, body = self.post(url, str(Document(extra_specs)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -190,8 +189,7 @@
                 spec.append(Text(value))
                 extra_specs.append(spec)
 
-        resp, body = self.put(url, str(Document(extra_specs)),
-                              self.headers)
+        resp, body = self.put(url, str(Document(extra_specs)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/services/volume/xml/backups_client.py b/tempest/services/volume/xml/backups_client.py
new file mode 100644
index 0000000..81caaee
--- /dev/null
+++ b/tempest/services/volume/xml/backups_client.py
@@ -0,0 +1,26 @@
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.services.volume.json import backups_client
+
+
+class BackupsClientXML(backups_client.BackupsClientJSON):
+    """
+    Client class to send CRUD Volume Backup API requests to a Cinder endpoint
+    """
+    TYPE = "xml"
+
+    #TODO(gfidente): XML client isn't yet implemented because of bug 1270589
+    pass
diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py
index 21e1d04..1ea974f 100644
--- a/tempest/services/volume/xml/extensions_client.py
+++ b/tempest/services/volume/xml/extensions_client.py
@@ -15,14 +15,15 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest.services.compute.xml.common import xml_to_json
 
 CONF = config.CONF
 
 
-class ExtensionsClientXML(RestClientXML):
+class ExtensionsClientXML(rest_client.RestClient):
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(ExtensionsClientXML, self).__init__(auth_provider)
@@ -36,6 +37,6 @@
 
     def list_extensions(self):
         url = 'extensions'
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_array(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index 4f066a6..458001b 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -15,7 +15,7 @@
 
 from lxml import etree
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
@@ -30,8 +30,9 @@
 LOG = logging.getLogger(__name__)
 
 
-class SnapshotsClientXML(RestClientXML):
+class SnapshotsClientXML(rest_client.RestClient):
     """Client class to send CRUD Volume API requests."""
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(SnapshotsClientXML, self).__init__(auth_provider)
@@ -47,7 +48,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         snapshots = []
         for snap in body:
@@ -61,7 +62,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         snapshots = []
         for snap in body:
@@ -71,7 +72,7 @@
     def get_snapshot(self, snapshot_id):
         """Returns the details of a single snapshot."""
         url = "snapshots/%s" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         return resp, xml_to_json(body)
 
@@ -86,8 +87,7 @@
         snapshot = Element("snapshot", xmlns=XMLNS_11, volume_id=volume_id)
         for key, value in kwargs.items():
             snapshot.add_attr(key, value)
-        resp, body = self.post('snapshots', str(Document(snapshot)),
-                               self.headers)
+        resp, body = self.post('snapshots', str(Document(snapshot)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -96,8 +96,7 @@
         put_body = Element("snapshot", xmlns=XMLNS_11, **kwargs)
 
         resp, body = self.put('snapshots/%s' % snapshot_id,
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -155,7 +154,7 @@
                             status=status
                             )
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -167,7 +166,7 @@
                             progress=progress
                             )
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -191,15 +190,14 @@
         """Create metadata for the snapshot."""
         post_body = self._metadata_body(metadata)
         resp, body = self.post('snapshots/%s/metadata' % snapshot_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_snapshot_metadata(self, snapshot_id):
         """Get metadata of the snapshot."""
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -207,7 +205,7 @@
         """Update metadata for the snapshot."""
         put_body = self._metadata_body(metadata)
         url = "snapshots/%s/metadata" % str(snapshot_id)
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -217,7 +215,7 @@
             put_body = Element('meta', key=k)
             put_body.append(Text(v))
         url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id))
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -230,7 +228,7 @@
         """Force Delete Snapshot."""
         post_body = Element("os-force_delete")
         url = 'snapshots/%s/action' % str(snapshot_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index deb56fd..aef1e3c 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -17,8 +17,9 @@
 import urllib
 
 from lxml import etree
+from xml.sax.saxutils import escape
 
-from tempest.common.rest_client import RestClientXML
+from tempest.common import rest_client
 from tempest import config
 from tempest import exceptions
 from tempest.services.compute.xml.common import Document
@@ -30,10 +31,11 @@
 CONF = config.CONF
 
 
-class VolumesClientXML(RestClientXML):
+class VolumesClientXML(rest_client.RestClient):
     """
     Client class to send CRUD Volume API requests to a Cinder endpoint
     """
+    TYPE = "xml"
 
     def __init__(self, auth_provider):
         super(VolumesClientXML, self).__init__(auth_provider)
@@ -87,7 +89,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -103,7 +105,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -115,7 +117,7 @@
     def get_volume(self, volume_id):
         """Returns the details of a single volume."""
         url = "volumes/%s" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_volume(etree.fromstring(body))
         body = self._check_if_bootable(body)
         return resp, body
@@ -151,8 +153,7 @@
         for key, value in attr_to_add.items():
             volume.add_attr(key, value)
 
-        resp, body = self.post('volumes', str(Document(volume)),
-                               self.headers)
+        resp, body = self.post('volumes', str(Document(volume)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -161,8 +162,7 @@
         put_body = Element("volume", xmlns=XMLNS_11, **kwargs)
 
         resp, body = self.put('volumes/%s' % volume_id,
-                              str(Document(put_body)),
-                              self.headers)
+                              str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
@@ -204,7 +204,7 @@
                             mountpoint=mountpoint
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -213,7 +213,7 @@
         """Detaches a volume from an instance."""
         post_body = Element("os-detach")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -224,7 +224,7 @@
                             image_name=image_name,
                             disk_format=disk_format)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -233,7 +233,7 @@
         post_body = Element("os-extend",
                             new_size=extend_size)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -244,7 +244,7 @@
                             status=status
                             )
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -253,7 +253,7 @@
         """Volume Begin Detaching."""
         post_body = Element("os-begin_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -262,7 +262,7 @@
         """Volume Roll Detaching."""
         post_body = Element("os-roll_detaching")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -271,7 +271,7 @@
         """Reserves a volume."""
         post_body = Element("os-reserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -280,7 +280,7 @@
         """Restore a reserved volume ."""
         post_body = Element("os-unreserve")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -292,15 +292,14 @@
         if display_name:
             post_body.add_attr('name', display_name)
         resp, body = self.post('os-volume-transfer',
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
     def get_volume_transfer(self, transfer_id):
         """Returns the details of a volume transfer."""
         url = "os-volume-transfer/%s" % str(transfer_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -310,7 +309,7 @@
         if params:
             url += '?%s' % urllib.urlencode(params)
 
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = etree.fromstring(body)
         volumes = []
         if body is not None:
@@ -334,7 +333,7 @@
         """Accept a volume transfer."""
         post_body = Element("accept", auth_key=transfer_auth_key)
         url = 'os-volume-transfer/%s/accept' % transfer_id
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         volume = xml_to_json(etree.fromstring(body))
         return resp, volume
 
@@ -343,7 +342,7 @@
         post_body = Element("os-update_readonly_flag",
                             readonly=readonly)
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -352,7 +351,7 @@
         """Force Delete Volume."""
         post_body = Element("os-force_delete")
         url = 'volumes/%s/action' % str(volume_id)
-        resp, body = self.post(url, str(Document(post_body)), self.headers)
+        resp, body = self.post(url, str(Document(post_body)))
         if body:
             body = xml_to_json(etree.fromstring(body))
         return resp, body
@@ -361,7 +360,8 @@
         post_body = Element('metadata')
         for k, v in meta.items():
             data = Element('meta', key=k)
-            data.append(Text(v))
+            # Escape value to allow for special XML chars
+            data.append(Text(escape(v)))
             post_body.append(data)
         return post_body
 
@@ -376,15 +376,14 @@
         """Create metadata for the volume."""
         post_body = self._metadata_body(metadata)
         resp, body = self.post('volumes/%s/metadata' % volume_id,
-                               str(Document(post_body)),
-                               self.headers)
+                               str(Document(post_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
     def get_volume_metadata(self, volume_id):
         """Get metadata of the volume."""
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.get(url, self.headers)
+        resp, body = self.get(url)
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -392,7 +391,7 @@
         """Update metadata for the volume."""
         put_body = self._metadata_body(metadata)
         url = "volumes/%s/metadata" % str(volume_id)
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = self._parse_key_value(etree.fromstring(body))
         return resp, body
 
@@ -402,7 +401,7 @@
             put_body = Element('meta', key=k)
             put_body.append(Text(v))
         url = "volumes/%s/metadata/%s" % (str(volume_id), str(id))
-        resp, body = self.put(url, str(Document(put_body)), self.headers)
+        resp, body = self.put(url, str(Document(put_body)))
         body = xml_to_json(etree.fromstring(body))
         return resp, body
 
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index d4689c4..3715636 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -220,7 +220,7 @@
     LOG.info("Run %d actions (%d failed)" %
              (sum_runs, sum_fails))
 
-    if not had_errors:
+    if not had_errors and CONF.stress.full_clean_stack:
         LOG.info("cleaning up")
         cleanup.cleanup()
     if had_errors:
diff --git a/tempest/stress/run_stress.py b/tempest/stress/run_stress.py
index 76320d0..c7c17c0 100755
--- a/tempest/stress/run_stress.py
+++ b/tempest/stress/run_stress.py
@@ -18,7 +18,7 @@
 import inspect
 import json
 import sys
-from testtools.testsuite import iterate_tests
+from testtools import testsuite
 try:
     from unittest import loader
 except ImportError:
@@ -38,7 +38,7 @@
     tests = []
     testloader = loader.TestLoader()
     list = testloader.discover(path)
-    for func in (iterate_tests(list)):
+    for func in (testsuite.iterate_tests(list)):
         attrs = []
         try:
             method_name = getattr(func, '_testMethodName')
@@ -87,8 +87,13 @@
             # NOTE(mkoderer): we just save the last result code
             if (step_result != 0):
                 result = step_result
+                if ns.stop:
+                    return result
     else:
-        driver.stress_openstack(tests, ns.duration, ns.number, ns.stop)
+        result = driver.stress_openstack(tests,
+                                         ns.duration,
+                                         ns.number,
+                                         ns.stop)
     return result
 
 
diff --git a/tempest/test.py b/tempest/test.py
index dcba226..c6e3d6e 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -23,7 +23,6 @@
 import uuid
 
 import fixtures
-import nose.plugins.attrib
 import testresources
 import testtools
 
@@ -43,11 +42,10 @@
 
 
 def attr(*args, **kwargs):
-    """A decorator which applies the nose and testtools attr decorator
+    """A decorator which applies the  testtools attr decorator
 
-    This decorator applies the nose attr decorator as well as the
-    the testtools.testcase.attr if it is in the list of attributes
-    to testtools we want to apply.
+    This decorator applies the testtools.testcase.attr if it is in the list of
+    attributes to testtools we want to apply.
     """
 
     def decorator(f):
@@ -60,7 +58,7 @@
                 f = testtools.testcase.attr(attr)(f)
                 if attr == 'smoke':
                     f = testtools.testcase.attr('gate')(f)
-        return nose.plugins.attrib.attr(*args, **kwargs)(f)
+        return f
 
     return decorator
 
@@ -149,6 +147,8 @@
             else:
                 skip = True
             if "bug" in kwargs and skip is True:
+                if not kwargs['bug'].isdigit():
+                    raise ValueError('bug must be a valid bug number')
                 msg = "Skipped until Bug: %s is resolved." % kwargs["bug"]
                 raise testtools.TestCase.skipException(msg)
             return f(self, *func_args, **func_kwargs)
@@ -192,40 +192,6 @@
         return True
     return False
 
-# there is a mis-match between nose and testtools for older pythons.
-# testtools will set skipException to be either
-# unittest.case.SkipTest, unittest2.case.SkipTest or an internal skip
-# exception, depending on what it can find. Python <2.7 doesn't have
-# unittest.case.SkipTest; so if unittest2 is not installed it falls
-# back to the internal class.
-#
-# The current nose skip plugin will decide to raise either
-# unittest.case.SkipTest or its own internal exception; it does not
-# look for unittest2 or the internal unittest exception.  Thus we must
-# monkey-patch testtools.TestCase.skipException to be the exception
-# the nose skip plugin expects.
-#
-# However, with the switch to testr nose may not be available, so we
-# require you to opt-in to this fix with an environment variable.
-#
-# This is temporary until upstream nose starts looking for unittest2
-# as testtools does; we can then remove this and ensure unittest2 is
-# available for older pythons; then nose and testtools will agree
-# unittest2.case.SkipTest is the one-true skip test exception.
-#
-#   https://review.openstack.org/#/c/33056
-#   https://github.com/nose-devs/nose/pull/699
-if 'TEMPEST_PY26_NOSE_COMPAT' in os.environ:
-    try:
-        import unittest.case.SkipTest
-        # convince pep8 we're using the import...
-        if unittest.case.SkipTest:
-            pass
-        raise RuntimeError("You have unittest.case.SkipTest; "
-                           "no need to override")
-    except ImportError:
-        LOG.info("Overriding skipException to nose SkipTest")
-        testtools.TestCase.skipException = nose.plugins.skip.SkipTest
 
 at_exit_set = set()
 
@@ -310,7 +276,7 @@
     @classmethod
     def get_client_manager(cls, interface=None):
         """
-        Returns an Openstack client manager
+        Returns an OpenStack client manager
         """
         cls.isolated_creds = isolated_creds.IsolatedCreds(
             cls.__name__, network_resources=cls.network_resources)
diff --git a/tempest/tests/fake_config.py b/tempest/tests/fake_config.py
index a50aaeb..41b0558 100644
--- a/tempest/tests/fake_config.py
+++ b/tempest/tests/fake_config.py
@@ -21,6 +21,34 @@
 
     class fake_identity(object):
         disable_ssl_certificate_validation = True
+        catalog_type = 'identity'
+        uri = 'http://fake_uri.com/auth'
+        uri_v3 = 'http://fake_uri_v3.com/auth'
+
+    class fake_default_feature_enabled(object):
+        api_extensions = ['all']
+
+    class fake_compute_feature_enabled(fake_default_feature_enabled):
+        api_v3_extensions = ['all']
+
+    class fake_object_storage_discoverable_apis(object):
+        discoverable_apis = ['all']
+
+    class fake_service_available(object):
+        nova = True
+        glance = True
+        cinder = True
+        heat = True
+        neutron = True
+        swift = True
+        horizon = True
+
+    compute_feature_enabled = fake_compute_feature_enabled()
+    volume_feature_enabled = fake_default_feature_enabled()
+    network_feature_enabled = fake_default_feature_enabled()
+    object_storage_feature_enabled = fake_object_storage_discoverable_apis()
+
+    service_available = fake_service_available()
 
     compute = fake_compute()
     identity = fake_identity()
diff --git a/tempest/tests/fake_http.py b/tempest/tests/fake_http.py
index ac5f765..a09d5ba 100644
--- a/tempest/tests/fake_http.py
+++ b/tempest/tests/fake_http.py
@@ -17,7 +17,7 @@
 
 class fake_httplib2(object):
 
-    def __init__(self, return_type=None):
+    def __init__(self, return_type=None, *args, **kwargs):
         self.return_type = return_type
 
     def request(self, uri, method="GET", body=None, headers=None,
diff --git a/tempest/tests/fake_identity.py b/tempest/tests/fake_identity.py
new file mode 100644
index 0000000..ea2bd44
--- /dev/null
+++ b/tempest/tests/fake_identity.py
@@ -0,0 +1,156 @@
+# Copyright 2014 IBM Corp.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+import httplib2
+import json
+
+
+TOKEN = "fake_token"
+ALT_TOKEN = "alt_fake_token"
+
+# Fake Identity v2 constants
+COMPUTE_ENDPOINTS_V2 = {
+    "endpoints": [
+        {
+            "adminURL": "http://fake_url/api/admin",
+            "region": "NoMatchRegion",
+            "internalURL": "http://fake_url/api/internal",
+            "publicURL": "http://fake_url/api/public"
+        },
+        {
+            "adminURL": "http://fake_url/api/admin",
+            "region": "FakeRegion",
+            "internalURL": "http://fake_url/api/internal",
+            "publicURL": "http://fake_url/api/public"
+        },
+    ],
+    "type": "compute",
+    "name": "nova"
+}
+
+CATALOG_V2 = [COMPUTE_ENDPOINTS_V2, ]
+
+ALT_IDENTITY_V2_RESPONSE = {
+    "access": {
+        "token": {
+            "expires": "2020-01-01T00:00:10Z",
+            "id": ALT_TOKEN,
+            "tenant": {
+                "id": "fake_tenant_id"
+            },
+        },
+        "user": {
+            "id": "fake_user_id",
+        },
+        "serviceCatalog": CATALOG_V2,
+    },
+}
+
+IDENTITY_V2_RESPONSE = {
+    "access": {
+        "token": {
+            "expires": "2020-01-01T00:00:10Z",
+            "id": TOKEN,
+            "tenant": {
+                "id": "fake_tenant_id"
+            },
+        },
+        "user": {
+            "id": "fake_user_id",
+        },
+        "serviceCatalog": CATALOG_V2,
+    },
+}
+
+# Fake Identity V3 constants
+COMPUTE_ENDPOINTS_V3 = {
+    "endpoints": [
+        {
+            "id": "fake_service",
+            "interface": "public",
+            "region": "NoMatchRegion",
+            "url": "http://fake_url/v3"
+        },
+        {
+            "id": "another_fake_service",
+            "interface": "public",
+            "region": "FakeRegion",
+            "url": "http://fake_url/v3"
+        }
+    ],
+    "type": "compute",
+    "id": "fake_compute_endpoint"
+}
+
+CATALOG_V3 = [COMPUTE_ENDPOINTS_V3, ]
+
+IDENTITY_V3_RESPONSE = {
+    "token": {
+        "methods": [
+            "token",
+            "password"
+        ],
+        "expires_at": "2020-01-01T00:00:10.000123Z",
+        "project": {
+            "domain": {
+                "id": "fake_id",
+                "name": "fake"
+            },
+            "id": "project_id",
+            "name": "project_name"
+        },
+        "user": {
+            "domain": {
+                "id": "domain_id",
+                "name": "domain_name"
+            },
+            "id": "fake_user_id",
+            "name": "username"
+        },
+        "issued_at": "2013-05-29T16:55:21.468960Z",
+        "catalog": CATALOG_V3
+    }
+}
+
+ALT_IDENTITY_V3 = IDENTITY_V3_RESPONSE
+
+
+def _fake_v3_response(self, uri, method="GET", body=None, headers=None,
+                      redirections=5, connection_type=None):
+    fake_headers = {
+        "status": "201",
+        "x-subject-token": TOKEN
+    }
+    return (httplib2.Response(fake_headers),
+            json.dumps(IDENTITY_V3_RESPONSE))
+
+
+def _fake_v2_response(self, uri, method="GET", body=None, headers=None,
+                      redirections=5, connection_type=None):
+    return (httplib2.Response({"status": "200"}),
+            json.dumps(IDENTITY_V2_RESPONSE))
+
+
+def _fake_auth_failure_response():
+    # the response body isn't really used in this case, but lets send it anyway
+    # to have a safe check in some future change on the rest client.
+    body = {
+        "unauthorized": {
+            "message": "Unauthorized",
+            "code": "401"
+        }
+    }
+    return httplib2.Response({"status": "401"}), json.dumps(body)
diff --git a/tempest/tests/files/setup.cfg b/tempest/tests/files/setup.cfg
index 8639baa..f6f9f73 100644
--- a/tempest/tests/files/setup.cfg
+++ b/tempest/tests/files/setup.cfg
@@ -2,8 +2,8 @@
 name = tempest_unit_tests
 version = 1
 summary = Fake Project for testing wrapper scripts
-author = OpenStack QA
-author-email = openstack-qa@lists.openstack.org
+author = OpenStack
+author-email = openstack-dev@lists.openstack.org
 home-page = http://www.openstack.org/
 classifier =
     Intended Audience :: Information Technology
diff --git a/tempest/tests/test_auth.py b/tempest/tests/test_auth.py
new file mode 100644
index 0000000..5346052
--- /dev/null
+++ b/tempest/tests/test_auth.py
@@ -0,0 +1,210 @@
+# Copyright 2014 IBM Corp.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import copy
+
+from tempest import auth
+from tempest.common import http
+from tempest import config
+from tempest import exceptions
+from tempest.openstack.common.fixture import mockpatch
+from tempest.tests import base
+from tempest.tests import fake_config
+from tempest.tests import fake_http
+from tempest.tests import fake_identity
+
+
+class BaseAuthTestsSetUp(base.TestCase):
+    _auth_provider_class = None
+    credentials = {
+        'username': 'fake_user',
+        'password': 'fake_pwd',
+        'tenant_name': 'fake_tenant'
+    }
+
+    def _auth(self, credentials, **params):
+        """
+        returns auth method according to keystone
+        """
+        return self._auth_provider_class(credentials, **params)
+
+    def setUp(self):
+        super(BaseAuthTestsSetUp, self).setUp()
+        self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakeConfig)
+        self.fake_http = fake_http.fake_httplib2(return_type=200)
+        self.stubs.Set(http.ClosingHttp, 'request', self.fake_http.request)
+        self.auth_provider = self._auth(self.credentials)
+
+
+class TestBaseAuthProvider(BaseAuthTestsSetUp):
+    """
+    This tests auth.AuthProvider class which is base for the other so we
+    obviously don't test not implemented method or the ones which strongly
+    depends on them.
+    """
+    _auth_provider_class = auth.AuthProvider
+
+    def test_check_credentials_is_dict(self):
+        self.assertTrue(self.auth_provider.check_credentials({}))
+
+    def test_check_credentials_bad_type(self):
+        self.assertFalse(self.auth_provider.check_credentials([]))
+
+    def test_instantiate_with_bad_credentials_type(self):
+        """
+        Assure that credentials with bad type fail with TypeError
+        """
+        self.assertRaises(TypeError, self._auth, [])
+
+    def test_auth_data_property(self):
+        self.assertRaises(NotImplementedError, getattr, self.auth_provider,
+                          'auth_data')
+
+    def test_auth_data_property_when_cache_exists(self):
+        self.auth_provider.cache = 'foo'
+        self.useFixture(mockpatch.PatchObject(self.auth_provider,
+                                              'is_expired',
+                                              return_value=False))
+        self.assertEqual('foo', getattr(self.auth_provider, 'auth_data'))
+
+    def test_delete_auth_data_property_through_deleter(self):
+        self.auth_provider.cache = 'foo'
+        del self.auth_provider.auth_data
+        self.assertIsNone(self.auth_provider.cache)
+
+    def test_delete_auth_data_property_through_clear_auth(self):
+        self.auth_provider.cache = 'foo'
+        self.auth_provider.clear_auth()
+        self.assertIsNone(self.auth_provider.cache)
+
+    def test_set_and_reset_alt_auth_data(self):
+        self.auth_provider.set_alt_auth_data('foo', 'bar')
+        self.assertEqual(self.auth_provider.alt_part, 'foo')
+        self.assertEqual(self.auth_provider.alt_auth_data, 'bar')
+
+        self.auth_provider.reset_alt_auth_data()
+        self.assertIsNone(self.auth_provider.alt_part)
+        self.assertIsNone(self.auth_provider.alt_auth_data)
+
+
+class TestKeystoneV2AuthProvider(BaseAuthTestsSetUp):
+    _auth_provider_class = auth.KeystoneV2AuthProvider
+
+    def setUp(self):
+        super(TestKeystoneV2AuthProvider, self).setUp()
+        self.stubs.Set(http.ClosingHttp, 'request',
+                       fake_identity._fake_v2_response)
+        self.target_url = 'test_api'
+
+    def _get_fake_alt_identity(self):
+        return fake_identity.ALT_IDENTITY_V2_RESPONSE['access']
+
+    def _get_result_url_from_fake_identity(self):
+        return fake_identity.COMPUTE_ENDPOINTS_V2['endpoints'][1]['publicURL']
+
+    def _get_token_from_fake_identity(self):
+        return fake_identity.TOKEN
+
+    def _test_request_helper(self):
+        filters = {
+            'service': 'compute',
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+
+        url, headers, body = self.auth_provider.auth_request('GET',
+                                                             self.target_url,
+                                                             filters=filters)
+
+        result_url = self._get_result_url_from_fake_identity()
+        self.assertEqual(url, result_url + '/' + self.target_url)
+        self.assertEqual(self._get_token_from_fake_identity(),
+                         headers['X-Auth-Token'])
+        self.assertEqual(body, None)
+
+    def test_request(self):
+        self._test_request_helper()
+
+    def test_request_with_alt_auth(self):
+        self.auth_provider.set_alt_auth_data(
+            'body',
+            (fake_identity.ALT_TOKEN, self._get_fake_alt_identity()))
+        self._test_request_helper()
+        # Assert alt auth data is clear after it
+        self.assertIsNone(self.auth_provider.alt_part)
+        self.assertIsNone(self.auth_provider.alt_auth_data)
+
+    def test_request_with_bad_service(self):
+        filters = {
+            'service': 'BAD_SERVICE',
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+        self.assertRaises(exceptions.EndpointNotFound,
+                          self.auth_provider.auth_request, 'GET',
+                          'http://fakeurl.com/fake_api', filters=filters)
+
+    def test_request_without_service(self):
+        filters = {
+            'service': None,
+            'endpoint_type': 'publicURL',
+            'region': 'fakeRegion'
+        }
+        self.assertRaises(exceptions.EndpointNotFound,
+                          self.auth_provider.auth_request, 'GET',
+                          'http://fakeurl.com/fake_api', filters=filters)
+
+    def test_check_credentials_missing_attribute(self):
+        for attr in ['username', 'password']:
+            cred = copy.copy(self.credentials)
+            del cred[attr]
+            self.assertFalse(self.auth_provider.check_credentials(cred))
+
+    def test_check_credentials_not_scoped_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['tenant_name']
+        self.assertTrue(self.auth_provider.check_credentials(cred,
+                                                             scoped=False))
+
+    def test_check_credentials_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['tenant_name']
+        self.assertFalse(self.auth_provider.check_credentials(cred))
+
+
+class TestKeystoneV3AuthProvider(TestKeystoneV2AuthProvider):
+    _auth_provider_class = auth.KeystoneV3AuthProvider
+    credentials = {
+        'username': 'fake_user',
+        'password': 'fake_pwd',
+        'tenant_name': 'fake_tenant',
+        'domain_name': 'fake_domain_name',
+    }
+
+    def setUp(self):
+        super(TestKeystoneV3AuthProvider, self).setUp()
+        self.stubs.Set(http.ClosingHttp, 'request',
+                       fake_identity._fake_v3_response)
+
+    def _get_fake_alt_identity(self):
+        return fake_identity.ALT_IDENTITY_V3['token']
+
+    def _get_result_url_from_fake_identity(self):
+        return fake_identity.COMPUTE_ENDPOINTS_V3['endpoints'][1]['url']
+
+    def test_check_credentials_missing_tenant_name(self):
+        cred = copy.copy(self.credentials)
+        del cred['domain_name']
+        self.assertFalse(self.auth_provider.check_credentials(cred))
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
new file mode 100644
index 0000000..aa3c8fc
--- /dev/null
+++ b/tempest/tests/test_decorators.py
@@ -0,0 +1,232 @@
+# Copyright 2013 IBM Corp.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+
+import testtools
+
+from tempest import exceptions
+from tempest.openstack.common.fixture import mockpatch
+from tempest import test
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class BaseDecoratorsTest(base.TestCase):
+    def setUp(self):
+        super(BaseDecoratorsTest, self).setUp()
+        self.stubs.Set(test, 'CONF', fake_config.FakeConfig)
+
+
+class TestAttrDecorator(BaseDecoratorsTest):
+    def _test_attr_helper(self, expected_attrs, **decorator_args):
+        @test.attr(**decorator_args)
+        def foo():
+            pass
+
+        # By our test.attr decorator the attribute __testtools_attrs will be
+        # set only for 'type' argument, so we test it first.
+        if 'type' in decorator_args:
+            # this is what testtools sets
+            self.assertEqual(getattr(foo, '__testtools_attrs'),
+                             set(expected_attrs))
+
+    def test_attr_without_type(self):
+        self._test_attr_helper(expected_attrs='baz', bar='baz')
+
+    def test_attr_decorator_with_smoke_type(self):
+        # smoke passed as type, so smoke and gate must have been set.
+        self._test_attr_helper(expected_attrs=['smoke', 'gate'], type='smoke')
+
+    def test_attr_decorator_with_list_type(self):
+        # if type is 'smoke' we'll get the original list of types plus 'gate'
+        self._test_attr_helper(expected_attrs=['smoke', 'foo', 'gate'],
+                               type=['smoke', 'foo'])
+
+    def test_attr_decorator_with_unknown_type(self):
+        self._test_attr_helper(expected_attrs=['foo'], type='foo')
+
+    def test_attr_decorator_with_duplicated_type(self):
+        self._test_attr_helper(expected_attrs=['foo'], type=['foo', 'foo'])
+
+
+class TestServicesDecorator(BaseDecoratorsTest):
+    def _test_services_helper(self, *decorator_args):
+        class TestFoo(test.BaseTestCase):
+            @test.services(*decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        self.assertEqual(set(decorator_args), getattr(t.test_bar,
+                                                      '__testtools_attrs'))
+        self.assertEqual(t.test_bar(), 0)
+
+    def test_services_decorator_with_single_service(self):
+        self._test_services_helper('compute')
+
+    def test_services_decorator_with_multiple_services(self):
+        self._test_services_helper('compute', 'network')
+
+    def test_services_decorator_with_duplicated_service(self):
+        self._test_services_helper('compute', 'compute')
+
+    def test_services_decorator_with_invalid_service(self):
+        self.assertRaises(exceptions.InvalidServiceTag,
+                          self._test_services_helper, 'compute',
+                          'bad_service')
+
+    def test_services_decorator_with_service_valid_and_unavailable(self):
+        self.useFixture(mockpatch.PatchObject(test.CONF.service_available,
+                                              'cinder', False))
+        self.assertRaises(testtools.TestCase.skipException,
+                          self._test_services_helper, 'compute',
+                          'volume')
+
+
+class TestStressDecorator(BaseDecoratorsTest):
+    def _test_stresstest_helper(self, expected_frequency='process',
+                                expected_inheritance=False,
+                                **decorator_args):
+        @test.stresstest(**decorator_args)
+        def foo():
+            pass
+        self.assertEqual(getattr(foo, 'st_class_setup_per'),
+                         expected_frequency)
+        self.assertEqual(getattr(foo, 'st_allow_inheritance'),
+                         expected_inheritance)
+        self.assertEqual(set(['stress']), getattr(foo, '__testtools_attrs'))
+
+    def test_stresstest_decorator_default(self):
+        self._test_stresstest_helper()
+
+    def test_stresstest_decorator_class_setup_frequency(self):
+        self._test_stresstest_helper('process', class_setup_per='process')
+
+    def test_stresstest_decorator_class_setup_frequency_non_default(self):
+        self._test_stresstest_helper(expected_frequency='application',
+                                     class_setup_per='application')
+
+    def test_stresstest_decorator_set_frequency_and_inheritance(self):
+        self._test_stresstest_helper(expected_frequency='application',
+                                     expected_inheritance=True,
+                                     class_setup_per='application',
+                                     allow_inheritance=True)
+
+
+class TestSkipBecauseDecorator(BaseDecoratorsTest):
+    def _test_skip_because_helper(self, expected_to_skip=True,
+                                  **decorator_args):
+        class TestFoo(test.BaseTestCase):
+            _interface = 'json'
+
+            @test.skip_because(**decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        if expected_to_skip:
+            self.assertRaises(testtools.TestCase.skipException, t.test_bar)
+        else:
+            # assert that test_bar returned 0
+            self.assertEqual(TestFoo('test_bar').test_bar(), 0)
+
+    def test_skip_because_bug(self):
+        self._test_skip_because_helper(bug='12345')
+
+    def test_skip_because_bug_and_interface_match(self):
+        self._test_skip_because_helper(bug='12346', interface='json')
+
+    def test_skip_because_bug_interface_not_match(self):
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12347', interface='xml')
+
+    def test_skip_because_bug_and_condition_true(self):
+        self._test_skip_because_helper(bug='12348', condition=True)
+
+    def test_skip_because_bug_and_condition_false(self):
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12349', condition=False)
+
+    def test_skip_because_bug_condition_false_and_interface_match(self):
+        """
+        Assure that only condition will be evaluated if both parameters are
+        passed.
+        """
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       bug='12350', condition=False,
+                                       interface='json')
+
+    def test_skip_because_bug_condition_true_and_interface_not_match(self):
+        """
+        Assure that only condition will be evaluated if both parameters are
+        passed.
+        """
+        self._test_skip_because_helper(bug='12351', condition=True,
+                                       interface='xml')
+
+    def test_skip_because_bug_without_bug_never_skips(self):
+        """Never skip without a bug parameter."""
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       condition=True)
+        self._test_skip_because_helper(expected_to_skip=False,
+                                       interface='json')
+
+    def test_skip_because_invalid_bug_number(self):
+        """Raise ValueError if with an invalid bug number"""
+        self.assertRaises(ValueError, self._test_skip_because_helper,
+                          bug='critical_bug')
+
+
+class TestRequiresExtDecorator(BaseDecoratorsTest):
+    def setUp(self):
+        super(TestRequiresExtDecorator, self).setUp()
+        self.fixture = self.useFixture(mockpatch.PatchObject(
+                                       test.CONF.compute_feature_enabled,
+                                       'api_extensions',
+                                       new=['enabled_ext', 'another_ext']))
+
+    def _test_requires_ext_helper(self, expected_to_skip=True,
+                                  **decorator_args):
+        class TestFoo(test.BaseTestCase):
+            @test.requires_ext(**decorator_args)
+            def test_bar(self):
+                return 0
+
+        t = TestFoo('test_bar')
+        if expected_to_skip:
+            self.assertRaises(testtools.TestCase.skipException, t.test_bar)
+        else:
+            self.assertEqual(t.test_bar(), 0)
+
+    def test_requires_ext_decorator(self):
+        self._test_requires_ext_helper(expected_to_skip=False,
+                                       extension='enabled_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_disabled_ext(self):
+        self._test_requires_ext_helper(extension='disabled_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_with_all_ext_enabled(self):
+        # disable fixture so the default (all) is used.
+        self.fixture.cleanUp()
+        self._test_requires_ext_helper(expected_to_skip=False,
+                                       extension='random_ext',
+                                       service='compute')
+
+    def test_requires_ext_decorator_bad_service(self):
+        self.assertRaises(KeyError,
+                          self._test_requires_ext_helper,
+                          extension='enabled_ext',
+                          service='bad_service')
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index ba43daf..9f07972 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -164,7 +164,7 @@
 
     keys = ["fake_key1", "fake_key2"]
     values = ["fake_value1", "fake_value2"]
-    item_expected = {key: value for key, value in zip(keys, values)}
+    item_expected = dict((key, value) for (key, value) in zip(keys, values))
     list_expected = {"body_list": [
         {keys[0]: values[0]},
         {keys[1]: values[1]},
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index b36e8c7..6a9836b 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -26,14 +26,12 @@
 import keystoneclient.exceptions
 
 import tempest.clients
-from tempest.common.utils.file_utils import have_effective_read_access
+from tempest.common.utils import file_utils
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
 import tempest.test
-from tempest.thirdparty.boto.utils.wait import re_search_wait
-from tempest.thirdparty.boto.utils.wait import state_wait
-from tempest.thirdparty.boto.utils.wait import wait_exception
+from tempest.thirdparty.boto.utils import wait
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
@@ -47,7 +45,7 @@
     id_matcher = re.compile("[A-Za-z0-9]{20,}")
 
     def all_read(*args):
-        return all(map(have_effective_read_access, args))
+        return all(map(file_utils.have_effective_read_access, args))
 
     materials_path = CONF.boto.s3_materials_path
     ami_path = materials_path + os.sep + CONF.boto.ami_manifest
@@ -327,7 +325,7 @@
             final_set = set((final_set,))
         final_set |= self.gone_set
         lfunction = self.get_lfunction_gone(lfunction)
-        state = state_wait(lfunction, final_set, valid_set)
+        state = wait.state_wait(lfunction, final_set, valid_set)
         self.assertIn(state, valid_set | self.gone_set)
         return state
 
@@ -377,8 +375,8 @@
                 return "ASSOCIATED"
             return "DISASSOCIATED"
 
-        state = state_wait(_disassociate, "DISASSOCIATED",
-                           set(("ASSOCIATED", "DISASSOCIATED")))
+        state = wait.state_wait(_disassociate, "DISASSOCIATED",
+                                set(("ASSOCIATED", "DISASSOCIATED")))
         self.assertEqual(state, "DISASSOCIATED")
 
     def assertAddressReleasedWait(self, address):
@@ -391,7 +389,7 @@
                     return "DELETED"
             return "NOTDELETED"
 
-        state = state_wait(_address_delete, "DELETED")
+        state = wait.state_wait(_address_delete, "DELETED")
         self.assertEqual(state, "DELETED")
 
     def assertReSearch(self, regexp, string):
@@ -462,7 +460,7 @@
         for instance in reservation.instances:
             try:
                 instance.terminate()
-                re_search_wait(_instance_state, "_GONE")
+                wait.re_search_wait(_instance_state, "_GONE")
             except BaseException:
                 LOG.exception("Failed to terminate instance %s " % instance)
                 exc_num += 1
@@ -503,7 +501,8 @@
             return volume.status
 
         try:
-            re_search_wait(_volume_state, "available")  # not validates status
+            wait.re_search_wait(_volume_state, "available")
+            # not validates status
             LOG.info(_volume_state())
             volume.delete()
         except BaseException:
@@ -520,7 +519,7 @@
         def _update():
             snapshot.update(validate=True)
 
-        wait_exception(_update)
+        wait.wait_exception(_update)
 
 
 # you can specify tuples if you want to specify the status pattern
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
index a6932bc..bbfbb79 100644
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ b/tempest/thirdparty/boto/test_ec2_instance_run.py
@@ -16,23 +16,21 @@
 from boto import exception
 
 from tempest.common.utils import data_utils
-from tempest.common.utils.linux.remote_client import RemoteClient
+from tempest.common.utils.linux import remote_client
 from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.test import skip_because
-from tempest.thirdparty.boto.test import BotoTestCase
-from tempest.thirdparty.boto.utils.s3 import s3_upload_dir
-from tempest.thirdparty.boto.utils.wait import re_search_wait
-from tempest.thirdparty.boto.utils.wait import state_wait
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
+from tempest.thirdparty.boto.utils import s3
+from tempest.thirdparty.boto.utils import wait
 
 CONF = config.CONF
 
 LOG = logging.getLogger(__name__)
 
 
-class InstanceRunTest(BotoTestCase):
+class InstanceRunTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
@@ -57,7 +55,7 @@
         cls.addResourceCleanUp(cls.destroy_bucket,
                                cls.s3_client.connection_data,
                                cls.bucket_name)
-        s3_upload_dir(bucket, cls.materials_path)
+        s3.s3_upload_dir(bucket, cls.materials_path)
         cls.images = {"ami":
                       {"name": data_utils.rand_name("ami-name-"),
                        "location": cls.bucket_name + "/" + ami_manifest},
@@ -78,14 +76,14 @@
             def _state():
                 retr = cls.ec2_client.get_image(image["image_id"])
                 return retr.state
-            state = state_wait(_state, "available")
+            state = wait.state_wait(_state, "available")
             if state != "available":
                 for _image in cls.images.itervalues():
                     cls.ec2_client.deregister_image(_image["image_id"])
                 raise exceptions.EC2RegisterImageException(image_id=
                                                            image["image_id"])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_run_idempotent_instances(self):
         # EC2 run instances idempotently
 
@@ -123,16 +121,7 @@
         _terminate_reservation(reservation_1, rcuk_1)
         _terminate_reservation(reservation_2, rcuk_2)
 
-        reservation_3, rcuk_3 = _run_instance('token_1')
-        self.assertIsNotNone(reservation_3)
-
-        # make sure we don't get the old reservation back
-        self.assertNotEqual(reservation_1.id, reservation_3.id)
-
-        # clean up
-        _terminate_reservation(reservation_3, rcuk_3)
-
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_run_stop_terminate_instance(self):
         # EC2 run, stop and terminate instance
         image_ami = self.ec2_client.get_image(self.images["ami"]
@@ -157,7 +146,7 @@
             instance.terminate()
         self.cancelResourceCleanUp(rcuk)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_run_stop_terminate_instance_with_tags(self):
         # EC2 run, stop and terminate instance with tags
         image_ami = self.ec2_client.get_image(self.images["ami"]
@@ -204,8 +193,8 @@
             instance.terminate()
         self.cancelResourceCleanUp(rcuk)
 
-    @skip_because(bug="1098891")
-    @attr(type='smoke')
+    @test.skip_because(bug="1098891")
+    @test.attr(type='smoke')
     def test_run_terminate_instance(self):
         # EC2 run, terminate immediately
         image_ami = self.ec2_client.get_image(self.images["ami"]
@@ -231,8 +220,8 @@
 
     # NOTE(afazekas): doctored test case,
     # with normal validation it would fail
-    @skip_because(bug="1182679")
-    @attr(type='smoke')
+    @test.skip_because(bug="1182679")
+    @test.attr(type='smoke')
     def test_integration_1(self):
         # EC2 1. integration test (not strict)
         image_ami = self.ec2_client.get_image(self.images["ami"]["image_id"])
@@ -278,11 +267,11 @@
         # TODO(afazekas): ping test. dependecy/permission ?
 
         self.assertVolumeStatusWait(volume, "available")
-        # NOTE(afazekas): it may be reports availble before it is available
+        # NOTE(afazekas): it may be reports available before it is available
 
-        ssh = RemoteClient(address.public_ip,
-                           CONF.compute.ssh_user,
-                           pkey=self.keypair.material)
+        ssh = remote_client.RemoteClient(address.public_ip,
+                                         CONF.compute.ssh_user,
+                                         pkey=self.keypair.material)
         text = data_utils.rand_name("Pattern text for console output -")
         resp = ssh.write_to_console(text)
         self.assertFalse(resp)
@@ -291,7 +280,7 @@
             output = instance.get_console_output()
             return output.output
 
-        re_search_wait(_output, text)
+        wait.re_search_wait(_output, text)
         part_lines = ssh.get_partitions().split('\n')
         volume.attach(instance.id, "/dev/vdh")
 
@@ -300,7 +289,7 @@
             return volume.status
 
         self.assertVolumeStatusWait(_volume_state, "in-use")
-        re_search_wait(_volume_state, "in-use")
+        wait.re_search_wait(_volume_state, "in-use")
 
         # NOTE(afazekas):  Different Hypervisor backends names
         # differently the devices,
@@ -314,7 +303,7 @@
                 return 'DECREASE'
             return 'EQUAL'
 
-        state_wait(_part_state, 'INCREASE')
+        wait.state_wait(_part_state, 'INCREASE')
         part_lines = ssh.get_partitions().split('\n')
 
         # TODO(afazekas): Resource compare to the flavor settings
@@ -322,10 +311,10 @@
         volume.detach()
 
         self.assertVolumeStatusWait(_volume_state, "available")
-        re_search_wait(_volume_state, "available")
+        wait.re_search_wait(_volume_state, "available")
         LOG.info("Volume %s state: %s", volume.id, volume.status)
 
-        state_wait(_part_state, 'DECREASE')
+        wait.state_wait(_part_state, 'DECREASE')
 
         instance.stop()
         address.disassociate()
diff --git a/tempest/thirdparty/boto/test_ec2_keys.py b/tempest/thirdparty/boto/test_ec2_keys.py
index 329ace3..37484cf 100644
--- a/tempest/thirdparty/boto/test_ec2_keys.py
+++ b/tempest/thirdparty/boto/test_ec2_keys.py
@@ -14,9 +14,8 @@
 #    under the License.
 
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import skip_because
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
 
 def compare_key_pairs(a, b):
@@ -24,7 +23,7 @@
             a.fingerprint == b.fingerprint)
 
 
-class EC2KeysTest(BotoTestCase):
+class EC2KeysTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
@@ -33,7 +32,7 @@
         cls.ec = cls.ec2_error_code
 
 # TODO(afazekas): merge create, delete, get test cases
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_ec2_keypair(self):
         # EC2 create KeyPair
         key_name = data_utils.rand_name("keypair-")
@@ -42,8 +41,8 @@
         self.assertTrue(compare_key_pairs(keypair,
                         self.client.get_key_pair(key_name)))
 
-    @skip_because(bug="1072318")
-    @attr(type='smoke')
+    @test.skip_because(bug="1072318")
+    @test.attr(type='smoke')
     def test_delete_ec2_keypair(self):
         # EC2 delete KeyPair
         key_name = data_utils.rand_name("keypair-")
@@ -51,7 +50,7 @@
         self.client.delete_key_pair(key_name)
         self.assertEqual(None, self.client.get_key_pair(key_name))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_ec2_keypair(self):
         # EC2 get KeyPair
         key_name = data_utils.rand_name("keypair-")
@@ -60,7 +59,7 @@
         self.assertTrue(compare_key_pairs(keypair,
                         self.client.get_key_pair(key_name)))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_duplicate_ec2_keypair(self):
         # EC2 duplicate KeyPair
         key_name = data_utils.rand_name("keypair-")
diff --git a/tempest/thirdparty/boto/test_ec2_network.py b/tempest/thirdparty/boto/test_ec2_network.py
index 4b2f01f..d508c07 100644
--- a/tempest/thirdparty/boto/test_ec2_network.py
+++ b/tempest/thirdparty/boto/test_ec2_network.py
@@ -13,12 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest.test import attr
-from tempest.test import skip_because
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
 
-class EC2NetworkTest(BotoTestCase):
+class EC2NetworkTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
@@ -26,8 +25,8 @@
         cls.client = cls.os.ec2api_client
 
     # Note(afazekas): these tests for things duable without an instance
-    @skip_because(bug="1080406")
-    @attr(type='smoke')
+    @test.skip_because(bug="1080406")
+    @test.attr(type='smoke')
     def test_disassociate_not_associated_floating_ip(self):
         # EC2 disassociate not associated floating ip
         ec2_codes = self.ec2_error_code
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
index 9b58603..86140ec 100644
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ b/tempest/thirdparty/boto/test_ec2_security_groups.py
@@ -14,18 +14,18 @@
 #    under the License.
 
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
 
-class EC2SecurityGroupTest(BotoTestCase):
+class EC2SecurityGroupTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(EC2SecurityGroupTest, cls).setUpClass()
         cls.client = cls.os.ec2api_client
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_authorize_security_group(self):
         # EC2 Create, authorize/revoke security group
         group_name = data_utils.rand_name("securty_group-")
diff --git a/tempest/thirdparty/boto/test_ec2_volumes.py b/tempest/thirdparty/boto/test_ec2_volumes.py
index 04671c5..6a771e5 100644
--- a/tempest/thirdparty/boto/test_ec2_volumes.py
+++ b/tempest/thirdparty/boto/test_ec2_volumes.py
@@ -13,10 +13,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest import config
 from tempest.openstack.common import log as logging
-from tempest.test import attr
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
+CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
@@ -25,15 +27,20 @@
             a.size == b.size)
 
 
-class EC2VolumesTest(BotoTestCase):
+class EC2VolumesTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(EC2VolumesTest, cls).setUpClass()
+
+        if not CONF.service_available.cinder:
+            skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
+            raise cls.skipException(skip_msg)
+
         cls.client = cls.os.ec2api_client
         cls.zone = cls.client.get_good_zone()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_get_delete(self):
         # EC2 Create, get, delete Volume
         volume = self.client.create_volume(1, self.zone)
@@ -46,7 +53,7 @@
         self.client.delete_volume(volume.id)
         self.cancelResourceCleanUp(cuk)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_volume_from_snapshot(self):
         # EC2 Create volume from snapshot
         volume = self.client.create_volume(1, self.zone)
diff --git a/tempest/thirdparty/boto/test_s3_buckets.py b/tempest/thirdparty/boto/test_s3_buckets.py
index f34faac..af6aa8b 100644
--- a/tempest/thirdparty/boto/test_s3_buckets.py
+++ b/tempest/thirdparty/boto/test_s3_buckets.py
@@ -14,20 +14,19 @@
 #    under the License.
 
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import skip_because
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
 
-class S3BucketsTest(BotoTestCase):
+class S3BucketsTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(S3BucketsTest, cls).setUpClass()
         cls.client = cls.os.s3_client
 
-    @skip_because(bug="1076965")
-    @attr(type='smoke')
+    @test.skip_because(bug="1076965")
+    @test.attr(type='smoke')
     def test_create_and_get_delete_bucket(self):
         # S3 Create, get and delete bucket
         bucket_name = data_utils.rand_name("s3bucket-")
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
index 9607a92..d2300ee 100644
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ b/tempest/thirdparty/boto/test_s3_ec2_images.py
@@ -17,14 +17,14 @@
 
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.thirdparty.boto.test import BotoTestCase
-from tempest.thirdparty.boto.utils.s3 import s3_upload_dir
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
+from tempest.thirdparty.boto.utils import s3
 
 CONF = config.CONF
 
 
-class S3ImagesTest(BotoTestCase):
+class S3ImagesTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
@@ -46,9 +46,9 @@
         cls.addResourceCleanUp(cls.destroy_bucket,
                                cls.s3_client.connection_data,
                                cls.bucket_name)
-        s3_upload_dir(bucket, cls.materials_path)
+        s3.s3_upload_dir(bucket, cls.materials_path)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_register_get_deregister_ami_image(self):
         # Register and deregister ami image
         image = {"name": data_utils.rand_name("ami-name-"),
diff --git a/tempest/thirdparty/boto/test_s3_objects.py b/tempest/thirdparty/boto/test_s3_objects.py
index a102a22..1ae46de 100644
--- a/tempest/thirdparty/boto/test_s3_objects.py
+++ b/tempest/thirdparty/boto/test_s3_objects.py
@@ -18,18 +18,18 @@
 import boto.s3.key
 
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.thirdparty.boto.test import BotoTestCase
+from tempest import test
+from tempest.thirdparty.boto import test as boto_test
 
 
-class S3BucketsTest(BotoTestCase):
+class S3BucketsTest(boto_test.BotoTestCase):
 
     @classmethod
     def setUpClass(cls):
         super(S3BucketsTest, cls).setUpClass()
         cls.client = cls.os.s3_client
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_get_delete_object(self):
         # S3 Create, get and delete object
         bucket_name = data_utils.rand_name("s3bucket-")
diff --git a/tempest/thirdparty/boto/utils/wait.py b/tempest/thirdparty/boto/utils/wait.py
index eed0a92..752ed0f 100644
--- a/tempest/thirdparty/boto/utils/wait.py
+++ b/tempest/thirdparty/boto/utils/wait.py
@@ -17,7 +17,7 @@
 import time
 
 import boto.exception
-from testtools import TestCase
+import testtools
 
 from tempest import config
 from tempest.openstack.common import log as logging
@@ -44,10 +44,11 @@
             return status
         dtime = time.time() - start_time
         if dtime > CONF.boto.build_timeout:
-            raise TestCase.failureException("State change timeout exceeded!"
-                                            '(%ds) While waiting'
-                                            'for %s at "%s"' %
-                                            (dtime, final_set, status))
+            raise testtools.TestCase\
+                .failureException("State change timeout exceeded!"
+                                  '(%ds) While waiting'
+                                  'for %s at "%s"' %
+                                  (dtime, final_set, status))
         time.sleep(CONF.boto.build_interval)
         old_status = status
         status = lfunction()
@@ -67,10 +68,11 @@
             return result
         dtime = time.time() - start_time
         if dtime > CONF.boto.build_timeout:
-            raise TestCase.failureException('Pattern find timeout exceeded!'
-                                            '(%ds) While waiting for'
-                                            '"%s" pattern in "%s"' %
-                                            (dtime, regexp, text))
+            raise testtools.TestCase\
+                .failureException('Pattern find timeout exceeded!'
+                                  '(%ds) While waiting for'
+                                  '"%s" pattern in "%s"' %
+                                  (dtime, regexp, text))
         time.sleep(CONF.boto.build_interval)
 
 
@@ -98,8 +100,8 @@
         # Let the other exceptions propagate
         dtime = time.time() - start_time
         if dtime > CONF.boto.build_timeout:
-            raise TestCase.failureException("Wait timeout exceeded! (%ds)" %
-                                            dtime)
+            raise testtools.TestCase\
+                .failureException("Wait timeout exceeded! (%ds)" % dtime)
         time.sleep(CONF.boto.build_interval)
 
 
@@ -116,8 +118,8 @@
             return exc
         dtime = time.time() - start_time
         if dtime > CONF.boto.build_timeout:
-            raise TestCase.failureException("Wait timeout exceeded! (%ds)" %
-                                            dtime)
+            raise testtools.TestCase\
+                .failureException("Wait timeout exceeded! (%ds)" % dtime)
         time.sleep(CONF.boto.build_interval)
 
 # TODO(afazekas): consider strategy design pattern..
diff --git a/tools/install_venv.py b/tools/install_venv.py
index e41ca43..96b8279 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -25,12 +25,12 @@
 
 def print_help(venv, root):
     help = """
-    Openstack development environment setup is complete.
+    OpenStack development environment setup is complete.
 
-    Openstack development uses virtualenv to track and manage Python
+    OpenStack development uses virtualenv to track and manage Python
     dependencies while in development and testing.
 
-    To activate the Openstack virtualenv for the extent of your current shell
+    To activate the OpenStack virtualenv for the extent of your current shell
     session you can run:
 
     $ source %s/bin/activate
diff --git a/tools/tempest_auto_config.py b/tools/tempest_auto_config.py
index 9aeb077..5b8d05b 100644
--- a/tools/tempest_auto_config.py
+++ b/tools/tempest_auto_config.py
@@ -13,14 +13,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 #
-# This script aims to configure an initial Openstack environment with all the
-# necessary configurations for tempest's run using nothing but Openstack's
+# This script aims to configure an initial OpenStack environment with all the
+# necessary configurations for tempest's run using nothing but OpenStack's
 # native API.
 # That includes, creating users, tenants, registering images (cirros),
 # configuring neutron and so on.
 #
 # ASSUMPTION: this script is run by an admin user as it is meant to configure
-# the Openstack environment prior to actual use.
+# the OpenStack environment prior to actual use.
 
 # Config
 import ConfigParser
@@ -32,7 +32,7 @@
 import glanceclient as glance_client
 import keystoneclient.v2_0.client as keystone_client
 
-# Import Openstack exceptions
+# Import OpenStack exceptions
 import glanceclient.exc as glance_exception
 import keystoneclient.exceptions as keystone_exception
 
@@ -88,7 +88,7 @@
 
     def get_image_client(self, version="1", *args, **kwargs):
         """
-        This method returns Openstack glance python client
+        This method returns OpenStack glance python client
         :param version: a string representing the version of the glance client
         to use.
         :param string endpoint: A user-supplied endpoint URL for the glance
@@ -333,7 +333,7 @@
     """
     Creates images for tempest's use and registers the environment variables
     IMAGE_ID and IMAGE_ID_ALT with registered images
-    :param image_client: Openstack python image client
+    :param image_client: OpenStack python image client
     :param config: a ConfigParser object representing the tempest config file
     :param config_section: the section name where the IMAGE ids are set
     :param download_url: the URL from which we should download the UEC tar
diff --git a/tools/verify_tempest_config.py b/tools/verify_tempest_config.py
index 29eed9d..4be812c 100755
--- a/tools/verify_tempest_config.py
+++ b/tools/verify_tempest_config.py
@@ -42,7 +42,12 @@
 def verify_nova_api_versions(os):
     # Check nova api versions - only get base URL without PATH
     os.servers_client.skip_path = True
-    __, body = RAW_HTTP.request(os.servers_client.base_url, 'GET')
+    # The nova base endpoint url includes the version but to get the versions
+    # list the unversioned endpoint is needed
+    v2_endpoint = os.servers_client.base_url
+    v2_endpoint_parts = v2_endpoint.split('/')
+    endpoint = v2_endpoint_parts[0] + '//' + v2_endpoint_parts[2]
+    __, body = RAW_HTTP.request(endpoint, 'GET')
     body = json.loads(body)
     # Restore full base_url
     os.servers_client.skip_path = False
diff --git a/tox.ini b/tox.ini
index 1580b14..4a625f8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,11 +4,10 @@
 skipsdist = True
 
 [testenv]
-sitepackages = True
 setenv = VIRTUAL_ENV={envdir}
          OS_TEST_PATH=./tempest/test_discover
 usedevelop = True
-install_command = pip install {opts} {packages}
+install_command = pip install -U {opts} {packages}
 
 [testenv:py26]
 setenv = OS_TEST_PATH=./tempest/tests
@@ -27,11 +26,13 @@
 commands = python setup.py testr --coverage --testr-arg='tempest\.tests {posargs}'
 
 [testenv:all]
+sitepackages = True
 setenv = VIRTUAL_ENV={envdir}
 commands =
-  python setup.py testr --slowest --testr-args='{posargs}'
+  bash tools/pretty_tox.sh '{posargs}'
 
 [testenv:full]
+sitepackages = True
 # 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 =
@@ -44,49 +45,29 @@
   bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
 [testenv:testr-full]
+sitepackages = True
 commands =
   bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
 
 [testenv:heat-slow]
+sitepackages = True
 setenv = OS_TEST_TIMEOUT=1200
 # The regex below is used to select heat api/scenario tests tagged as slow.
 commands =
   bash tools/pretty_tox_serial.sh '(?=.*\[.*\bslow\b.*\])(^tempest\.(api|scenario)\.orchestration) {posargs}'
 
 [testenv:large-ops]
+sitepackages = True
 commands =
   python setup.py testr --slowest --testr-args='tempest.scenario.test_large_ops {posargs}'
 
-
-[testenv:py26-full]
-setenv = VIRTUAL_ENV={envdir}
-         NOSE_WITH_OPENSTACK=1
-         NOSE_OPENSTACK_COLOR=1
-         NOSE_OPENSTACK_RED=15
-         NOSE_OPENSTACK_YELLOW=3
-         NOSE_OPENSTACK_SHOW_ELAPSED=1
-         NOSE_OPENSTACK_STDOUT=1
-         TEMPEST_PY26_NOSE_COMPAT=1
-commands =
-  nosetests --logging-format '%(asctime)-15s %(message)s' --with-xunit -sv --xunit-file=nosetests-full.xml tempest/api tempest/scenario tempest/thirdparty tempest/cli {posargs}
-
-[testenv:py26-smoke]
-setenv = VIRTUAL_ENV={envdir}
-NOSE_WITH_OPENSTACK=1
-         NOSE_OPENSTACK_COLOR=1
-         NOSE_OPENSTACK_RED=15
-         NOSE_OPENSTACK_YELLOW=3
-         NOSE_OPENSTACK_SHOW_ELAPSED=1
-         NOSE_OPENSTACK_STDOUT=1
-         TEMPEST_PY26_NOSE_COMPAT=1
-commands =
-  nosetests --logging-format '%(asctime)-15s %(message)s' --with-xunit -sv --attr=type=smoke --xunit-file=nosetests-smoke.xml tempest {posargs}
-
 [testenv:smoke]
+sitepackages = True
 commands =
    bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
 
 [testenv:smoke-serial]
+sitepackages = True
 # This is still serial because neutron doesn't work with parallel. See:
 # https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
 # job would fail if we moved it to parallel.
@@ -94,6 +75,7 @@
    bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
 
 [testenv:stress]
+sitepackages = True
 commands =
     python -m tempest/stress/run_stress -a -d 3600 -S
 
