diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 4e64d7f..ffd0b91 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -39,8 +39,8 @@
 # Deprecated group/name - [DEFAULT]/logdir
 #log_dir = <None>
 
-# Use syslog for logging. Existing syslog format is DEPRECATED during
-# I, and changed in J to honor RFC5424. (boolean value)
+# Use syslog for logging. Existing syslog format is DEPRECATED and
+# will be changed later to honor RFC5424. (boolean value)
 #use_syslog = false
 
 # (Optional) Enables or disables syslog rfc5424 format for logging. If
@@ -77,9 +77,6 @@
 # Enables or disables publication of error events. (boolean value)
 #publish_errors = false
 
-# Enables or disables fatal status of deprecations. (boolean value)
-#fatal_deprecations = false
-
 # The format for an instance that is passed with the log message.
 # (string value)
 #instance_format = "[instance: %(uuid)s] "
@@ -254,6 +251,10 @@
 # value)
 #build_timeout = 300
 
+# Shell fragments to use before executing a command when sshing to a
+# guest. (string value)
+#ssh_shell_prologue = set -eu -o pipefail; PATH=$$PATH:/sbin;
+
 # Auth method used for authenticate to the instance. Valid choices
 # are: keypair, configured, adminpass and disabled. Keypair: start the
 # servers with a ssh keypair. Configured: use the configured user and
@@ -803,7 +804,8 @@
 
 # A list of enabled network extensions with a special entry all which
 # indicates every extension is enabled. Empty list indicates all
-# extensions are disabled (list value)
+# extensions are disabled. To get the list of extensions run: 'neutron
+# ext-list' (list value)
 #api_extensions = all
 
 # Allow the execution of IPv6 subnet tests that use the extended IPv6
diff --git a/requirements.txt b/requirements.txt
index cb0031d..60dee97 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,22 +1,22 @@
 # The order of packages is significant, because pip processes them in the order
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
-pbr>=0.11,<2.0
+pbr<2.0,>=0.11
 anyjson>=0.3.3
 httplib2>=0.7.5
-jsonschema>=2.0.0,<3.0.0,!=2.5.0
-testtools>=0.9.36,!=1.2.0
+jsonschema!=2.5.0,<3.0.0,>=2.0.0
+testtools>=1.4.0
 boto>=2.32.1
 paramiko>=1.13.0
 netaddr>=0.7.12
 testrepository>=0.0.18
 pyOpenSSL>=0.11
-oslo.concurrency>=2.0.0         # Apache-2.0
-oslo.config>=1.11.0  # Apache-2.0
-oslo.i18n>=1.5.0  # Apache-2.0
-oslo.log>=1.2.0  # Apache-2.0
-oslo.serialization>=1.4.0               # Apache-2.0
-oslo.utils>=1.4.0                       # Apache-2.0
+oslo.concurrency>=2.1.0 # Apache-2.0
+oslo.config>=1.11.0 # Apache-2.0
+oslo.i18n>=1.5.0 # Apache-2.0
+oslo.log>=1.2.0 # Apache-2.0
+oslo.serialization>=1.4.0 # Apache-2.0
+oslo.utils>=1.6.0 # Apache-2.0
 six>=1.9.0
 iso8601>=0.1.9
 fixtures>=0.3.14
diff --git a/setup.py b/setup.py
old mode 100755
new mode 100644
index 7363757..056c16c
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index f12784e..d4b8311 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -125,7 +125,7 @@
         self.addCleanup(self.flavor_clean_up, flavor['id'])
         flag = False
         # Verify flavor is retrieved
-        flavors = self.client.list_flavors_with_detail()
+        flavors = self.client.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['name'] == flavor_name:
                 flag = True
@@ -165,7 +165,7 @@
         verify_flavor_response_extension(flavor)
 
         # Check if flavor is present in list
-        flavors = self.user_client.list_flavors_with_detail()
+        flavors = self.user_client.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['name'] == flavor_name:
                 verify_flavor_response_extension(flavor)
@@ -190,7 +190,7 @@
         self.addCleanup(self.flavor_clean_up, flavor['id'])
         # Verify flavor is retrieved
         flag = False
-        flavors = self.client.list_flavors_with_detail()
+        flavors = self.client.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['name'] == flavor_name:
                 flag = True
@@ -198,7 +198,7 @@
 
         # Verify flavor is not retrieved with other user
         flag = False
-        flavors = self.user_client.list_flavors_with_detail()
+        flavors = self.user_client.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['name'] == flavor_name:
                 flag = True
@@ -240,7 +240,7 @@
         flag = False
         self.new_client = self.flavors_client
         # Verify flavor is retrieved with new user
-        flavors = self.new_client.list_flavors_with_detail()
+        flavors = self.new_client.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['name'] == flavor_name:
                 flag = True
@@ -278,7 +278,7 @@
         def _test_string_variations(variations, flavor_name):
             for string in variations:
                 params = {'is_public': string}
-                flavors = self.client.list_flavors_with_detail(params)
+                flavors = self.client.list_flavors(detail=True, **params)
                 flavor = _flavor_lookup(flavors, flavor_name)
                 self.assertIsNotNone(flavor)
 
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index 61d3dc6..4c743dc 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -87,7 +87,7 @@
         self.assertIn(resp_body, add_body)
 
         # The flavor is present in list.
-        flavors = self.flavors_client.list_flavors_with_detail()
+        flavors = self.flavors_client.list_flavors(detail=True)
         self.assertIn(new_flavor['id'], map(lambda x: x['id'], flavors))
 
         # Remove flavor access from a tenant.
@@ -96,5 +96,5 @@
         self.assertNotIn(resp_body, remove_body)
 
         # The flavor is not present in list.
-        flavors = self.flavors_client.list_flavors_with_detail()
+        flavors = self.flavors_client.list_flavors(detail=True)
         self.assertNotIn(new_flavor['id'], map(lambda x: x['id'], flavors))
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 9da7901..189c316 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -44,7 +44,7 @@
     def test_get_instance_usage_audit_log(self):
         # Get instance usage audit log before specified time
         now = datetime.datetime.now()
-        body = self.adm_client.get_instance_usage_audit_log(
+        body = self.adm_client.show_instance_usage_audit_log(
             urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
 
         expected_items = ['total_errors', 'total_instances', 'log',
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
index 97d665b..eea3103 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
@@ -39,12 +39,12 @@
         now = datetime.datetime.now()
         self.assertRaises(lib_exc.Forbidden,
                           self.instance_usages_audit_log_client.
-                          get_instance_usage_audit_log,
+                          show_instance_usage_audit_log,
                           urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
 
     @test.attr(type=['negative'])
     @test.idempotent_id('9b952047-3641-41c7-ba91-a809fc5974c8')
     def test_get_instance_usage_audit_logs_with_invalid_time(self):
         self.assertRaises(lib_exc.BadRequest,
-                          self.adm_client.get_instance_usage_audit_log,
+                          self.adm_client.show_instance_usage_audit_log,
                           "invalid_time")
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 01db25c..029e578 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -58,7 +58,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'])
-        quota_set = self.adm_client.get_default_quota_set(
+        quota_set = self.adm_client.show_default_quota_set(
             self.demo_tenant_id)
         self.assertEqual(quota_set['id'], self.demo_tenant_id)
         for quota in expected_quota_set:
@@ -67,7 +67,7 @@
     @test.idempotent_id('55fbe2bf-21a9-435b-bbd2-4162b0ed799a')
     def test_update_all_quota_resources_for_tenant(self):
         # Admin can update all the resource quota limits for a tenant
-        default_quota_set = self.adm_client.get_default_quota_set(
+        default_quota_set = self.adm_client.show_default_quota_set(
             self.demo_tenant_id)
         new_quota_set = {'injected_file_content_bytes': 20480,
                          'metadata_items': 256, 'injected_files': 10,
@@ -107,7 +107,7 @@
         self.addCleanup(identity_client.delete_tenant, tenant_id)
 
         self.adm_client.update_quota_set(tenant_id, ram='5120')
-        quota_set = self.adm_client.get_quota_set(tenant_id)
+        quota_set = self.adm_client.show_quota_set(tenant_id)
         self.assertEqual(5120, quota_set['ram'])
 
         # Verify that GET shows the updated quota set of user
@@ -124,8 +124,8 @@
         self.adm_client.update_quota_set(tenant_id,
                                          user_id=user_id,
                                          ram='2048')
-        quota_set = self.adm_client.get_quota_set(tenant_id,
-                                                  user_id=user_id)
+        quota_set = self.adm_client.show_quota_set(tenant_id,
+                                                   user_id=user_id)
         self.assertEqual(2048, quota_set['ram'])
 
     @test.idempotent_id('389d04f0-3a41-405f-9317-e5f86e3c44f0')
@@ -138,14 +138,14 @@
                                                description=tenant_desc)
         tenant_id = tenant['id']
         self.addCleanup(identity_client.delete_tenant, tenant_id)
-        quota_set_default = self.adm_client.get_quota_set(tenant_id)
+        quota_set_default = self.adm_client.show_quota_set(tenant_id)
         ram_default = quota_set_default['ram']
 
         self.adm_client.update_quota_set(tenant_id, ram='5120')
 
         self.adm_client.delete_quota_set(tenant_id)
 
-        quota_set_new = self.adm_client.get_quota_set(tenant_id)
+        quota_set_new = self.adm_client.show_quota_set(tenant_id)
         self.assertEqual(ram_default, quota_set_new['ram'])
 
 
@@ -176,7 +176,7 @@
     @test.idempotent_id('7932ab0f-5136-4075-b201-c0e2338df51a')
     def test_update_default_quotas(self):
         LOG.debug("get the current 'default' quota class values")
-        body = self.adm_client.get_quota_class_set('default')
+        body = self.adm_client.show_quota_class_set('default')
         self.assertIn('id', body)
         self.assertEqual('default', body.pop('id'))
         # restore the defaults when the test is done
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index d20ebf3..c450a1d 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -54,7 +54,7 @@
     @test.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
     def test_create_server_when_cpu_quota_is_full(self):
         # Disallow server creation when tenant's vcpu quota is full
-        quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
         default_vcpu_quota = quota_set['cores']
         vcpu_quota = 0  # Set the quota to zero to conserve resources
 
@@ -71,7 +71,7 @@
     @test.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
     def test_create_server_when_memory_quota_is_full(self):
         # Disallow server creation when tenant's memory quota is full
-        quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
         default_mem_quota = quota_set['ram']
         mem_quota = 0  # Set the quota to zero to conserve resources
 
@@ -88,7 +88,7 @@
     @test.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
     def test_create_server_when_instances_quota_is_full(self):
         # Once instances quota limit is reached, disallow server creation
-        quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
         default_instances_quota = quota_set['instances']
         instances_quota = 0  # Set quota to zero to disallow server creation
 
@@ -107,7 +107,7 @@
     def test_security_groups_exceed_limit(self):
         # Negative test: Creation Security Groups over limit should FAIL
 
-        quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
         default_sg_quota = quota_set['security_groups']
         sg_quota = 0  # Set the quota to zero to conserve resources
 
@@ -136,7 +136,7 @@
         # Negative test: Creation of Security Group Rules should FAIL
         # when we reach limit maxSecurityGroupRules
 
-        quota_set = self.adm_client.get_quota_set(self.demo_tenant_id)
+        quota_set = self.adm_client.show_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_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index d325bd7..cda4bc4 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -68,7 +68,7 @@
         self.useFixture(fixtures.LockFixture('compute_quotas'))
         flavor_name = data_utils.rand_name("flavor")
         flavor_id = self._get_unused_flavor_id()
-        quota_set = self.quotas_client.get_default_quota_set(self.tenant_id)
+        quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
         ram = int(quota_set['ram']) + 1
         vcpus = 8
         disk = 10
@@ -91,7 +91,7 @@
         flavor_name = data_utils.rand_name("flavor")
         flavor_id = self._get_unused_flavor_id()
         ram = 512
-        quota_set = self.quotas_client.get_default_quota_set(self.tenant_id)
+        quota_set = self.quotas_client.show_default_quota_set(self.tenant_id)
         vcpus = int(quota_set['cores']) + 1
         disk = 10
         flavor_ref = self.flavors_client.create_flavor(flavor_name,
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 251f4ec..728fefb 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -41,7 +41,7 @@
     @test.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
     def test_list_flavors_with_detail(self):
         # Detailed list of all flavors should contain the expected flavor
-        flavors = self.client.list_flavors_with_detail()
+        flavors = self.client.list_flavors(detail=True)
         flavor = self.client.show_flavor(self.flavor_ref)
         self.assertIn(flavor, flavors)
 
@@ -56,14 +56,14 @@
     def test_list_flavors_limit_results(self):
         # Only the expected number of flavors should be returned
         params = {'limit': 1}
-        flavors = self.client.list_flavors(params)
+        flavors = self.client.list_flavors(**params)
         self.assertEqual(1, len(flavors))
 
     @test.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
     def test_list_flavors_detailed_limit_results(self):
         # Only the expected number of flavors (detailed) should be returned
         params = {'limit': 1}
-        flavors = self.client.list_flavors_with_detail(params)
+        flavors = self.client.list_flavors(detail=True, **params)
         self.assertEqual(1, len(flavors))
 
     @test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
@@ -73,7 +73,7 @@
         flavor_id = flavor['id']
 
         params = {'marker': flavor_id}
-        flavors = self.client.list_flavors(params)
+        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.')
 
@@ -84,7 +84,7 @@
         flavor_id = flavor['id']
 
         params = {'marker': flavor_id}
-        flavors = self.client.list_flavors_with_detail(params)
+        flavors = self.client.list_flavors(detail=True, **params)
         self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
                          'The list of flavors did not start after the marker.')
 
@@ -95,7 +95,7 @@
         flavor_id = flavor['id']
 
         params = {self._min_disk: flavor['disk'] + 1}
-        flavors = self.client.list_flavors_with_detail(params)
+        flavors = self.client.list_flavors(detail=True, **params)
         self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
 
     @test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
@@ -105,7 +105,7 @@
         flavor_id = flavor['id']
 
         params = {self._min_ram: flavor['ram'] + 1}
-        flavors = self.client.list_flavors_with_detail(params)
+        flavors = self.client.list_flavors(detail=True, **params)
         self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
 
     @test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
@@ -115,7 +115,7 @@
         flavor_id = flavor['id']
 
         params = {self._min_disk: flavor['disk'] + 1}
-        flavors = self.client.list_flavors(params)
+        flavors = self.client.list_flavors(**params)
         self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
 
     @test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
@@ -125,5 +125,5 @@
         flavor_id = flavor['id']
 
         params = {self._min_ram: flavor['ram'] + 1}
-        flavors = self.client.list_flavors(params)
+        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/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 9664c61..4e0ed97 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -93,8 +93,8 @@
     @test.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')
     def test_get_image_metadata_item(self):
         # The value for a specific metadata key should be returned
-        meta = self.client.get_image_metadata_item(self.image_id,
-                                                   'os_distro')
+        meta = self.client.show_image_metadata_item(self.image_id,
+                                                    'os_distro')
         self.assertEqual('value2', meta['os_distro'])
 
     @test.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index e44fbfc..0c1971a 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -49,7 +49,7 @@
     def test_get_nonexistent_image_metadata_item(self):
         # Negative test: Get on non-existent image should not happen
         self.assertRaises(lib_exc.NotFound,
-                          self.client.get_image_metadata_item,
+                          self.client.show_image_metadata_item,
                           data_utils.rand_uuid(), 'os_version')
 
     @test.attr(type=['negative'])
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index e2d4bd9..111398b 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -105,7 +105,7 @@
         # The list of images should contain only images with the
         # provided status
         params = {'status': 'ACTIVE'}
-        images = self.client.list_images(params)
+        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]))
@@ -116,7 +116,7 @@
         # List of all images should contain the expected images filtered
         # by name
         params = {'name': self.image1['name']}
-        images = self.client.list_images(params)
+        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]))
@@ -128,7 +128,7 @@
     def test_list_images_filter_by_server_id(self):
         # The images should contain images filtered by server id
         params = {'server': self.server1['id']}
