diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index dfcc6a9..d4a32e6 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -15,12 +15,7 @@
 
 from tempest.api.compute import base
 from tempest.common.utils import data_utils
-from tempest import config
-from tempest import exceptions
-from tempest.test import attr
-from tempest.test import skip_because
-
-CONF = config.CONF
+from tempest import test
 
 
 class QuotasAdminTestJSON(base.BaseV2ComputeAdminTest):
@@ -30,11 +25,8 @@
     @classmethod
     def setUpClass(cls):
         super(QuotasAdminTestJSON, cls).setUpClass()
-        cls.auth_url = cls.config.identity.uri
         cls.client = cls.os.quotas_client
         cls.adm_client = cls.os_adm.quotas_client
-        cls.identity_admin_client = cls._get_identity_admin_client()
-        cls.sg_client = cls.security_groups_client
 
         # NOTE(afazekas): these test cases should always create and use a new
         # tenant most of them should be skipped if we can't do that
@@ -49,7 +41,7 @@
                                      'instances', 'security_group_rules',
                                      'cores', 'security_groups'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_default_quotas(self):
         # Admin can get the default resource quota set for a tenant
         expected_quota_set = self.default_quota_set | set(['id'])
@@ -60,7 +52,7 @@
                          sorted(quota_set.keys()))
         self.assertEqual(quota_set['id'], self.demo_tenant_id)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_update_all_quota_resources_for_tenant(self):
         # Admin can update all the resource quota limits for a tenant
         resp, default_quota_set = self.client.get_default_quota_set(
@@ -84,7 +76,7 @@
         self.assertEqual(new_quota_set, quota_set)
 
     # TODO(afazekas): merge these test cases
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_updated_quotas(self):
         # Verify that GET shows the updated quota set
         tenant_name = data_utils.rand_name('cpu_quota_tenant_')
@@ -102,119 +94,6 @@
         self.assertEqual(200, resp.status)
         self.assertEqual(quota_set['ram'], 5120)
 
-    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
-    # it can be moved into the setUpClass as well
-    @attr(type='gate')
-    def test_create_server_when_cpu_quota_is_full(self):
-        # Disallow server creation when tenant's vcpu quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_vcpu_quota = quota_set['cores']
-        vcpu_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
-                                                           force=True,
-                                                           cores=vcpu_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        cores=default_vcpu_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @attr(type='gate')
-    def test_create_server_when_memory_quota_is_full(self):
-        # Disallow server creation when tenant's memory quota is full
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_mem_quota = quota_set['ram']
-        mem_quota = 0  # Set the quota to zero to conserve resources
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         ram=mem_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        ram=default_mem_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @attr(type='gate')
-    def test_update_quota_normal_user(self):
-        self.assertRaises(exceptions.Unauthorized,
-                          self.client.update_quota_set,
-                          self.demo_tenant_id,
-                          ram=0)
-
-    @attr(type=['negative', 'gate'])
-    def test_create_server_when_instances_quota_is_full(self):
-        # Once instances quota limit is reached, disallow server creation
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_instances_quota = quota_set['instances']
-        instances_quota = 0  # Set quota to zero to disallow server creation
-
-        self.adm_client.update_quota_set(self.demo_tenant_id,
-                                         force=True,
-                                         instances=instances_quota)
-        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
-                        instances=default_instances_quota)
-        self.assertRaises(exceptions.OverLimit, self.create_test_server)
-
-    @skip_because(bug="1186354",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'gate'])
-    def test_security_groups_exceed_limit(self):
-        # Negative test: Creation Security Groups over limit should FAIL
-
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_sg_quota = quota_set['security_groups']
-        sg_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set =\
-            self.adm_client.update_quota_set(self.demo_tenant_id,
-                                             force=True,
-                                             security_groups=sg_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set,
-                        self.demo_tenant_id,
-                        security_groups=default_sg_quota)
-
-        # Check we cannot create anymore
-        self.assertRaises(exceptions.OverLimit,
-                          self.sg_client.create_security_group,
-                          "sg-overlimit", "sg-desc")
-
-    @skip_because(bug="1186354",
-                  condition=CONF.service_available.neutron)
-    @attr(type=['negative', 'gate'])
-    def test_security_groups_rules_exceed_limit(self):
-        # Negative test: Creation of Security Group Rules should FAIL
-        # when we reach limit maxSecurityGroupRules
-
-        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
-        default_sg_rules_quota = quota_set['security_group_rules']
-        sg_rules_quota = 0  # Set the quota to zero to conserve resources
-
-        resp, quota_set =\
-            self.adm_client.update_quota_set(
-                self.demo_tenant_id,
-                force=True,
-                security_group_rules=sg_rules_quota)
-
-        self.addCleanup(self.adm_client.update_quota_set,
-                        self.demo_tenant_id,
-                        security_group_rules=default_sg_rules_quota)
-
-        s_name = data_utils.rand_name('securitygroup-')
-        s_description = data_utils.rand_name('description-')
-        resp, securitygroup =\
-            self.sg_client.create_security_group(s_name, s_description)
-        self.addCleanup(self.sg_client.delete_security_group,
-                        securitygroup['id'])
-
-        secgroup_id = securitygroup['id']
-        ip_protocol = 'tcp'
-
-        # Check we cannot create SG rule anymore
-        self.assertRaises(exceptions.OverLimit,
-                          self.sg_client.create_security_group_rule,
-                          secgroup_id, ip_protocol, 1025, 1025)
-
 
 class QuotasAdminTestXML(QuotasAdminTestJSON):
     _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