-        images = self.client.list_images(params)
+        images = self.client.list_images(**params)
 
         self.assertTrue(any([i for i in images
                              if i['id'] == self.snapshot1_id]),
@@ -149,7 +149,7 @@
         # Try all server link types
         for link in server_links:
             params = {'server': link['href']}
-            images = self.client.list_images(params)
+            images = self.client.list_images(**params)
 
             self.assertFalse(any([i for i in images
                                   if i['id'] == self.snapshot1_id]))
@@ -164,7 +164,7 @@
     def test_list_images_filter_by_type(self):
         # The list of servers should be filtered by image type
         params = {'type': 'snapshot'}
-        images = self.client.list_images(params)
+        images = self.client.list_images(**params)
 
         self.assertTrue(any([i for i in images
                              if i['id'] == self.snapshot1_id]))
@@ -179,7 +179,7 @@
     def test_list_images_limit_results(self):
         # Verify only the expected number of results are returned
         params = {'limit': '1'}
-        images = self.client.list_images(params)
+        images = self.client.list_images(**params)
         self.assertEqual(1, len([x for x in images if 'id' in x]))
 
     @test.idempotent_id('18bac3ae-da27-436c-92a9-b22474d13aab')
@@ -189,7 +189,7 @@
         # Becoming ACTIVE will modify the updated time
         # Filter by the image's created time
         params = {'changes-since': self.image3['created']}
-        images = self.client.list_images(params)
+        images = self.client.list_images(**params)
         found = any([i for i in images if i['id'] == self.image3_id])
         self.assertTrue(found)
 
@@ -198,7 +198,7 @@
         # Detailed list of all images should only contain images
         # with the provided status
         params = {'status': 'ACTIVE'}
-        images = self.client.list_images_with_detail(params)
+        images = self.client.list_images(detail=True, **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]))
@@ -209,7 +209,7 @@
         # Detailed list of all images should contain the expected
         # images filtered by name
         params = {'name': self.image1['name']}
-        images = self.client.list_images_with_detail(params)
+        images = self.client.list_images(detail=True, **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]))
@@ -220,7 +220,7 @@
         # Verify only the expected number of results (with full details)
         # are returned
         params = {'limit': '1'}
-        images = self.client.list_images_with_detail(params)
+        images = self.client.list_images(detail=True, **params)
         self.assertEqual(1, len(images))
 
     @test.idempotent_id('8c78f822-203b-4bf6-8bba-56ebd551cf84')
@@ -233,7 +233,7 @@
         # Try all server link types
         for link in server_links:
             params = {'server': link['href']}
-            images = self.client.list_images_with_detail(params)
+            images = self.client.list_images(detail=True, **params)
 
             self.assertFalse(any([i for i in images
                                   if i['id'] == self.snapshot1_id]))
@@ -248,7 +248,7 @@
     def test_list_images_with_detail_filter_by_type(self):
         # The detailed list of servers should be filtered by image type
         params = {'type': 'snapshot'}
-        images = self.client.list_images_with_detail(params)
+        images = self.client.list_images(detail=True, **params)
         self.client.show_image(self.image_ref)
 
         self.assertTrue(any([i for i in images
@@ -267,5 +267,5 @@
         # Becoming ACTIVE will modify the updated time
         # Filter by the image's created time
         params = {'changes-since': self.image1['created']}
-        images = self.client.list_images_with_detail(params)
+        images = self.client.list_images(detail=True, **params)
         self.assertTrue(any([i for i in images if i['id'] == self.image1_id]))
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index 5b80c72..b67378c 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -50,6 +50,6 @@
     @test.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
     def test_list_images_with_detail(self):
         # Detailed list of all images should contain the expected images
-        images = self.client.list_images_with_detail()
+        images = self.client.list_images(detail=True)
         found = any([i for i in images if i['id'] == self.image_ref])
         self.assertTrue(found)
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 01e3c86..50ebdeb 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -82,7 +82,7 @@
         # Keypair should be created, Got details by name and deleted
         k_name = data_utils.rand_name('keypair')
         self._create_keypair(k_name)
-        keypair_detail = self.client.get_keypair(k_name)
+        keypair_detail = self.client.show_keypair(k_name)
         self.assertIn('name', keypair_detail)
         self.assertIn('public_key', keypair_detail)
         self.assertEqual(keypair_detail['name'], k_name,
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 10b08a1..6fcd38a 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -430,7 +430,7 @@
         server = self.client.get_server(self.server_id)
         image_name = server['name'] + '-shelved'
         params = {'name': image_name}
-        images = self.images_client.list_images(params)
+        images = self.images_client.list_images(**params)
         self.assertEqual(1, len(images))
         self.assertEqual(image_name, images[0]['name'])
 
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 1a977ab..a8f7597 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -137,7 +137,7 @@
         # A 403 Forbidden or 413 Overlimit (old behaviour) exception
         # will be raised while exceeding metadata items limit for
         # tenant.
-        quota_set = self.quotas.get_quota_set(self.tenant_id)
+        quota_set = self.quotas.show_quota_set(self.tenant_id)
         quota_metadata = quota_set['metadata_items']
         if quota_metadata == -1:
             raise self.skipException("No limit for metadata_items")
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 82ef7f5..08bebc0 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -475,7 +475,7 @@
         server = self.client.get_server(self.server_id)
         image_name = server['name'] + '-shelved'
         params = {'name': image_name}
-        images = self.images_client.list_images(params)
+        images = self.images_client.list_images(**params)
         self.assertEqual(1, len(images))
         self.assertEqual(image_name, images[0]['name'])
 
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 63b78a0..af29425 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -219,7 +219,7 @@
     def test_get_keypair_of_alt_account_fails(self):
         # A GET request for another user's keypair should fail
         self.assertRaises(lib_exc.NotFound,
-                          self.alt_keypairs_client.get_keypair,
+                          self.alt_keypairs_client.show_keypair,
                           self.keypairname)
 
     @test.idempotent_id('6d841683-a8e0-43da-a1b8-b339f7692b61')
@@ -356,7 +356,7 @@
         self.images_client.set_image_metadata(self.image['id'],
                                               req_metadata)
         self.assertRaises(lib_exc.NotFound,
-                          self.alt_images_client.get_image_metadata_item,
+                          self.alt_images_client.show_image_metadata_item,
                           self.image['id'], 'meta1')
 
     @test.idempotent_id('79531e2e-e721-493c-8b30-a35db36fdaa6')
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index a6e877c..e302798 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -47,14 +47,14 @@
     def test_get_quotas(self):
         # User can get the quota set for it's tenant
         expected_quota_set = self.default_quota_set | set(['id'])
-        quota_set = self.client.get_quota_set(self.tenant_id)
+        quota_set = self.client.show_quota_set(self.tenant_id)
         self.assertEqual(quota_set['id'], self.tenant_id)
         for quota in expected_quota_set:
             self.assertIn(quota, quota_set.keys())
 
         # get the quota set using user id
-        quota_set = self.client.get_quota_set(self.tenant_id,
-                                              self.user_id)
+        quota_set = self.client.show_quota_set(self.tenant_id,
+                                               self.user_id)
         self.assertEqual(quota_set['id'], self.tenant_id)
         for quota in expected_quota_set:
             self.assertIn(quota, quota_set.keys())
@@ -63,7 +63,7 @@
     def test_get_default_quotas(self):
         # User can get the default quota set for it's tenant
         expected_quota_set = self.default_quota_set | set(['id'])
-        quota_set = self.client.get_default_quota_set(self.tenant_id)
+        quota_set = self.client.show_default_quota_set(self.tenant_id)
         self.assertEqual(quota_set['id'], self.tenant_id)
         for quota in expected_quota_set:
             self.assertIn(quota, quota_set.keys())
@@ -72,6 +72,6 @@
     def test_compare_tenant_quotas_with_default_quotas(self):
         # Tenants are created with the default quota values
         defualt_quota_set = \
-            self.client.get_default_quota_set(self.tenant_id)
-        tenant_quota_set = self.client.get_quota_set(self.tenant_id)
+            self.client.show_default_quota_set(self.tenant_id)
+        tenant_quota_set = self.client.show_quota_set(self.tenant_id)
         self.assertEqual(defualt_quota_set, tenant_quota_set)
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index eeb472c..e698baa 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -58,7 +58,7 @@
     @test.services('compute')
     def test_compare_db_flavors_with_os(self):
         db_flavors = self.client.list_db_flavors()
-        os_flavors = self.os_flavors_client.list_flavors_with_detail()
+        os_flavors = self.os_flavors_client.list_flavors(detail=True)
         self.assertEqual(len(os_flavors), len(db_flavors),
                          "OS flavors %s do not match DB flavors %s" %
                          (os_flavors, db_flavors))
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
deleted file mode 100644
index 7234348..0000000
--- a/tempest/api/network/admin/test_lbaas_agent_scheduler.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# 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_lib.common.utils import data_utils
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest):
-    """
-    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 skip_checks(cls):
-        super(LBaaSAgentSchedulerTestJSON, cls).skip_checks()
-        if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
-            msg = "LBaaS Agent Scheduler Extension not enabled."
-            raise cls.skipException(msg)
-
-    @classmethod
-    def resource_setup(cls):
-        super(LBaaSAgentSchedulerTestJSON, cls).resource_setup()
-        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.idempotent_id('e5ea8b15-4f44-4350-963c-e0fcb533ee79')
-    def test_list_pools_on_lbaas_agent(self):
-        found = False
-        body = self.admin_client.list_agents(
-            agent_type="Loadbalancer agent")
-        agents = body['agents']
-        for a in agents:
-            msg = 'Load Balancer agent expected'
-            self.assertEqual(a['agent_type'], 'Loadbalancer agent', msg)
-            body = (
-                self.admin_client.list_pools_hosted_by_one_lbaas_agent(
-                    a['id']))
-            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.idempotent_id('e2745593-fd79-4b98-a262-575fd7865796')
-    def test_show_lbaas_agent_hosting_pool(self):
-        body = self.admin_client.show_lbaas_agent_hosting_pool(
-            self.pool['id'])
-        self.assertEqual('Loadbalancer agent', body['agent']['agent_type'])
diff --git a/tempest/api/network/admin/test_load_balancer_admin_actions.py b/tempest/api/network/admin/test_load_balancer_admin_actions.py
deleted file mode 100644
index 24a04be..0000000
--- a/tempest/api/network/admin/test_load_balancer_admin_actions.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 2014 Mirantis.inc
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest_lib.common.utils import data_utils
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LoadBalancerAdminTestJSON(base.BaseAdminNetworkTest):
-    """
-    Test admin actions for load balancer.
-
-    Create VIP for another tenant
-    Create health monitor for another tenant
-    """
-
-    force_tenant_isolation = True
-
-    @classmethod
-    def skip_checks(cls):
-        super(LoadBalancerAdminTestJSON, cls).skip_checks()
-        if not test.is_extension_enabled('lbaas', 'network'):
-            msg = "lbaas extension not enabled."
-            raise cls.skipException(msg)
-
-    @classmethod
-    def setup_clients(cls):
-        super(LoadBalancerAdminTestJSON, cls).setup_clients()
-        cls.client = cls.manager.network_client
-
-    @classmethod
-    def resource_setup(cls):
-        super(LoadBalancerAdminTestJSON, cls).resource_setup()
-        cls.tenant_id = cls.os.credentials.tenant_id
-        cls.network = cls.create_network()
-        cls.subnet = cls.create_subnet(cls.network)
-        cls.pool = cls.create_pool(data_utils.rand_name('pool-'),
-                                   "ROUND_ROBIN", "HTTP", cls.subnet)
-
-    @test.idempotent_id('6b0a20d8-4fcd-455e-b54f-ec4db5199518')
-    def test_create_vip_as_admin_for_another_tenant(self):
-        name = data_utils.rand_name('vip-')
-        body = self.admin_client.create_pool(
-            name=data_utils.rand_name('pool-'),
-            lb_method="ROUND_ROBIN",
-            protocol="HTTP",
-            subnet_id=self.subnet['id'],
-            tenant_id=self.tenant_id)
-        pool = body['pool']
-        self.addCleanup(self.admin_client.delete_pool, pool['id'])
-        body = self.admin_client.create_vip(name=name,
-                                            protocol="HTTP",
-                                            protocol_port=80,
-                                            subnet_id=self.subnet['id'],
-                                            pool_id=pool['id'],
-                                            tenant_id=self.tenant_id)
-        vip = body['vip']
-        self.addCleanup(self.admin_client.delete_vip, vip['id'])
-        self.assertIsNotNone(vip['id'])
-        self.assertEqual(self.tenant_id, vip['tenant_id'])
-        body = self.client.show_vip(vip['id'])
-        show_vip = body['vip']
-        self.assertEqual(vip['id'], show_vip['id'])
-        self.assertEqual(vip['name'], show_vip['name'])
-
-    @test.idempotent_id('74552cfc-ab78-4fb6-825b-f67bca379921')
-    def test_create_health_monitor_as_admin_for_another_tenant(self):
-        body = (
-            self.admin_client.create_health_monitor(delay=4,
-                                                    max_retries=3,
-                                                    type="TCP",
-                                                    timeout=1,
-                                                    tenant_id=self.tenant_id))
-        health_monitor = body['health_monitor']
-        self.addCleanup(self.admin_client.delete_health_monitor,
-                        health_monitor['id'])
-        self.assertIsNotNone(health_monitor['id'])
-        self.assertEqual(self.tenant_id, health_monitor['tenant_id'])
-        body = self.client.show_health_monitor(health_monitor['id'])
-        show_health_monitor = body['health_monitor']
-        self.assertEqual(health_monitor['id'], show_health_monitor['id'])
-
-    @test.idempotent_id('266a192d-3c22-46c4-a8fb-802450301e82')
-    def test_create_pool_from_admin_user_other_tenant(self):
-        body = self.admin_client.create_pool(
-            name=data_utils.rand_name('pool-'),
-            lb_method="ROUND_ROBIN",
-            protocol="HTTP",
-            subnet_id=self.subnet['id'],
-            tenant_id=self.tenant_id)
-        pool = body['pool']
-        self.addCleanup(self.admin_client.delete_pool, pool['id'])
-        self.assertIsNotNone(pool['id'])
-        self.assertEqual(self.tenant_id, pool['tenant_id'])
-
-    @test.idempotent_id('158bb272-b9ed-4cfc-803c-661dac46f783')
-    def test_create_member_from_admin_user_other_tenant(self):
-        body = self.admin_client.create_member(address="10.0.9.47",
-                                               protocol_port=80,
-                                               pool_id=self.pool['id'],
-                                               tenant_id=self.tenant_id)
-        member = body['member']
-        self.addCleanup(self.admin_client.delete_member, member['id'])
-        self.assertIsNotNone(member['id'])
-        self.assertEqual(self.tenant_id, member['tenant_id'])
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 46d6651..f6046d3 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -90,10 +90,3 @@
     def test_quotas(self):
         new_quotas = {'network': 0, 'security_group': 0}
         self._check_quotas(new_quotas)
-
-    @test.idempotent_id('a7add2b1-691e-44d6-875f-697d9685f091')
-    @test.requires_ext(extension='lbaas', service='network')
-    def test_lbaas_quotas(self):
-        new_quotas = {'vip': 1, 'pool': 2,
-                      'member': 3, 'health_monitor': 4}
-        self._check_quotas(new_quotas)
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index f864f95..bbefc25 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -82,64 +82,19 @@
         cls.subnets = []
         cls.ports = []
         cls.routers = []
-        cls.pools = []
-        cls.vips = []
-        cls.members = []
-        cls.health_monitors = []
-        cls.vpnservices = []
-        cls.ikepolicies = []
         cls.floating_ips = []
         cls.metering_labels = []
         cls.metering_label_rules = []
-        cls.fw_rules = []
-        cls.fw_policies = []
-        cls.ipsecpolicies = []
         cls.ethertype = "IPv" + str(cls._ip_version)
 
     @classmethod
     def resource_cleanup(cls):
         if CONF.service_available.neutron:
-            # Clean up ipsec policies
-            for ipsecpolicy in cls.ipsecpolicies:
-                cls._try_delete_resource(cls.client.delete_ipsecpolicy,
-                                         ipsecpolicy['id'])
-            # Clean up firewall policies
-            for fw_policy in cls.fw_policies:
-                cls._try_delete_resource(cls.client.delete_firewall_policy,
-                                         fw_policy['id'])
-            # Clean up firewall rules
-            for fw_rule in cls.fw_rules:
-                cls._try_delete_resource(cls.client.delete_firewall_rule,
-                                         fw_rule['id'])
-            # Clean up ike policies
-            for ikepolicy in cls.ikepolicies:
-                cls._try_delete_resource(cls.client.delete_ikepolicy,
-                                         ikepolicy['id'])
-            # Clean up vpn services
-            for vpnservice in cls.vpnservices:
-                cls._try_delete_resource(cls.client.delete_vpnservice,
-                                         vpnservice['id'])
             # Clean up floating IPs
             for floating_ip in cls.floating_ips:
                 cls._try_delete_resource(cls.client.delete_floatingip,
                                          floating_ip['id'])
 
-            # Clean up health monitors
-            for health_monitor in cls.health_monitors:
-                cls._try_delete_resource(cls.client.delete_health_monitor,
-                                         health_monitor['id'])
-            # Clean up members
-            for member in cls.members:
-                cls._try_delete_resource(cls.client.delete_member,
-                                         member['id'])
-            # Clean up vips
-            for vip in cls.vips:
-                cls._try_delete_resource(cls.client.delete_vip,
-                                         vip['id'])
-            # Clean up pools
-            for pool in cls.pools:
-                cls._try_delete_resource(cls.client.delete_pool,
-                                         pool['id'])
             # Clean up metering label rules
             for metering_label_rule in cls.metering_label_rules:
                 cls._try_delete_resource(
@@ -284,78 +239,6 @@
         return fip
 
     @classmethod
-    def create_pool(cls, name, lb_method, protocol, subnet):
-        """Wrapper utility that returns a test pool."""
-        body = cls.client.create_pool(
-            name=name,
-            lb_method=lb_method,
-            protocol=protocol,
-            subnet_id=subnet['id'])
-        pool = body['pool']
-        cls.pools.append(pool)
-        return pool
-
-    @classmethod
-    def update_pool(cls, name):
-        """Wrapper utility that returns a test pool."""
-        body = cls.client.update_pool(name=name)
-        pool = body['pool']
-        return pool
-
-    @classmethod
-    def create_vip(cls, name, protocol, protocol_port, subnet, pool):
-        """Wrapper utility that returns a test vip."""
-        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):
-        body = cls.client.update_vip(name=name)
-        vip = body['vip']
-        return vip
-
-    @classmethod
-    def create_member(cls, protocol_port, pool, ip_version=None):
-        """Wrapper utility that returns a test member."""
-        ip_version = ip_version if ip_version is not None else cls._ip_version
-        member_address = "fd00::abcd" if ip_version == 6 else "10.0.9.46"
-        body = cls.client.create_member(address=member_address,
-                                        protocol_port=protocol_port,
-                                        pool_id=pool['id'])
-        member = body['member']
-        cls.members.append(member)
-        return member
-
-    @classmethod
-    def update_member(cls, admin_state_up):
-        body = cls.client.update_member(admin_state_up=admin_state_up)
-        member = body['member']
-        return member
-
-    @classmethod
-    def create_health_monitor(cls, delay, max_retries, Type, timeout):
-        """Wrapper utility that returns a test health monitor."""
-        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):
-        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."""
         interface = cls.client.add_router_interface_with_subnet_id(
@@ -363,44 +246,6 @@
         return interface
 
     @classmethod
-    def create_vpnservice(cls, subnet_id, router_id):
-        """Wrapper utility that returns a test vpn service."""
-        body = cls.client.create_vpnservice(
-            subnet_id=subnet_id, router_id=router_id, admin_state_up=True,
-            name=data_utils.rand_name("vpnservice-"))
-        vpnservice = body['vpnservice']
-        cls.vpnservices.append(vpnservice)
-        return vpnservice
-
-    @classmethod
-    def create_ikepolicy(cls, name):
-        """Wrapper utility that returns a test ike policy."""
-        body = cls.client.create_ikepolicy(name=name)
-        ikepolicy = body['ikepolicy']
-        cls.ikepolicies.append(ikepolicy)
-        return ikepolicy
-
-    @classmethod
-    def create_firewall_rule(cls, action, protocol):
-        """Wrapper utility that returns a test firewall rule."""
-        body = cls.client.create_firewall_rule(
-            name=data_utils.rand_name("fw-rule"),
-            action=action,
-            protocol=protocol)
-        fw_rule = body['firewall_rule']
-        cls.fw_rules.append(fw_rule)
-        return fw_rule
-
-    @classmethod
-    def create_firewall_policy(cls):
-        """Wrapper utility that returns a test firewall policy."""
-        body = cls.client.create_firewall_policy(
-            name=data_utils.rand_name("fw-policy"))
-        fw_policy = body['firewall_policy']
-        cls.fw_policies.append(fw_policy)
-        return fw_policy
-
-    @classmethod
     def delete_router(cls, router):
         body = cls.client.list_router_interfaces(router['id'])
         interfaces = body['ports']
@@ -412,14 +257,6 @@
                 pass
         cls.client.delete_router(router['id'])
 
-    @classmethod
-    def create_ipsecpolicy(cls, name):
-        """Wrapper utility that returns a test ipsec policy."""
-        body = cls.client.create_ipsecpolicy(name=name)
-        ipsecpolicy = body['ipsecpolicy']
-        cls.ipsecpolicies.append(ipsecpolicy)
-        return ipsecpolicy
-
 
 class BaseAdminNetworkTest(BaseNetworkTest):
 
diff --git a/tempest/api/network/test_fwaas_extensions.py b/tempest/api/network/test_fwaas_extensions.py
deleted file mode 100644
index 651b4ab..0000000
--- a/tempest/api/network/test_fwaas_extensions.py
+++ /dev/null
@@ -1,333 +0,0 @@
-# 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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import exceptions as lib_exc
-
-from tempest.api.network import base
-from tempest import config
-from tempest import exceptions
-from tempest import test
-
-CONF = config.CONF
-
-
-class FWaaSExtensionTestJSON(base.BaseNetworkTest):
-    """
-    Tests the following operations in the Neutron API using the REST client for
-    Neutron:
-
-        List firewall rules
-        Create firewall rule
-        Update firewall rule
-        Delete firewall rule
-        Show firewall rule
-        List firewall policies
-        Create firewall policy
-        Update firewall policy
-        Insert firewall rule to policy
-        Remove firewall rule from policy
-        Insert firewall rule after/before rule in policy
-        Update firewall policy audited attribute
-        Delete firewall policy
-        Show firewall policy
-        List firewall
-        Create firewall
-        Update firewall
-        Delete firewall
-        Show firewall
-    """
-
-    @classmethod
-    def skip_checks(cls):
-        super(FWaaSExtensionTestJSON, cls).skip_checks()
-        if not test.is_extension_enabled('fwaas', 'network'):
-            msg = "FWaaS Extension not enabled."
-            raise cls.skipException(msg)
-
-    @classmethod
-    def resource_setup(cls):
-        super(FWaaSExtensionTestJSON, cls).resource_setup()
-        cls.fw_rule = cls.create_firewall_rule("allow", "tcp")
-        cls.fw_policy = cls.create_firewall_policy()
-
-    def _try_delete_policy(self, policy_id):
-        # delete policy, if it exists
-        try:
-            self.client.delete_firewall_policy(policy_id)
-        # if policy is not found, this means it was deleted in the test
-        except lib_exc.NotFound:
-            pass
-
-    def _try_delete_rule(self, rule_id):
-        # delete rule, if it exists
-        try:
-            self.client.delete_firewall_rule(rule_id)
-        # if rule is not found, this means it was deleted in the test
-        except lib_exc.NotFound:
-            pass
-
-    def _try_delete_firewall(self, fw_id):
-        # delete firewall, if it exists
-        try:
-            self.client.delete_firewall(fw_id)
-        # if firewall is not found, this means it was deleted in the test
-        except lib_exc.NotFound:
-            pass
-
-        self.client.wait_for_resource_deletion('firewall', fw_id)
-
-    def _wait_until_ready(self, fw_id):
-        target_states = ('ACTIVE', 'CREATED')
-
-        def _wait():
-            firewall = self.client.show_firewall(fw_id)
-            firewall = firewall['firewall']
-            return firewall['status'] in target_states
-
-        if not test.call_until_true(_wait, CONF.network.build_timeout,
-                                    CONF.network.build_interval):
-            status = self.client.show_firewall(fw_id)['firewall']['status']
-            m = ("Timed out waiting for firewall %s to reach %s state(s) "
-                 "after %ss, currently in %s state." %
-                 (fw_id,
-                  target_states,
-                  CONF.network.build_interval,
-                  status))
-            raise exceptions.TimeoutException(m)
-
-    @test.idempotent_id('1b84cf01-9c09-4ce7-bc72-b15e39076468')
-    def test_list_firewall_rules(self):
-        # List firewall rules
-        fw_rules = self.client.list_firewall_rules()
-        fw_rules = fw_rules['firewall_rules']
-        self.assertIn((self.fw_rule['id'],
-                       self.fw_rule['name'],
-                       self.fw_rule['action'],
-                       self.fw_rule['protocol'],
-                       self.fw_rule['ip_version'],
-                       self.fw_rule['enabled']),
-                      [(m['id'],
-                        m['name'],
-                        m['action'],
-                        m['protocol'],
-                        m['ip_version'],
-                        m['enabled']) for m in fw_rules])
-
-    @test.idempotent_id('563564f7-7077-4f5e-8cdc-51f37ae5a2b9')
-    def test_create_update_delete_firewall_rule(self):
-        # Create firewall rule
-        body = self.client.create_firewall_rule(
-            name=data_utils.rand_name("fw-rule"),
-            action="allow",
-            protocol="tcp")
-        fw_rule_id = body['firewall_rule']['id']
-
-        # Update firewall rule
-        body = self.client.update_firewall_rule(fw_rule_id,
-                                                shared=True)
-        self.assertTrue(body["firewall_rule"]['shared'])
-
-        # Delete firewall rule
-        self.client.delete_firewall_rule(fw_rule_id)
-        # Confirm deletion
-        fw_rules = self.client.list_firewall_rules()
-        self.assertNotIn(fw_rule_id,
-                         [m['id'] for m in fw_rules['firewall_rules']])
-
-    @test.idempotent_id('3ff8c08e-26ff-4034-ae48-810ed213a998')
-    def test_show_firewall_rule(self):
-        # show a created firewall rule
-        fw_rule = self.client.show_firewall_rule(self.fw_rule['id'])
-        for key, value in six.iteritems(fw_rule['firewall_rule']):
-            self.assertEqual(self.fw_rule[key], value)
-
-    @test.idempotent_id('1086dd93-a4c0-4bbb-a1bd-6d4bc62c199f')
-    def test_list_firewall_policies(self):
-        fw_policies = self.client.list_firewall_policies()
-        fw_policies = fw_policies['firewall_policies']
-        self.assertIn((self.fw_policy['id'],
-                       self.fw_policy['name'],
-                       self.fw_policy['firewall_rules']),
-                      [(m['id'],
-                        m['name'],
-                        m['firewall_rules']) for m in fw_policies])
-
-    @test.idempotent_id('bbf37b6c-498c-421e-9c95-45897d3ed775')
-    def test_create_update_delete_firewall_policy(self):
-        # Create firewall policy
-        body = self.client.create_firewall_policy(
-            name=data_utils.rand_name("fw-policy"))
-        fw_policy_id = body['firewall_policy']['id']
-        self.addCleanup(self._try_delete_policy, fw_policy_id)
-
-        # Update firewall policy
-        body = self.client.update_firewall_policy(fw_policy_id,
-                                                  shared=True,
-                                                  name="updated_policy")
-        updated_fw_policy = body["firewall_policy"]
-        self.assertTrue(updated_fw_policy['shared'])
-        self.assertEqual("updated_policy", updated_fw_policy['name'])
-
-        # Delete firewall policy
-        self.client.delete_firewall_policy(fw_policy_id)
-        # Confirm deletion
-        fw_policies = self.client.list_firewall_policies()
-        fw_policies = fw_policies['firewall_policies']
-        self.assertNotIn(fw_policy_id, [m['id'] for m in fw_policies])
-
-    @test.idempotent_id('1df59b3a-517e-41d4-96f6-fc31cf4ecff2')
-    def test_show_firewall_policy(self):
-        # show a created firewall policy
-        fw_policy = self.client.show_firewall_policy(self.fw_policy['id'])
-        fw_policy = fw_policy['firewall_policy']
-        for key, value in six.iteritems(fw_policy):
-            self.assertEqual(self.fw_policy[key], value)
-
-    @test.idempotent_id('02082a03-3cdd-4789-986a-1327dd80bfb7')
-    def test_create_show_delete_firewall(self):
-        # Create tenant network resources required for an ACTIVE firewall
-        network = self.create_network()
-        subnet = self.create_subnet(network)
-        router = self.create_router(
-            data_utils.rand_name('router-'),
-            admin_state_up=True)
-        self.client.add_router_interface_with_subnet_id(
-            router['id'], subnet['id'])
-
-        # Create firewall
-        body = self.client.create_firewall(
-            name=data_utils.rand_name("firewall"),
-            firewall_policy_id=self.fw_policy['id'])
-        created_firewall = body['firewall']
-        firewall_id = created_firewall['id']
-        self.addCleanup(self._try_delete_firewall, firewall_id)
-
-        # Wait for the firewall resource to become ready
-        self._wait_until_ready(firewall_id)
-
-        # show a created firewall
-        firewall = self.client.show_firewall(firewall_id)
-        firewall = firewall['firewall']
-
-        for key, value in six.iteritems(firewall):
-            if key == 'status':
-                continue
-            self.assertEqual(created_firewall[key], value)
-
-        # list firewall
-        firewalls = self.client.list_firewalls()
-        firewalls = firewalls['firewalls']
-        self.assertIn((created_firewall['id'],
-                       created_firewall['name'],
-                       created_firewall['firewall_policy_id']),
-                      [(m['id'],
-                        m['name'],
-                        m['firewall_policy_id']) for m in firewalls])
-
-        # Delete firewall
-        self.client.delete_firewall(firewall_id)
-
-    @test.idempotent_id('53305b4b-9897-4e01-87c0-2ae386083180')
-    def test_firewall_rule_insertion_position_removal_rule_from_policy(self):
-        # Create firewall rule
-        body = self.client.create_firewall_rule(
-            name=data_utils.rand_name("fw-rule"),
-            action="allow",
-            protocol="tcp")
-        fw_rule_id1 = body['firewall_rule']['id']
-        self.addCleanup(self._try_delete_rule, fw_rule_id1)
-        # Create firewall policy
-        body = self.client.create_firewall_policy(
-            name=data_utils.rand_name("fw-policy"))
-        fw_policy_id = body['firewall_policy']['id']
-        self.addCleanup(self._try_delete_policy, fw_policy_id)
-
-        # Insert rule to firewall policy
-        self.client.insert_firewall_rule_in_policy(
-            fw_policy_id, fw_rule_id1, '', '')
-
-        # Verify insertion of rule in policy
-        self.assertIn(fw_rule_id1, self._get_list_fw_rule_ids(fw_policy_id))
-        # Create another firewall rule
-        body = self.client.create_firewall_rule(
-            name=data_utils.rand_name("fw-rule"),
-            action="allow",
-            protocol="icmp")
-        fw_rule_id2 = body['firewall_rule']['id']
-        self.addCleanup(self._try_delete_rule, fw_rule_id2)
-
-        # Insert rule to firewall policy after the first rule
-        self.client.insert_firewall_rule_in_policy(
-            fw_policy_id, fw_rule_id2, fw_rule_id1, '')
-
-        # Verify the posiition of rule after insertion
-        fw_rule = self.client.show_firewall_rule(
-            fw_rule_id2)
-
-        self.assertEqual(int(fw_rule['firewall_rule']['position']), 2)
-        # Remove rule from the firewall policy
-        self.client.remove_firewall_rule_from_policy(
-            fw_policy_id, fw_rule_id2)
-        # Insert rule to firewall policy before the first rule
-        self.client.insert_firewall_rule_in_policy(
-            fw_policy_id, fw_rule_id2, '', fw_rule_id1)
-        # Verify the posiition of rule after insertion
-        fw_rule = self.client.show_firewall_rule(
-            fw_rule_id2)
-        self.assertEqual(int(fw_rule['firewall_rule']['position']), 1)
-        # Remove rule from the firewall policy
-        self.client.remove_firewall_rule_from_policy(
-            fw_policy_id, fw_rule_id2)
-        # Verify removal of rule from firewall policy
-        self.assertNotIn(fw_rule_id2, self._get_list_fw_rule_ids(fw_policy_id))
-
-        # Remove rule from the firewall policy
-        self.client.remove_firewall_rule_from_policy(
-            fw_policy_id, fw_rule_id1)
-
-        # Verify removal of rule from firewall policy
-        self.assertNotIn(fw_rule_id1, self._get_list_fw_rule_ids(fw_policy_id))
-
-    def _get_list_fw_rule_ids(self, fw_policy_id):
-        fw_policy = self.client.show_firewall_policy(
-            fw_policy_id)
-        return [ruleid for ruleid in fw_policy['firewall_policy']
-                ['firewall_rules']]
-
-    @test.idempotent_id('8515ca8a-0d2f-4298-b5ff-6f924e4587ca')
-    def test_update_firewall_policy_audited_attribute(self):
-        # Create firewall rule
-        body = self.client.create_firewall_rule(
-            name=data_utils.rand_name("fw-rule"),
-            action="allow",
-            protocol="icmp")
-        fw_rule_id = body['firewall_rule']['id']
-        self.addCleanup(self._try_delete_rule, fw_rule_id)
-        # Create firewall policy
-        body = self.client.create_firewall_policy(
-            name=data_utils.rand_name('fw-policy'))
-        fw_policy_id = body['firewall_policy']['id']
-        self.addCleanup(self._try_delete_policy, fw_policy_id)
-        self.assertFalse(body['firewall_policy']['audited'])
-        # Update firewall policy audited attribute to ture
-        self.client.update_firewall_policy(fw_policy_id,
-                                           audited=True)
-        # Insert Firewall rule to firewall policy
-        self.client.insert_firewall_rule_in_policy(
-            fw_policy_id, fw_rule_id, '', '')
-        body = self.client.show_firewall_policy(
-            fw_policy_id)
-        self.assertFalse(body['firewall_policy']['audited'])
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
deleted file mode 100644
index 38a6fe9..0000000
--- a/tempest/api/network/test_load_balancer.py
+++ /dev/null
@@ -1,432 +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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import decorators
-
-from tempest.api.network import base
-from tempest import test
-
-
-class LoadBalancerTestJSON(base.BaseNetworkTest):
-    """
-    Tests the following operations in the Neutron API using the REST client for
-    Neutron:
-
-        create vIP, and Pool
-        show vIP
-        list vIP
-        update vIP
-        delete vIP
-        update pool
-        delete pool
-        show pool
-        list pool
-        health monitoring operations
-    """
-
-    @classmethod
-    def skip_checks(cls):
-        super(LoadBalancerTestJSON, cls).skip_checks()
-        if not test.is_extension_enabled('lbaas', 'network'):
-            msg = "lbaas extension not enabled."
-            raise cls.skipException(msg)
-
-    @classmethod
-    def resource_setup(cls):
-        super(LoadBalancerTestJSON, cls).resource_setup()
-        cls.network = cls.create_network()
-        cls.name = cls.network['name']
-        cls.subnet = cls.create_subnet(cls.network)
-        pool_name = data_utils.rand_name('pool-')
-        vip_name = data_utils.rand_name('vip-')
-        cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
-                                   "HTTP", cls.subnet)
-        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._ip_version)
-        cls.member_address = ("10.0.9.47" if cls._ip_version == 4
-                              else "2015::beef")
-        cls.health_monitor = cls.create_health_monitor(delay=4,
-                                                       max_retries=3,
-                                                       Type="TCP",
-                                                       timeout=1)
-
-    def _check_list_with_filter(self, obj_name, attr_exceptions, **kwargs):
-        create_obj = getattr(self.client, 'create_' + obj_name)
-        delete_obj = getattr(self.client, 'delete_' + obj_name)
-        list_objs = getattr(self.client, 'list_' + obj_name + 's')
-
-        body = create_obj(**kwargs)
-        obj = body[obj_name]
-        self.addCleanup(delete_obj, obj['id'])
-        for key, value in six.iteritems(obj):
-            # It is not relevant to filter by all arguments. That is why
-            # there is a list of attr to except
-            if key not in attr_exceptions:
-                body = list_objs(**{key: value})
-                objs = [v[key] for v in body[obj_name + 's']]
-                self.assertIn(value, objs)
-
-    @test.idempotent_id('c96dbfab-4a80-4e74-a535-e950b5bedd47')
-    def test_list_vips(self):
-        # Verify the vIP exists in the list of all vIPs
-        body = self.client.list_vips()
-        vips = body['vips']
-        self.assertIn(self.vip['id'], [v['id'] for v in vips])
-
-    @test.idempotent_id('b8853f65-5089-4e69-befd-041a143427ff')
-    def test_list_vips_with_filter(self):
-        name = data_utils.rand_name('vip-')
-        body = self.client.create_pool(name=data_utils.rand_name("pool-"),
-                                       lb_method="ROUND_ROBIN",
-                                       protocol="HTTPS",
-                                       subnet_id=self.subnet['id'])
-        pool = body['pool']
-        self.addCleanup(self.client.delete_pool, pool['id'])
-        attr_exceptions = ['status', 'session_persistence',
-                           'status_description']
-        self._check_list_with_filter(
-            'vip', attr_exceptions, name=name, protocol="HTTPS",
-            protocol_port=81, subnet_id=self.subnet['id'], pool_id=pool['id'],
-            description=data_utils.rand_name('description-'),
-            admin_state_up=False)
-
-    @test.idempotent_id('27f56083-9af9-4a48-abe9-ca1bcc6c9035')
-    def test_create_update_delete_pool_vip(self):
-        # Creates a vip
-        name = data_utils.rand_name('vip-')
-        address = self.subnet['allocation_pools'][0]['end']
-        body = self.client.create_pool(
-            name=data_utils.rand_name("pool-"),
-            lb_method='ROUND_ROBIN',
-            protocol='HTTP',
-            subnet_id=self.subnet['id'])
-        pool = body['pool']
-        body = self.client.create_vip(name=name,
-                                      protocol="HTTP",
-                                      protocol_port=80,
-                                      subnet_id=self.subnet['id'],
-                                      pool_id=pool['id'],
-                                      address=address)
-        vip = body['vip']
-        vip_id = vip['id']
-        # Confirm VIP's address correctness with a show
-        body = self.client.show_vip(vip_id)
-        vip = body['vip']
-        self.assertEqual(address, vip['address'])
-        # Verification of vip update
-        new_name = "New_vip"
-        new_description = "New description"
-        persistence_type = "HTTP_COOKIE"
-        update_data = {"session_persistence": {
-            "type": persistence_type}}
-        body = self.client.update_vip(vip_id,
-                                      name=new_name,
-                                      description=new_description,
-                                      connection_limit=10,
-                                      admin_state_up=False,
-                                      **update_data)
-        updated_vip = body['vip']
-        self.assertEqual(new_name, updated_vip['name'])
-        self.assertEqual(new_description, updated_vip['description'])
-        self.assertEqual(10, updated_vip['connection_limit'])
-        self.assertFalse(updated_vip['admin_state_up'])
-        self.assertEqual(persistence_type,
-                         updated_vip['session_persistence']['type'])
-        self.client.delete_vip(vip['id'])
-        self.client.wait_for_resource_deletion('vip', vip['id'])
-        # Verification of pool update
-        new_name = "New_pool"
-        body = self.client.update_pool(pool['id'],
-                                       name=new_name,
-                                       description="new_description",
-                                       lb_method='LEAST_CONNECTIONS')
-        updated_pool = body['pool']
-        self.assertEqual(new_name, updated_pool['name'])
-        self.assertEqual('new_description', updated_pool['description'])
-        self.assertEqual('LEAST_CONNECTIONS', updated_pool['lb_method'])
-        self.client.delete_pool(pool['id'])
-
-    @test.idempotent_id('0435a95e-1d19-4d90-9e9f-3b979e9ad089')
-    def test_show_vip(self):
-        # Verifies the details of a vip
-        body = self.client.show_vip(self.vip['id'])
-        vip = body['vip']
-        for key, value in six.iteritems(vip):
-            # 'status' should not be confirmed in api tests
-            if key != 'status':
-                self.assertEqual(self.vip[key], value)
-
-    @test.idempotent_id('6e7a7d31-8451-456d-b24a-e50479ce42a7')
-    def test_show_pool(self):
-        # Here we need to new pool without any dependence with vips
-        body = self.client.create_pool(name=data_utils.rand_name("pool-"),
-                                       lb_method='ROUND_ROBIN',
-                                       protocol='HTTP',
-                                       subnet_id=self.subnet['id'])
-        pool = body['pool']
-        self.addCleanup(self.client.delete_pool, pool['id'])
-        # Verifies the details of a pool
-        body = self.client.show_pool(pool['id'])
-        shown_pool = body['pool']
-        for key, value in six.iteritems(pool):
-            # 'status' should not be confirmed in api tests
-            if key != 'status':
-                self.assertEqual(value, shown_pool[key])
-
-    @test.idempotent_id('d1ab1ffa-e06a-487f-911f-56418cb27727')
-    def test_list_pools(self):
-        # Verify the pool exists in the list of all pools
-        body = self.client.list_pools()
-        pools = body['pools']
-        self.assertIn(self.pool['id'], [p['id'] for p in pools])
-
-    @test.idempotent_id('27cc4c1a-caac-4273-b983-2acb4afaad4f')
-    def test_list_pools_with_filters(self):
-        attr_exceptions = ['status', 'vip_id', 'members', 'provider',
-                           'status_description']
-        self._check_list_with_filter(
-            'pool', attr_exceptions, name=data_utils.rand_name("pool-"),
-            lb_method="ROUND_ROBIN", protocol="HTTPS",
-            subnet_id=self.subnet['id'],
-            description=data_utils.rand_name('description-'),
-            admin_state_up=False)
-
-    @test.idempotent_id('282d0dfd-5c3a-4c9b-b39c-c99782f39193')
-    def test_list_members(self):
-        # Verify the member exists in the list of all members
-        body = self.client.list_members()
-        members = body['members']
-        self.assertIn(self.member['id'], [m['id'] for m in members])
-
-    @test.idempotent_id('243b5126-24c6-4879-953e-7c7e32d8a57f')
-    def test_list_members_with_filters(self):
-        attr_exceptions = ['status', 'status_description']
-        self._check_list_with_filter('member', attr_exceptions,
-                                     address=self.member_address,
-                                     protocol_port=80,
-                                     pool_id=self.pool['id'])
-
-    @test.idempotent_id('fb833ee8-9e69-489f-b540-a409762b78b2')
-    def test_create_update_delete_member(self):
-        # Creates a member
-        body = self.client.create_member(address=self.member_address,
-                                         protocol_port=80,
-                                         pool_id=self.pool['id'])
-        member = body['member']
-        # Verification of member update
-        body = self.client.update_member(member['id'],
-                                         admin_state_up=False)
-        updated_member = body['member']
-        self.assertFalse(updated_member['admin_state_up'])
-        # Verification of member delete
-        self.client.delete_member(member['id'])
-
-    @test.idempotent_id('893cd71f-a7dd-4485-b162-f6ab9a534914')
-    def test_show_member(self):
-        # Verifies the details of a member
-        body = self.client.show_member(self.member['id'])
-        member = body['member']
-        for key, value in six.iteritems(member):
-            # 'status' should not be confirmed in api tests
-            if key != 'status':
-                self.assertEqual(self.member[key], value)
-
-    @test.idempotent_id('8e5822c5-68a4-4224-8d6c-a617741ebc2d')
-    def test_list_health_monitors(self):
-        # Verify the health monitor exists in the list of all health monitors
-        body = self.client.list_health_monitors()
-        health_monitors = body['health_monitors']
-        self.assertIn(self.health_monitor['id'],
-                      [h['id'] for h in health_monitors])
-
-    @test.idempotent_id('49bac58a-511c-4875-b794-366698211d25')
-    def test_list_health_monitors_with_filters(self):
-        attr_exceptions = ['status', 'status_description', 'pools']
-        self._check_list_with_filter('health_monitor', attr_exceptions,
-                                     delay=5, max_retries=4, type="TCP",
-                                     timeout=2)
-
-    @test.idempotent_id('e8ce05c4-d554-4d1e-a257-ad32ce134bb5')
-    def test_create_update_delete_health_monitor(self):
-        # Creates a health_monitor
-        body = self.client.create_health_monitor(delay=4,
-                                                 max_retries=3,
-                                                 type="TCP",
-                                                 timeout=1)
-        health_monitor = body['health_monitor']
-        # Verification of health_monitor update
-        body = (self.client.update_health_monitor
-                (health_monitor['id'],
-                 admin_state_up=False))
-        updated_health_monitor = body['health_monitor']
-        self.assertFalse(updated_health_monitor['admin_state_up'])
-        # Verification of health_monitor delete
-        body = self.client.delete_health_monitor(health_monitor['id'])
-
-    @test.idempotent_id('d3e1aebc-06c2-49b3-9816-942af54012eb')
-    def test_create_health_monitor_http_type(self):
-        hm_type = "HTTP"
-        body = self.client.create_health_monitor(delay=4,
-                                                 max_retries=3,
-                                                 type=hm_type,
-                                                 timeout=1)
-        health_monitor = body['health_monitor']
-        self.addCleanup(self.client.delete_health_monitor,
-                        health_monitor['id'])
-        self.assertEqual(hm_type, health_monitor['type'])
-
-    @test.idempotent_id('0eff9f67-90fb-4bb1-b4ed-c5fda99fff0c')
-    def test_update_health_monitor_http_method(self):
-        body = self.client.create_health_monitor(delay=4,
-                                                 max_retries=3,
-                                                 type="HTTP",
-                                                 timeout=1)
-        health_monitor = body['health_monitor']
-        self.addCleanup(self.client.delete_health_monitor,
-                        health_monitor['id'])
-        body = (self.client.update_health_monitor
-                (health_monitor['id'],
-                 http_method="POST",
-                 url_path="/home/user",
-                 expected_codes="290"))
-        updated_health_monitor = body['health_monitor']
-        self.assertEqual("POST", updated_health_monitor['http_method'])
-        self.assertEqual("/home/user", updated_health_monitor['url_path'])
-        self.assertEqual("290", updated_health_monitor['expected_codes'])
-
-    @test.idempotent_id('08e126ab-1407-483f-a22e-b11cc032ca7c')
-    def test_show_health_monitor(self):
-        # Verifies the details of a health_monitor
-        body = self.client.show_health_monitor(self.health_monitor['id'])
-        health_monitor = body['health_monitor']
-        for key, value in six.iteritems(health_monitor):
-            # 'status' should not be confirmed in api tests
-            if key != 'status':
-                self.assertEqual(self.health_monitor[key], value)
-
-    @test.idempotent_id('87f7628e-8918-493d-af50-0602845dbb5b')
-    def test_associate_disassociate_health_monitor_with_pool(self):
-        # Verify that a health monitor can be associated with a pool
-        self.client.associate_health_monitor_with_pool(
-            self.health_monitor['id'], self.pool['id'])
-        body = self.client.show_health_monitor(
-            self.health_monitor['id'])
-        health_monitor = body['health_monitor']
-        body = self.client.show_pool(self.pool['id'])
-        pool = body['pool']
-        self.assertIn(pool['id'],
-                      [p['pool_id'] for p in health_monitor['pools']])
-        self.assertIn(health_monitor['id'], pool['health_monitors'])
-        # Verify that a health monitor can be disassociated from a pool
-        (self.client.disassociate_health_monitor_with_pool
-            (self.health_monitor['id'], self.pool['id']))
-        body = self.client.show_pool(self.pool['id'])
-        pool = body['pool']
-        body = self.client.show_health_monitor(
-            self.health_monitor['id'])
-        health_monitor = body['health_monitor']
-        self.assertNotIn(health_monitor['id'], pool['health_monitors'])
-        self.assertNotIn(pool['id'],
-                         [p['pool_id'] for p in health_monitor['pools']])
-
-    @test.idempotent_id('525fc7dc-be24-408d-938d-822e9783e027')
-    def test_get_lb_pool_stats(self):
-        # Verify the details of pool stats
-        body = self.client.list_lb_pool_stats(self.pool['id'])
-        stats = body['stats']
-        self.assertIn("bytes_in", stats)
-        self.assertIn("total_connections", stats)
-        self.assertIn("active_connections", stats)
-        self.assertIn("bytes_out", stats)
-
-    @test.idempotent_id('66236be2-5121-4047-8cde-db4b83b110a5')
-    def test_update_list_of_health_monitors_associated_with_pool(self):
-        (self.client.associate_health_monitor_with_pool
-            (self.health_monitor['id'], self.pool['id']))
-        self.client.update_health_monitor(
-            self.health_monitor['id'], admin_state_up=False)
-        body = self.client.show_pool(self.pool['id'])
-        health_monitors = body['pool']['health_monitors']
-        for health_monitor_id in health_monitors:
-            body = self.client.show_health_monitor(health_monitor_id)
-            self.assertFalse(body['health_monitor']['admin_state_up'])
-            (self.client.disassociate_health_monitor_with_pool
-                (self.health_monitor['id'], self.pool['id']))
-
-    @test.idempotent_id('44ec9b40-b501-41e2-951f-4fc673b15ac0')
-    def test_update_admin_state_up_of_pool(self):
-        self.client.update_pool(self.pool['id'],
-                                admin_state_up=False)
-        body = self.client.show_pool(self.pool['id'])
-        pool = body['pool']
-        self.assertFalse(pool['admin_state_up'])
-
-    @test.idempotent_id('466a9d4c-37c6-4ea2-b807-133437beb48c')
-    def test_show_vip_associated_with_pool(self):
-        body = self.client.show_pool(self.pool['id'])
-        pool = body['pool']
-        body = self.client.show_vip(pool['vip_id'])
-        vip = body['vip']
-        self.assertEqual(self.vip['name'], vip['name'])
-        self.assertEqual(self.vip['id'], vip['id'])
-
-    @test.idempotent_id('7b97694e-69d0-4151-b265-e1052a465aa8')
-    def test_show_members_associated_with_pool(self):
-        body = self.client.show_pool(self.pool['id'])
-        members = body['pool']['members']
-        for member_id in members:
-            body = self.client.show_member(member_id)
-            self.assertIsNotNone(body['member']['status'])
-            self.assertEqual(member_id, body['member']['id'])
-            self.assertIsNotNone(body['member']['admin_state_up'])
-
-    @test.idempotent_id('73ed6f27-595b-4b2c-969c-dbdda6b8ab34')
-    def test_update_pool_related_to_member(self):
-        # Create new pool
-        body = self.client.create_pool(name=data_utils.rand_name("pool-"),
-                                       lb_method='ROUND_ROBIN',
-                                       protocol='HTTP',
-                                       subnet_id=self.subnet['id'])
-        new_pool = body['pool']
-        self.addCleanup(self.client.delete_pool, new_pool['id'])
-        # Update member with new pool's id
-        body = self.client.update_member(self.member['id'],
-                                         pool_id=new_pool['id'])
-        # Confirm with show that pool_id change
-        body = self.client.show_member(self.member['id'])
-        member = body['member']
-        self.assertEqual(member['pool_id'], new_pool['id'])
-        # Update member with old pool id, this is needed for clean up
-        body = self.client.update_member(self.member['id'],
-                                         pool_id=self.pool['id'])
-
-    @test.idempotent_id('cf63f071-bbe3-40ba-97a0-a33e11923162')
-    def test_update_member_weight(self):
-        self.client.update_member(self.member['id'],
-                                  weight=2)
-        body = self.client.show_member(self.member['id'])
-        member = body['member']
-        self.assertEqual(2, member['weight'])
-
-
-@decorators.skip_because(bug="1402007")
-class LoadBalancerIpV6TestJSON(LoadBalancerTestJSON):
-    _ip_version = 6
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
deleted file mode 100644
index 9fe2a56..0000000
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ /dev/null
@@ -1,319 +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.
-
-import six
-from tempest_lib.common.utils import data_utils
-from tempest_lib import exceptions as lib_exc
-
-from tempest.api.network import base
-from tempest import config
-from tempest import test
-
-CONF = config.CONF
-
-
-class VPNaaSTestJSON(base.BaseAdminNetworkTest):
-    """
-    Tests the following operations in the Neutron API using the REST client for
-    Neutron:
-        List, Show, Create, Delete, and Update VPN Service
-        List, Show, Create, Delete, and Update IKE policy
-        List, Show, Create, Delete, and Update IPSec policy
-    """
-
-    @classmethod
-    def skip_checks(cls):
-        super(VPNaaSTestJSON, cls).skip_checks()
-        if not test.is_extension_enabled('vpnaas', 'network'):
-            msg = "vpnaas extension not enabled."
-            raise cls.skipException(msg)
-
-    @classmethod
-    def resource_setup(cls):
-        super(VPNaaSTestJSON, cls).resource_setup()
-        cls.ext_net_id = CONF.network.public_network_id
-        cls.network = cls.create_network()
-        cls.subnet = cls.create_subnet(cls.network)
-        cls.router = cls.create_router(
-            data_utils.rand_name("router"),
-            external_network_id=CONF.network.public_network_id)
-        cls.create_router_interface(cls.router['id'], cls.subnet['id'])
-        cls.vpnservice = cls.create_vpnservice(cls.subnet['id'],
-                                               cls.router['id'])
-
-        cls.ikepolicy = cls.create_ikepolicy(
-            data_utils.rand_name("ike-policy-"))
-        cls.ipsecpolicy = cls.create_ipsecpolicy(
-            data_utils.rand_name("ipsec-policy-"))
-
-    def _delete_ike_policy(self, ike_policy_id):
-        # Deletes a ike policy and verifies if it is deleted or not
-        ike_list = list()
-        all_ike = self.client.list_ikepolicies()
-        for ike in all_ike['ikepolicies']:
-            ike_list.append(ike['id'])
-        if ike_policy_id in ike_list:
-            self.client.delete_ikepolicy(ike_policy_id)
-            # Asserting that the policy is not found in list after deletion
-            ikepolicies = self.client.list_ikepolicies()
-            ike_id_list = list()
-            for i in ikepolicies['ikepolicies']:
-                ike_id_list.append(i['id'])
-            self.assertNotIn(ike_policy_id, ike_id_list)
-
-    def _delete_ipsec_policy(self, ipsec_policy_id):
-        # Deletes an ike policy if it exists
-        try:
-            self.client.delete_ipsecpolicy(ipsec_policy_id)
-
-        except lib_exc.NotFound:
-            pass
-
-    def _assertExpected(self, expected, actual):
-        # Check if not expected keys/values exists in actual response body
-        for key, value in six.iteritems(expected):
-            self.assertIn(key, actual)
-            self.assertEqual(value, actual[key])
-
-    def _delete_vpn_service(self, vpn_service_id):
-        self.client.delete_vpnservice(vpn_service_id)
-        # Asserting if vpn service is found in the list after deletion
-        body = self.client.list_vpnservices()
-        vpn_services = [vs['id'] for vs in body['vpnservices']]
-        self.assertNotIn(vpn_service_id, vpn_services)
-
-    def _get_tenant_id(self):
-        """
-        Returns the tenant_id of the client current user
-        """
-        # TODO(jroovers) This is a temporary workaround to get the tenant_id
-        # of the the current client. Replace this once tenant_isolation for
-        # neutron is fixed.
-        body = self.client.show_network(self.network['id'])
-        return body['network']['tenant_id']
-
-    @test.idempotent_id('14311574-0737-4e53-ac05-f7ae27742eed')
-    def test_admin_create_ipsec_policy_for_tenant(self):
-        tenant_id = self._get_tenant_id()
-        # Create IPSec policy for the newly created tenant
-        name = data_utils.rand_name('ipsec-policy')
-        body = (self.admin_client.
-                create_ipsecpolicy(name=name, tenant_id=tenant_id))
-        ipsecpolicy = body['ipsecpolicy']
-        self.assertIsNotNone(ipsecpolicy['id'])
-        self.addCleanup(self.admin_client.delete_ipsecpolicy,
-                        ipsecpolicy['id'])
-
-        # Assert that created ipsec policy is found in API list call
-        body = self.client.list_ipsecpolicies()
-        ipsecpolicies = [policy['id'] for policy in body['ipsecpolicies']]
-        self.assertIn(ipsecpolicy['id'], ipsecpolicies)
-
-    @test.idempotent_id('b62acdc6-0c53-4d84-84aa-859b22b79799')
-    def test_admin_create_vpn_service_for_tenant(self):
-        tenant_id = self._get_tenant_id()
-
-        # Create vpn service for the newly created tenant
-        network2 = self.create_network()
-        subnet2 = self.create_subnet(network2)
-        router2 = self.create_router(data_utils.rand_name('router-'),
-                                     external_network_id=self.ext_net_id)
-        self.create_router_interface(router2['id'], subnet2['id'])
-        name = data_utils.rand_name('vpn-service')
-        body = self.admin_client.create_vpnservice(
-            subnet_id=subnet2['id'],
-            router_id=router2['id'],
-            name=name,
-            admin_state_up=True,
-            tenant_id=tenant_id)
-        vpnservice = body['vpnservice']
-        self.assertIsNotNone(vpnservice['id'])
-        self.addCleanup(self.admin_client.delete_vpnservice, vpnservice['id'])
-        # Assert that created vpnservice is found in API list call
-        body = self.client.list_vpnservices()
-        vpn_services = [vs['id'] for vs in body['vpnservices']]
-        self.assertIn(vpnservice['id'], vpn_services)
-
-    @test.idempotent_id('58cc4a1c-443b-4f39-8fb6-c19d39f343ab')
-    def test_admin_create_ike_policy_for_tenant(self):
-        tenant_id = self._get_tenant_id()
-
-        # Create IKE policy for the newly created tenant
-        name = data_utils.rand_name('ike-policy')
-        body = (self.admin_client.
-                create_ikepolicy(name=name, ike_version="v1",
-                                 encryption_algorithm="aes-128",
-                                 auth_algorithm="sha1",
-                                 tenant_id=tenant_id))
-        ikepolicy = body['ikepolicy']
-        self.assertIsNotNone(ikepolicy['id'])
-        self.addCleanup(self.admin_client.delete_ikepolicy, ikepolicy['id'])
-
-        # Assert that created ike policy is found in API list call
-        body = self.client.list_ikepolicies()
-        ikepolicies = [ikp['id'] for ikp in body['ikepolicies']]
-        self.assertIn(ikepolicy['id'], ikepolicies)
-
-    @test.idempotent_id('de5bb04c-3a1f-46b1-b329-7a8abba5c7f1')
-    def test_list_vpn_services(self):
-        # Verify the VPN service exists in the list of all VPN services
-        body = self.client.list_vpnservices()
-        vpnservices = body['vpnservices']
-        self.assertIn(self.vpnservice['id'], [v['id'] for v in vpnservices])
-
-    @test.idempotent_id('aacb13b1-fdc7-41fd-bab2-32621aee1878')
-    def test_create_update_delete_vpn_service(self):
-        # Creates a VPN service and sets up deletion
-        network1 = self.create_network()
-        subnet1 = self.create_subnet(network1)
-        router1 = self.create_router(data_utils.rand_name('router-'),
-                                     external_network_id=self.ext_net_id)
-        self.create_router_interface(router1['id'], subnet1['id'])
-        name = data_utils.rand_name('vpn-service1')
-        body = self.client.create_vpnservice(subnet_id=subnet1['id'],
-                                             router_id=router1['id'],
-                                             name=name,
-                                             admin_state_up=True)
-        vpnservice = body['vpnservice']
-        self.addCleanup(self._delete_vpn_service, vpnservice['id'])
-        # Assert if created vpnservices are not found in vpnservices list
-        body = self.client.list_vpnservices()
-        vpn_services = [vs['id'] for vs in body['vpnservices']]
-        self.assertIsNotNone(vpnservice['id'])
-        self.assertIn(vpnservice['id'], vpn_services)
-
-        # TODO(raies): implement logic to update  vpnservice
-        # VPNaaS client function to update is implemented.
-        # But precondition is that current state of vpnservice
-        # should be "ACTIVE" not "PENDING*"
-
-    @test.idempotent_id('0dedfc1d-f8ee-4e2a-bfd4-7997b9dc17ff')
-    def test_show_vpn_service(self):
-        # Verifies the details of a vpn service
-        body = self.client.show_vpnservice(self.vpnservice['id'])
-        vpnservice = body['vpnservice']
-        self.assertEqual(self.vpnservice['id'], vpnservice['id'])
-        self.assertEqual(self.vpnservice['name'], vpnservice['name'])
-        self.assertEqual(self.vpnservice['description'],
-                         vpnservice['description'])
-        self.assertEqual(self.vpnservice['router_id'], vpnservice['router_id'])
-        self.assertEqual(self.vpnservice['subnet_id'], vpnservice['subnet_id'])
-        self.assertEqual(self.vpnservice['tenant_id'], vpnservice['tenant_id'])
-        valid_status = ["ACTIVE", "DOWN", "BUILD", "ERROR", "PENDING_CREATE",
-                        "PENDING_UPDATE", "PENDING_DELETE"]
-        self.assertIn(vpnservice['status'], valid_status)
-
-    @test.idempotent_id('e0fb6200-da3d-4869-8340-a8c1956ca618')
-    def test_list_ike_policies(self):
-        # Verify the ike policy exists in the list of all IKE policies
-        body = self.client.list_ikepolicies()
-        ikepolicies = body['ikepolicies']
-        self.assertIn(self.ikepolicy['id'], [i['id'] for i in ikepolicies])
-
-    @test.idempotent_id('d61f29a5-160c-487d-bc0d-22e32e731b44')
-    def test_create_update_delete_ike_policy(self):
-        # Creates a IKE policy
-        name = data_utils.rand_name('ike-policy')
-        body = (self.client.create_ikepolicy(
-                name=name,
-                ike_version="v1",
-                encryption_algorithm="aes-128",
-                auth_algorithm="sha1"))
-        ikepolicy = body['ikepolicy']
-        self.assertIsNotNone(ikepolicy['id'])
-        self.addCleanup(self._delete_ike_policy, ikepolicy['id'])
-
-        # Update IKE Policy
-        new_ike = {'name': data_utils.rand_name("New-IKE"),
-                   'description': "Updated ike policy",
-                   'encryption_algorithm': "aes-256",
-                   'ike_version': "v2",
-                   'pfs': "group14",
-                   'lifetime': {'units': "seconds", 'value': 2000}}
-        self.client.update_ikepolicy(ikepolicy['id'], **new_ike)
-        # Confirm that update was successful by verifying using 'show'
-        body = self.client.show_ikepolicy(ikepolicy['id'])
-        ike_policy = body['ikepolicy']
-        for key, value in six.iteritems(new_ike):
-            self.assertIn(key, ike_policy)
-            self.assertEqual(value, ike_policy[key])
-
-        # Verification of ike policy delete
-        self.client.delete_ikepolicy(ikepolicy['id'])
-        body = self.client.list_ikepolicies()
-        ikepolicies = [ikp['id'] for ikp in body['ikepolicies']]
-        self.assertNotIn(ike_policy['id'], ikepolicies)
-
-    @test.idempotent_id('b5fcf3a3-9407-452d-b8a8-e7c6c32baea8')
-    def test_show_ike_policy(self):
-        # Verifies the details of a ike policy
-        body = self.client.show_ikepolicy(self.ikepolicy['id'])
-        ikepolicy = body['ikepolicy']
-        self.assertEqual(self.ikepolicy['id'], ikepolicy['id'])
-        self.assertEqual(self.ikepolicy['name'], ikepolicy['name'])
-        self.assertEqual(self.ikepolicy['description'],
-                         ikepolicy['description'])
-        self.assertEqual(self.ikepolicy['encryption_algorithm'],
-                         ikepolicy['encryption_algorithm'])
-        self.assertEqual(self.ikepolicy['auth_algorithm'],
-                         ikepolicy['auth_algorithm'])
-        self.assertEqual(self.ikepolicy['tenant_id'],
-                         ikepolicy['tenant_id'])
-        self.assertEqual(self.ikepolicy['pfs'],
-                         ikepolicy['pfs'])
-        self.assertEqual(self.ikepolicy['phase1_negotiation_mode'],
-                         ikepolicy['phase1_negotiation_mode'])
-        self.assertEqual(self.ikepolicy['ike_version'],
-                         ikepolicy['ike_version'])
-
-    @test.idempotent_id('19ea0a2f-add9-44be-b732-ffd8a7b42f37')
-    def test_list_ipsec_policies(self):
-        # Verify the ipsec policy exists in the list of all ipsec policies
-        body = self.client.list_ipsecpolicies()
-        ipsecpolicies = body['ipsecpolicies']
-        self.assertIn(self.ipsecpolicy['id'], [i['id'] for i in ipsecpolicies])
-
-    @test.idempotent_id('9c1701c9-329a-4e5d-930a-1ead1b3f86ad')
-    def test_create_update_delete_ipsec_policy(self):
-        # Creates an ipsec policy
-        ipsec_policy_body = {'name': data_utils.rand_name('ipsec-policy'),
-                             'pfs': 'group5',
-                             'encryption_algorithm': "aes-128",
-                             'auth_algorithm': 'sha1'}
-        resp_body = self.client.create_ipsecpolicy(**ipsec_policy_body)
-        ipsecpolicy = resp_body['ipsecpolicy']
-        self.addCleanup(self._delete_ipsec_policy, ipsecpolicy['id'])
-        self._assertExpected(ipsec_policy_body, ipsecpolicy)
-        # Verification of ipsec policy update
-        new_ipsec = {'description': 'Updated ipsec policy',
-                     'pfs': 'group2',
-                     'name': data_utils.rand_name("New-IPSec"),
-                     'encryption_algorithm': "aes-256",
-                     'lifetime': {'units': "seconds", 'value': '2000'}}
-        body = self.client.update_ipsecpolicy(ipsecpolicy['id'],
-                                              **new_ipsec)
-        updated_ipsec_policy = body['ipsecpolicy']
-        self._assertExpected(new_ipsec, updated_ipsec_policy)
-        # Verification of ipsec policy delete
-        self.client.delete_ipsecpolicy(ipsecpolicy['id'])
-        self.assertRaises(lib_exc.NotFound,
-                          self.client.delete_ipsecpolicy, ipsecpolicy['id'])
-
-    @test.idempotent_id('601f8a05-9d3c-4539-a400-1c4b3a21b03b')
-    def test_show_ipsec_policy(self):
-        # Verifies the details of an ipsec policy
-        body = self.client.show_ipsecpolicy(self.ipsecpolicy['id'])
-        ipsecpolicy = body['ipsecpolicy']
-        self._assertExpected(self.ipsecpolicy, ipsecpolicy)
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index 43180e5..cce8e2a 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -55,8 +55,7 @@
         cls.nova_notifications = ['memory', 'vcpus', 'disk.root.size',
                                   'disk.ephemeral.size']
 
-        cls.glance_notifications = ['image.update', 'image.upload',
-                                    'image.delete']
+        cls.glance_notifications = ['image.size']
 
         cls.glance_v2_notifications = ['image.download', 'image.serve']
 
diff --git a/tempest/api/telemetry/test_telemetry_notification_api.py b/tempest/api/telemetry/test_telemetry_notification_api.py
index d49b2ba..52793c8 100644
--- a/tempest/api/telemetry/test_telemetry_notification_api.py
+++ b/tempest/api/telemetry/test_telemetry_notification_api.py
@@ -10,7 +10,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from tempest_lib import decorators
 import testtools
 
 from tempest.api.telemetry import base
@@ -46,7 +45,6 @@
     @test.services("image")
     @testtools.skipIf(not CONF.image_feature_enabled.api_v1,
                       "Glance api v1 is disabled")
-    @decorators.skip_because(bug='1351627')
     def test_check_glance_v1_notifications(self):
         body = self.create_image(self.image_client)
         self.image_client.update_image(body['id'], data='data')
@@ -63,7 +61,6 @@
     @test.services("image")
     @testtools.skipIf(not CONF.image_feature_enabled.api_v2,
                       "Glance api v2 is disabled")
-    @decorators.skip_because(bug='1351627')
     def test_check_glance_v2_notifications(self):
         body = self.create_image(self.image_client_v2)
 
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 8ec4670..1de20d6 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -420,131 +420,6 @@
         self.data['networks'] = networks
 
 
-class NetworkIpSecPolicyService(NetworkService):
-
-    def list(self):
-        client = self.client
-        ipsecpols = client.list_ipsecpolicies()
-        ipsecpols = ipsecpols['ipsecpolicies']
-        ipsecpols = self._filter_by_tenant_id(ipsecpols)
-        LOG.debug("List count, %s IP Security Policies" % len(ipsecpols))
-        return ipsecpols
-
-    def delete(self):
-        client = self.client
-        ipsecpols = self.list()
-        for ipsecpol in ipsecpols:
-            try:
-                client.delete_ipsecpolicy(ipsecpol['id'])
-            except Exception as e:
-                LOG.exception("Delete IP Securty Policy exception: %s" % e)
-                pass
-
-    def dry_run(self):
-        ipsecpols = self.list()
-        self.data['ip_security_policies'] = ipsecpols
-
-
-class NetworkFwPolicyService(NetworkService):
-
-    def list(self):
-        client = self.client
-        fwpols = client.list_firewall_policies()
-        fwpols = fwpols['firewall_policies']
-        fwpols = self._filter_by_tenant_id(fwpols)
-        LOG.debug("List count, %s Firewall Policies" % len(fwpols))
-        return fwpols
-
-    def delete(self):
-        client = self.client
-        fwpols = self.list()
-        for fwpol in fwpols:
-            try:
-                client.delete_firewall_policy(fwpol['id'])
-            except Exception as e:
-                LOG.exception("Delete Firewall Policy exception: %s" % e)
-                pass
-
-    def dry_run(self):
-        fwpols = self.list()
-        self.data['firewall_policies'] = fwpols
-
-
-class NetworkFwRulesService(NetworkService):
-
-    def list(self):
-        client = self.client
-        fwrules = client.list_firewall_rules()
-        fwrules = fwrules['firewall_rules']
-        fwrules = self._filter_by_tenant_id(fwrules)
-        LOG.debug("List count, %s Firewall Rules" % len(fwrules))
-        return fwrules
-
-    def delete(self):
-        client = self.client
-        fwrules = self.list()
-        for fwrule in fwrules:
-            try:
-                client.delete_firewall_rule(fwrule['id'])
-            except Exception as e:
-                LOG.exception("Delete Firewall Rule exception: %s" % e)
-                pass
-
-    def dry_run(self):
-        fwrules = self.list()
-        self.data['firewall_rules'] = fwrules
-
-
-class NetworkIkePolicyService(NetworkService):
-
-    def list(self):
-        client = self.client
-        ikepols = client.list_ikepolicies()
-        ikepols = ikepols['ikepolicies']
-        ikepols = self._filter_by_tenant_id(ikepols)
-        LOG.debug("List count, %s IKE Policies" % len(ikepols))
-        return ikepols
-
-    def delete(self):
-        client = self.client
-        ikepols = self.list()
-        for ikepol in ikepols:
-            try:
-                client.delete_firewall_rule(ikepol['id'])
-            except Exception as e:
-                LOG.exception("Delete IKE Policy exception: %s" % e)
-                pass
-
-    def dry_run(self):
-        ikepols = self.list()
-        self.data['ike_policies'] = ikepols
-
-
-class NetworkVpnServiceService(NetworkService):
-
-    def list(self):
-        client = self.client
-        vpnsrvs = client.list_vpnservices()
-        vpnsrvs = vpnsrvs['vpnservices']
-        vpnsrvs = self._filter_by_tenant_id(vpnsrvs)
-        LOG.debug("List count, %s VPN Services" % len(vpnsrvs))
-        return vpnsrvs
-
-    def delete(self):
-        client = self.client
-        vpnsrvs = self.list()
-        for vpnsrv in vpnsrvs:
-            try:
-                client.delete_vpnservice(vpnsrv['id'])
-            except Exception as e:
-                LOG.exception("Delete VPN Service exception: %s" % e)
-                pass
-
-    def dry_run(self):
-        vpnsrvs = self.list()
-        self.data['vpn_services'] = vpnsrvs
-
-
 class NetworkFloatingIpService(NetworkService):
 
     def list(self):
@@ -1094,18 +969,6 @@
     if IS_HEAT:
         tenant_services.append(StackService)
     if IS_NEUTRON:
-        if test.is_extension_enabled('vpnaas', 'network'):
-            tenant_services.append(NetworkIpSecPolicyService)
-            tenant_services.append(NetworkIkePolicyService)
-            tenant_services.append(NetworkVpnServiceService)
-        if test.is_extension_enabled('fwaas', 'network'):
-            tenant_services.append(NetworkFwPolicyService)
-            tenant_services.append(NetworkFwRulesService)
-        if test.is_extension_enabled('lbaas', 'network'):
-            tenant_services.append(NetworkHealthMonitorService)
-            tenant_services.append(NetworkMemberService)
-            tenant_services.append(NetworkVipService)
-            tenant_services.append(NetworkPoolService)
         if test.is_extension_enabled('metering', 'network'):
             tenant_services.append(NetworkMeteringLabelRuleService)
             tenant_services.append(NetworkMeteringLabelService)
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 4b3995b..d4e6eb8 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -14,6 +14,7 @@
 import re
 import time
 
+from oslo_log import log as logging
 import six
 from tempest_lib.common import ssh
 
@@ -22,6 +23,8 @@
 
 CONF = config.CONF
 
+LOG = logging.getLogger(__name__)
+
 
 class RemoteClient(object):
 
@@ -48,7 +51,8 @@
     def exec_command(self, cmd):
         # Shell options below add more clearness on failures,
         # path is extended for some non-cirros guest oses (centos7)
-        cmd = "set -eu -o pipefail; PATH=$PATH:/sbin; " + cmd
+        cmd = CONF.compute.ssh_shell_prologue + " " + cmd
+        LOG.debug("Remote command: %s" % cmd)
         return self.ssh_client.exec_command(cmd)
 
     def validate_authentication(self):
diff --git a/tempest/config.py b/tempest/config.py
index 7709910..a52f74c 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -206,6 +206,10 @@
                help="Timeout in seconds to wait for an instance to build. "
                     "Other services that do not define build_timeout will "
                     "inherit this value."),
+    cfg.StrOpt('ssh_shell_prologue',
+               default="set -eu -o pipefail; PATH=$$PATH:/sbin;",
+               help="Shell fragments to use before executing a command "
+                    "when sshing to a guest."),
     cfg.StrOpt('ssh_auth_method',
                default='keypair',
                help="Auth method used for authenticate to the instance. "
@@ -522,9 +526,10 @@
                 help="Allow the execution of IPv6 tests"),
     cfg.ListOpt('api_extensions',
                 default=['all'],
-                help='A list of enabled network extensions with a special '
-                     'entry all which indicates every extension is enabled. '
-                     'Empty list indicates all extensions are disabled'),
+                help="A list of enabled network extensions with a special "
+                     "entry all which indicates every extension is enabled. "
+                     "Empty list indicates all extensions are disabled. "
+                     "To get the list of extensions run: 'neutron ext-list'"),
     cfg.BoolOpt('ipv6_subnet_attributes',
                 default=False,
                 help="Allow the execution of IPv6 subnet tests that use "
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 5f8d605..fff8a5c 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -934,41 +934,6 @@
 
         return rules
 
-    def _create_pool(self, lb_method, protocol, subnet_id):
-        """Wrapper utility that returns a test pool."""
-        client = self.network_client
-        name = data_utils.rand_name('pool')
-        resp_pool = client.create_pool(protocol=protocol, name=name,
-                                       subnet_id=subnet_id,
-                                       lb_method=lb_method)
-        pool = net_resources.DeletablePool(client=client, **resp_pool['pool'])
-        self.assertEqual(pool['name'], name)
-        self.addCleanup(self.delete_wrapper, pool.delete)
-        return pool
-
-    def _create_member(self, address, protocol_port, pool_id):
-        """Wrapper utility that returns a test member."""
-        client = self.network_client
-        resp_member = client.create_member(protocol_port=protocol_port,
-                                           pool_id=pool_id,
-                                           address=address)
-        member = net_resources.DeletableMember(client=client,
-                                               **resp_member['member'])
-        self.addCleanup(self.delete_wrapper, member.delete)
-        return member
-
-    def _create_vip(self, protocol, protocol_port, subnet_id, pool_id):
-        """Wrapper utility that returns a test vip."""
-        client = self.network_client
-        name = data_utils.rand_name('vip')
-        resp_vip = client.create_vip(protocol=protocol, name=name,
-                                     subnet_id=subnet_id, pool_id=pool_id,
-                                     protocol_port=protocol_port)
-        vip = net_resources.DeletableVip(client=client, **resp_vip['vip'])
-        self.assertEqual(vip['name'], name)
-        self.addCleanup(self.delete_wrapper, vip.delete)
-        return vip
-
     def _ssh_to_server(self, server, private_key):
         ssh_login = CONF.compute.image_ssh_user
         return self.get_remote_client(server,
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
deleted file mode 100644
index 691c7c9..0000000
--- a/tempest/scenario/test_load_balancer_basic.py
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 2014 Mirantis.inc
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-
-import tempfile
-import time
-
-import six
-from six.moves.urllib import request as urllib2
-
-from tempest.common import commands
-from tempest import config
-from tempest import exceptions
-from tempest.scenario import manager
-from tempest.services.network import resources as net_resources
-from tempest import test
-
-config = config.CONF
-
-
-class TestLoadBalancerBasic(manager.NetworkScenarioTest):
-
-    """
-    This test checks basic load balancing.
-
-    The following is the scenario outline:
-    1. Create an instance
-    2. SSH to the instance and start two servers
-    3. Create a load balancer with two members and with ROUND_ROBIN algorithm
-       associate the VIP with a floating ip
-    4. Send NUM requests to the floating ip and check that they are shared
-       between the two servers.
-    """
-
-    @classmethod
-    def skip_checks(cls):
-        super(TestLoadBalancerBasic, cls).skip_checks()
-        cfg = config.network
-        if not test.is_extension_enabled('lbaas', 'network'):
-            msg = 'LBaaS Extension is not enabled'
-            raise cls.skipException(msg)
-        if not (cfg.tenant_networks_reachable or cfg.public_network_id):
-            msg = ('Either tenant_networks_reachable must be "true", or '
-                   'public_network_id must be defined.')
-            raise cls.skipException(msg)
-
-    @classmethod
-    def resource_setup(cls):
-        super(TestLoadBalancerBasic, cls).resource_setup()
-        cls.servers_keypairs = {}
-        cls.members = []
-        cls.floating_ips = {}
-        cls.server_ips = {}
-        cls.port1 = 80
-        cls.port2 = 88
-        cls.num = 50
-
-    def setUp(self):
-        super(TestLoadBalancerBasic, self).setUp()
-        self.server_ips = {}
-        self.server_fixed_ips = {}
-        self._create_security_group_for_test()
-        self._set_net_and_subnet()
-
-    def _set_net_and_subnet(self):
-        """
-        Query and set appropriate network and subnet attributes to be used
-        for the test.  Existing tenant networks are used if they are found.
-        The configured private network and associated subnet is used as a
-        fallback in absence of tenant networking.
-        """
-        try:
-            tenant_net = self._list_networks(tenant_id=self.tenant_id)[0]
-        except IndexError:
-            tenant_net = None
-
-        if tenant_net:
-            tenant_subnet = self._list_subnets(tenant_id=self.tenant_id)[0]
-            self.subnet = net_resources.DeletableSubnet(
-                client=self.network_client,
-                **tenant_subnet)
-            self.network = tenant_net
-        else:
-            self.network = self._get_network_by_name(
-                config.compute.fixed_network_name)
-            # TODO(adam_g): We are assuming that the first subnet associated
-            # with the fixed network is the one we want.  In the future, we
-            # should instead pull a subnet id from config, which is set by
-            # devstack/admin/etc.
-            subnet = self._list_subnets(network_id=self.network['id'])[0]
-            self.subnet = net_resources.AttributeDict(subnet)
-
-    def _create_security_group_for_test(self):
-        self.security_group = self._create_security_group(
-            tenant_id=self.tenant_id)
-        self._create_security_group_rules_for_port(self.port1)
-        self._create_security_group_rules_for_port(self.port2)
-
-    def _create_security_group_rules_for_port(self, port):
-        rule = {
-            'direction': 'ingress',
-            'protocol': 'tcp',
-            'port_range_min': port,
-            'port_range_max': port,
-        }
-        self._create_security_group_rule(
-            secgroup=self.security_group,
-            tenant_id=self.tenant_id,
-            **rule)
-
-    def _create_server(self, name):
-        keypair = self.create_keypair()
-        security_groups = [{'name': self.security_group['name']}]
-        create_kwargs = {
-            'networks': [
-                {'uuid': self.network['id']},
-            ],
-            'key_name': keypair['name'],
-            'security_groups': security_groups,
-        }
-        net_name = self.network['name']
-        server = self.create_server(name=name, create_kwargs=create_kwargs)
-        self.servers_keypairs[server['id']] = keypair
-        if (config.network.public_network_id and not
-                config.network.tenant_networks_reachable):
-            public_network_id = config.network.public_network_id
-            floating_ip = self.create_floating_ip(
-                server, public_network_id)
-            self.floating_ips[floating_ip] = server
-            self.server_ips[server['id']] = floating_ip.floating_ip_address
-        else:
-            self.server_ips[server['id']] =\
-                server['addresses'][net_name][0]['addr']
-        self.server_fixed_ips[server['id']] =\
-            server['addresses'][net_name][0]['addr']
-        self.assertTrue(self.servers_keypairs)
-        return server
-
-    def _create_servers(self):
-        for count in range(2):
-            self._create_server(name=("server%s" % (count + 1)))
-        self.assertEqual(len(self.servers_keypairs), 2)
-
-    def _start_servers(self):
-        """
-        Start two backends
-
-        1. SSH to the instance
-        2. Start two http backends listening on ports 80 and 88 respectively
-        """
-        for server_id, ip in six.iteritems(self.server_ips):
-            private_key = self.servers_keypairs[server_id]['private_key']
-            server_name = self.servers_client.get_server(server_id)['name']
-            username = config.scenario.ssh_user
-            ssh_client = self.get_remote_client(
-                server_or_ip=ip,
-                private_key=private_key)
-
-            # Write a backend's response into a file
-            resp = ('echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 7\r\n'
-                    'Connection: close\r\nContent-Type: text/html; '
-                    'charset=UTF-8\r\n\r\n%s"; cat >/dev/null')
-
-            with tempfile.NamedTemporaryFile() as script:
-                script.write(resp % server_name)
-                script.flush()
-                with tempfile.NamedTemporaryFile() as key:
-                    key.write(private_key)
-                    key.flush()
-                    commands.copy_file_to_host(script.name,
-                                               "/tmp/script1",
-                                               ip,
-                                               username, key.name)
-
-            # Start netcat
-            start_server = ('while true; do '
-                            'sudo nc -ll -p %(port)s -e sh /tmp/%(script)s; '
-                            'done > /dev/null &')
-            cmd = start_server % {'port': self.port1,
-                                  'script': 'script1'}
-            ssh_client.exec_command(cmd)
-
-            if len(self.server_ips) == 1:
-                with tempfile.NamedTemporaryFile() as script:
-                    script.write(resp % 'server2')
-                    script.flush()
-                    with tempfile.NamedTemporaryFile() as key:
-                        key.write(private_key)
-                        key.flush()
-                        commands.copy_file_to_host(script.name,
-                                                   "/tmp/script2", ip,
-                                                   username, key.name)
-                cmd = start_server % {'port': self.port2,
-                                      'script': 'script2'}
-                ssh_client.exec_command(cmd)
-
-    def _check_connection(self, check_ip, port=80):
-        def try_connect(ip, port):
-            try:
-                resp = urllib2.urlopen("http://{0}:{1}/".format(ip, port))
-                if resp.getcode() == 200:
-                    return True
-                return False
-            except IOError:
-                return False
-            except urllib2.HTTPError:
-                return False
-        timeout = config.compute.ping_timeout
-        start = time.time()
-        while not try_connect(check_ip, port):
-            if (time.time() - start) > timeout:
-                message = "Timed out trying to connect to %s" % check_ip
-                raise exceptions.TimeoutException(message)
-
-    def _create_pool(self):
-        """Create a pool with ROUND_ROBIN algorithm."""
-        self.pool = super(TestLoadBalancerBasic, self)._create_pool(
-            lb_method='ROUND_ROBIN',
-            protocol='HTTP',
-            subnet_id=self.subnet.id)
-        self.assertTrue(self.pool)
-
-    def _create_members(self):
-        """
-        Create two members.
-
-        In case there is only one server, create both members with the same ip
-        but with different ports to listen on.
-        """
-
-        for server_id, ip in six.iteritems(self.server_fixed_ips):
-            if len(self.server_fixed_ips) == 1:
-                member1 = self._create_member(address=ip,
-                                              protocol_port=self.port1,
-                                              pool_id=self.pool.id)
-                member2 = self._create_member(address=ip,
-                                              protocol_port=self.port2,
-                                              pool_id=self.pool.id)
-                self.members.extend([member1, member2])
-            else:
-                member = self._create_member(address=ip,
-                                             protocol_port=self.port1,
-                                             pool_id=self.pool.id)
-                self.members.append(member)
-        self.assertTrue(self.members)
-
-    def _assign_floating_ip_to_vip(self, vip):
-        public_network_id = config.network.public_network_id
-        port_id = vip.port_id
-        floating_ip = self.create_floating_ip(vip, public_network_id,
-                                              port_id=port_id)
-        self.floating_ips.setdefault(vip.id, [])
-        self.floating_ips[vip.id].append(floating_ip)
-        # Check for floating ip status before you check load-balancer
-        self.check_floating_ip_status(floating_ip, "ACTIVE")
-
-    def _create_load_balancer(self):
-        self._create_pool()
-        self._create_members()
-        self.vip = self._create_vip(protocol='HTTP',
-                                    protocol_port=80,
-                                    subnet_id=self.subnet.id,
-                                    pool_id=self.pool.id)
-        self.vip.wait_for_status('ACTIVE')
-        if (config.network.public_network_id and not
-                config.network.tenant_networks_reachable):
-            self._assign_floating_ip_to_vip(self.vip)
-            self.vip_ip = self.floating_ips[
-                self.vip.id][0]['floating_ip_address']
-        else:
-            self.vip_ip = self.vip.address
-
-        # Currently the ovs-agent is not enforcing security groups on the
-        # vip port - see https://bugs.launchpad.net/neutron/+bug/1163569
-        # However the linuxbridge-agent does, and it is necessary to add a
-        # security group with a rule that allows tcp port 80 to the vip port.
-        self.network_client.update_port(
-            self.vip.port_id, security_groups=[self.security_group.id])
-
-    def _check_load_balancing(self):
-        """
-        1. Send NUM requests on the floating ip associated with the VIP
-        2. Check that the requests are shared between the two servers
-        """
-
-        self._check_connection(self.vip_ip)
-        self._send_requests(self.vip_ip, ["server1", "server2"])
-
-    def _send_requests(self, vip_ip, servers):
-        counters = dict.fromkeys(servers, 0)
-        for i in range(self.num):
-            try:
-                server = urllib2.urlopen("http://{0}/".format(vip_ip)).read()
-                counters[server] += 1
-            # HTTP exception means fail of server, so don't increase counter
-            # of success and continue connection tries
-            except urllib2.HTTPError:
-                continue
-        # Assert that each member of the pool gets balanced at least once
-        for member, counter in six.iteritems(counters):
-            self.assertGreater(counter, 0, 'Member %s never balanced' % member)
-
-    @test.idempotent_id('c0c6f1ca-603b-4509-9c0f-2c63f0d838ee')
-    @test.services('compute', 'network')
-    def test_load_balancer_basic(self):
-        self._create_server('server1')
-        self._start_servers()
-        self._create_load_balancer()
-        self._check_load_balancing()
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index dee56ac..ebe4117 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -27,24 +27,19 @@
 
 class FlavorsClientJSON(service_client.ServiceClient):
 
-    def list_flavors(self, params=None):
+    def list_flavors(self, detail=False, **params):
         url = 'flavors'
+        _schema = schema.list_flavors
+
+        if detail:
+            url += '/detail'
+            _schema = schema.list_flavors_details
         if params:
             url += '?%s' % urllib.urlencode(params)
 
         resp, body = self.get(url)
         body = json.loads(body)
-        self.validate_response(schema.list_flavors, resp, body)
-        return service_client.ResponseBodyList(resp, body['flavors'])
-
-    def list_flavors_with_detail(self, params=None):
-        url = 'flavors/detail'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        self.validate_response(schema.list_flavors_details, resp, body)
+        self.validate_response(_schema, resp, body)
         return service_client.ResponseBodyList(resp, body['flavors'])
 
     def show_flavor(self, flavor_id):
@@ -87,7 +82,7 @@
         # Did not use show_flavor(id) for verification as it gives
         # 200 ok even for deleted id. LP #981263
         # we can remove the loop here and use get by ID when bug gets sortedout
-        flavors = self.list_flavors_with_detail()
+        flavors = self.list_flavors(detail=True)
         for flavor in flavors:
             if flavor['id'] == id:
                 return False
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 30aa962..3736a15 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -43,26 +43,20 @@
         self.validate_response(schema.create_image, resp, body)
         return service_client.ResponseBody(resp, body)
 
-    def list_images(self, params=None):
+    def list_images(self, detail=False, **params):
         """Returns a list of all images filtered by any parameters."""
         url = 'images'
+        _schema = schema.list_images
+        if detail:
+            url += '/detail'
+            _schema = schema.list_images_details
+
         if params:
             url += '?%s' % urllib.urlencode(params)
 
         resp, body = self.get(url)
         body = json.loads(body)
-        self.validate_response(schema.list_images, resp, body)
-        return service_client.ResponseBodyList(resp, body['images'])
-
-    def list_images_with_detail(self, params=None):
-        """Returns a detailed list of images filtered by any parameters."""
-        url = 'images/detail'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        self.validate_response(schema.list_images_details, resp, body)
+        self.validate_response(_schema, resp, body)
         return service_client.ResponseBodyList(resp, body['images'])
 
     def show_image(self, image_id):
@@ -106,7 +100,7 @@
         self.validate_response(schema.image_metadata, resp, body)
         return service_client.ResponseBody(resp, body['metadata'])
 
-    def get_image_metadata_item(self, image_id, key):
+    def show_image_metadata_item(self, image_id, key):
         """Returns the value for a specific image metadata key."""
         resp, body = self.get("images/%s/metadata/%s" % (str(image_id), key))
         body = json.loads(body)
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index 33ba76f..2b6dbb7 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -31,7 +31,7 @@
         return service_client.ResponseBody(resp,
                                            body["instance_usage_audit_logs"])
 
-    def get_instance_usage_audit_log(self, time_before):
+    def show_instance_usage_audit_log(self, time_before):
         url = 'os-instance_usage_audit_log/%s' % time_before
         resp, body = self.get(url)
         body = json.loads(body)
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index 7fe335b..143fe72 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -32,7 +32,7 @@
         self.validate_response(schema.list_keypairs, resp, body)
         return service_client.ResponseBodyList(resp, body['keypairs'])
 
-    def get_keypair(self, key_name):
+    def show_keypair(self, key_name):
         resp, body = self.get("os-keypairs/%s" % str(key_name))
         body = json.loads(body)
         self.validate_response(schema.get_keypair, resp, body)
diff --git a/tempest/services/compute/json/quota_classes_client.py b/tempest/services/compute/json/quota_classes_client.py
index 6c43679..ad35e3f 100644
--- a/tempest/services/compute/json/quota_classes_client.py
+++ b/tempest/services/compute/json/quota_classes_client.py
@@ -22,10 +22,10 @@
 
 class QuotaClassesClientJSON(service_client.ServiceClient):
 
-    def get_quota_class_set(self, quota_class_id):
+    def show_quota_class_set(self, quota_class_id):
         """List the quota class set for a quota class."""
 
-        url = 'os-quota-class-sets/%s' % str(quota_class_id)
+        url = 'os-quota-class-sets/%s' % quota_class_id
         resp, body = self.get(url)
         body = json.loads(body)
         self.validate_response(classes_schema.get_quota_class_set, resp, body)
@@ -37,7 +37,7 @@
         """
         post_body = json.dumps({'quota_class_set': kwargs})
 
-        resp, body = self.put('os-quota-class-sets/%s' % str(quota_class_id),
+        resp, body = self.put('os-quota-class-sets/%s' % quota_class_id,
                               post_body)
 
         body = json.loads(body)
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 92a1fe7..f488817 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -21,21 +21,21 @@
 
 class QuotasClientJSON(service_client.ServiceClient):
 
-    def get_quota_set(self, tenant_id, user_id=None):
+    def show_quota_set(self, tenant_id, user_id=None):
         """List the quota set for a tenant."""
 
-        url = 'os-quota-sets/%s' % str(tenant_id)
+        url = 'os-quota-sets/%s' % tenant_id
         if user_id:
-            url += '?user_id=%s' % str(user_id)
+            url += '?user_id=%s' % user_id
         resp, body = self.get(url)
         body = json.loads(body)
         self.validate_response(schema.get_quota_set, resp, body)
         return service_client.ResponseBody(resp, body['quota_set'])
 
-    def get_default_quota_set(self, tenant_id):
+    def show_default_quota_set(self, tenant_id):
         """List the default quota set for a tenant."""
 
-        url = 'os-quota-sets/%s/defaults' % str(tenant_id)
+        url = 'os-quota-sets/%s/defaults' % tenant_id
         resp, body = self.get(url)
         body = json.loads(body)
         self.validate_response(schema.get_quota_set, resp, body)
@@ -97,9 +97,9 @@
 
         if user_id:
             resp, body = self.put('os-quota-sets/%s?user_id=%s' %
-                                  (str(tenant_id), str(user_id)), post_body)
+                                  (tenant_id, user_id), post_body)
         else:
-            resp, body = self.put('os-quota-sets/%s' % str(tenant_id),
+            resp, body = self.put('os-quota-sets/%s' % tenant_id,
                                   post_body)
 
         body = json.loads(body)
@@ -108,6 +108,6 @@
 
     def delete_quota_set(self, tenant_id):
         """Delete the tenant's quota set."""
-        resp, body = self.delete('os-quota-sets/%s' % str(tenant_id))
+        resp, body = self.delete('os-quota-sets/%s' % tenant_id)
         self.validate_response(schema.delete_quota, resp, body)
         return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index e93cc47..5f85199 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -42,34 +42,18 @@
     def get_uri(self, plural_name):
         # get service prefix from resource name
 
-        # The following list represents resource names that do not require
-        # changing underscore to a hyphen
-        hyphen_exceptions = ["health_monitors", "firewall_rules",
-                             "firewall_policies"]
         # the following map is used to construct proper URI
         # for the given neutron resource
         service_resource_prefix_map = {
             'networks': '',
             'subnets': '',
             'ports': '',
-            'pools': 'lb',
-            'vips': 'lb',
-            'health_monitors': 'lb',
-            'members': 'lb',
-            'ipsecpolicies': 'vpn',
-            'vpnservices': 'vpn',
-            'ikepolicies': 'vpn',
-            'ipsec-site-connections': 'vpn',
             'metering_labels': 'metering',
             'metering_label_rules': 'metering',
-            'firewall_rules': 'fw',
-            'firewall_policies': 'fw',
-            'firewalls': 'fw'
         }
         service_prefix = service_resource_prefix_map.get(
             plural_name)
-        if plural_name not in hyphen_exceptions:
-            plural_name = plural_name.replace("_", "-")
+        plural_name = plural_name.replace("_", "-")
         if service_prefix:
             uri = '%s/%s/%s' % (self.uri_prefix, service_prefix,
                                 plural_name)
@@ -85,11 +69,7 @@
         resource_plural_map = {
             'security_groups': 'security_groups',
             'security_group_rules': 'security_group_rules',
-            'ipsecpolicy': 'ipsecpolicies',
-            'ikepolicy': 'ikepolicies',
-            'ipsec_site_connection': 'ipsec-site-connections',
             'quotas': 'quotas',
-            'firewall_policy': 'firewall_policies'
         }
         return resource_plural_map.get(resource_name, resource_name + 's')
 
@@ -131,17 +111,13 @@
 
         return _show
 
-    def _creater(self, resource_name):
-        def _create(**kwargs):
-            plural = self.pluralize(resource_name)
-            uri = self.get_uri(plural)
-            post_data = self.serialize({resource_name: kwargs})
-            resp, body = self.post(uri, post_data)
-            body = self.deserialize_single(body)
-            self.expected_success(201, resp.status)
-            return service_client.ResponseBody(resp, body)
-
-        return _create
+    def _create_resource(self, uri, post_data):
+        req_uri = self.uri_prefix + uri
+        req_post_data = self.serialize(post_data)
+        resp, body = self.post(req_uri, req_post_data)
+        body = self.deserialize_single(body)
+        self.expected_success(201, resp.status)
+        return service_client.ResponseBody(resp, body)
 
     def _updater(self, resource_name):
         def _update(res_id, **kwargs):
@@ -156,11 +132,10 @@
         return _update
 
     def __getattr__(self, name):
-        method_prefixes = ["list_", "delete_", "show_", "create_", "update_"]
+        method_prefixes = ["list_", "delete_", "show_", "update_"]
         method_functors = [self._lister,
                            self._deleter,
                            self._shower,
-                           self._creater,
                            self._updater]
         for index, prefix in enumerate(method_prefixes):
             prefix_len = len(prefix)
@@ -168,6 +143,46 @@
                 return method_functors[index](name[prefix_len:])
         raise AttributeError(name)
 
+    def create_network(self, **kwargs):
+        uri = '/networks'
+        post_data = {'network': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_subnet(self, **kwargs):
+        uri = '/subnets'
+        post_data = {'subnet': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_port(self, **kwargs):
+        uri = '/ports'
+        post_data = {'port': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_floatingip(self, **kwargs):
+        uri = '/floatingips'
+        post_data = {'floatingip': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_metering_label(self, **kwargs):
+        uri = '/metering/metering-labels'
+        post_data = {'metering_label': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_metering_label_rule(self, **kwargs):
+        uri = '/metering/metering-label-rules'
+        post_data = {'metering_label_rule': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_security_group(self, **kwargs):
+        uri = '/security-groups'
+        post_data = {'security_group': kwargs}
+        return self._create_resource(uri, post_data)
+
+    def create_security_group_rule(self, **kwargs):
+        uri = '/security-group-rules'
+        post_data = {'security_group_rule': kwargs}
+        return self._create_resource(uri, post_data)
+
     # Common methods that are hard to automate
     def create_bulk_network(self, names):
         network_list = [{'name': name} for name in names]
@@ -385,29 +400,6 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def associate_health_monitor_with_pool(self, health_monitor_id,
-                                           pool_id):
-        post_body = {
-            "health_monitor": {
-                "id": health_monitor_id,
-            }
-        }
-        body = json.dumps(post_body)
-        uri = '%s/lb/pools/%s/health_monitors' % (self.uri_prefix,
-                                                  pool_id)
-        resp, body = self.post(uri, body)
-        self.expected_success(201, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def disassociate_health_monitor_with_pool(self, health_monitor_id,
-                                              pool_id):
-        uri = '%s/lb/pools/%s/health_monitors/%s' % (self.uri_prefix, pool_id,
-                                                     health_monitor_id)
-        resp, body = self.delete(uri)
-        self.expected_success(204, resp.status)
-        return service_client.ResponseBody(resp, body)
-
     def list_router_interfaces(self, uuid):
         uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
         resp, body = self.get(uri)
@@ -428,21 +420,6 @@
         body = json.loads(body)
         return service_client.ResponseBody(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)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(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)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(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)
@@ -494,21 +471,6 @@
         self.expected_success(204, resp.status)
         return service_client.ResponseBody(resp, body)
 
-    def create_ikepolicy(self, name, **kwargs):
-        post_body = {
-            "ikepolicy": {
-                "name": name,
-            }
-        }
-        for key, val in kwargs.items():
-            post_body['ikepolicy'][key] = val
-        body = json.dumps(post_body)
-        uri = '%s/vpn/ikepolicies' % (self.uri_prefix)
-        resp, body = self.post(uri, body)
-        self.expected_success(201, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
     def update_extra_routes(self, router_id, nexthop, destination):
         uri = '%s/routers/%s' % (self.uri_prefix, router_id)
         put_body = {
@@ -537,13 +499,6 @@
         body = json.loads(body)
         return service_client.ResponseBody(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)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
     def add_dhcp_agent_to_network(self, agent_id, network_id):
         post_body = {'network_id': network_id}
         body = json.dumps(post_body)
@@ -552,30 +507,3 @@
         self.expected_success(201, resp.status)
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
-
-    def insert_firewall_rule_in_policy(self, firewall_policy_id,
-                                       firewall_rule_id, insert_after="",
-                                       insert_before=""):
-        uri = '%s/fw/firewall_policies/%s/insert_rule' % (self.uri_prefix,
-                                                          firewall_policy_id)
-        body = {
-            "firewall_rule_id": firewall_rule_id,
-            "insert_after": insert_after,
-            "insert_before": insert_before
-        }
-        body = json.dumps(body)
-        resp, body = self.put(uri, body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def remove_firewall_rule_from_policy(self, firewall_policy_id,
-                                         firewall_rule_id):
-        uri = '%s/fw/firewall_policies/%s/remove_rule' % (self.uri_prefix,
-                                                          firewall_policy_id)
-        update_body = {"firewall_rule_id": firewall_rule_id}
-        update_body = json.dumps(update_body)
-        resp, body = self.put(uri, update_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py
index a0b250e..f0921d5 100644
--- a/tempest/tests/cmd/test_javelin.py
+++ b/tempest/tests/cmd/test_javelin.py
@@ -109,7 +109,7 @@
         self.fake_client.identity.get_tenant_by_name.return_value = \
             self.fake_object['tenant']
         self.fake_client.identity.get_user_by_username.side_effect = \
-            lib_exc.NotFound()
+            lib_exc.NotFound("user is not found")
         self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
                                               return_value=self.fake_client))
 
@@ -126,7 +126,7 @@
 
     def test_create_user_missing_tenant(self):
         self.fake_client.identity.get_tenant_by_name.side_effect = \
-            lib_exc.NotFound()
+            lib_exc.NotFound("tenant is not found")
         self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
                                               return_value=self.fake_client))
 
@@ -245,14 +245,49 @@
         mocked_function = self.fake_client.volumes.wait_for_volume_status
         self.assertFalse(mocked_function.called)
 
+    def test_create_router(self):
+
+        self.fake_client.networks.list_routers.return_value = {'routers': []}
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+
+        javelin.create_routers([self.fake_object])
+
+        mocked_function = self.fake_client.networks.create_router
+        mocked_function.assert_called_once_with(self.fake_object['name'])
+
+    def test_create_router_existing(self):
+        self.fake_client.networks.list_routers.return_value = {
+            'routers': [self.fake_object]}
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+
+        javelin.create_routers([self.fake_object])
+
+        mocked_function = self.fake_client.networks.create_router
+        self.assertFalse(mocked_function.called)
+
+    def test_create_secgroup(self):
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+        self.fake_client.secgroups.list_security_groups.return_value = []
+        self.fake_client.secgroups.create_security_group.return_value = \
+            {'id': self.fake_object['secgroup_id']}
+
+        javelin.create_secgroups([self.fake_object])
+
+        mocked_function = self.fake_client.secgroups.create_security_group
+        mocked_function.assert_called_once_with(
+            self.fake_object['name'],
+            self.fake_object['description'])
+
 
 class TestDestroyResources(JavelinUnitTest):
 
     def test_destroy_tenants(self):
 
         fake_tenant = self.fake_object['tenant']
-
-        fake_auth = mock.MagicMock()
+        fake_auth = self.fake_client
         fake_auth.identity.get_tenant_by_name.return_value = fake_tenant
 
         self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
@@ -267,7 +302,7 @@
         fake_user = self.fake_object['user']
         fake_tenant = self.fake_object['tenant']
 
-        fake_auth = mock.MagicMock()
+        fake_auth = self.fake_client
         fake_auth.identity.get_tenant_by_name.return_value = fake_tenant
         fake_auth.identity.get_user_by_username.return_value = fake_user
 
@@ -281,42 +316,40 @@
 
     def test_destroy_objects(self):
 
-        fake_client = mock.MagicMock()
-        fake_client.objects.delete_object.return_value = {'status': "200"}, ""
+        self.fake_client.objects.delete_object.return_value = \
+            {'status': "200"}, ""
         self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
-                                              return_value=fake_client))
+                                              return_value=self.fake_client))
         javelin.destroy_objects([self.fake_object])
 
-        mocked_function = fake_client.objects.delete_object
+        mocked_function = self.fake_client.objects.delete_object
         mocked_function.asswert_called_once(self.fake_object['container'],
                                             self.fake_object['name'])
 
     def test_destroy_images(self):
 
-        fake_client = mock.MagicMock()
         self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
-                                              return_value=fake_client))
+                                              return_value=self.fake_client))
         self.useFixture(mockpatch.PatchObject(javelin, "_get_image_by_name",
                         return_value=self.fake_object['image']))
 
         javelin.destroy_images([self.fake_object])
 
-        mocked_function = fake_client.images.delete_image
+        mocked_function = self.fake_client.images.delete_image
         mocked_function.assert_called_once_with(
             self.fake_object['image']['id'])
 
     def test_destroy_networks(self):
 
-        fake_client = mock.MagicMock()
         self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
-                                              return_value=fake_client))
+                                              return_value=self.fake_client))
         self.useFixture(mockpatch.PatchObject(
             javelin, "_get_resource_by_name",
             return_value=self.fake_object['resource']))
 
         javelin.destroy_networks([self.fake_object])
 