new file mode 100644
index 0000000..d3696a1
--- /dev/null
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -0,0 +1,155 @@
+# Copyright 2014 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class QuotasAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
+    _interface = 'json'
+    force_tenant_isolation = True
+
+    @classmethod
+    def setUpClass(cls):
+        super(QuotasAdminNegativeTestJSON, cls).setUpClass()
+        cls.client = cls.os.quotas_client
+        cls.adm_client = cls.os_adm.quotas_client
+        cls.sg_client = cls.security_groups_client
+
+        # NOTE(afazekas): these test cases should always create and use a new
+        # tenant most of them should be skipped if we can't do that
+        cls.demo_tenant_id = cls.isolated_creds.get_primary_user().get(
+            'tenantId')
+
+    @test.attr(type=['negative', 'gate'])
+    def test_update_quota_normal_user(self):
+        self.assertRaises(exceptions.Unauthorized,
+                          self.client.update_quota_set,
+                          self.demo_tenant_id,
+                          ram=0)
+
+    # TODO(afazekas): Add dedicated tenant to the skiped quota tests
+    # it can be moved into the setUpClass as well
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_cpu_quota_is_full(self):
+        # Disallow server creation when tenant's vcpu quota is full
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_vcpu_quota = quota_set['cores']
+        vcpu_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set = self.adm_client.update_quota_set(self.demo_tenant_id,
+                                                           force=True,
+                                                           cores=vcpu_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        cores=default_vcpu_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_memory_quota_is_full(self):
+        # Disallow server creation when tenant's memory quota is full
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_mem_quota = quota_set['ram']
+        mem_quota = 0  # Set the quota to zero to conserve resources
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         ram=mem_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        ram=default_mem_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.attr(type=['negative', 'gate'])
+    def test_create_server_when_instances_quota_is_full(self):
+        # Once instances quota limit is reached, disallow server creation
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_instances_quota = quota_set['instances']
+        instances_quota = 0  # Set quota to zero to disallow server creation
+
+        self.adm_client.update_quota_set(self.demo_tenant_id,
+                                         force=True,
+                                         instances=instances_quota)
+        self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+                        instances=default_instances_quota)
+        self.assertRaises(exceptions.OverLimit, self.create_test_server)
+
+    @test.skip_because(bug="1186354",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type='gate')
+    def test_security_groups_exceed_limit(self):
+        # Negative test: Creation Security Groups over limit should FAIL
+
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_sg_quota = quota_set['security_groups']
+        sg_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set =\
+            self.adm_client.update_quota_set(self.demo_tenant_id,
+                                             force=True,
+                                             security_groups=sg_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set,
+                        self.demo_tenant_id,
+                        security_groups=default_sg_quota)
+
+        # Check we cannot create anymore
+        self.assertRaises(exceptions.OverLimit,
+                          self.sg_client.create_security_group,
+                          "sg-overlimit", "sg-desc")
+
+    @test.skip_because(bug="1186354",
+                       condition=CONF.service_available.neutron)
+    @test.attr(type=['negative', 'gate'])
+    def test_security_groups_rules_exceed_limit(self):
+        # Negative test: Creation of Security Group Rules should FAIL
+        # when we reach limit maxSecurityGroupRules
+
+        resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
+        default_sg_rules_quota = quota_set['security_group_rules']
+        sg_rules_quota = 0  # Set the quota to zero to conserve resources
+
+        resp, quota_set =\
+            self.adm_client.update_quota_set(
+                self.demo_tenant_id,
+                force=True,
+                security_group_rules=sg_rules_quota)
+
+        self.addCleanup(self.adm_client.update_quota_set,
+                        self.demo_tenant_id,
+                        security_group_rules=default_sg_rules_quota)
+
+        s_name = data_utils.rand_name('securitygroup-')
+        s_description = data_utils.rand_name('description-')
+        resp, securitygroup =\
+            self.sg_client.create_security_group(s_name, s_description)
+        self.addCleanup(self.sg_client.delete_security_group,
+                        securitygroup['id'])
+
+        secgroup_id = securitygroup['id']
+        ip_protocol = 'tcp'
+
+        # Check we cannot create SG rule anymore
+        self.assertRaises(exceptions.OverLimit,
+                          self.sg_client.create_security_group_rule,
+                          secgroup_id, ip_protocol, 1025, 1025)
+
+
+class QuotasAdminNegativeTestXML(QuotasAdminNegativeTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 10484a9..2cee78a 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -99,6 +99,18 @@
         self.servers_client.wait_for_server_termination(server['id'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
diff --git a/tempest/api/compute/floating_ips/base.py b/tempest/api/compute/floating_ips/base.py
index e2c9b04..fd76e62 100644
--- a/tempest/api/compute/floating_ips/base.py
+++ b/tempest/api/compute/floating_ips/base.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2014 OpenStack Foundation
 # All Rights Reserved.
 #
diff --git a/tempest/api/compute/security_groups/base.py b/tempest/api/compute/security_groups/base.py
index 66f2600..6838ce1 100644
--- a/tempest/api/compute/security_groups/base.py
+++ b/tempest/api/compute/security_groups/base.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2012 OpenStack Foundation
 # All Rights Reserved.
 #
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 582faf8..49d8495 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -84,7 +84,8 @@
             # Log in and verify the boot time has changed
             linux_client = RemoteClient(server, self.ssh_user, self.password)
             new_boot_time = linux_client.get_boot_time()
-            self.assertGreater(new_boot_time, boot_time)
+            self.assertTrue(new_boot_time > boot_time,
+                            '%s > %s' % (new_boot_time, boot_time))
 
     @skip_because(bug="1014647")
     @attr(type='smoke')
@@ -104,7 +105,8 @@
             # Log in and verify the boot time has changed
             linux_client = RemoteClient(server, self.ssh_user, self.password)
             new_boot_time = linux_client.get_boot_time()
-            self.assertGreater(new_boot_time, boot_time)
+            self.assertTrue(new_boot_time > boot_time,
+                            '%s > %s' % (new_boot_time, boot_time))
 
     @attr(type='smoke')
     def test_rebuild_server(self):
@@ -230,7 +232,7 @@
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
-        backup1 = data_utils.rand_name('backup')
+        backup1 = data_utils.rand_name('backup-1')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
                                                     2,
@@ -247,7 +249,7 @@
         self.assertEqual(202, resp.status)
         self.os.image_client.wait_for_image_status(image1_id, 'active')
 
-        backup2 = data_utils.rand_name('backup')
+        backup2 = data_utils.rand_name('backup-2')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -275,7 +277,7 @@
 
         # create the third one, due to the rotation is 2,
         # the first one will be deleted
-        backup3 = data_utils.rand_name('backup')
+        backup3 = data_utils.rand_name('backup-3')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -293,7 +295,11 @@
             sort_key='created_at',
             sort_dir='asc')
         self.assertEqual(200, resp.status)
-        self.assertEqual(2, len(image_list))
+        self.assertEqual(2, len(image_list),
+                         'Unexpected number of images for '
+                         'v2:test_create_backup; was the oldest backup not '
+                         'yet deleted? Image list: %s' %
+                         [image['name'] for image in image_list])
         self.assertEqual((backup2, backup3),
                          (image_list[0]['name'], image_list[1]['name']))
 
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 8ae43b5..203832e 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -104,6 +104,24 @@
         self.assertEqual('::babe:202:202', server['accessIPv6'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_delete_server_while_in_building_state(self):
         # Delete a server while it's VM state is Building
         resp, server = self.create_test_server(wait_until='BUILD')
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index 2db128e..f6f5673 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -83,6 +83,18 @@
         self.servers_client.wait_for_server_termination(server['id'])
 
     @attr(type='gate')
+    def test_delete_server_while_in_error_state(self):
+        # Delete a server while it's VM state is error
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.reset_state(server['id'], state='error')
+        self.assertEqual(202, resp.status)
+        # Verify server's state
+        resp, server = self.client.get_server(server['id'])
+        self.assertEqual(server['status'], 'ERROR')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @attr(type='gate')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
         resp, server = self.client.reset_state(self.s1_id)
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index 9bb287a..fdf23f8 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -225,7 +225,7 @@
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
-        backup1 = data_utils.rand_name('backup')
+        backup1 = data_utils.rand_name('backup-1')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
                                                     2,
@@ -242,7 +242,7 @@
         self.assertEqual(202, resp.status)
         self.images_client.wait_for_image_status(image1_id, 'active')
 
-        backup2 = data_utils.rand_name('backup')
+        backup2 = data_utils.rand_name('backup-2')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -270,7 +270,7 @@
 
         # create the third one, due to the rotation is 2,
         # the first one will be deleted
-        backup3 = data_utils.rand_name('backup')
+        backup3 = data_utils.rand_name('backup-3')
         self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
         resp, _ = self.servers_client.create_backup(self.server_id,
                                                     'daily',
@@ -287,7 +287,11 @@
             sort_key='created_at',
             sort_dir='asc')
         self.assertEqual(200, resp.status)
-        self.assertEqual(2, len(image_list))
+        self.assertEqual(2, len(image_list),
+                         'Unexpected number of images for '
+                         'v3:test_create_backup; was the oldest backup not '
+                         'yet deleted? Image list: %s' %
+                         [image['name'] for image in image_list])
         self.assertEqual((backup2, backup3),
                          (image_list[0]['name'], image_list[1]['name']))
 
diff --git a/tempest/api/compute/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index 72c91b0..c476b78 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -105,6 +105,24 @@
                          server['os-access-ips:access_ip_v6'])
 
     @test.attr(type='gate')
+    def test_delete_server_while_in_shutoff_state(self):
+        # Delete a server while it's VM state is Shutoff
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.stop(server['id'])
+        self.client.wait_for_server_status(server['id'], 'SHUTOFF')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
+    def test_delete_server_while_in_pause_state(self):
+        # Delete a server while it's VM state is Pause
+        resp, server = self.create_test_server(wait_until='ACTIVE')
+        resp, body = self.client.pause_server(server['id'])
+        self.client.wait_for_server_status(server['id'], 'PAUSED')
+        resp, _ = self.client.delete_server(server['id'])
+        self.assertEqual('204', resp['status'])
+
+    @test.attr(type='gate')
     def test_delete_server_while_in_building_state(self):
         # Delete a server while it's VM state is Building
         resp, server = self.create_test_server(wait_until='BUILD')
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index ca8ca54..70afec7 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 IBM Corp.
 # All Rights Reserved.
 #
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index bfc2287..2a5401f 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -199,8 +199,8 @@
 
     @attr(type='gate')
     def test_list_images_param_status(self):
-        # Test to get all available images
-        params = {"status": "available"}
+        # Test to get all active images
+        params = {"status": "active"}
         self._list_by_param_value_and_assert(params)
 
     @attr(type='gate')
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 8710d82..4ee7bd0 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -55,10 +55,17 @@
         cls.alt_client = cls.os_alt.volumes_client
         cls.adm_client = cls.os_adm.volumes_client
 
+    def _delete_volume(self, volume_id):
+        # Delete the specified volume using admin creds
+        resp, _ = self.adm_client.delete_volume(volume_id)
+        self.assertEqual(202, resp.status)
+        self.adm_client.wait_for_resource_deletion(volume_id)
+
     @attr(type='gate')
     def test_create_get_list_accept_volume_transfer(self):
         # Create a volume first
         volume = self.create_volume()
+        self.addCleanup(self._delete_volume, volume['id'])
 
         # Create a volume transfer
         resp, transfer = self.client.create_volume_transfer(volume['id'])
@@ -88,6 +95,7 @@
     def test_create_list_delete_volume_transfer(self):
         # Create a volume first
         volume = self.create_volume()
+        self.addCleanup(self._delete_volume, volume['id'])
 
         # Create a volume transfer
         resp, body = self.client.create_volume_transfer(volume['id'])
diff --git a/tempest/clients.py b/tempest/clients.py
index 65b603b..4c40ce0 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -143,6 +143,10 @@
     ObjectClientCustomizedHeader
 from tempest.services.orchestration.json.orchestration_client import \
     OrchestrationClient
+from tempest.services.telemetry.json.telemetry_client import \
+    TelemetryClientJSON
+from tempest.services.telemetry.xml.telemetry_client import \
+    TelemetryClientXML
 from tempest.services.volume.json.admin.volume_hosts_client import \
     VolumeHostsClientJSON
 from tempest.services.volume.json.admin.volume_types_client import \
@@ -256,6 +260,8 @@
             if client_args_v3_auth:
                 self.servers_client_v3_auth = ServersClientXML(
                     *client_args_v3_auth)
+            if CONF.service_available.ceilometer:
+                self.telemetry_client = TelemetryClientXML(*client_args)
 
         elif interface == 'json':
             self.certificates_client = CertificatesClientJSON(*client_args)
@@ -318,6 +324,8 @@
             self.volumes_extension_client = VolumeExtensionClientJSON(
                 *client_args)
             self.hosts_v3_client = HostsV3ClientJSON(*client_args)
+            if CONF.service_available.ceilometer:
+                self.telemetry_client = TelemetryClientJSON(*client_args)
 
             if client_args_v3_auth:
                 self.servers_client_v3_auth = ServersClientJSON(
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 3efc710..81ebd4b 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -456,18 +456,17 @@
         if resp.status < 400:
             return
 
-        JSON_ENC = ['application/json; charset=UTF-8', 'application/json',
-                    'application/json; charset=utf-8']
+        JSON_ENC = ['application/json', 'application/json; charset=utf-8']
         # NOTE(mtreinish): This is for compatibility with Glance and swift
         # APIs. These are the return content types that Glance api v1
         # (and occasionally swift) are using.
-        TXT_ENC = ['text/plain', 'text/plain; charset=UTF-8',
-                   'text/html; charset=UTF-8', 'text/plain; charset=utf-8']
-        XML_ENC = ['application/xml', 'application/xml; charset=UTF-8']
+        TXT_ENC = ['text/plain', 'text/html', 'text/html; charset=utf-8',
+                   'text/plain; charset=utf-8']
+        XML_ENC = ['application/xml', 'application/xml; charset=utf-8']
 
-        if ctype in JSON_ENC or ctype in XML_ENC:
+        if ctype.lower() in JSON_ENC or ctype.lower() in XML_ENC:
             parse_resp = True
-        elif ctype in TXT_ENC:
+        elif ctype.lower() in TXT_ENC:
             parse_resp = False
         else:
             raise exceptions.RestClientException(str(resp.status))
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index 5eb7336..0ed9b82 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -93,20 +93,6 @@
     def _is_timed_out(self, start_time):
         return (time.time() - self.timeout) > start_time
 
-    def connect_until_closed(self):
-        """Connect to the server and wait until connection is lost."""
-        try:
-            ssh = self._get_ssh_connection()
-            _transport = ssh.get_transport()
-            _start_time = time.time()
-            _timed_out = self._is_timed_out(_start_time)
-            while _transport.is_active() and not _timed_out:
-                time.sleep(5)
-                _timed_out = self._is_timed_out(_start_time)
-            ssh.close()
-        except (EOFError, paramiko.AuthenticationException, socket.error):
-            return
-
     def exec_command(self, cmd):
         """
         Execute the specified command on the server.
@@ -138,7 +124,7 @@
                 raise exceptions.TimeoutException(
                     "Command: '{0}' executed on host '{1}'.".format(
                         cmd, self.host))
-            if not ready[0]:        # If there is nothing to read.
+            if not ready[0]:  # If there is nothing to read.
                 continue
             out_chunk = err_chunk = None
             if channel.recv_ready():
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 3ae9567..7afa863 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
 # Copyright 2013 IBM Corp.
 # All Rights Reserved.
 #
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index eec5a05..a6f47b7 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -33,9 +33,7 @@
         HEAD on the storage URL
         Returns all account metadata headers
         """
-
-        headers = {"X-Storage-Token": self.token}
-        resp, body = self.head('', headers=headers)
+        resp, body = self.head('')
         return resp, body
 
     def create_account_metadata(self, metadata,
@@ -54,7 +52,7 @@
         Deletes an account metadata entry.
         """
 
-        headers = {"X-Storage-Token": self.token}
+        headers = {}
         for item in metadata:
             headers[metadata_prefix + item] = 'x'
         resp, body = self.post('', headers=headers, body=None)
@@ -63,8 +61,8 @@
     def list_account_containers(self, params=None):
         """
         GET on the (base) storage URL
-        Given the X-Storage-URL and a valid X-Auth-Token, returns
-        a list of all containers for the account.
+        Given valid X-Auth-Token, returns a list of all containers for the
+        account.
 
         Optional Arguments:
         limit=[integer value N]
@@ -135,8 +133,8 @@
     def list_account_containers(self, params=None, metadata=None):
         """
         GET on the (base) storage URL
-        Given the X-Storage-URL and a valid X-Auth-Token, returns
-        a list of all containers for the account.
+        Given a valid X-Auth-Token, returns a list of all containers for the
+        account.
 
         Optional Arguments:
         limit=[integer value N]
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index 15185bc..cbd07bf 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -82,8 +82,7 @@
         Retrieves container metadata headers
         """
         url = str(container_name)
-        headers = {"X-Storage-Token": self.token}
-        resp, body = self.head(url, headers=headers)
+        resp, body = self.head(url)
         return resp, body
 
     def list_all_container_objects(self, container, params=None):
diff --git a/tempest/services/telemetry/__init__.py b/tempest/services/telemetry/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/telemetry/__init__.py
diff --git a/tempest/services/telemetry/json/__init__.py b/tempest/services/telemetry/json/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/telemetry/json/__init__.py
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
new file mode 100644
index 0000000..8d46bf3
--- /dev/null
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -0,0 +1,52 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.common.rest_client import RestClient
+from tempest.openstack.common import jsonutils as json
+import tempest.services.telemetry.telemetry_client_base as client
+
+
+class TelemetryClientJSON(client.TelemetryClientBase):
+
+    def get_rest_client(self, config, username,
+                        password, auth_url, tenant_name=None):
+        return RestClient(config, username, password, auth_url, tenant_name)
+
+    def deserialize(self, body):
+        return json.loads(body.replace("\n", ""))
+
+    def serialize(self, body):
+        return json.dumps(body)
+
+    def create_alarm(self, **kwargs):
+        uri = "%s/alarms" % self.uri_prefix
+        return self.post(uri, kwargs)
+
+    def add_sample(self, sample_list, meter_name, meter_unit, volume,
+                   sample_type, resource_id, **kwargs):
+        sample = {"counter_name": meter_name, "counter_unit": meter_unit,
+                  "counter_volume": volume, "counter_type": sample_type,
+                  "resource_id": resource_id}
+        for key in kwargs:
+            sample[key] = kwargs[key]
+
+        sample_list.append(self.serialize(sample))
+        return sample_list
+
+    def create_sample(self, meter_name, sample_list):
+        uri = "%s/meters/%s" % (self.uri_prefix, meter_name)
+        return self.post(uri, str(sample_list))
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
new file mode 100644
index 0000000..59127b9
--- /dev/null
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -0,0 +1,133 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import abc
+import six
+import urllib
+
+
+@six.add_metaclass(abc.ABCMeta)
+class TelemetryClientBase(object):
+
+    """
+    Tempest REST client for Ceilometer V2 API.
+    Implements the following basic Ceilometer abstractions:
+    resources
+    meters
+    alarms
+    queries
+    statistics
+    """
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        self.rest_client = self.get_rest_client(config, username, password,
+                                                auth_url, tenant_name)
+        self.rest_client.service = \
+            self.rest_client.config.telemetry.catalog_type
+        self.headers = self.rest_client.headers
+        self.version = '2'
+        self.uri_prefix = "v%s" % self.version
+
+    @abc.abstractmethod
+    def get_rest_client(self, config, username, password,
+                        auth_url, tenant_name):
+        """
+        :param config:
+        :param username:
+        :param password:
+        :param auth_url:
+        :param tenant_name:
+        :return: RestClient
+        """
+
+    @abc.abstractmethod
+    def deserialize(self, body):
+        """
+        :param body:
+        :return: Deserialize body
+        """
+
+    @abc.abstractmethod
+    def serialize(self, body):
+        """
+        :param body:
+        :return: Serialize body
+        """
+
+    def post(self, uri, body):
+        body = self.serialize(body)
+        resp, body = self.rest_client.post(uri, body, self.headers)
+        body = self.deserialize(body)
+        return resp, body
+
+    def put(self, uri, body):
+        return self.rest_client.put(uri, body, self.headers)
+
+    def get(self, uri):
+        resp, body = self.rest_client.get(uri)
+        body = self.deserialize(body)
+        return resp, body
+
+    def delete(self, uri):
+        resp, body = self.rest_client.delete(uri)
+        if body:
+            body = self.deserialize(body)
+        return resp, body
+
+    def helper_list(self, uri, query=None, period=None):
+        uri_dict = {}
+        if query:
+            uri_dict = {'q.field': query[0],
+                        'q.op': query[1],
+                        'q.value': query[2]}
+        if period:
+            uri_dict['period'] = period
+        if uri_dict:
+            uri += "?%s" % urllib.urlencode(uri_dict)
+        return self.get(uri)
+
+    def list_resources(self):
+        uri = '%s/resources' % self.uri_prefix
+        return self.get(uri)
+
+    def list_meters(self):
+        uri = '%s/meters' % self.uri_prefix
+        return self.get(uri)
+
+    def list_alarms(self):
+        uri = '%s/alarms' % self.uri_prefix
+        return self.get(uri)
+
+    def list_statistics(self, meter, period=None, query=None):
+        uri = "%s/meters/%s/statistics" % (self.uri_prefix, meter)
+        return self.helper_list(uri, query, period)
+
+    def list_samples(self, meter_id, query=None):
+        uri = '%s/meters/%s' % (self.uri_prefix, meter_id)
+        return self.helper_list(uri, query)
+
+    def get_resource(self, resource_id):
+        uri = '%s/resources/%s' % (self.uri_prefix, resource_id)
+        return self.get(uri)
+
+    def get_alarm(self, alarm_id):
+        uri = '%s/meter/%s' % (self.uri_prefix, alarm_id)
+        return self.get(uri)
+
+    def delete_alarm(self, alarm_id):
+        uri = "%s/alarms/%s" % (self.uri_prefix, alarm_id)
+        return self.delete(uri)
diff --git a/tempest/services/telemetry/xml/__init__.py b/tempest/services/telemetry/xml/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/services/telemetry/xml/__init__.py
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
new file mode 100644
index 0000000..245ccb5
--- /dev/null
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -0,0 +1,42 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from lxml import etree
+
+from tempest.common.rest_client import RestClientXML
+from tempest.services.compute.xml.common import Document
+from tempest.services.compute.xml.common import xml_to_json
+import tempest.services.telemetry.telemetry_client_base as client
+
+
+class TelemetryClientXML(client.TelemetryClientBase):
+
+    def get_rest_client(self, config, username,
+                        password, auth_url, tenant_name=None):
+        return RestClientXML(config, username, password, auth_url, tenant_name)
+
+    def _parse_array(self, body):
+        array = []
+        for child in body.getchildren():
+            array.append(xml_to_json(child))
+        return array
+
+    def serialize(self, body):
+        return str(Document(body))
+
+    def deserialize(self, body):
+        return self._parse_array(etree.fromstring(body))
diff --git a/tempest/stress/run_stress.py b/tempest/stress/run_stress.py
index 61fb58f..76320d0 100755
--- a/tempest/stress/run_stress.py
+++ b/tempest/stress/run_stress.py
@@ -19,7 +19,11 @@
 import json
 import sys
 from testtools.testsuite import iterate_tests
-from unittest import loader
+try:
+    from unittest import loader
+except ImportError:
+    # unittest in python 2.6 does not contain loader, so uses unittest2
+    from unittest2 import loader
 
 from tempest.openstack.common import log as logging
 from tempest.stress import driver
diff --git a/tempest/tests/base.py b/tempest/tests/base.py
index 3654f64..15e4311 100644
--- a/tempest/tests/base.py
+++ b/tempest/tests/base.py
@@ -15,6 +15,7 @@
 import os
 
 import fixtures
+import mock
 import testtools
 
 from tempest.openstack.common.fixture import moxstubout
@@ -36,3 +37,22 @@
         mox_fixture = self.useFixture(moxstubout.MoxStubout())
         self.mox = mox_fixture.mox
         self.stubs = mox_fixture.stubs
+
+    def patch(self, target, **kwargs):
+        """
+        Returns a started `mock.patch` object for the supplied target.
+
+        The caller may then call the returned patcher to create a mock object.
+
+        The caller does not need to call stop() on the returned
+        patcher object, as this method automatically adds a cleanup
+        to the test class to stop the patcher.
+
+        :param target: String module.class or module.object expression to patch
+        :param **kwargs: Passed as-is to `mock.patch`. See mock documentation
+                         for details.
+        """
+        p = mock.patch(target, **kwargs)
+        m = p.start()
+        self.addCleanup(p.stop)
+        return m
diff --git a/tempest/tests/test_ssh.py b/tempest/tests/test_ssh.py
new file mode 100644
index 0000000..09bb588
--- /dev/null
+++ b/tempest/tests/test_ssh.py
@@ -0,0 +1,200 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2014 OpenStack Foundation
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import contextlib
+import socket
+
+import mock
+import testtools
+
+from tempest.common import ssh
+from tempest import exceptions
+from tempest.tests import base
+
+
+class TestSshClient(base.TestCase):
+
+    def test_pkey_calls_paramiko_RSAKey(self):
+        with contextlib.nested(
+            mock.patch('paramiko.RSAKey.from_private_key'),
+            mock.patch('cStringIO.StringIO')) as (rsa_mock, cs_mock):
+            cs_mock.return_value = mock.sentinel.csio
+            pkey = 'mykey'
+            ssh.Client('localhost', 'root', pkey=pkey)
+            rsa_mock.assert_called_once_with(mock.sentinel.csio)
+            cs_mock.assert_called_once_with('mykey')
+            rsa_mock.reset_mock()
+            cs_mock.rest_mock()
+            pkey = mock.sentinel.pkey
+            # Shouldn't call out to load a file from RSAKey, since
+            # a sentinel isn't a basestring...
+            ssh.Client('localhost', 'root', pkey=pkey)
+            rsa_mock.assert_not_called()
+            cs_mock.assert_not_called()
+
+    def test_get_ssh_connection(self):
+        c_mock = self.patch('paramiko.SSHClient')
+        aa_mock = self.patch('paramiko.AutoAddPolicy')
+        s_mock = self.patch('time.sleep')
+        t_mock = self.patch('time.time')
+
+        aa_mock.return_value = mock.sentinel.aa
+
+        def reset_mocks():
+            aa_mock.reset_mock()
+            c_mock.reset_mock()
+            s_mock.reset_mock()
+            t_mock.reset_mock()
+
+        # Test normal case for successful connection on first try
+        client_mock = mock.MagicMock()
+        c_mock.return_value = client_mock
+        client_mock.connect.return_value = True
+
+        client = ssh.Client('localhost', 'root', timeout=2)
+        client._get_ssh_connection(sleep=1)
+
+        aa_mock.assert_called_once_with()
+        client_mock.set_missing_host_key_policy.assert_called_once_with(
+            mock.sentinel.aa)
+        expected_connect = [mock.call(
+            'localhost',
+            username='root',
+            pkey=None,
+            key_filename=None,
+            look_for_keys=False,
+            timeout=10.0,
+            password=None
+        )]
+        self.assertEqual(expected_connect, client_mock.connect.mock_calls)
+        s_mock.assert_not_called()
+        t_mock.assert_called_once_with()
+
+        reset_mocks()
+
+        # Test case when connection fails on first two tries and
+        # succeeds on third try (this validates retry logic)
+        client_mock.connect.side_effect = [socket.error, socket.error, True]
+        t_mock.side_effect = [
+            1000,  # Start time
+            1001,  # Sleep loop 1
+            1002   # Sleep loop 2
+        ]
+
+        client._get_ssh_connection(sleep=1)
+
+        expected_sleeps = [
+            mock.call(1),
+            mock.call(1.01)
+        ]
+        self.assertEqual(expected_sleeps, s_mock.mock_calls)
+
+        reset_mocks()
+
+        # Test case when connection fails on first three tries and
+        # exceeds the timeout, so expect to raise a Timeout exception
+        client_mock.connect.side_effect = [
+            socket.error,
+            socket.error,
+            socket.error
+        ]
+        t_mock.side_effect = [
+            1000,  # Start time
+            1001,  # Sleep loop 1
+            1002,  # Sleep loop 2
+            1003,  # Sleep loop 3
+            1004  # LOG.error() calls time.time()
+        ]
+
+        with testtools.ExpectedException(exceptions.SSHTimeout):
+            client._get_ssh_connection()
+
+    def test_exec_command(self):
+        gsc_mock = self.patch('tempest.common.ssh.Client._get_ssh_connection')
+        ito_mock = self.patch('tempest.common.ssh.Client._is_timed_out')
+        select_mock = self.patch('select.poll')
+
+        client_mock = mock.MagicMock()
+        tran_mock = mock.MagicMock()
+        chan_mock = mock.MagicMock()
+        poll_mock = mock.MagicMock()
+
+        def reset_mocks():
+            gsc_mock.reset_mock()
+            ito_mock.reset_mock()
+            select_mock.reset_mock()
+            poll_mock.reset_mock()
+            client_mock.reset_mock()
+            tran_mock.reset_mock()
+            chan_mock.reset_mock()
+
+        select_mock.return_value = poll_mock
+        gsc_mock.return_value = client_mock
+        ito_mock.return_value = True
+        client_mock.get_transport.return_value = tran_mock
+        tran_mock.open_session.return_value = chan_mock
+        poll_mock.poll.side_effect = [
+            [0, 0, 0]
+        ]
+
+        # Test for a timeout condition immediately raised
+        client = ssh.Client('localhost', 'root', timeout=2)
+        with testtools.ExpectedException(exceptions.TimeoutException):
+            client.exec_command("test")
+
+        chan_mock.fileno.assert_called_once_with()
+        chan_mock.exec_command.assert_called_once_with("test")
+        chan_mock.shutdown_write.assert_called_once_with()
+
+        SELECT_POLLIN = 1
+        poll_mock.register.assert_called_once_with(chan_mock, SELECT_POLLIN)
+        poll_mock.poll.assert_called_once_with(10)
+
+        # Test for proper reading of STDOUT and STDERROR and closing
+        # of all file descriptors.
+
+        reset_mocks()
+
+        select_mock.return_value = poll_mock
+        gsc_mock.return_value = client_mock
+        ito_mock.return_value = False
+        client_mock.get_transport.return_value = tran_mock
+        tran_mock.open_session.return_value = chan_mock
+        poll_mock.poll.side_effect = [
+            [1, 0, 0]
+        ]
+        closed_prop = mock.PropertyMock(return_value=True)
+        type(chan_mock).closed = closed_prop
+        chan_mock.recv_exit_status.return_value = 0
+        chan_mock.recv.return_value = ''
+        chan_mock.recv_stderr.return_value = ''
+
+        client = ssh.Client('localhost', 'root', timeout=2)
+        client.exec_command("test")
+
+        chan_mock.fileno.assert_called_once_with()
+        chan_mock.exec_command.assert_called_once_with("test")
+        chan_mock.shutdown_write.assert_called_once_with()
+
+        SELECT_POLLIN = 1
+        poll_mock.register.assert_called_once_with(chan_mock, SELECT_POLLIN)
+        poll_mock.poll.assert_called_once_with(10)
+        chan_mock.recv_ready.assert_called_once_with()
+        chan_mock.recv.assert_called_once_with(1024)
+        chan_mock.recv_stderr_ready.assert_called_once_with()
+        chan_mock.recv_stderr.assert_called_once_with(1024)
+        chan_mock.recv_exit_status.assert_called_once_with()
+        closed_prop.assert_called_once_with()
diff --git a/tools/install_venv.py b/tools/install_venv.py
index a7fb5ee..e41ca43 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -1,7 +1,7 @@
 # Copyright 2010 United States Government as represented by the
 # Administrator of the National Aeronautics and Space Administration.
 # All Rights Reserved.
-# flake8: noqa
+#
 # Copyright 2010 OpenStack Foundation
 # Copyright 2013 IBM Corp.
 #
@@ -17,66 +17,55 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-"""Installation script for Tempest's development virtualenv."""
-
 import os
 import sys
 
-import install_venv_common as install_venv
+import install_venv_common as install_venv  # noqa
 
 
-class CentOS(install_venv.Fedora):
-    """This covers CentOS."""
-
-    def post_process(self):
-        if not self.check_pkg('openssl-devel'):
-            self.yum.install('openssl-devel', check_exit_code=False)
-
-
-def print_help():
-    """This prints Help."""
-
+def print_help(venv, root):
     help = """
-    Tempest development environment setup is complete.
+    Openstack development environment setup is complete.
 
-    Tempest development uses virtualenv to track and manage Python dependencies
-    while in development and testing.
+    Openstack development uses virtualenv to track and manage Python
+    dependencies while in development and testing.
 
-    To activate the Tempest virtualenv for the extent of your current shell
+    To activate the Openstack virtualenv for the extent of your current shell
     session you can run:
 
-    $ source .venv/bin/activate
+    $ source %s/bin/activate
 
     Or, if you prefer, you can run commands in the virtualenv on a case by case
     basis by running:
 
-    $ tools/with_venv.sh <your command>
+    $ %s/tools/with_venv.sh <your command>
 
     Also, make test will automatically use the virtualenv.
     """
-    print(help)
+    print(help % (venv, root))
 
 
 def main(argv):
     root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+
+    if os.environ.get('tools_path'):
+        root = os.environ['tools_path']
     venv = os.path.join(root, '.venv')
+    if os.environ.get('venv'):
+        venv = os.environ['venv']
+
     pip_requires = os.path.join(root, 'requirements.txt')
     test_requires = os.path.join(root, 'test-requirements.txt')
     py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
     project = 'Tempest'
     install = install_venv.InstallVenv(root, venv, pip_requires, test_requires,
                                        py_version, project)
-    if os.path.exists('/etc/redhat-release'):
-        with open('/etc/redhat-release') as rh_release:
-            if 'CentOS' in rh_release.read():
-                install_venv.Fedora = CentOS
     options = install.parse_args(argv)
     install.check_python_version()
     install.check_dependencies()
     install.create_virtualenv(no_site_packages=options.no_site_packages)
     install.install_dependencies()
-    install.post_process()
-    print_help()
+    print_help(venv, root)
 
 if __name__ == '__main__':
     main(sys.argv)
diff --git a/tools/verify_tempest_config.py b/tools/verify_tempest_config.py
index f56b475..0c21cea 100755
--- a/tools/verify_tempest_config.py
+++ b/tools/verify_tempest_config.py
@@ -22,13 +22,6 @@
 
 CONF = config.CONF
 
-#Dicts matching extension names to config options
-NOVA_EXTENSIONS = {
-    'disk_config': 'DiskConfig',
-    'change_password': 'ServerPassword',
-    'flavor_extra': 'FlavorExtraSpecs'
-}
-
 
 def verify_glance_api_versions(os):
     # Check glance api versions
@@ -42,32 +35,87 @@
             not CONF.image_feature_enabled.api_v2))
 
 
-def verify_extensions(os):
-    results = {}
-    extensions_client = os.extensions_client
+def get_extension_client(os, service):
+    extensions_client = {
+        'nova': os.extensions_client,
+        'nova_v3': os.extensions_v3_client,
+        'cinder': os.volumes_extension_client,
+        'neutron': os.network_client,
+    }
+    if service not in extensions_client:
+        print('No tempest extensions client for %s' % service)
+        exit(1)
+    return extensions_client[service]
+
+
+def get_enabled_extensions(service):
+    extensions_options = {
+        'nova': CONF.compute_feature_enabled.api_extensions,
+        'nova_v3': CONF.compute_feature_enabled.api_v3_extensions,
+        'cinder': CONF.volume_feature_enabled.api_extensions,
+        'neutron': CONF.network_feature_enabled.api_extensions,
+    }
+    if service not in extensions_options:
+        print('No supported extensions list option for %s' % service)
+        exit(1)
+    return extensions_options[service]
+
+
+def verify_extensions(os, service, results):
+    extensions_client = get_extension_client(os, service)
     __, resp = extensions_client.list_extensions()
-    resp = resp['extensions']
-    extensions = map(lambda x: x['name'], resp)
-    results['nova_features'] = {}
-    for extension in NOVA_EXTENSIONS.keys():
-        if NOVA_EXTENSIONS[extension] in extensions:
-            results['nova_features'][extension] = True
+    if isinstance(resp, dict):
+        # Neutron's extension 'name' field has is not a single word (it has
+        # spaces in the string) Since that can't be used for list option the
+        # api_extension option in the network-feature-enabled group uses alias
+        # instead of name.
+        if service == 'neutron':
+            extensions = map(lambda x: x['alias'], resp['extensions'])
         else:
-            results['nova_features'][extension] = False
+            extensions = map(lambda x: x['name'], resp['extensions'])
+
+    else:
+        extensions = map(lambda x: x['name'], resp)
+    if not results.get(service):
+        results[service] = {}
+    extensions_opt = get_enabled_extensions(service)
+    if extensions_opt[0] == 'all':
+        results[service]['extensions'] = 'all'
+        return results
+    # Verify that all configured extensions are actually enabled
+    for extension in extensions_opt:
+        results[service][extension] = extension in extensions
+    # Verify that there aren't additional extensions enabled that aren't
+    # specified in the config list
+    for extension in extensions:
+        if extension not in extensions_opt:
+            results[service][extension] = False
     return results
 
 
 def display_results(results):
-    for option in NOVA_EXTENSIONS.keys():
-        config_value = getattr(CONF.compute_feature_enabled, option)
-        if config_value != results['nova_features'][option]:
-            print("Config option: %s should be changed to: %s" % (
-                option, not config_value))
+    for service in results:
+        # If all extensions are specified as being enabled there is no way to
+        # verify this so we just assume this to be true
+        if results[service].get('extensions'):
+            continue
+        extension_list = get_enabled_extensions(service)
+        for extension in results[service]:
+            if not results[service][extension]:
+                if extension in extension_list:
+                    print("%s extension: %s should not be included in the list"
+                          " of enabled extensions" % (service, extension))
+                else:
+                    print("%s extension: %s should be included in the list of "
+                          "enabled extensions" % (service, extension))
 
 
 def main(argv):
+    print('Running config verification...')
     os = clients.ComputeAdminManager(interface='json')
-    results = verify_extensions(os)
+    results = {}
+    for service in ['nova', 'nova_v3', 'cinder', 'neutron']:
+        results = verify_extensions(os, service, results)
     verify_glance_api_versions(os)
     display_results(results)
 