-        mocked_function = fake_client.networks.delete_network
+        mocked_function = self.fake_client.networks.delete_network
         mocked_function.assert_called_once_with(
             self.fake_object['resource']['id'])
 
@@ -334,3 +367,47 @@
         mocked_function.assert_called_once_with(self.fake_object.volume['id'])
         mocked_function = self.fake_client.volumes.delete_volume
         mocked_function.assert_called_once_with(self.fake_object.volume['id'])
+
+    def test_destroy_subnets(self):
+
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+        fake_subnet_id = self.fake_object['subnet_id']
+        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
+                                              return_value={
+                                                  'id': fake_subnet_id}))
+
+        javelin.destroy_subnets([self.fake_object])
+
+        mocked_function = self.fake_client.networks.delete_subnet
+        mocked_function.assert_called_once_with(fake_subnet_id)
+
+    def test_destroy_routers(self):
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+
+        # this function is used on 2 different occasions in the code
+        def _fake_get_resource_by_name(*args):
+            if args[1] == "routers":
+                return {"id": self.fake_object['router_id']}
+            elif args[1] == "subnets":
+                return {"id": self.fake_object['subnet_id']}
+        javelin._get_resource_by_name = _fake_get_resource_by_name
+
+        javelin.destroy_routers([self.fake_object])
+
+        mocked_function = self.fake_client.networks.delete_router
+        mocked_function.assert_called_once_with(
+            self.fake_object['router_id'])
+
+    def test_destroy_secgroup(self):
+        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
+                                              return_value=self.fake_client))
+        fake_secgroup = {'id': self.fake_object['id']}
+        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
+                                              return_value=fake_secgroup))
+
+        javelin.destroy_secgroups([self.fake_object])
+
+        mocked_function = self.fake_client.secgroups.delete_security_group
+        mocked_function.assert_called_once_with(self.fake_object['id'])
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index e713969..f2e8b20 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -292,7 +292,6 @@
              'password': 'p', 'roles': ['role-7', 'role-11'],
              'resources': {'network': 'network-2'}}]
         # Clear previous mock using self.test_accounts
-        self.accounts_mock.cleanUp()
         self.useFixture(mockpatch.Patch(
             'tempest.common.accounts.read_accounts_yaml',
             return_value=test_accounts))
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
index e5f51f2..ce3eb7e 100644
--- a/tempest/tests/test_decorators.py
+++ b/tempest/tests/test_decorators.py
@@ -213,8 +213,8 @@
                                        service='compute')
 
     def test_requires_ext_decorator_with_all_ext_enabled(self):
-        # disable fixture so the default (all) is used.
-        self.config_fixture.cleanUp()
+        cfg.CONF.set_default('api_extensions', 'all',
+                             group='compute-feature-enabled')
         self._test_requires_ext_helper(expected_to_skip=False,
                                        extension='random_ext',
                                        service='compute')
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 72a63c3..95008a2 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -211,20 +211,15 @@
         iso_creds = isolated_creds.IsolatedCreds(name='test class',
                                                  password='fake_password')
         self._mock_assign_user_role()
-        roles_fix = self._mock_list_role()
-        tenant_fix = self._mock_tenant_create('1234', 'fake_prim_tenant')
-        user_fix = self._mock_user_create('1234', 'fake_prim_user')
+        self._mock_list_role()
+        self._mock_tenant_create('1234', 'fake_prim_tenant')
+        self._mock_user_create('1234', 'fake_prim_user')
         iso_creds.get_primary_creds()
-        tenant_fix.cleanUp()
-        user_fix.cleanUp()
-        tenant_fix = self._mock_tenant_create('12345', 'fake_alt_tenant')
-        user_fix = self._mock_user_create('12345', 'fake_alt_user')
+        self._mock_tenant_create('12345', 'fake_alt_tenant')
+        self._mock_user_create('12345', 'fake_alt_user')
         iso_creds.get_alt_creds()
-        tenant_fix.cleanUp()
-        user_fix.cleanUp()
-        roles_fix.cleanUp()
-        tenant_fix = self._mock_tenant_create('123456', 'fake_admin_tenant')
-        user_fix = self._mock_user_create('123456', 'fake_admin_user')
+        self._mock_tenant_create('123456', 'fake_admin_tenant')
+        self._mock_user_create('123456', 'fake_admin_user')
         self._mock_list_roles('123456', 'admin')
         iso_creds.get_admin_creds()
         user_mock = self.patch(
@@ -335,47 +330,36 @@
                                                  password='fake_password')
         # Create primary tenant and network
         self._mock_assign_user_role()
-        roles_fix = self._mock_list_role()
-        user_fix = self._mock_user_create('1234', 'fake_prim_user')
-        tenant_fix = self._mock_tenant_create('1234', 'fake_prim_tenant')
-        net_fix = self._mock_network_create(iso_creds, '1234', 'fake_net')
-        subnet_fix = self._mock_subnet_create(iso_creds, '1234', 'fake_subnet')
-        router_fix = self._mock_router_create('1234', 'fake_router')
+        self._mock_list_role()
+        self._mock_user_create('1234', 'fake_prim_user')
+        self._mock_tenant_create('1234', 'fake_prim_tenant')
+        self._mock_network_create(iso_creds, '1234', 'fake_net')
+        self._mock_subnet_create(iso_creds, '1234', 'fake_subnet')
+        self._mock_router_create('1234', 'fake_router')
         router_interface_mock = self.patch(
             'tempest.services.network.json.network_client.NetworkClientJSON.'
             'add_router_interface_with_subnet_id')
         iso_creds.get_primary_creds()
         router_interface_mock.called_once_with('1234', '1234')
         router_interface_mock.reset_mock()
-        tenant_fix.cleanUp()
-        user_fix.cleanUp()
-        net_fix.cleanUp()
-        subnet_fix.cleanUp()
-        router_fix.cleanUp()
         # Create alternate tenant and network
-        user_fix = self._mock_user_create('12345', 'fake_alt_user')
-        tenant_fix = self._mock_tenant_create('12345', 'fake_alt_tenant')
-        net_fix = self._mock_network_create(iso_creds, '12345', 'fake_alt_net')
-        subnet_fix = self._mock_subnet_create(iso_creds, '12345',
-                                              'fake_alt_subnet')
-        router_fix = self._mock_router_create('12345', 'fake_alt_router')
+        self._mock_user_create('12345', 'fake_alt_user')
+        self._mock_tenant_create('12345', 'fake_alt_tenant')
+        self._mock_network_create(iso_creds, '12345', 'fake_alt_net')
+        self._mock_subnet_create(iso_creds, '12345',
+                                 'fake_alt_subnet')
+        self._mock_router_create('12345', 'fake_alt_router')
         iso_creds.get_alt_creds()
         router_interface_mock.called_once_with('12345', '12345')
         router_interface_mock.reset_mock()
-        tenant_fix.cleanUp()
-        user_fix.cleanUp()
-        net_fix.cleanUp()
-        subnet_fix.cleanUp()
-        router_fix.cleanUp()
-        roles_fix.cleanUp()
         # Create admin tenant and networks
-        user_fix = self._mock_user_create('123456', 'fake_admin_user')
-        tenant_fix = self._mock_tenant_create('123456', 'fake_admin_tenant')
-        net_fix = self._mock_network_create(iso_creds, '123456',
-                                            'fake_admin_net')
-        subnet_fix = self._mock_subnet_create(iso_creds, '123456',
-                                              'fake_admin_subnet')
-        router_fix = self._mock_router_create('123456', 'fake_admin_router')
+        self._mock_user_create('123456', 'fake_admin_user')
+        self._mock_tenant_create('123456', 'fake_admin_tenant')
+        self._mock_network_create(iso_creds, '123456',
+                                  'fake_admin_net')
+        self._mock_subnet_create(iso_creds, '123456',
+                                 'fake_admin_subnet')
+        self._mock_router_create('123456', 'fake_admin_router')
         self._mock_list_roles('123456', 'admin')
         iso_creds.get_admin_creds()
         self.patch('tempest.services.identity.v2.json.identity_client.'
diff --git a/test-requirements.txt b/test-requirements.txt
index 7169610..9bd3f46 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,11 +3,11 @@
 # process, which may cause wedges in the gate later.
 hacking<0.11,>=0.10.0
 # needed for doc build
-sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
+sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
 python-subunit>=0.0.18
-oslosphinx>=2.5.0  # Apache-2.0
+oslosphinx>=2.5.0 # Apache-2.0
 mox>=0.5.3
 mock>=1.0
 coverage>=3.6
-oslotest>=1.5.1  # Apache-2.0
-stevedore>=1.5.0  # Apache-2.0
+oslotest>=1.5.1 # Apache-2.0
+stevedore>=1.5.0 # Apache-2.0
