diff --git a/README.rst b/README.rst
index 45cb4c0..71e185f 100644
--- a/README.rst
+++ b/README.rst
@@ -87,7 +87,7 @@
    be done with testr directly or any `testr`_ based test runner, like
    `ostestr`_. For example, from the working dir running::
 
-     $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty))'
+     $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))'
 
    will run the same set of tests as the default gate jobs.
 
diff --git a/doc/source/field_guide/thirdparty.rst b/doc/source/field_guide/thirdparty.rst
deleted file mode 120000
index 3fd6a51..0000000
--- a/doc/source/field_guide/thirdparty.rst
+++ /dev/null
@@ -1 +0,0 @@
-../../../tempest/thirdparty/README.rst
\ No newline at end of file
diff --git a/doc/source/index.rst b/doc/source/index.rst
index fe6074f..32e6e51 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -26,7 +26,6 @@
    field_guide/api
    field_guide/scenario
    field_guide/stress
-   field_guide/thirdparty
    field_guide/unit_tests
 
 ---------------------------
diff --git a/requirements.txt b/requirements.txt
index d470c30..df04ca8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,7 +7,6 @@
 httplib2>=0.7.5
 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.16,>=0.7.12
 testrepository>=0.0.18
diff --git a/run_tempest.sh b/run_tempest.sh
index a704684..8c8f25f 100755
--- a/run_tempest.sh
+++ b/run_tempest.sh
@@ -14,8 +14,6 @@
   echo "  -C, --config             Config file location"
   echo "  -h, --help               Print this usage message"
   echo "  -d, --debug              Run tests with testtools instead of testr. This allows you to use PDB"
-  echo "  -l, --logging            Enable logging"
-  echo "  -L, --logging-config     Logging config file location.  Default is etc/logging.conf"
   echo "  -- [TESTROPTIONS]        After the first '--' you can pass arbitrary arguments to testr "
 }
 
@@ -31,10 +29,8 @@
 wrapper=""
 config_file=""
 update=0
-logging=0
-logging_config=etc/logging.conf
 
-if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config:,logging,logging-config: -- "$@")
+if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config: -- "$@")
 then
     # parse error
     usage
@@ -55,8 +51,6 @@
     -C|--config) config_file=$2; shift;;
     -s|--smoke) testrargs+="smoke";;
     -t|--serial) serial=1;;
-    -l|--logging) logging=1;;
-    -L|--logging-config) logging_config=$2; shift;;
     --) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no  ;;
     *) testrargs="$testrargs $1";;
   esac
@@ -69,16 +63,6 @@
     export TEMPEST_CONFIG=`basename "$config_file"`
 fi
 
-if [ $logging -eq 1 ]; then
-    if [ ! -f "$logging_config" ]; then
-        echo "No such logging config file: $logging_config"
-        exit 1
-    fi
-    logging_config=`readlink -f "$logging_config"`
-    export TEMPEST_LOG_CONFIG_DIR=`dirname "$logging_config"`
-    export TEMPEST_LOG_CONFIG=`basename "$logging_config"`
-fi
-
 cd `dirname "$0"`
 
 if [ $no_site_packages -eq 1 ]; then
diff --git a/setup.cfg b/setup.cfg
index ee61788..4415063 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -35,6 +35,7 @@
 tempest.cm =
     init = tempest.cmd.init:TempestInit
     cleanup = tempest.cmd.cleanup:TempestCleanup
+    run-stress = tempest.cmd.run_stress:TempestRunStress
 oslo.config.opts =
     tempest.config = tempest.config:list_opts
 
diff --git a/tempest/README.rst b/tempest/README.rst
index f93a173..113b191 100644
--- a/tempest/README.rst
+++ b/tempest/README.rst
@@ -16,7 +16,6 @@
 |    api/ - API tests
 |    scenario/ - complex scenario tests
 |    stress/ - stress tests
-|    thirdparty/ - 3rd party api tests
 
 Each of these directories contains different types of tests. What
 belongs in each directory, the rules and examples for good tests, are
@@ -56,14 +55,6 @@
 several test jobs in parallel and can run any existing test in Tempest as a
 stress job.
 
-:ref:`third_party_field_guide`
-------------------------------
-
-Many openstack components include 3rdparty API support. It is
-completely legitimate for Tempest to include tests of 3rdparty APIs,
-but those should be kept separate from the normal OpenStack
-validation.
-
 :ref:`unit_tests_field_guide`
 -----------------------------
 
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
index fe05ddb..456363c 100644
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ b/tempest/api/compute/admin/test_floating_ips_bulk.py
@@ -38,7 +38,7 @@
     @classmethod
     def resource_setup(cls):
         super(FloatingIPsBulkAdminTestJSON, cls).resource_setup()
-        cls.ip_range = CONF.compute.floating_ip_range
+        cls.ip_range = CONF.validation.floating_ip_range
         cls.verify_unallocated_floating_ip_range(cls.ip_range)
 
     @classmethod
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index fa1c666..2907e26 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -111,7 +111,7 @@
 
         # Verify that GET shows the updated quota set of user
         user_name = data_utils.rand_name('cpu_quota_user')
-        password = data_utils.rand_name('password')
+        password = data_utils.rand_password()
         email = user_name + '@testmail.tm'
         user = self.identity_utils.create_user(username=user_name,
                                                password=password,
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index b038c6b..fd6f105 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -130,7 +130,7 @@
     @test.idempotent_id('ee8ae470-db70-474d-b752-690b7892cab1')
     def test_reset_state_server(self):
         # Reset server's state to 'error'
-        self.client.reset_state(self.s1_id)
+        self.client.reset_state(self.s1_id, state='error')
 
         # Verify server's state
         server = self.client.show_server(self.s1_id)['server']
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 7c5e8d0..055dc1b 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -123,7 +123,7 @@
     @test.idempotent_id('e741298b-8df2-46f0-81cb-8f814ff2504c')
     def test_reset_state_server_nonexistent_server(self):
         self.assertRaises(lib_exc.NotFound,
-                          self.client.reset_state, '999')
+                          self.client.reset_state, '999', state='error')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('e84e2234-60d2-42fa-8b30-e2d3049724ac')
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 2321b4e..aa8ee3f 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -101,13 +101,13 @@
         super(BaseV2ComputeTest, cls).resource_setup()
         cls.build_interval = CONF.compute.build_interval
         cls.build_timeout = CONF.compute.build_timeout
-        cls.ssh_user = CONF.compute.ssh_user
         cls.image_ref = CONF.compute.image_ref
         cls.image_ref_alt = CONF.compute.image_ref_alt
         cls.flavor_ref = CONF.compute.flavor_ref
         cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
-        cls.image_ssh_user = CONF.compute.image_ssh_user
-        cls.image_ssh_password = CONF.compute.image_ssh_password
+        cls.ssh_user = CONF.validation.image_ssh_user
+        cls.image_ssh_user = CONF.validation.image_ssh_user
+        cls.image_ssh_password = CONF.validation.image_ssh_password
         cls.servers = []
         cls.images = []
         cls.security_groups = []
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index dbbeb70..81a02be 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -100,7 +100,7 @@
         server_id = server['id']
         waiters.wait_for_server_status(self.servers_client, server_id,
                                        'ACTIVE')
-        self.servers_client.add_security_group(server_id, sg['name'])
+        self.servers_client.add_security_group(server_id, name=sg['name'])
 
         # Check that we are not able to delete the security
         # group since it is in use by an active server
@@ -109,10 +109,10 @@
                           sg['id'])
 
         # Reboot and add the other security group
-        self.servers_client.reboot_server(server_id, 'HARD')
+        self.servers_client.reboot_server(server_id, type='HARD')
         waiters.wait_for_server_status(self.servers_client, server_id,
                                        'ACTIVE')
-        self.servers_client.add_security_group(server_id, sg2['name'])
+        self.servers_client.add_security_group(server_id, name=sg2['name'])
 
         # Check that we are not able to delete the other security
         # group since it is in use by an active server
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index 814aec7..1367629 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -35,7 +35,7 @@
     @test.idempotent_id('77ca5cc5-9990-45e0-ab98-1de8fead201a')
     def test_list_instance_actions(self):
         # List actions of the provided server
-        self.client.reboot_server(self.server_id, 'HARD')
+        self.client.reboot_server(self.server_id, type='HARD')
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
         body = (self.client.list_instance_actions(self.server_id)
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 0754d27..71dfd96 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -81,7 +81,7 @@
     def test_change_server_password(self):
         # The server's password should be set to the provided password
         new_password = 'Newpass1234'
-        self.client.change_password(self.server_id, new_password)
+        self.client.change_password(self.server_id, adminPass=new_password)
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
         if CONF.validation.run_validation:
@@ -104,7 +104,7 @@
                 self.validation_resources['keypair']['private_key'])
             boot_time = linux_client.get_boot_time()
 
-        self.client.reboot_server(self.server_id, reboot_type)
+        self.client.reboot_server(self.server_id, type=reboot_type)
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
         if CONF.validation.run_validation:
@@ -279,9 +279,9 @@
         # create the first and the second backup
         backup1 = data_utils.rand_name('backup-1')
         resp = self.client.create_backup(self.server_id,
-                                         'daily',
-                                         2,
-                                         backup1).response
+                                         backup_type='daily',
+                                         rotation=2,
+                                         name=backup1).response
         oldest_backup_exist = True
 
         # the oldest one should be deleted automatically in this test
@@ -303,9 +303,9 @@
         backup2 = data_utils.rand_name('backup-2')
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
         resp = self.client.create_backup(self.server_id,
-                                         'daily',
-                                         2,
-                                         backup2).response
+                                         backup_type='daily',
+                                         rotation=2,
+                                         name=backup2).response
         image2_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(self.os.image_client.delete_image, image2_id)
         self.os.image_client.wait_for_image_status(image2_id, 'active')
@@ -331,9 +331,9 @@
         backup3 = data_utils.rand_name('backup-3')
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
         resp = self.client.create_backup(self.server_id,
-                                         'daily',
-                                         2,
-                                         backup3).response
+                                         backup_type='daily',
+                                         rotation=2,
+                                         name=backup3).response
         image3_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(self.os.image_client.delete_image, image3_id)
         # the first back up should be deleted
@@ -356,7 +356,7 @@
 
     def _get_output(self):
         output = self.client.get_console_output(
-            self.server_id, 10)['output']
+            self.server_id, length=10)['output']
         self.assertTrue(output, "Console output was empty.")
         lines = len(output.split('\n'))
         self.assertEqual(lines, 10)
@@ -373,7 +373,7 @@
         # log file is truncated and we cannot get any console log through
         # "console-log" API.
         # The detail is https://bugs.launchpad.net/nova/+bug/1251920
-        self.client.reboot_server(self.server_id, 'HARD')
+        self.client.reboot_server(self.server_id, type='HARD')
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
         self.wait_for(self._get_output)
 
@@ -384,8 +384,7 @@
         server = self.create_test_server(wait_until='ACTIVE')
 
         def _check_full_length_console_log():
-            output = self.client.get_console_output(server['id'],
-                                                    None)['output']
+            output = self.client.get_console_output(server['id'])['output']
             self.assertTrue(output, "Console output was empty.")
             lines = len(output.split('\n'))
 
@@ -499,7 +498,7 @@
         console_types = ['novnc', 'xvpvnc']
         for console_type in console_types:
             body = self.client.get_vnc_console(self.server_id,
-                                               console_type)['console']
+                                               type=console_type)['console']
             self.assertEqual(console_type, body['type'])
             self.assertNotEqual('', body['url'])
             self._validate_url(body['url'])
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index 77af509..58d26d3 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -17,6 +17,8 @@
 from tempest_lib import exceptions as lib_exc
 
 from tempest.api.compute import base
+from tempest.common.utils.linux import remote_client
+from tempest.common import waiters
 from tempest import config
 from tempest import test
 
@@ -26,6 +28,16 @@
 class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
 
     @classmethod
+    def setup_credentials(cls):
+        cls.prepare_instance_network()
+        super(ServerPersonalityTestJSON, cls).setup_credentials()
+
+    @classmethod
+    def resource_setup(cls):
+        cls.set_validation_resources()
+        super(ServerPersonalityTestJSON, cls).resource_setup()
+
+    @classmethod
     def skip_checks(cls):
         super(ServerPersonalityTestJSON, cls).skip_checks()
         if not CONF.compute_feature_enabled.personality:
@@ -40,18 +52,34 @@
     @test.idempotent_id('3cfe87fd-115b-4a02-b942-7dc36a337fdf')
     def test_create_server_with_personality(self):
         file_contents = 'This is a test file.'
-        personality = [{'path': '/test.txt',
+        file_path = '/test.txt'
+        personality = [{'path': file_path,
                         'contents': base64.b64encode(file_contents)}]
-        self.create_test_server(personality=personality)
+        server = self.create_test_server(personality=personality,
+                                         wait_until='ACTIVE',
+                                         validatable=True)
+        if CONF.validation.run_validation:
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user, server['adminPass'],
+                self.validation_resources['keypair']['private_key'])
+            self.assertEqual(file_contents,
+                             linux_client.exec_command(
+                                 'sudo cat %s' % file_path))
 
     @test.idempotent_id('128966d8-71fc-443c-8cab-08e24114ecc9')
     def test_rebuild_server_with_personality(self):
-        server_id = self.rebuild_server(None)
+        server = self.create_test_server(wait_until='ACTIVE', validatable=True)
+        server_id = server['id']
         file_contents = 'Test server rebuild.'
         personality = [{'path': 'rebuild.txt',
                         'contents': base64.b64encode(file_contents)}]
-        self.client.rebuild_server(server_id, self.image_ref_alt,
-                                   personality=personality)
+        rebuilt_server = self.client.rebuild_server(server_id,
+                                                    self.image_ref_alt,
+                                                    personality=personality)
+        waiters.wait_for_server_status(self.client, server_id, 'ACTIVE')
+        self.assertEqual(self.image_ref_alt,
+                         rebuilt_server['server']['image']['id'])
 
     @test.idempotent_id('176cd8c9-b9e8-48ee-a480-180beab292bf')
     def test_personality_files_exceed_limit(self):
@@ -83,9 +111,20 @@
             raise self.skipException("No limit for personality files")
         person = []
         for i in range(0, int(max_file_limit)):
-            path = 'etc/test' + str(i) + '.txt'
+            path = '/etc/test' + str(i) + '.txt'
             person.append({
                 'path': path,
                 'contents': base64.b64encode(file_contents),
             })
-        self.create_test_server(personality=person)
+        server = self.create_test_server(personality=person,
+                                         wait_until='ACTIVE',
+                                         validatable=True)
+        if CONF.validation.run_validation:
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user, server['adminPass'],
+                self.validation_resources['keypair']['private_key'])
+            for i in person:
+                self.assertEqual(base64.b64decode(i['contents']),
+                                 linux_client.exec_command(
+                                     'sudo cat %s' % i['path']))
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 96ce45e..2296980 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -116,8 +116,9 @@
         self.addCleanup(self._unrescue, self.server_id)
 
         # Add Security group
-        self.servers_client.add_security_group(self.server_id, self.sg_name)
+        self.servers_client.add_security_group(self.server_id,
+                                               name=self.sg_name)
 
         # Delete Security group
         self.servers_client.remove_security_group(self.server_id,
-                                                  self.sg_name)
+                                                  name=self.sg_name)
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index f8567cf..65ad2f5 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -101,7 +101,7 @@
     @test.idempotent_id('db22b618-f157-4566-a317-1b6d467a8094')
     def test_rescued_vm_reboot(self):
         self.assertRaises(lib_exc.Conflict, self.servers_client.reboot_server,
-                          self.rescue_id, 'HARD')
+                          self.rescue_id, type='HARD')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('6dfc0a55-3a77-4564-a144-1587b7971dde')
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index a5e9afd..ed8484e 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -152,7 +152,7 @@
         # Reboot a non existent server
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
-                          nonexistent_server, 'SOFT')
+                          nonexistent_server, type='SOFT')
 
     @test.idempotent_id('d1417e7f-a509-41b5-a102-d5eed8613369')
     @testtools.skipUnless(CONF.compute_feature_enabled.pause,
@@ -188,7 +188,7 @@
         waiters.wait_for_server_termination(self.client, server['id'])
 
         self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
-                          server['id'], 'SOFT')
+                          server['id'], type='SOFT')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('d86141a7-906e-4731-b187-d64a2ea61422')
@@ -430,7 +430,7 @@
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.get_console_output,
-                          nonexistent_server, 10)
+                          nonexistent_server, length=10)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('6f47992b-5144-4250-9f8b-f00aa33950f3')
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 4f2bc04..e363fc4 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -151,13 +151,13 @@
     def test_change_password_for_alt_account_fails(self):
         # A change password request for another user's server should fail
         self.assertRaises(lib_exc.NotFound, self.alt_client.change_password,
-                          self.server['id'], 'newpass')
+                          self.server['id'], adminPass='newpass')
 
     @test.idempotent_id('14cb5ff5-f646-45ca-8f51-09081d6c0c24')
     def test_reboot_server_for_alt_account_fails(self):
         # A reboot request for another user's server should fail
         self.assertRaises(lib_exc.NotFound, self.alt_client.reboot_server,
-                          self.server['id'], 'HARD')
+                          self.server['id'], type='HARD')
 
     @test.idempotent_id('8a0bce51-cd00-480b-88ba-dbc7d8408a37')
     def test_rebuild_server_for_alt_account_fails(self):
@@ -444,4 +444,4 @@
         # A Get Console Output for another user's server should fail
         self.assertRaises(lib_exc.NotFound,
                           self.alt_client.get_console_output,
-                          self.server['id'], 10)
+                          self.server['id'], length=10)
diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py
index 8702db7..e547bdd 100644
--- a/tempest/api/identity/admin/v2/test_roles.py
+++ b/tempest/api/identity/admin/v2/test_roles.py
@@ -27,7 +27,7 @@
         super(RolesTestJSON, cls).resource_setup()
         for _ in moves.xrange(5):
             role_name = data_utils.rand_name(name='role')
-            role = cls.client.create_role(role_name)['role']
+            role = cls.roles_client.create_role(role_name)['role']
             cls.data.roles.append(role)
 
     def _get_role_params(self):
@@ -48,7 +48,7 @@
     @test.idempotent_id('75d9593f-50b7-4fcf-bd64-e3fb4a278e23')
     def test_list_roles(self):
         """Return a list of all roles."""
-        body = self.client.list_roles()['roles']
+        body = self.roles_client.list_roles()['roles']
         found = [role for role in body if role in self.data.roles]
         self.assertTrue(any(found))
         self.assertEqual(len(found), len(self.data.roles))
@@ -57,16 +57,16 @@
     def test_role_create_delete(self):
         """Role should be created, verified, and deleted."""
         role_name = data_utils.rand_name(name='role-test')
-        body = self.client.create_role(role_name)['role']
+        body = self.roles_client.create_role(role_name)['role']
         self.assertEqual(role_name, body['name'])
 
-        body = self.client.list_roles()['roles']
+        body = self.roles_client.list_roles()['roles']
         found = [role for role in body if role['name'] == role_name]
         self.assertTrue(any(found))
 
-        body = self.client.delete_role(found[0]['id'])
+        body = self.roles_client.delete_role(found[0]['id'])
 
-        body = self.client.list_roles()['roles']
+        body = self.roles_client.list_roles()['roles']
         found = [role for role in body if role['name'] == role_name]
         self.assertFalse(any(found))
 
@@ -76,7 +76,7 @@
         self.data.setup_test_role()
         role_id = self.data.role['id']
         role_name = self.data.role['name']
-        body = self.client.show_role(role_id)['role']
+        body = self.roles_client.show_role(role_id)['role']
         self.assertEqual(role_id, body['id'])
         self.assertEqual(role_name, body['name'])
 
@@ -84,24 +84,28 @@
     def test_assign_user_role(self):
         """Assign a role to a user on a tenant."""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
-        roles = self.client.list_user_roles(tenant['id'], user['id'])['roles']
+        self.roles_client.assign_user_role(tenant['id'], user['id'],
+                                           role['id'])
+        roles = self.roles_client.list_user_roles(tenant['id'],
+                                                  user['id'])['roles']
         self.assert_role_in_role_list(role, roles)
 
     @test.idempotent_id('f0b9292c-d3ba-4082-aa6c-440489beef69')
     def test_remove_user_role(self):
         """Remove a role assigned to a user on a tenant."""
         (user, tenant, role) = self._get_role_params()
-        user_role = self.client.assign_user_role(tenant['id'],
-                                                 user['id'],
-                                                 role['id'])['role']
-        self.client.delete_user_role(tenant['id'], user['id'],
-                                     user_role['id'])
+        user_role = self.roles_client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])['role']
+        self.roles_client.delete_user_role(tenant['id'], user['id'],
+                                           user_role['id'])
 
     @test.idempotent_id('262e1e3e-ed71-4edd-a0e5-d64e83d66d05')
     def test_list_user_roles(self):
         """List roles assigned to a user on tenant."""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
-        roles = self.client.list_user_roles(tenant['id'], user['id'])['roles']
+        self.roles_client.assign_user_role(tenant['id'], user['id'],
+                                           role['id'])
+        roles = self.roles_client.list_user_roles(tenant['id'],
+                                                  user['id'])['roles']
         self.assert_role_in_role_list(role, roles)
diff --git a/tempest/api/identity/admin/v2/test_roles_negative.py b/tempest/api/identity/admin/v2/test_roles_negative.py
index 45c95df..a57163d 100644
--- a/tempest/api/identity/admin/v2/test_roles_negative.py
+++ b/tempest/api/identity/admin/v2/test_roles_negative.py
@@ -37,7 +37,7 @@
     def test_list_roles_by_unauthorized_user(self):
         # Non-administrator user should not be able to list roles
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.list_roles)
+                          self.non_admin_roles_client.list_roles)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('11a3c7da-df6c-40c2-abc2-badd682edf9f')
@@ -45,14 +45,15 @@
         # Request to list roles without a valid token should fail
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
-        self.assertRaises(lib_exc.Unauthorized, self.client.list_roles)
+        self.assertRaises(lib_exc.Unauthorized, self.roles_client.list_roles)
         self.client.auth_provider.clear_auth()
 
     @test.attr(type=['negative'])
     @test.idempotent_id('c0b89e56-accc-4c73-85f8-9c0f866104c1')
     def test_role_create_blank_name(self):
         # Should not be able to create a role with a blank name
-        self.assertRaises(lib_exc.BadRequest, self.client.create_role, '')
+        self.assertRaises(lib_exc.BadRequest, self.roles_client.create_role,
+                          '')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('585c8998-a8a4-4641-a5dd-abef7a8ced00')
@@ -60,7 +61,7 @@
         # Non-administrator user should not be able to create role
         role_name = data_utils.rand_name(name='role')
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.create_role, role_name)
+                          self.non_admin_roles_client.create_role, role_name)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('a7edd17a-e34a-4aab-8bb7-fa6f498645b8')
@@ -70,7 +71,7 @@
         self.client.delete_token(token)
         role_name = data_utils.rand_name(name='role')
         self.assertRaises(lib_exc.Unauthorized,
-                          self.client.create_role, role_name)
+                          self.roles_client.create_role, role_name)
         self.client.auth_provider.clear_auth()
 
     @test.attr(type=['negative'])
@@ -78,10 +79,10 @@
     def test_role_create_duplicate(self):
         # Role names should be unique
         role_name = data_utils.rand_name(name='role-dup')
-        body = self.client.create_role(role_name)['role']
+        body = self.roles_client.create_role(role_name)['role']
         role1_id = body.get('id')
-        self.addCleanup(self.client.delete_role, role1_id)
-        self.assertRaises(lib_exc.Conflict, self.client.create_role,
+        self.addCleanup(self.roles_client.delete_role, role1_id)
+        self.assertRaises(lib_exc.Conflict, self.roles_client.create_role,
                           role_name)
 
     @test.attr(type=['negative'])
@@ -89,24 +90,24 @@
     def test_delete_role_by_unauthorized_user(self):
         # Non-administrator user should not be able to delete role
         role_name = data_utils.rand_name(name='role')
-        body = self.client.create_role(role_name)['role']
+        body = self.roles_client.create_role(role_name)['role']
         self.data.roles.append(body)
         role_id = body.get('id')
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.delete_role, role_id)
+                          self.non_admin_roles_client.delete_role, role_id)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('44b60b20-70de-4dac-beaf-a3fc2650a16b')
     def test_delete_role_request_without_token(self):
         # Request to delete role without a valid token should fail
         role_name = data_utils.rand_name(name='role')
-        body = self.client.create_role(role_name)['role']
+        body = self.roles_client.create_role(role_name)['role']
         self.data.roles.append(body)
         role_id = body.get('id')
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(lib_exc.Unauthorized,
-                          self.client.delete_role,
+                          self.roles_client.delete_role,
                           role_id)
         self.client.auth_provider.clear_auth()
 
@@ -115,7 +116,7 @@
     def test_delete_role_non_existent(self):
         # Attempt to delete a non existent role should fail
         non_existent_role = str(uuid.uuid4().hex)
-        self.assertRaises(lib_exc.NotFound, self.client.delete_role,
+        self.assertRaises(lib_exc.NotFound, self.roles_client.delete_role,
                           non_existent_role)
 
     @test.attr(type=['negative'])
@@ -125,7 +126,7 @@
         # assign a role to user
         (user, tenant, role) = self._get_role_params()
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.assign_user_role,
+                          self.non_admin_roles_client.assign_user_role,
                           tenant['id'], user['id'], role['id'])
 
     @test.attr(type=['negative'])
@@ -136,7 +137,7 @@
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(lib_exc.Unauthorized,
-                          self.client.assign_user_role, tenant['id'],
+                          self.roles_client.assign_user_role, tenant['id'],
                           user['id'], role['id'])
         self.client.auth_provider.clear_auth()
 
@@ -146,7 +147,7 @@
         # Attempt to assign a non existent role to user should fail
         (user, tenant, role) = self._get_role_params()
         non_existent_role = str(uuid.uuid4().hex)
-        self.assertRaises(lib_exc.NotFound, self.client.assign_user_role,
+        self.assertRaises(lib_exc.NotFound, self.roles_client.assign_user_role,
                           tenant['id'], user['id'], non_existent_role)
 
     @test.attr(type=['negative'])
@@ -155,7 +156,7 @@
         # Attempt to assign a role on a non existent tenant should fail
         (user, tenant, role) = self._get_role_params()
         non_existent_tenant = str(uuid.uuid4().hex)
-        self.assertRaises(lib_exc.NotFound, self.client.assign_user_role,
+        self.assertRaises(lib_exc.NotFound, self.roles_client.assign_user_role,
                           non_existent_tenant, user['id'], role['id'])
 
     @test.attr(type=['negative'])
@@ -163,8 +164,9 @@
     def test_assign_duplicate_user_role(self):
         # Duplicate user role should not get assigned
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
-        self.assertRaises(lib_exc.Conflict, self.client.assign_user_role,
+        self.roles_client.assign_user_role(tenant['id'], user['id'],
+                                           role['id'])
+        self.assertRaises(lib_exc.Conflict, self.roles_client.assign_user_role,
                           tenant['id'], user['id'], role['id'])
 
     @test.attr(type=['negative'])
@@ -173,11 +175,11 @@
         # Non-administrator user should not be authorized to
         # remove a user's role
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'],
-                                     user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant['id'],
+                                           user['id'],
+                                           role['id'])
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.delete_user_role,
+                          self.non_admin_roles_client.delete_user_role,
                           tenant['id'], user['id'], role['id'])
 
     @test.attr(type=['negative'])
@@ -185,13 +187,13 @@
     def test_remove_user_role_request_without_token(self):
         # Request to remove a user's role without a valid token
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'],
-                                     user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant['id'],
+                                           user['id'],
+                                           role['id'])
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
         self.assertRaises(lib_exc.Unauthorized,
-                          self.client.delete_user_role, tenant['id'],
+                          self.roles_client.delete_user_role, tenant['id'],
                           user['id'], role['id'])
         self.client.auth_provider.clear_auth()
 
@@ -200,11 +202,11 @@
     def test_remove_user_role_non_existent_role(self):
         # Attempt to delete a non existent role from a user should fail
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'],
-                                     user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant['id'],
+                                           user['id'],
+                                           role['id'])
         non_existent_role = str(uuid.uuid4().hex)
-        self.assertRaises(lib_exc.NotFound, self.client.delete_user_role,
+        self.assertRaises(lib_exc.NotFound, self.roles_client.delete_user_role,
                           tenant['id'], user['id'], non_existent_role)
 
     @test.attr(type=['negative'])
@@ -212,11 +214,11 @@
     def test_remove_user_role_non_existent_tenant(self):
         # Attempt to remove a role from a non existent tenant should fail
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'],
-                                     user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant['id'],
+                                           user['id'],
+                                           role['id'])
         non_existent_tenant = str(uuid.uuid4().hex)
-        self.assertRaises(lib_exc.NotFound, self.client.delete_user_role,
+        self.assertRaises(lib_exc.NotFound, self.roles_client.delete_user_role,
                           non_existent_tenant, user['id'], role['id'])
 
     @test.attr(type=['negative'])
@@ -225,10 +227,11 @@
         # Non-administrator user should not be authorized to list
         # a user's roles
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
+        self.roles_client.assign_user_role(tenant['id'], user['id'],
+                                           role['id'])
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.list_user_roles, tenant['id'],
-                          user['id'])
+                          self.non_admin_roles_client.list_user_roles,
+                          tenant['id'], user['id'])
 
     @test.attr(type=['negative'])
     @test.idempotent_id('682adfb2-fd5f-4b0a-a9ca-322e9bebb907')
@@ -239,7 +242,7 @@
         self.client.delete_token(token)
         try:
             self.assertRaises(lib_exc.Unauthorized,
-                              self.client.list_user_roles, tenant['id'],
+                              self.roles_client.list_user_roles, tenant['id'],
                               user['id'])
         finally:
             self.client.auth_provider.clear_auth()
diff --git a/tempest/api/identity/admin/v2/test_tenant_negative.py b/tempest/api/identity/admin/v2/test_tenant_negative.py
index 74558d1..a02dbc1 100644
--- a/tempest/api/identity/admin/v2/test_tenant_negative.py
+++ b/tempest/api/identity/admin/v2/test_tenant_negative.py
@@ -29,7 +29,7 @@
     def test_list_tenants_by_unauthorized_user(self):
         # Non-administrator user should not be able to list tenants
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.list_tenants)
+                          self.non_admin_tenants_client.list_tenants)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('df33926c-1c96-4d8d-a762-79cc6b0c3cf4')
@@ -37,7 +37,8 @@
         # Request to list tenants without a valid token should fail
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
-        self.assertRaises(lib_exc.Unauthorized, self.client.list_tenants)
+        self.assertRaises(lib_exc.Unauthorized,
+                          self.tenants_client.list_tenants)
         self.client.auth_provider.clear_auth()
 
     @test.attr(type=['negative'])
@@ -45,21 +46,23 @@
     def test_tenant_delete_by_unauthorized_user(self):
         # Non-administrator user should not be able to delete a tenant
         tenant_name = data_utils.rand_name(name='tenant')
-        tenant = self.client.create_tenant(tenant_name)['tenant']
+        tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
         self.data.tenants.append(tenant)
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.delete_tenant, tenant['id'])
+                          self.non_admin_tenants_client.delete_tenant,
+                          tenant['id'])
 
     @test.attr(type=['negative'])
     @test.idempotent_id('e450db62-2e9d-418f-893a-54772d6386b1')
     def test_tenant_delete_request_without_token(self):
         # Request to delete a tenant without a valid token should fail
         tenant_name = data_utils.rand_name(name='tenant')
-        tenant = self.client.create_tenant(tenant_name)['tenant']
+        tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
         self.data.tenants.append(tenant)
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
-        self.assertRaises(lib_exc.Unauthorized, self.client.delete_tenant,
+        self.assertRaises(lib_exc.Unauthorized,
+                          self.tenants_client.delete_tenant,
                           tenant['id'])
         self.client.auth_provider.clear_auth()
 
@@ -67,7 +70,7 @@
     @test.idempotent_id('9c9a2aed-6e3c-467a-8f5c-89da9d1b516b')
     def test_delete_non_existent_tenant(self):
         # Attempt to delete a non existent tenant should fail
-        self.assertRaises(lib_exc.NotFound, self.client.delete_tenant,
+        self.assertRaises(lib_exc.NotFound, self.tenants_client.delete_tenant,
                           str(uuid.uuid4().hex))
 
     @test.attr(type=['negative'])
@@ -75,14 +78,14 @@
     def test_tenant_create_duplicate(self):
         # Tenant names should be unique
         tenant_name = data_utils.rand_name(name='tenant')
-        body = self.client.create_tenant(tenant_name)['tenant']
+        body = self.tenants_client.create_tenant(tenant_name)['tenant']
         tenant = body
         self.data.tenants.append(tenant)
         tenant1_id = body.get('id')
 
-        self.addCleanup(self.client.delete_tenant, tenant1_id)
+        self.addCleanup(self.tenants_client.delete_tenant, tenant1_id)
         self.addCleanup(self.data.tenants.remove, tenant)
-        self.assertRaises(lib_exc.Conflict, self.client.create_tenant,
+        self.assertRaises(lib_exc.Conflict, self.tenants_client.create_tenant,
                           tenant_name)
 
     @test.attr(type=['negative'])
@@ -91,7 +94,8 @@
         # Non-administrator user should not be authorized to create a tenant
         tenant_name = data_utils.rand_name(name='tenant')
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.create_tenant, tenant_name)
+                          self.non_admin_tenants_client.create_tenant,
+                          tenant_name)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('a3ee9d7e-6920-4dd5-9321-d4b2b7f0a638')
@@ -100,7 +104,8 @@
         tenant_name = data_utils.rand_name(name='tenant')
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
-        self.assertRaises(lib_exc.Unauthorized, self.client.create_tenant,
+        self.assertRaises(lib_exc.Unauthorized,
+                          self.tenants_client.create_tenant,
                           tenant_name)
         self.client.auth_provider.clear_auth()
 
@@ -108,7 +113,8 @@
     @test.idempotent_id('5a2e4ca9-b0c0-486c-9c48-64a94fba2395')
     def test_create_tenant_with_empty_name(self):
         # Tenant name should not be empty
-        self.assertRaises(lib_exc.BadRequest, self.client.create_tenant,
+        self.assertRaises(lib_exc.BadRequest,
+                          self.tenants_client.create_tenant,
                           name='')
 
     @test.attr(type=['negative'])
@@ -116,14 +122,15 @@
     def test_create_tenants_name_length_over_64(self):
         # Tenant name length should not be greater than 64 characters
         tenant_name = 'a' * 65
-        self.assertRaises(lib_exc.BadRequest, self.client.create_tenant,
+        self.assertRaises(lib_exc.BadRequest,
+                          self.tenants_client.create_tenant,
                           tenant_name)
 
     @test.attr(type=['negative'])
     @test.idempotent_id('bd20dc2a-9557-4db7-b755-f48d952ad706')
     def test_update_non_existent_tenant(self):
         # Attempt to update a non existent tenant should fail
-        self.assertRaises(lib_exc.NotFound, self.client.update_tenant,
+        self.assertRaises(lib_exc.NotFound, self.tenants_client.update_tenant,
                           str(uuid.uuid4().hex))
 
     @test.attr(type=['negative'])
@@ -131,20 +138,22 @@
     def test_tenant_update_by_unauthorized_user(self):
         # Non-administrator user should not be able to update a tenant
         tenant_name = data_utils.rand_name(name='tenant')
-        tenant = self.client.create_tenant(tenant_name)['tenant']
+        tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
         self.data.tenants.append(tenant)
         self.assertRaises(lib_exc.Forbidden,
-                          self.non_admin_client.update_tenant, tenant['id'])
+                          self.non_admin_tenants_client.update_tenant,
+                          tenant['id'])
 
     @test.attr(type=['negative'])
     @test.idempotent_id('7a421573-72c7-4c22-a98e-ce539219c657')
     def test_tenant_update_request_without_token(self):
         # Request to update a tenant without a valid token should fail
         tenant_name = data_utils.rand_name(name='tenant')
-        tenant = self.client.create_tenant(tenant_name)['tenant']
+        tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
         self.data.tenants.append(tenant)
         token = self.client.auth_provider.get_token()
         self.client.delete_token(token)
-        self.assertRaises(lib_exc.Unauthorized, self.client.update_tenant,
+        self.assertRaises(lib_exc.Unauthorized,
+                          self.tenants_client.update_tenant,
                           tenant['id'])
         self.client.auth_provider.clear_auth()
diff --git a/tempest/api/identity/admin/v2/test_tenants.py b/tempest/api/identity/admin/v2/test_tenants.py
index 4632b1e..8d0b9b1 100644
--- a/tempest/api/identity/admin/v2/test_tenants.py
+++ b/tempest/api/identity/admin/v2/test_tenants.py
@@ -28,19 +28,19 @@
         tenants = []
         for _ in moves.xrange(3):
             tenant_name = data_utils.rand_name(name='tenant-new')
-            tenant = self.client.create_tenant(tenant_name)['tenant']
+            tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
             self.data.tenants.append(tenant)
             tenants.append(tenant)
         tenant_ids = map(lambda x: x['id'], tenants)
-        body = self.client.list_tenants()['tenants']
+        body = self.tenants_client.list_tenants()['tenants']
         found = [t for t in body if t['id'] in tenant_ids]
         self.assertEqual(len(found), len(tenants), 'Tenants not created')
 
         for tenant in tenants:
-            self.client.delete_tenant(tenant['id'])
+            self.tenants_client.delete_tenant(tenant['id'])
             self.data.tenants.remove(tenant)
 
-        body = self.client.list_tenants()['tenants']
+        body = self.tenants_client.list_tenants()['tenants']
         found = [tenant for tenant in body if tenant['id'] in tenant_ids]
         self.assertFalse(any(found), 'Tenants failed to delete')
 
@@ -49,60 +49,60 @@
         # Create tenant with a description
         tenant_name = data_utils.rand_name(name='tenant')
         tenant_desc = data_utils.rand_name(name='desc')
-        body = self.client.create_tenant(tenant_name,
-                                         description=tenant_desc)['tenant']
-        tenant = body
+        body = self.tenants_client.create_tenant(tenant_name,
+                                                 description=tenant_desc)
+        tenant = body['tenant']
         self.data.tenants.append(tenant)
-        tenant_id = body['id']
-        desc1 = body['description']
+        tenant_id = tenant['id']
+        desc1 = tenant['description']
         self.assertEqual(desc1, tenant_desc, 'Description should have '
                          'been sent in response for create')
-        body = self.client.show_tenant(tenant_id)['tenant']
+        body = self.tenants_client.show_tenant(tenant_id)['tenant']
         desc2 = body['description']
         self.assertEqual(desc2, tenant_desc, 'Description does not appear'
                          'to be set')
-        self.client.delete_tenant(tenant_id)
+        self.tenants_client.delete_tenant(tenant_id)
         self.data.tenants.remove(tenant)
 
     @test.idempotent_id('670bdddc-1cd7-41c7-b8e2-751cfb67df50')
     def test_tenant_create_enabled(self):
         # Create a tenant that is enabled
         tenant_name = data_utils.rand_name(name='tenant')
-        body = self.client.create_tenant(tenant_name, enabled=True)['tenant']
-        tenant = body
+        body = self.tenants_client.create_tenant(tenant_name, enabled=True)
+        tenant = body['tenant']
         self.data.tenants.append(tenant)
-        tenant_id = body['id']
-        en1 = body['enabled']
+        tenant_id = tenant['id']
+        en1 = tenant['enabled']
         self.assertTrue(en1, 'Enable should be True in response')
-        body = self.client.show_tenant(tenant_id)['tenant']
+        body = self.tenants_client.show_tenant(tenant_id)['tenant']
         en2 = body['enabled']
         self.assertTrue(en2, 'Enable should be True in lookup')
-        self.client.delete_tenant(tenant_id)
+        self.tenants_client.delete_tenant(tenant_id)
         self.data.tenants.remove(tenant)
 
     @test.idempotent_id('3be22093-b30f-499d-b772-38340e5e16fb')
     def test_tenant_create_not_enabled(self):
         # Create a tenant that is not enabled
         tenant_name = data_utils.rand_name(name='tenant')
-        body = self.client.create_tenant(tenant_name, enabled=False)['tenant']
-        tenant = body
+        body = self.tenants_client.create_tenant(tenant_name, enabled=False)
+        tenant = body['tenant']
         self.data.tenants.append(tenant)
-        tenant_id = body['id']
-        en1 = body['enabled']
+        tenant_id = tenant['id']
+        en1 = tenant['enabled']
         self.assertEqual('false', str(en1).lower(),
                          'Enable should be False in response')
-        body = self.client.show_tenant(tenant_id)['tenant']
+        body = self.tenants_client.show_tenant(tenant_id)['tenant']
         en2 = body['enabled']
         self.assertEqual('false', str(en2).lower(),
                          'Enable should be False in lookup')
-        self.client.delete_tenant(tenant_id)
+        self.tenants_client.delete_tenant(tenant_id)
         self.data.tenants.remove(tenant)
 
     @test.idempotent_id('781f2266-d128-47f3-8bdb-f70970add238')
     def test_tenant_update_name(self):
         # Update name attribute of a tenant
         t_name1 = data_utils.rand_name(name='tenant')
-        body = self.client.create_tenant(t_name1)['tenant']
+        body = self.tenants_client.create_tenant(t_name1)['tenant']
         tenant = body
         self.data.tenants.append(tenant)
 
@@ -110,18 +110,18 @@
         resp1_name = body['name']
 
         t_name2 = data_utils.rand_name(name='tenant2')
-        body = self.client.update_tenant(t_id, name=t_name2)['tenant']
+        body = self.tenants_client.update_tenant(t_id, name=t_name2)['tenant']
         resp2_name = body['name']
         self.assertNotEqual(resp1_name, resp2_name)
 
-        body = self.client.show_tenant(t_id)['tenant']
+        body = self.tenants_client.show_tenant(t_id)['tenant']
         resp3_name = body['name']
 
         self.assertNotEqual(resp1_name, resp3_name)
         self.assertEqual(t_name1, resp1_name)
         self.assertEqual(resp2_name, resp3_name)
 
-        self.client.delete_tenant(t_id)
+        self.tenants_client.delete_tenant(t_id)
         self.data.tenants.remove(tenant)
 
     @test.idempotent_id('859fcfe1-3a03-41ef-86f9-b19a47d1cd87')
@@ -129,26 +129,27 @@
         # Update description attribute of a tenant
         t_name = data_utils.rand_name(name='tenant')
         t_desc = data_utils.rand_name(name='desc')
-        body = self.client.create_tenant(t_name, description=t_desc)['tenant']
-        tenant = body
+        body = self.tenants_client.create_tenant(t_name, description=t_desc)
+        tenant = body['tenant']
         self.data.tenants.append(tenant)
 
-        t_id = body['id']
-        resp1_desc = body['description']
+        t_id = tenant['id']
+        resp1_desc = tenant['description']
 
         t_desc2 = data_utils.rand_name(name='desc2')
-        body = self.client.update_tenant(t_id, description=t_desc2)['tenant']
-        resp2_desc = body['description']
+        body = self.tenants_client.update_tenant(t_id, description=t_desc2)
+        updated_tenant = body['tenant']
+        resp2_desc = updated_tenant['description']
         self.assertNotEqual(resp1_desc, resp2_desc)
 
-        body = self.client.show_tenant(t_id)['tenant']
+        body = self.tenants_client.show_tenant(t_id)['tenant']
         resp3_desc = body['description']
 
         self.assertNotEqual(resp1_desc, resp3_desc)
         self.assertEqual(t_desc, resp1_desc)
         self.assertEqual(resp2_desc, resp3_desc)
 
-        self.client.delete_tenant(t_id)
+        self.tenants_client.delete_tenant(t_id)
         self.data.tenants.remove(tenant)
 
     @test.idempotent_id('8fc8981f-f12d-4c66-9972-2bdcf2bc2e1a')
@@ -156,24 +157,25 @@
         # Update the enabled attribute of a tenant
         t_name = data_utils.rand_name(name='tenant')
         t_en = False
-        body = self.client.create_tenant(t_name, enabled=t_en)['tenant']
-        tenant = body
+        body = self.tenants_client.create_tenant(t_name, enabled=t_en)
+        tenant = body['tenant']
         self.data.tenants.append(tenant)
 
-        t_id = body['id']
-        resp1_en = body['enabled']
+        t_id = tenant['id']
+        resp1_en = tenant['enabled']
 
         t_en2 = True
-        body = self.client.update_tenant(t_id, enabled=t_en2)['tenant']
-        resp2_en = body['enabled']
+        body = self.tenants_client.update_tenant(t_id, enabled=t_en2)
+        updated_tenant = body['tenant']
+        resp2_en = updated_tenant['enabled']
         self.assertNotEqual(resp1_en, resp2_en)
 
-        body = self.client.show_tenant(t_id)['tenant']
+        body = self.tenants_client.show_tenant(t_id)['tenant']
         resp3_en = body['enabled']
 
         self.assertNotEqual(resp1_en, resp3_en)
         self.assertEqual('false', str(resp1_en).lower())
         self.assertEqual(resp2_en, resp3_en)
 
-        self.client.delete_tenant(t_id)
+        self.tenants_client.delete_tenant(t_id)
         self.data.tenants.remove(tenant)
diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py
index 0e7a480..e752b02 100644
--- a/tempest/api/identity/admin/v2/test_tokens.py
+++ b/tempest/api/identity/admin/v2/test_tokens.py
@@ -24,10 +24,10 @@
     def test_create_get_delete_token(self):
         # get a token by username and password
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         # first:create a tenant
         tenant_name = data_utils.rand_name(name='tenant')
-        tenant = self.client.create_tenant(tenant_name)['tenant']
+        tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
         self.data.tenants.append(tenant)
         # second:create a user
         user = self.client.create_user(user_name, user_password,
@@ -59,7 +59,7 @@
 
         # Create a user.
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         tenant_id = None  # No default tenant so will get unscoped token.
         email = ''
         user = self.client.create_user(user_name, user_password,
@@ -68,24 +68,24 @@
 
         # Create a couple tenants.
         tenant1_name = data_utils.rand_name(name='tenant')
-        tenant1 = self.client.create_tenant(tenant1_name)['tenant']
+        tenant1 = self.tenants_client.create_tenant(tenant1_name)['tenant']
         self.data.tenants.append(tenant1)
 
         tenant2_name = data_utils.rand_name(name='tenant')
-        tenant2 = self.client.create_tenant(tenant2_name)['tenant']
+        tenant2 = self.tenants_client.create_tenant(tenant2_name)['tenant']
         self.data.tenants.append(tenant2)
 
         # Create a role
         role_name = data_utils.rand_name(name='role')
-        role = self.client.create_role(role_name)['role']
+        role = self.roles_client.create_role(role_name)['role']
         self.data.roles.append(role)
 
         # Grant the user the role on the tenants.
-        self.client.assign_user_role(tenant1['id'], user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant1['id'], user['id'],
+                                           role['id'])
 
-        self.client.assign_user_role(tenant2['id'], user['id'],
-                                     role['id'])
+        self.roles_client.assign_user_role(tenant2['id'], user['id'],
+                                           role['id'])
 
         # Get an unscoped token.
         body = self.token_client.auth(user_name, user_password)
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 6341106..2e9714e 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -26,7 +26,7 @@
     def resource_setup(cls):
         super(UsersTestJSON, cls).resource_setup()
         cls.alt_user = data_utils.rand_name('test_user')
-        cls.alt_password = data_utils.rand_name('pass')
+        cls.alt_password = data_utils.rand_password()
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
     @test.attr(type='smoke')
@@ -132,21 +132,22 @@
         self.data.setup_test_tenant()
         user_ids = list()
         fetched_user_ids = list()
+        password1 = data_utils.rand_password()
         alt_tenant_user1 = data_utils.rand_name('tenant_user1')
-        user1 = self.client.create_user(alt_tenant_user1, 'password1',
+        user1 = self.client.create_user(alt_tenant_user1, password1,
                                         self.data.tenant['id'],
                                         'user1@123')['user']
         user_ids.append(user1['id'])
         self.data.users.append(user1)
-
+        password2 = data_utils.rand_password()
         alt_tenant_user2 = data_utils.rand_name('tenant_user2')
-        user2 = self.client.create_user(alt_tenant_user2, 'password2',
+        user2 = self.client.create_user(alt_tenant_user2, password2,
                                         self.data.tenant['id'],
                                         'user2@123')['user']
         user_ids.append(user2['id'])
         self.data.users.append(user2)
         # List of users for the respective tenant ID
-        body = (self.client.list_tenant_users(self.data.tenant['id'])
+        body = (self.tenants_client.list_tenant_users(self.data.tenant['id'])
                 ['users'])
         for i in body:
             fetched_user_ids.append(i['id'])
@@ -169,20 +170,21 @@
         user_ids = list()
         fetched_user_ids = list()
         user_ids.append(user['id'])
-        role = self.client.assign_user_role(tenant['id'], user['id'],
-                                            role['id'])['role']
+        role = self.roles_client.assign_user_role(tenant['id'], user['id'],
+                                                  role['id'])['role']
 
         alt_user2 = data_utils.rand_name('second_user')
-        second_user = self.client.create_user(alt_user2, 'password1',
+        alt_password2 = data_utils.rand_password()
+        second_user = self.client.create_user(alt_user2, alt_password2,
                                               self.data.tenant['id'],
                                               'user2@123')['user']
         user_ids.append(second_user['id'])
         self.data.users.append(second_user)
-        role = self.client.assign_user_role(tenant['id'],
-                                            second_user['id'],
-                                            role['id'])['role']
+        role = self.roles_client.assign_user_role(tenant['id'],
+                                                  second_user['id'],
+                                                  role['id'])['role']
         # List of users with roles for the respective tenant ID
-        body = (self.client.list_tenant_users(self.data.tenant['id'])
+        body = (self.tenants_client.list_tenant_users(self.data.tenant['id'])
                 ['users'])
         for i in body:
             fetched_user_ids.append(i['id'])
@@ -198,7 +200,7 @@
         # Test case to check if updating of user password is successful.
         self.data.setup_test_user()
         # Updating the user with new password
-        new_pass = data_utils.rand_name('pass')
+        new_pass = data_utils.rand_password()
         update_user = self.client.update_user_password(
             self.data.user['id'], new_pass)['user']
         self.assertEqual(update_user['id'], self.data.user['id'])
diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py
index a88053d..8fa5a36 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -28,7 +28,7 @@
     def resource_setup(cls):
         super(UsersNegativeTestJSON, cls).resource_setup()
         cls.alt_user = data_utils.rand_name('test_user')
-        cls.alt_password = data_utils.rand_name('pass')
+        cls.alt_password = data_utils.rand_password()
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
     @test.attr(type=['negative'])
@@ -247,4 +247,4 @@
         # List the users with invalid tenant id
         for invalid in invalid_id:
             self.assertRaises(lib_exc.NotFound,
-                              self.client.list_tenant_users, invalid)
+                              self.tenants_client.list_tenant_users, invalid)
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 5e1c3cc..b81bff7 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         for i in range(2):
             cls.project = cls.client.create_project(
                 data_utils.rand_name('project'),
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 260ea54..e022023 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -67,7 +67,8 @@
         users = []
         for i in range(3):
             name = data_utils.rand_name('User')
-            user = self.client.create_user(name)['user']
+            password = data_utils.rand_password()
+            user = self.client.create_user(name, password)['user']
             users.append(user)
             self.addCleanup(self.client.delete_user, user['id'])
             self.groups_client.add_group_user(group['id'], user['id'])
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index b7f37d4..ca91ce5 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -34,7 +34,7 @@
     def resource_setup(cls):
         super(UsersV3TestJSON, cls).resource_setup()
         alt_user = data_utils.rand_name('test_user')
-        alt_password = data_utils.rand_name('pass')
+        alt_password = data_utils.rand_password()
         cls.alt_email = alt_user + '@testmail.tm'
         cls.data.setup_test_domain()
         # Create user with Domain
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index d39fd5f..af9497c 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -161,7 +161,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=project['id'])['user']
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 3be2643..f194d9c 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -31,7 +31,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        cls.u_password = data_utils.rand_name('pass')
+        cls.u_password = data_utils.rand_password()
         cls.domain = cls.client.create_domain(
             data_utils.rand_name('domain'),
             description=data_utils.rand_name('domain-desc'))['domain']
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 7d33d4a..f5b20d5 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s-description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email)['user']
@@ -60,7 +60,7 @@
 
         # Create a user.
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         user = self.client.create_user(user_name,
                                        password=user_password)['user']
         self.addCleanup(self.client.delete_user, user['id'])
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index a8b0af9..bf7ad71 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -55,7 +55,7 @@
         self.trustor_username = data_utils.rand_name('user')
         u_desc = self.trustor_username + 'description'
         u_email = self.trustor_username + '@testmail.xx'
-        self.trustor_password = data_utils.rand_name('pass')
+        self.trustor_password = data_utils.rand_password()
         user = self.client.create_user(
             self.trustor_username,
             description=u_desc,
@@ -115,7 +115,7 @@
             trustor_user_id=self.trustor_user_id,
             trustee_user_id=self.trustee_user_id,
             project_id=self.trustor_project_id,
-            role_names=[self.delegated_role],
+            roles=[{'name': self.delegated_role}],
             impersonation=impersonate,
             expires_at=expires)['trust']
         self.trust_id = trust_create['id']
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 60abde7..6dbd443 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False)['user']
@@ -69,15 +69,15 @@
     def test_update_user_password(self):
         # Creating User to check password updation
         u_name = data_utils.rand_name('user')
-        original_password = data_utils.rand_name('pass')
+        original_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, password=original_password)['user']
         # Delete the User at the end all test methods
         self.addCleanup(self.client.delete_user, user['id'])
         # Update user with new password
-        new_password = data_utils.rand_name('pass1')
-        self.client.update_user_password(user['id'], new_password,
-                                         original_password)
+        new_password = data_utils.rand_password()
+        self.client.update_user_password(user['id'], password=new_password,
+                                         original_password=original_password)
         # TODO(lbragstad): Sleeping after the response status has been checked
         # and the body loaded as JSON allows requests to fail-fast. The sleep
         # is necessary because keystone will err on the side of security and
@@ -109,7 +109,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user_body = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False, project_id=u_project['id'])['user']
diff --git a/tempest/api/identity/admin/v3/test_users_negative.py b/tempest/api/identity/admin/v3/test_users_negative.py
index d40a5b9..4c80bda 100644
--- a/tempest/api/identity/admin/v3/test_users_negative.py
+++ b/tempest/api/identity/admin/v3/test_users_negative.py
@@ -28,7 +28,7 @@
         # Attempt to create a user in a non-existent domain should fail
         u_name = data_utils.rand_name('user')
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         self.assertRaises(lib_exc.NotFound, self.client.create_user,
                           u_name, u_password,
                           email=u_email,
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 0364f3a..1a4c8bb 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -35,7 +35,7 @@
     @classmethod
     def disable_tenant(cls, tenant_name):
         tenant = cls.get_tenant_by_name(tenant_name)
-        cls.client.update_tenant(tenant['id'], enabled=False)
+        cls.tenants_client.update_tenant(tenant['id'], enabled=False)
 
     @classmethod
     def get_user_by_name(cls, name):
@@ -47,7 +47,7 @@
     @classmethod
     def get_tenant_by_name(cls, name):
         try:
-            tenants = cls.client.list_tenants()['tenants']
+            tenants = cls.tenants_client.list_tenants()['tenants']
         except AttributeError:
             tenants = cls.client.list_projects()['projects']
         tenant = [t for t in tenants if t['name'] == name]
@@ -56,7 +56,7 @@
 
     @classmethod
     def get_role_by_name(cls, name):
-        roles = cls.client.list_roles()['roles']
+        roles = cls.roles_client.list_roles()['roles']
         role = [r for r in roles if r['name'] == name]
         if len(role) > 0:
             return role[0]
@@ -75,6 +75,8 @@
         super(BaseIdentityV2Test, cls).setup_clients()
         cls.non_admin_client = cls.os.identity_public_client
         cls.non_admin_token_client = cls.os.token_client
+        cls.non_admin_tenants_client = cls.os.tenants_public_client
+        cls.non_admin_roles_client = cls.os.roles_public_client
 
     @classmethod
     def resource_setup(cls):
@@ -95,11 +97,16 @@
         cls.client = cls.os_adm.identity_client
         cls.non_admin_client = cls.os.identity_client
         cls.token_client = cls.os_adm.token_client
+        cls.tenants_client = cls.os_adm.tenants_client
+        cls.non_admin_tenants_client = cls.os.tenants_client
+        cls.roles_client = cls.os_adm.roles_client
+        cls.non_admin_roles_client = cls.os.roles_client
 
     @classmethod
     def resource_setup(cls):
         super(BaseIdentityV2AdminTest, cls).resource_setup()
-        cls.data = DataGenerator(cls.client)
+        cls.data = DataGenerator(cls.client, cls.tenants_client,
+                                 cls.roles_client)
 
     @classmethod
     def resource_cleanup(cls):
@@ -184,8 +191,11 @@
 
 class DataGenerator(object):
 
-        def __init__(self, client):
+        def __init__(self, client, tenants_client=None, roles_client=None):
             self.client = client
+            # TODO(dmellado) split Datagenerator for v2 and v3
+            self.tenants_client = tenants_client
+            self.roles_client = roles_client
             self.users = []
             self.tenants = []
             self.roles = []
@@ -207,7 +217,7 @@
             """Set up a test user."""
             self.setup_test_tenant()
             self.test_user = data_utils.rand_name('test_user')
-            self.test_password = data_utils.rand_name('pass')
+            self.test_password = data_utils.rand_password()
             self.test_email = self.test_user + '@testmail.tm'
             self.user = self.client.create_user(self.test_user,
                                                 self.test_password,
@@ -219,7 +229,7 @@
             """Set up a test tenant."""
             self.test_tenant = data_utils.rand_name('test_tenant')
             self.test_description = data_utils.rand_name('desc')
-            self.tenant = self.client.create_tenant(
+            self.tenant = self.tenants_client.create_tenant(
                 name=self.test_tenant,
                 description=self.test_description)['tenant']
             self.tenants.append(self.tenant)
@@ -227,14 +237,14 @@
         def setup_test_role(self):
             """Set up a test role."""
             self.test_role = data_utils.rand_name('role')
-            self.role = self.client.create_role(self.test_role)['role']
+            self.role = self.roles_client.create_role(self.test_role)['role']
             self.roles.append(self.role)
 
         def setup_test_v3_user(self):
             """Set up a test v3 user."""
             self.setup_test_project()
             self.test_user = data_utils.rand_name('test_user')
-            self.test_password = data_utils.rand_name('pass')
+            self.test_password = data_utils.rand_password()
             self.test_email = self.test_user + '@testmail.tm'
             self.v3_user = self.client.create_user(
                 self.test_user,
@@ -287,9 +297,9 @@
             for user in self.users:
                 self._try_wrapper(self.client.delete_user, user)
             for tenant in self.tenants:
-                self._try_wrapper(self.client.delete_tenant, tenant)
+                self._try_wrapper(self.tenants_client.delete_tenant, tenant)
             for role in self.roles:
-                self._try_wrapper(self.client.delete_role, role)
+                self._try_wrapper(self.roles_client.delete_role, role)
             for v3_user in self.v3_users:
                 self._try_wrapper(self.client.delete_user, v3_user)
             for v3_project in self.projects:
diff --git a/tempest/api/identity/v2/test_tenants.py b/tempest/api/identity/v2/test_tenants.py
index 1fcff8d..4e31557 100644
--- a/tempest/api/identity/v2/test_tenants.py
+++ b/tempest/api/identity/v2/test_tenants.py
@@ -26,7 +26,7 @@
     @test.idempotent_id('ecae2459-243d-4ba1-ad02-65f15dc82b78')
     def test_list_tenants_returns_only_authorized_tenants(self):
         alt_tenant_name = self.alt_manager.credentials.credentials.tenant_name
-        resp = self.non_admin_client.list_tenants()
+        resp = self.non_admin_tenants_client.list_tenants()
 
         # check that user can see only that tenants that he presents in so user
         # can successfully authenticate using his credentials and tenant name
diff --git a/tempest/api/identity/v3/test_users.py b/tempest/api/identity/v3/test_users.py
index 2bab5d1..93814d3 100644
--- a/tempest/api/identity/v3/test_users.py
+++ b/tempest/api/identity/v3/test_users.py
@@ -50,13 +50,13 @@
         # to change password back. important for allow_tenant_isolation = false
         self.addCleanup(
             self.non_admin_client_for_cleanup.update_user_password,
-            user_id=user_id,
+            user_id,
             password=old_pass,
             original_password=new_pass)
 
         # user updates own password
         self.non_admin_client.update_user_password(
-            user_id=user_id, password=new_pass, original_password=old_pass)
+            user_id, password=new_pass, original_password=old_pass)
 
         # TODO(lbragstad): Sleeping after the response status has been checked
         # and the body loaded as JSON allows requests to fail-fast. The sleep
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index da0ce83..c3205ce 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -70,8 +70,10 @@
         container_format = kwargs.pop('container_format')
         disk_format = kwargs.pop('disk_format')
 
-        image = cls.client.create_image(name, container_format,
-                                        disk_format, **kwargs)
+        image = cls.client.create_image(name=name,
+                                        container_format=container_format,
+                                        disk_format=disk_format,
+                                        **kwargs)
         # Image objects returned by the v1 client have the image
         # data inside a dict that is keyed against 'image'.
         if 'image' in image:
@@ -156,7 +158,7 @@
 
     def _create_image(self):
         name = data_utils.rand_name('image')
-        image = self.os_img_client.create_image(name,
+        image = self.os_img_client.create_image(name=name,
                                                 container_format='bare',
                                                 disk_format='raw')
         image_id = image['id']
diff --git a/tempest/api/image/v2/test_images_negative.py b/tempest/api/image/v2/test_images_negative.py
index 71c8c7a..485942e 100644
--- a/tempest/api/image/v2/test_images_negative.py
+++ b/tempest/api/image/v2/test_images_negative.py
@@ -90,10 +90,12 @@
     def test_register_with_invalid_container_format(self):
         # Negative tests for invalid data supplied to POST /images
         self.assertRaises(lib_exc.BadRequest, self.client.create_image,
-                          'test', 'wrong', 'vhd')
+                          name='test', container_format='wrong',
+                          disk_format='vhd')
 
     @test.attr(type=['negative'])
     @test.idempotent_id('70c6040c-5a97-4111-9e13-e73665264ce1')
     def test_register_with_invalid_disk_format(self):
         self.assertRaises(lib_exc.BadRequest, self.client.create_image,
-                          'test', 'bare', 'wrong')
+                          name='test', container_format='bare',
+                          disk_format='wrong')
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index c5d0d57..64802aa 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -63,7 +63,7 @@
         # one to avoid the negative effect.
         agent_status = {'admin_state_up': origin_status}
         body = self.admin_client.update_agent(agent_id=self.agent['id'],
-                                              agent_info=agent_status)
+                                              agent=agent_status)
         updated_status = body['agent']['admin_state_up']
         self.assertEqual(origin_status, updated_status)
 
@@ -73,7 +73,7 @@
         description = 'description for update agent.'
         agent_description = {'description': description}
         body = self.admin_client.update_agent(agent_id=self.agent['id'],
-                                              agent_info=agent_description)
+                                              agent=agent_description)
         self.addCleanup(self._restore_agent)
         updated_description = body['agent']['description']
         self.assertEqual(updated_description, description)
@@ -84,4 +84,4 @@
         description = self.agent['description'] or ''
         origin_agent = {'description': description}
         self.admin_client.update_agent(agent_id=self.agent['id'],
-                                       agent_info=origin_agent)
+                                       agent=origin_agent)
diff --git a/tempest/api/network/admin/test_negative_quotas.py b/tempest/api/network/admin/test_negative_quotas.py
index 5c4c421..47da08c 100644
--- a/tempest/api/network/admin/test_negative_quotas.py
+++ b/tempest/api/network/admin/test_negative_quotas.py
@@ -29,6 +29,7 @@
 
         quota_driver = neutron.db.quota_db.DbQuotaDriver
     """
+    force_tenant_isolation = True
 
     @classmethod
     def skip_checks(cls):
@@ -45,9 +46,9 @@
     @test.idempotent_id('644f4e1b-1bf9-4af0-9fd8-eb56ac0f51cf')
     def test_network_quota_exceeding(self):
         # Set the network quota to two
-        self.admin_client.update_quotas(self.networks_client.tenant_id,
-                                        network=2)
-        self.addCleanup(self.admin_client.reset_quotas,
+        self.admin_quotas_client.update_quotas(self.networks_client.tenant_id,
+                                               network=2)
+        self.addCleanup(self.admin_quotas_client.reset_quotas,
                         self.networks_client.tenant_id)
 
         # Create two networks
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 4a25206..45d35cf 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -57,14 +57,14 @@
         self.addCleanup(self.identity_utils.delete_project, project_id)
 
         # Change quotas for tenant
-        quota_set = self.admin_client.update_quotas(project_id,
-                                                    **new_quotas)['quota']
-        self.addCleanup(self.admin_client.reset_quotas, project_id)
+        quota_set = self.admin_quotas_client.update_quotas(
+            project_id, **new_quotas)['quota']
+        self.addCleanup(self.admin_quotas_client.reset_quotas, project_id)
         for key, value in six.iteritems(new_quotas):
             self.assertEqual(value, quota_set[key])
 
         # Confirm our tenant is listed among tenants with non default quotas
-        non_default_quotas = self.admin_client.list_quotas()
+        non_default_quotas = self.admin_quotas_client.list_quotas()
         found = False
         for qs in non_default_quotas['quotas']:
             if qs['tenant_id'] == project_id:
@@ -72,14 +72,14 @@
         self.assertTrue(found)
 
         # Confirm from API quotas were changed as requested for tenant
-        quota_set = self.admin_client.show_quotas(project_id)
+        quota_set = self.admin_quotas_client.show_quotas(project_id)
         quota_set = quota_set['quota']
         for key, value in six.iteritems(new_quotas):
             self.assertEqual(value, quota_set[key])
 
         # Reset quotas to default and confirm
-        self.admin_client.reset_quotas(project_id)
-        non_default_quotas = self.admin_client.list_quotas()
+        self.admin_quotas_client.reset_quotas(project_id)
+        non_default_quotas = self.admin_quotas_client.list_quotas()
         for q in non_default_quotas['quotas']:
             self.assertNotEqual(project_id, q['tenant_id'])
 
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index c5a3dff..f1fd3e9 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -74,6 +74,7 @@
         cls.networks_client = cls.os.networks_client
         cls.subnets_client = cls.os.subnets_client
         cls.ports_client = cls.os.ports_client
+        cls.quotas_client = cls.os.network_quotas_client
         cls.floating_ips_client = cls.os.floating_ips_client
 
     @classmethod
@@ -274,6 +275,7 @@
         cls.admin_networks_client = cls.os_adm.networks_client
         cls.admin_subnets_client = cls.os_adm.subnets_client
         cls.admin_ports_client = cls.os_adm.ports_client
+        cls.admin_quotas_client = cls.os_adm.network_quotas_client
         cls.admin_floating_ips_client = cls.os_adm.floating_ips_client
         cls.admin_metering_labels_client = cls.os_adm.metering_labels_client
         cls.admin_metering_label_rules_client = (
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index ed191b6..406ad44 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -301,7 +301,7 @@
 
         test_routes.sort(key=lambda x: x['destination'])
         extra_route = self.client.update_extra_routes(router['id'],
-                                                      test_routes)
+                                                      routes=test_routes)
         show_body = self.client.show_router(router['id'])
         # Assert the number of routes
         self.assertEqual(routes_num, len(extra_route['router']['routes']))
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index a614c76..8466e11 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -89,7 +89,7 @@
                 server_id = body['physical_resource_id']
                 LOG.debug('Console output for %s', server_id)
                 output = cls.servers_client.get_console_output(
-                    server_id, None)['output']
+                    server_id)['output']
                 LOG.debug(output)
             raise e
 
diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index bbd01f0..8b617ac 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -77,7 +77,7 @@
     @classmethod
     def create_image(cls, client):
         body = client.create_image(
-            data_utils.rand_name('image'), container_format='bare',
+            name=data_utils.rand_name('image'), container_format='bare',
             disk_format='raw', visibility='private')
         # TODO(jswarren) Move ['image'] up to initial body value assignment
         # once both v1 and v2 glance clients include the full response
diff --git a/tempest/clients.py b/tempest/clients.py
index 955748b..761f6f7 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -70,7 +70,6 @@
 from tempest import manager
 from tempest.services.baremetal.v1.json.baremetal_client import \
     BaremetalClient
-from tempest.services import botoclients
 from tempest.services.compute.json.floating_ips_client import \
     FloatingIPsClient as ComputeFloatingIPsClient
 from tempest.services.compute.json.keypairs_client import KeyPairsClient
@@ -89,6 +88,10 @@
     DatabaseVersionsClient
 from tempest.services.identity.v2.json.identity_client import \
     IdentityClient
+from tempest.services.identity.v2.json.roles_client import \
+    RolesClient
+from tempest.services.identity.v2.json.tenants_client import \
+    TenantsClient
 from tempest.services.identity.v3.json.credentials_client import \
     CredentialsClient as CredentialsV3Client
 from tempest.services.identity.v3.json.endpoints_client import \
@@ -114,6 +117,8 @@
 from tempest.services.network.json.network_client import NetworkClient
 from tempest.services.network.json.networks_client import NetworksClient
 from tempest.services.network.json.ports_client import PortsClient
+from tempest.services.network.json.quotas_client import QuotasClient \
+    as NetworkQuotasClient
 from tempest.services.network.json.subnets_client import SubnetsClient
 from tempest.services.object_storage.account_client import AccountClient
 from tempest.services.object_storage.container_client import ContainerClient
@@ -229,6 +234,14 @@
             build_interval=CONF.network.build_interval,
             build_timeout=CONF.network.build_timeout,
             **self.default_params)
+        self.network_quotas_client = NetworkQuotasClient(
+            self.auth_provider,
+            CONF.network.catalog_type,
+            CONF.network.region or CONF.identity.region,
+            endpoint_type=CONF.network.endpoint_type,
+            build_interval=CONF.network.build_interval,
+            build_timeout=CONF.network.build_timeout,
+            **self.default_params)
         self.floating_ips_client = FloatingIPsClient(
             self.auth_provider,
             CONF.network.catalog_type,
@@ -306,15 +319,6 @@
         self.negative_client = negative_rest_client.NegativeRestClient(
             self.auth_provider, service, **self.default_params)
 
-        # Generating EC2 credentials in tempest is only supported
-        # with identity v2
-        if CONF.identity_feature_enabled.api_v2 and \
-                CONF.identity.auth_version == 'v2':
-            # EC2 and S3 clients, if used, will check configured AWS
-            # credentials and generate new ones if needed
-            self.ec2api_client = botoclients.APIClientEC2(self.identity_client)
-            self.s3_client = botoclients.ObjectClientS3(self.identity_client)
-
     def _set_compute_clients(self):
         params = {
             'service': CONF.compute.catalog_type,
@@ -423,12 +427,20 @@
         # Client uses admin endpoint type of Keystone API v2
         self.identity_client = IdentityClient(self.auth_provider,
                                               **params_v2_admin)
+        self.tenants_client = TenantsClient(self.auth_provider,
+                                            **params_v2_admin)
+        self.roles_client = RolesClient(self.auth_provider,
+                                        **params_v2_admin)
         params_v2_public = params.copy()
         params_v2_public['endpoint_type'] = (
             CONF.identity.v2_public_endpoint_type)
         # Client uses public endpoint type of Keystone API v2
         self.identity_public_client = IdentityClient(self.auth_provider,
                                                      **params_v2_public)
+        self.tenants_public_client = TenantsClient(self.auth_provider,
+                                                   **params_v2_public)
+        self.roles_public_client = RolesClient(self.auth_provider,
+                                               **params_v2_public)
         params_v3 = params.copy()
         params_v3['endpoint_type'] = CONF.identity.v3_endpoint_type
         # Clients below use the endpoint type of Keystone API v3
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index 613fb26..b90ee04 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -93,6 +93,8 @@
 from tempest import config
 from tempest import exceptions as exc
 from tempest.services.identity.v2.json import identity_client
+from tempest.services.identity.v2.json import roles_client
+from tempest.services.identity.v2.json import tenants_client
 from tempest.services.network.json import network_client
 from tempest.services.network.json import networks_client
 from tempest.services.network.json import subnets_client
@@ -138,6 +140,20 @@
         endpoint_type='adminURL',
         **params
     )
+    tenants_admin = tenants_client.TenantsClient(
+        _auth,
+        CONF.identity.catalog_type,
+        CONF.identity.region,
+        endpoint_type='adminURL',
+        **params
+    )
+    roles_admin = roles_client.RolesClient(
+        _auth,
+        CONF.identity.catalog_type,
+        CONF.identity.region,
+        endpoint_type='adminURL',
+        **params
+    )
     network_admin = None
     networks_admin = None
     subnets_admin = None
@@ -163,14 +179,14 @@
             CONF.network.region or CONF.identity.region,
             endpoint_type='adminURL',
             **params)
-    return (identity_admin, neutron_iso_networks, network_admin,
-            networks_admin, subnets_admin)
+    return (identity_admin, tenants_admin, roles_admin, neutron_iso_networks,
+            network_admin, networks_admin, subnets_admin)
 
 
 def create_resources(opts, resources):
-    (identity_admin, neutron_iso_networks,
+    (identity_admin, tenants_admin, roles_admin, neutron_iso_networks,
      network_admin, networks_admin, subnets_admin) = get_admin_clients(opts)
-    roles = identity_admin.list_roles()['roles']
+    roles = roles_admin.list_roles()['roles']
     for u in resources['users']:
         u['role_ids'] = []
         for r in u.get('roles', ()):
@@ -180,22 +196,22 @@
                 msg = "Role: %s doesn't exist" % r
                 raise exc.InvalidConfiguration(msg)
             u['role_ids'] += [role['id']]
-    existing = [x['name'] for x in identity_admin.list_tenants()['tenants']]
+    existing = [x['name'] for x in tenants_admin.list_tenants()['tenants']]
     for tenant in resources['tenants']:
         if tenant not in existing:
-            identity_admin.create_tenant(tenant)
+            tenants_admin.create_tenant(tenant)
         else:
             LOG.warn("Tenant '%s' already exists in this environment" % tenant)
     LOG.info('Tenants created')
     for u in resources['users']:
         try:
-            tenant = identity.get_tenant_by_name(identity_admin, u['tenant'])
+            tenant = identity.get_tenant_by_name(tenants_admin, u['tenant'])
         except tempest_lib.exceptions.NotFound:
             LOG.error("Tenant: %s - not found" % u['tenant'])
             continue
         while True:
             try:
-                identity.get_user_by_username(identity_admin,
+                identity.get_user_by_username(tenants_admin,
                                               tenant['id'], u['name'])
             except tempest_lib.exceptions.NotFound:
                 identity_admin.create_user(
@@ -211,7 +227,7 @@
     LOG.info('Users created')
     if neutron_iso_networks:
         for u in resources['users']:
-            tenant = identity.get_tenant_by_name(identity_admin, u['tenant'])
+            tenant = identity.get_tenant_by_name(tenants_admin, u['tenant'])
             network_name, router_name = create_network_resources(
                 network_admin, networks_admin, subnets_admin, tenant['id'],
                 u['name'])
@@ -220,19 +236,19 @@
         LOG.info('Networks created')
     for u in resources['users']:
         try:
-            tenant = identity.get_tenant_by_name(identity_admin, u['tenant'])
+            tenant = identity.get_tenant_by_name(tenants_admin, u['tenant'])
         except tempest_lib.exceptions.NotFound:
             LOG.error("Tenant: %s - not found" % u['tenant'])
             continue
         try:
-            user = identity.get_user_by_username(identity_admin,
+            user = identity.get_user_by_username(tenants_admin,
                                                  tenant['id'], u['name'])
         except tempest_lib.exceptions.NotFound:
             LOG.error("User: %s - not found" % u['user'])
             continue
         for r in u['role_ids']:
             try:
-                identity_admin.assign_user_role(tenant['id'], user['id'], r)
+                roles_admin.assign_user_role(tenant['id'], user['id'], r)
             except tempest_lib.exceptions.Conflict:
                 # don't care if it's already assigned
                 pass
@@ -341,7 +357,7 @@
                 resources['users'].append({
                     'tenant': tenant,
                     'name': user,
-                    'pass': data_utils.rand_name(),
+                    'pass': data_utils.rand_password(),
                     'prefix': user_group['prefix'],
                     'roles': user_group['roles']
                 })
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index 1c8ddcb..b79bff4 100644
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -176,17 +176,18 @@
             svc.run()
 
     def _init_admin_ids(self):
-        id_cl = self.admin_mgr.identity_client
+        tn_cl = self.admin_mgr.tenants_client
+        rl_cl = self.admin_mgr.roles_client
 
-        tenant = identity.get_tenant_by_name(id_cl,
+        tenant = identity.get_tenant_by_name(tn_cl,
                                              CONF.auth.admin_tenant_name)
         self.admin_tenant_id = tenant['id']
 
-        user = identity.get_user_by_username(id_cl, self.admin_tenant_id,
+        user = identity.get_user_by_username(tn_cl, self.admin_tenant_id,
                                              CONF.auth.admin_username)
         self.admin_id = user['id']
 
-        roles = id_cl.list_roles()['roles']
+        roles = rl_cl.list_roles()['roles']
         for role in roles:
             if role['name'] == CONF.identity.admin_role:
                 self.admin_role_id = role['id']
@@ -221,8 +222,9 @@
 
     def _add_admin(self, tenant_id):
         id_cl = self.admin_mgr.identity_client
+        rl_cl = self.admin_mgr.roles_client
         needs_role = True
-        roles = id_cl.list_user_roles(tenant_id, self.admin_id)['roles']
+        roles = rl_cl.list_user_roles(tenant_id, self.admin_id)['roles']
         for role in roles:
             if role['id'] == self.admin_role_id:
                 needs_role = False
@@ -247,9 +249,9 @@
                               "exists, exception: %s" % ex)
 
     def _tenant_exists(self, tenant_id):
-        id_cl = self.admin_mgr.identity_client
+        tn_cl = self.admin_mgr.tenants_client
         try:
-            t = id_cl.show_tenant(tenant_id)
+            t = tn_cl.show_tenant(tenant_id)
             LOG.debug("Tenant is: %s" % str(t))
             return True
         except Exception as ex:
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 4fd92ab..c2f3885 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -85,10 +85,10 @@
 def _get_network_id(net_name, tenant_name):
     am = credentials.AdminManager()
     net_cl = am.networks_client
-    id_cl = am.identity_client
+    tn_cl = am.tenants_client
 
     networks = net_cl.list_networks()
-    tenant = identity.get_tenant_by_name(id_cl, tenant_name)
+    tenant = identity.get_tenant_by_name(tn_cl, tenant_name)
     t_id = tenant['id']
     n_id = None
     for net in networks['networks']:
@@ -855,12 +855,15 @@
             self.data['users'][user['id']] = user['name']
 
 
-class RoleService(IdentityService):
+class RoleService(BaseService):
+
+    def __init__(self, manager, **kwargs):
+        super(RoleService, self).__init__(kwargs)
+        self.client = manager.roles_client
 
     def list(self):
-        client = self.client
         try:
-            roles = client.list_roles()['roles']
+            roles = self.client.list_roles()['roles']
             # reconcile roles with saved state and never list admin role
             if not self.is_save_state:
                 roles = [role for role in roles if
@@ -874,11 +877,10 @@
             return []
 
     def delete(self):
-        client = self.client
         roles = self.list()
         for role in roles:
             try:
-                client.delete_role(role['id'])
+                self.client.delete_role(role['id'])
             except Exception:
                 LOG.exception("Delete Role exception.")
 
@@ -893,11 +895,14 @@
             self.data['roles'][role['id']] = role['name']
 
 
-class TenantService(IdentityService):
+class TenantService(BaseService):
+
+    def __init__(self, manager, **kwargs):
+        super(TenantService, self).__init__(kwargs)
+        self.client = manager.tenants_client
 
     def list(self):
-        client = self.client
-        tenants = client.list_tenants()['tenants']
+        tenants = self.client.list_tenants()['tenants']
         if not self.is_save_state:
             tenants = [tenant for tenant in tenants if (tenant['id']
                        not in self.saved_state_json['tenants'].keys()
@@ -911,11 +916,10 @@
         return tenants
 
     def delete(self):
-        client = self.client
         tenants = self.list()
         for tenant in tenants:
             try:
-                client.delete_tenant(tenant['id'])
+                self.client.delete_tenant(tenant['id'])
             except Exception:
                 LOG.exception("Delete Tenant exception.")
 
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index c5e4a7e..cdd0044 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -128,6 +128,8 @@
 from tempest.services.compute.json import security_group_rules_client
 from tempest.services.compute.json import servers_client
 from tempest.services.identity.v2.json import identity_client
+from tempest.services.identity.v2.json import roles_client
+from tempest.services.identity.v2.json import tenants_client
 from tempest.services.image.v2.json import images_client
 from tempest.services.network.json import network_client
 from tempest.services.network.json import subnets_client
@@ -199,6 +201,18 @@
             CONF.identity.region,
             endpoint_type='adminURL',
             **default_params_with_timeout_values)
+        self.tenants = tenants_client.TenantsClient(
+            _auth,
+            CONF.identity.catalog_type,
+            CONF.identity.region,
+            endpoint_type='adminURL',
+            **default_params_with_timeout_values)
+        self.roles = roles_client.RolesClient(
+            _auth,
+            CONF.identity.catalog_type,
+            CONF.identity.region,
+            endpoint_type='adminURL',
+            **default_params_with_timeout_values)
         self.servers = servers_client.ServersClient(_auth,
                                                     **compute_params)
         self.flavors = flavors_client.FlavorsClient(_auth,
@@ -291,11 +305,11 @@
     Don't create the tenants if they already exist.
     """
     admin = keystone_admin()
-    body = admin.identity.list_tenants()['tenants']
+    body = admin.tenants.list_tenants()['tenants']
     existing = [x['name'] for x in body]
     for tenant in tenants:
         if tenant not in existing:
-            admin.identity.create_tenant(tenant)['tenant']
+            admin.tenants.create_tenant(tenant)['tenant']
         else:
             LOG.warn("Tenant '%s' already exists in this environment" % tenant)
 
@@ -303,8 +317,8 @@
 def destroy_tenants(tenants):
     admin = keystone_admin()
     for tenant in tenants:
-        tenant_id = identity.get_tenant_by_name(admin.identity, tenant)['id']
-        admin.identity.delete_tenant(tenant_id)
+        tenant_id = identity.get_tenant_by_name(admin.tenant, tenant)['id']
+        admin.tenants.delete_tenant(tenant_id)
 
 ##############
 #
@@ -332,11 +346,11 @@
 
 def _assign_swift_role(user, swift_role):
     admin = keystone_admin()
-    roles = admin.identity.list_roles()
+    roles = admin.roles.list_roles()
     role = next(r for r in roles if r['name'] == swift_role)
     LOG.debug(USERS[user])
     try:
-        admin.identity.assign_user_role(
+        admin.roles.assign_user_role(
             USERS[user]['tenant_id'],
             USERS[user]['id'],
             role['id'])
@@ -355,7 +369,7 @@
     admin = keystone_admin()
     for u in users:
         try:
-            tenant = identity.get_tenant_by_name(admin.identity, u['tenant'])
+            tenant = identity.get_tenant_by_name(admin.tenants, u['tenant'])
         except lib_exc.NotFound:
             LOG.error("Tenant: %s - not found" % u['tenant'])
             continue
@@ -374,7 +388,7 @@
 def destroy_users(users):
     admin = keystone_admin()
     for user in users:
-        tenant_id = identity.get_tenant_by_name(admin.identity,
+        tenant_id = identity.get_tenant_by_name(admin.tenants,
                                                 user['tenant'])['id']
         user_id = identity.get_user_by_username(admin.identity,
                                                 tenant_id, user['name'])['id']
@@ -386,7 +400,7 @@
     LOG.info("Collecting users")
     admin = keystone_admin()
     for u in users:
-        tenant = identity.get_tenant_by_name(admin.identity, u['tenant'])
+        tenant = identity.get_tenant_by_name(admin.tenants, u['tenant'])
         u['tenant_id'] = tenant['id']
         USERS[u['name']] = u
         body = identity.get_user_by_username(admin.identity,
@@ -485,24 +499,26 @@
                 for network_name, body in found['addresses'].items():
                     for addr in body:
                         ip = addr['addr']
-                        # If floatingip_for_ssh is at True, it's assumed
-                        # you want to use the floating IP to reach the server,
-                        # fallback to fixed IP, then other type.
+                        # Use floating IP, fixed IP or other type to
+                        # reach the server.
                         # This is useful in multi-node environment.
-                        if CONF.compute.use_floatingip_for_ssh:
+                        if CONF.validation.connect_method == 'floating':
                             if addr.get('OS-EXT-IPS:type',
                                         'floating') == 'floating':
                                 self._ping_ip(ip, 60)
                                 _floating_is_alive = True
-                        elif addr.get('OS-EXT-IPS:type', 'fixed') == 'fixed':
-                            namespace = _get_router_namespace(client,
-                                                              network_name)
-                            self._ping_ip(ip, 60, namespace)
+                        elif CONF.validation.connect_method == 'fixed':
+                            if addr.get('OS-EXT-IPS:type',
+                                        'fixed') == 'fixed':
+                                namespace = _get_router_namespace(client,
+                                                                  network_name)
+                                self._ping_ip(ip, 60, namespace)
                         else:
                             self._ping_ip(ip, 60)
-                # if floatingip_for_ssh is at True, validate found a
-                # floating IP and ping worked.
-                if CONF.compute.use_floatingip_for_ssh:
+                # If CONF.validation.connect_method is floating, validate
+                # that the floating IP is attached to the server and the
+                # the server is pingable.
+                if CONF.validation.connect_method == 'floating':
                     self.assertTrue(_floating_is_alive,
                                     "Server %s has no floating IP." %
                                     server['name'])
@@ -895,8 +911,8 @@
         client.servers.wait_for_server_status(server_id, 'ACTIVE')
         # create security group(s) after server spawning
         for secgroup in server['secgroups']:
-            client.servers.add_security_group(server_id, secgroup)
-        if CONF.compute.use_floatingip_for_ssh:
+            client.servers.add_security_group(server_id, name=secgroup)
+        if CONF.validation.connect_method == 'floating':
             floating_ip_pool = server.get('floating_ip_pool')
             floating_ip = client.floating_ips.create_floating_ip(
                 pool_name=floating_ip_pool)['floating_ip']
diff --git a/tempest/cmd/run_stress.py b/tempest/cmd/run_stress.py
old mode 100755
new mode 100644
index 80f1b85..f99e5d9
--- a/tempest/cmd/run_stress.py
+++ b/tempest/cmd/run_stress.py
@@ -23,6 +23,7 @@
     # unittest in python 2.6 does not contain loader, so uses unittest2
     from unittest2 import loader
 
+from cliff import command
 from oslo_log import log as logging
 from oslo_serialization import jsonutils as json
 from testtools import testsuite
@@ -70,29 +71,42 @@
     return tests
 
 
-parser = argparse.ArgumentParser(description='Run stress tests')
-parser.add_argument('-d', '--duration', default=300, type=int,
-                    help="Duration of test in secs")
-parser.add_argument('-s', '--serial', action='store_true',
-                    help="Trigger running tests serially")
-parser.add_argument('-S', '--stop', action='store_true',
-                    default=False, help="Stop on first error")
-parser.add_argument('-n', '--number', type=int,
-                    help="How often an action is executed for each process")
-group = parser.add_mutually_exclusive_group(required=True)
-group.add_argument('-a', '--all', action='store_true',
-                   help="Execute all stress tests")
-parser.add_argument('-T', '--type',
-                    help="Filters tests of a certain type (e.g. gate)")
-parser.add_argument('-i', '--call-inherited', action='store_true',
-                    default=False,
-                    help="Call also inherited function with stress attribute")
-group.add_argument('-t', "--tests", nargs='?',
-                   help="Name of the file with test description")
+class TempestRunStress(command.Command):
+
+    def get_parser(self, prog_name):
+        pa = super(TempestRunStress, self).get_parser(prog_name)
+        pa = add_arguments(pa)
+        return pa
+
+    def take_action(self, pa):
+        return action(pa)
 
 
-def main():
-    ns = parser.parse_args()
+def add_arguments(parser):
+    parser.add_argument('-d', '--duration', default=300, type=int,
+                        help="Duration of test in secs")
+    parser.add_argument('-s', '--serial', action='store_true',
+                        help="Trigger running tests serially")
+    parser.add_argument('-S', '--stop', action='store_true',
+                        default=False, help="Stop on first error")
+    parser.add_argument('-n', '--number', type=int,
+                        help="How often an action is executed for each "
+                        "process")
+    group = parser.add_mutually_exclusive_group(required=True)
+    group.add_argument('-a', '--all', action='store_true',
+                       help="Execute all stress tests")
+    parser.add_argument('-T', '--type',
+                        help="Filters tests of a certain type (e.g. gate)")
+    parser.add_argument('-i', '--call-inherited', action='store_true',
+                        default=False,
+                        help="Call also inherited function with stress "
+                        "attribute")
+    group.add_argument('-t', "--tests", nargs='?',
+                       help="Name of the file with test description")
+    return parser
+
+
+def action(ns):
     result = 0
     if not ns.all:
         tests = json.load(open(ns.tests, 'r'))
@@ -121,6 +135,15 @@
     return result
 
 
+def main():
+    LOG.warning("Deprecated: Use 'tempest run-stress' instead. "
+                "The old entrypoint will be removed in a future release.")
+    parser = argparse.ArgumentParser(description='Run stress tests')
+    pa = add_arguments(parser)
+    ns = pa.parse_args()
+    return action(ns)
+
+
 if __name__ == "__main__":
     try:
         sys.exit(main())
diff --git a/tempest/common/cred_client.py b/tempest/common/cred_client.py
index 13baafb..a33732e 100644
--- a/tempest/common/cred_client.py
+++ b/tempest/common/cred_client.py
@@ -31,9 +31,14 @@
      admin credentials used for generating credentials.
     """
 
-    def __init__(self, identity_client):
+    def __init__(self, identity_client, projects_client=None,
+                 roles_client=None):
         # The client implies version and credentials
         self.identity_client = identity_client
+        # this is temporary until the v3 project client is
+        # separated, then projects_client will become mandatory
+        self.projects_client = projects_client or identity_client
+        self.roles_client = roles_client or identity_client
 
     def create_user(self, username, password, project, email):
         user = self.identity_client.create_user(
@@ -56,7 +61,7 @@
 
     def create_user_role(self, role_name):
         if not self._check_role_exists(role_name):
-            self.identity_client.create_role(role_name)
+            self.roles_client.create_role(role_name)
 
     def assign_user_role(self, user, project, role_name):
         role = self._check_role_exists(role_name)
@@ -64,8 +69,8 @@
             msg = 'No "%s" role found' % role_name
             raise lib_exc.NotFound(msg)
         try:
-            self.identity_client.assign_user_role(project['id'], user['id'],
-                                                  role['id'])
+            self.roles_client.assign_user_role(project['id'], user['id'],
+                                               role['id'])
         except lib_exc.Conflict:
             LOG.debug("Role %s already assigned on project %s for user %s" % (
                 role['id'], project['id'], user['id']))
@@ -85,14 +90,19 @@
         self.identity_client.delete_user(user_id)
 
     def _list_roles(self):
-        roles = self.identity_client.list_roles()['roles']
+        roles = self.roles_client.list_roles()['roles']
         return roles
 
 
 class V2CredsClient(CredsClient):
 
+    def __init__(self, identity_client, projects_client, roles_client):
+        super(V2CredsClient, self).__init__(identity_client,
+                                            projects_client,
+                                            roles_client)
+
     def create_project(self, name, description):
-        tenant = self.identity_client.create_tenant(
+        tenant = self.projects_client.create_tenant(
             name=name, description=description)['tenant']
         return tenant
 
@@ -108,7 +118,7 @@
             password=password)
 
     def delete_project(self, project_id):
-        self.identity_client.delete_tenant(project_id)
+        self.projects_client.delete_tenant(project_id)
 
 
 class V3CredsClient(CredsClient):
@@ -152,8 +162,11 @@
         return roles
 
 
-def get_creds_client(identity_client, project_domain_name=None):
+def get_creds_client(identity_client,
+                     projects_client=None,
+                     roles_client=None,
+                     project_domain_name=None):
     if isinstance(identity_client, v2_identity.IdentityClient):
-        return V2CredsClient(identity_client)
+        return V2CredsClient(identity_client, projects_client, roles_client)
     else:
         return V3CredsClient(identity_client, project_domain_name)
diff --git a/tempest/common/credentials_factory.py b/tempest/common/credentials_factory.py
index 95dcafc..5d290d4 100644
--- a/tempest/common/credentials_factory.py
+++ b/tempest/common/credentials_factory.py
@@ -11,8 +11,6 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 
-import os
-
 from oslo_concurrency import lockutils
 from oslo_log import log as logging
 from tempest_lib import auth
@@ -170,8 +168,7 @@
             admin_creds=admin_creds,
             **_get_dynamic_provider_params())
     else:
-        if (CONF.auth.test_accounts_file and
-                os.path.isfile(CONF.auth.test_accounts_file)):
+        if CONF.auth.test_accounts_file:
             # Most params are not relevant for pre-created accounts
             return preprov_creds.PreProvisionedCredentialProvider(
                 name=name, identity_version=identity_version,
@@ -193,8 +190,7 @@
     if CONF.auth.use_dynamic_credentials:
         return is_admin
     # Check whether test accounts file has the admin specified or not
-    elif (CONF.auth.test_accounts_file and
-            os.path.isfile(CONF.auth.test_accounts_file)):
+    elif CONF.auth.test_accounts_file:
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
             identity_version=identity_version, name='check_admin',
             **_get_preprov_provider_params())
@@ -219,8 +215,7 @@
     if CONF.auth.use_dynamic_credentials:
         return True
     # Check whether test accounts file has the admin specified or not
-    if (CONF.auth.test_accounts_file and
-            os.path.isfile(CONF.auth.test_accounts_file)):
+    if CONF.auth.test_accounts_file:
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
             identity_version=identity_version, name='check_alt',
             **_get_preprov_provider_params())
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index e950c3e..c52aa41 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -57,7 +57,9 @@
         self._creds = {}
         self.ports = []
         self.default_admin_creds = admin_creds
-        (self.identity_admin_client, self.network_admin_client,
+        (self.identity_admin_client, self.tenants_admin_client,
+         self.roles_admin_client,
+         self.network_admin_client,
          self.networks_admin_client,
          self.subnets_admin_client,
          self.ports_admin_client) = self._get_admin_clients()
@@ -69,7 +71,10 @@
                 self.default_admin_creds.project_domain_name or
                 self.credentials_domain)
         self.creds_client = cred_client.get_creds_client(
-            self.identity_admin_client, self.creds_domain_name)
+            self.identity_admin_client,
+            self.tenants_admin_client,
+            self.roles_admin_client,
+            self.creds_domain_name)
 
     def _get_admin_clients(self):
         """Returns a tuple with instances of the following admin clients
@@ -80,10 +85,11 @@
         """
         os = clients.Manager(self.default_admin_creds)
         if self.identity_version == 'v2':
-            return (os.identity_client, os.network_client, os.networks_client,
-                    os.subnets_client, os.ports_client)
+            return (os.identity_client, os.tenants_client, os.roles_client,
+                    os.network_client, os.networks_client, os.subnets_client,
+                    os.ports_client)
         else:
-            return (os.identity_v3_client, os.network_client,
+            return (os.identity_v3_client, None, None, os.network_client,
                     os.networks_client, os.subnets_client, os.ports_client)
 
     def _create_creds(self, suffix="", admin=False, roles=None):
diff --git a/tempest/common/preprov_creds.py b/tempest/common/preprov_creds.py
index 74cc3f0..34af31e 100644
--- a/tempest/common/preprov_creds.py
+++ b/tempest/common/preprov_creds.py
@@ -31,8 +31,13 @@
 
 
 def read_accounts_yaml(path):
-    with open(path, 'r') as yaml_file:
-        accounts = yaml.load(yaml_file)
+    try:
+        with open(path, 'r') as yaml_file:
+            accounts = yaml.load(yaml_file)
+    except IOError:
+        raise exceptions.InvalidConfiguration(
+            'The path for the test accounts file: %s '
+            'could not be found' % path)
     return accounts
 
 
@@ -74,7 +79,7 @@
             identity_version=identity_version, name=name,
             admin_role=admin_role, credentials_domain=credentials_domain)
         self.test_accounts_file = test_accounts_file
-        if test_accounts_file and os.path.isfile(test_accounts_file):
+        if test_accounts_file:
             accounts = read_accounts_yaml(self.test_accounts_file)
             self.use_default_creds = False
         else:
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 025b79f..b76c356 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -31,7 +31,7 @@
     # NOTE(afazekas): It should always get an address instead of server
     def __init__(self, server, username, password=None, pkey=None):
         ssh_timeout = CONF.validation.ssh_timeout
-        network = CONF.compute.network_for_ssh
+        network = CONF.validation.network_for_ssh
         ip_version = CONF.validation.ip_version_for_ssh
         connect_timeout = CONF.validation.connect_timeout
         if isinstance(server, six.string_types):
@@ -51,7 +51,7 @@
     def exec_command(self, cmd):
         # Shell options below add more clearness on failures,
         # path is extended for some non-cirros guest oses (centos7)
-        cmd = CONF.compute.ssh_shell_prologue + " " + cmd
+        cmd = CONF.validation.ssh_shell_prologue + " " + cmd
         LOG.debug("Remote command: %s" % cmd)
         return self.ssh_client.exec_command(cmd)
 
@@ -73,7 +73,7 @@
             return output.split()[1]
 
     def get_number_of_vcpus(self):
-        output = self.exec_command('grep -c processor /proc/cpuinfo')
+        output = self.exec_command('grep -c ^processor /proc/cpuinfo')
         return int(output)
 
     def get_partitions(self):
@@ -94,8 +94,8 @@
         cmd = 'sudo sh -c "echo \\"%s\\" >/dev/console"' % message
         return self.exec_command(cmd)
 
-    def ping_host(self, host, count=CONF.compute.ping_count,
-                  size=CONF.compute.ping_size, nic=None):
+    def ping_host(self, host, count=CONF.validation.ping_count,
+                  size=CONF.validation.ping_size, nic=None):
         addr = netaddr.IPAddress(host)
         cmd = 'ping6' if addr.version == 6 else 'ping'
         if nic:
diff --git a/tempest/config.py b/tempest/config.py
index a6212fb..8f2ca4b 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -17,9 +17,10 @@
 
 import logging as std_logging
 import os
+import tempfile
 
+from oslo_concurrency import lockutils
 from oslo_config import cfg
-
 from oslo_log import log as logging
 
 from tempest.test_discover import plugins
@@ -231,12 +232,6 @@
     cfg.StrOpt('flavor_ref_alt',
                default="2",
                help='Valid secondary flavor to be used in tests.'),
-    cfg.StrOpt('image_ssh_user',
-               default="root",
-               help="User name used to authenticate to an instance."),
-    cfg.StrOpt('image_ssh_password',
-               default="password",
-               help="Password used to authenticate to an instance."),
     cfg.IntOpt('build_interval',
                default=1,
                help="Time in seconds between build status checks."),
@@ -245,41 +240,6 @@
                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',
-               choices=('keypair', 'configured', 'adminpass', 'disabled'),
-               help="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 password. "
-                    "Adminpass: use the injected adminPass. "
-                    "Disabled: avoid using ssh when it is an option."),
-    cfg.StrOpt('ssh_connect_method',
-               default='floating',
-               choices=('fixed', 'floating'),
-               help="How to connect to the instance? "
-                    "fixed: using the first ip belongs the fixed network "
-                    "floating: creating and using a floating ip."),
-    cfg.StrOpt('ssh_user',
-               default='root',
-               help="User name used to authenticate to an instance."),
-    cfg.IntOpt('ping_timeout',
-               default=120,
-               help="Timeout in seconds to wait for ping to "
-                    "succeed."),
-    cfg.IntOpt('ping_size',
-               default=56,
-               help="The packet size for ping packets originating "
-                    "from remote linux hosts"),
-    cfg.IntOpt('ping_count',
-               default=1,
-               help="The number of ping packets originating from remote "
-                    "linux hosts"),
     cfg.IntOpt('ready_wait',
                default=0,
                help="Additional wait time for clean state, when there is "
@@ -291,13 +251,6 @@
                     "servers if tempest does not create a network or a "
                     "network is not specified elsewhere. It may be used for "
                     "ssh validation only if floating IPs are disabled."),
-    cfg.StrOpt('network_for_ssh',
-               default='public',
-               help="Network used for SSH connections. Ignored if "
-                    "use_floatingip_for_ssh=true or run_validation=false."),
-    cfg.BoolOpt('use_floatingip_for_ssh',
-                default=True,
-                help="Does SSH use Floating IPs?"),
     cfg.StrOpt('catalog_type',
                default='compute',
                help="Catalog type of the Compute service."),
@@ -323,12 +276,6 @@
                     'when shelved. This time should be the same as the time '
                     'of nova.conf, and some tests will run for as long as the '
                     'time.'),
-    cfg.StrOpt('floating_ip_range',
-               default='10.0.0.0/29',
-               help='Unallocated floating IP range, which will be used to '
-                    'test the floating IP bulk feature for CRUD operation. '
-                    'This block must not overlap an existing floating IP '
-                    'pool.'),
     cfg.IntOpt('min_compute_nodes',
                default=1,
                help=('The minimum number of compute nodes expected. This will '
@@ -441,9 +388,6 @@
                 default=True,
                 help='Does the test environment support creating snapshot '
                      'images of running instances?'),
-    cfg.BoolOpt('ec2_api',
-                default=True,
-                help='Does the test environment have the ec2 api running?'),
     cfg.BoolOpt('nova_cert',
                 default=True,
                 help='Does the test environment have the nova cert running?'),
@@ -672,9 +616,7 @@
     cfg.BoolOpt('run_validation',
                 default=False,
                 help='Enable ssh on created servers and creation of additional'
-                     ' validation resources to enable remote access',
-                deprecated_opts=[cfg.DeprecatedOpt('run_ssh',
-                                                   group='compute')]),
+                     ' validation resources to enable remote access'),
     cfg.BoolOpt('security_group',
                 default=True,
                 help='Enable/disable security groups.'),
@@ -686,31 +628,77 @@
                choices=['fixed', 'floating'],
                help='Default IP type used for validation: '
                     '-fixed: uses the first IP belonging to the fixed network '
-                    '-floating: creates and uses a floating IP'),
+                    '-floating: creates and uses a floating IP',
+               deprecated_opts=[cfg.DeprecatedOpt('use_floatingip_for_ssh',
+                                                  group='compute')]),
     cfg.StrOpt('auth_method',
                default='keypair',
                choices=['keypair'],
                help='Default authentication method to the instance. '
                     'Only ssh via keypair is supported for now. '
-                    'Additional methods will be handled in a separate spec.'),
+                    'Additional methods will be handled in a separate spec.',
+               deprecated_opts=[cfg.DeprecatedOpt('ssh_auth_method',
+                                                  group='compute')]),
     cfg.IntOpt('ip_version_for_ssh',
                default=4,
-               help='Default IP version for ssh connections.',
-               deprecated_opts=[cfg.DeprecatedOpt('ip_version_for_ssh',
-                                                  group='compute')]),
+               help='Default IP version for ssh connections.'),
     cfg.IntOpt('ping_timeout',
                default=120,
-               help='Timeout in seconds to wait for ping to succeed.'),
+               help='Timeout in seconds to wait for ping to succeed.',
+               deprecated_opts=[cfg.DeprecatedOpt('ping_timeout',
+                                                  group='compute')]),
     cfg.IntOpt('connect_timeout',
                default=60,
                help='Timeout in seconds to wait for the TCP connection to be '
-                    'successful.',
-               deprecated_opts=[cfg.DeprecatedOpt('ssh_channel_timeout',
-                                                  group='compute')]),
+                    'successful.'),
     cfg.IntOpt('ssh_timeout',
                default=300,
-               help='Timeout in seconds to wait for the ssh banner.',
-               deprecated_opts=[cfg.DeprecatedOpt('ssh_timeout',
+               help='Timeout in seconds to wait for the ssh banner.'),
+    cfg.StrOpt('image_ssh_user',
+               default="root",
+               help="User name used to authenticate to an instance.",
+               deprecated_opts=[cfg.DeprecatedOpt('image_ssh_user',
+                                                  group='compute'),
+                                cfg.DeprecatedOpt('ssh_user',
+                                                  group='compute'),
+                                cfg.DeprecatedOpt('ssh_user',
+                                                  group='scenario')]),
+    cfg.StrOpt('image_ssh_password',
+               default="password",
+               help="Password used to authenticate to an instance.",
+               deprecated_opts=[cfg.DeprecatedOpt('image_ssh_password',
+                                                  group='compute')]),
+    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.",
+               deprecated_opts=[cfg.DeprecatedOpt('ssh_shell_prologue',
+                                                  group='compute')]),
+    cfg.IntOpt('ping_size',
+               default=56,
+               help="The packet size for ping packets originating "
+                    "from remote linux hosts",
+               deprecated_opts=[cfg.DeprecatedOpt('ping_size',
+                                                  group='compute')]),
+    cfg.IntOpt('ping_count',
+               default=1,
+               help="The number of ping packets originating from remote "
+                    "linux hosts",
+               deprecated_opts=[cfg.DeprecatedOpt('ping_count',
+                                                  group='compute')]),
+    cfg.StrOpt('floating_ip_range',
+               default='10.0.0.0/29',
+               help='Unallocated floating IP range, which will be used to '
+                    'test the floating IP bulk feature for CRUD operation. '
+                    'This block must not overlap an existing floating IP '
+                    'pool.',
+               deprecated_opts=[cfg.DeprecatedOpt('floating_ip_range',
+                                                  group='compute')]),
+    cfg.StrOpt('network_for_ssh',
+               default='public',
+               help="Network used for SSH connections. Ignored if "
+                    "use_floatingip_for_ssh=true or run_validation=false.",
+               deprecated_opts=[cfg.DeprecatedOpt('network_for_ssh',
                                                   group='compute')]),
 ]
 
@@ -1013,54 +1001,6 @@
                 help="List of enabled data processing plugins")
 ]
 
-
-boto_group = cfg.OptGroup(name='boto',
-                          title='EC2/S3 options')
-BotoGroup = [
-    cfg.StrOpt('ec2_url',
-               default="http://localhost:8773/services/Cloud",
-               help="EC2 URL"),
-    cfg.StrOpt('s3_url',
-               default="http://localhost:8080",
-               help="S3 URL"),
-    cfg.StrOpt('aws_secret',
-               help="AWS Secret Key",
-               secret=True),
-    cfg.StrOpt('aws_access',
-               help="AWS Access Key"),
-    cfg.StrOpt('aws_zone',
-               default="nova",
-               help="AWS Zone for EC2 tests"),
-    cfg.StrOpt('s3_materials_path',
-               default="/opt/stack/devstack/files/images/"
-                       "s3-materials/cirros-0.3.0",
-               help="S3 Materials Path"),
-    cfg.StrOpt('ari_manifest',
-               default="cirros-0.3.0-x86_64-initrd.manifest.xml",
-               help="ARI Ramdisk Image manifest"),
-    cfg.StrOpt('ami_manifest',
-               default="cirros-0.3.0-x86_64-blank.img.manifest.xml",
-               help="AMI Machine Image manifest"),
-    cfg.StrOpt('aki_manifest',
-               default="cirros-0.3.0-x86_64-vmlinuz.manifest.xml",
-               help="AKI Kernel Image manifest"),
-    cfg.StrOpt('instance_type',
-               default="m1.tiny",
-               help="Instance type"),
-    cfg.IntOpt('http_socket_timeout',
-               default=3,
-               help="boto Http socket timeout"),
-    cfg.IntOpt('num_retries',
-               default=1,
-               help="boto num_retries on error"),
-    cfg.IntOpt('build_timeout',
-               default=60,
-               help="Status Change Timeout"),
-    cfg.IntOpt('build_interval',
-               default=1,
-               help="Status Change Test Interval"),
-]
-
 stress_group = cfg.OptGroup(name='stress', title='Stress Test Options')
 
 StressGroup = [
@@ -1126,9 +1066,6 @@
     cfg.StrOpt('aki_img_file',
                default='cirros-0.3.1-x86_64-vmlinuz',
                help='AKI image file name'),
-    cfg.StrOpt('ssh_user',
-               default='cirros',
-               help='ssh username for the image file'),
     cfg.IntOpt(
         'large_ops_number',
         default=0,
@@ -1322,7 +1259,6 @@
     (dashboard_group, DashboardGroup),
     (data_processing_group, DataProcessingGroup),
     (data_processing_feature_group, DataProcessingFeaturesGroup),
-    (boto_group, BotoGroup),
     (stress_group, StressGroup),
     (scenario_group, ScenarioGroup),
     (service_available_group, ServiceAvailableGroup),
@@ -1392,7 +1328,6 @@
         self.data_processing = _CONF['data-processing']
         self.data_processing_feature_enabled = _CONF[
             'data-processing-feature-enabled']
-        self.boto = _CONF.boto
         self.stress = _CONF.stress
         self.scenario = _CONF.scenario
         self.service_available = _CONF.service_available
@@ -1406,6 +1341,7 @@
         _CONF.set_default('alt_domain_name',
                           self.auth.default_credentials_domain_name,
                           group='identity')
+        logging.tempest_set_log_file('tempest.log')
 
     def __init__(self, parse_conf=True, config_path=None):
         """Initialize a configuration from a conf directory and conf file."""
@@ -1436,6 +1372,13 @@
             _CONF([], project='tempest', default_config_files=config_files)
         else:
             _CONF([], project='tempest')
+
+        logging_cfg_path = "%s/logging.conf" % os.path.dirname(path)
+        if (not hasattr(_CONF, 'log_config_append') and
+            os.path.isfile(logging_cfg_path)):
+            # if logging conf is in place we need to set log_config_append
+            _CONF.log_config_append = logging_cfg_path
+
         logging.setup(_CONF, 'tempest')
         LOG = logging.getLogger('tempest')
         LOG.info("Using tempest config file %s" % path)
@@ -1462,6 +1405,8 @@
     def __getattr__(self, attr):
         if not self._config:
             self._fix_log_levels()
+            lock_dir = os.path.join(tempfile.gettempdir(), 'tempest-lock')
+            lockutils.set_defaults(lock_dir)
             self._config = TempestConfigPrivate(config_path=self._path)
 
         return getattr(self._config, attr)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index c304136..c2159c3 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -359,7 +359,7 @@
         if isinstance(server_or_ip, six.string_types):
             ip = server_or_ip
         else:
-            addrs = server_or_ip['addresses'][CONF.compute.network_for_ssh]
+            addrs = server_or_ip['addresses'][CONF.validation.network_for_ssh]
             try:
                 ip = (addr['addr'] for addr in addrs if
                       netaddr.valid_ipv4(addr['addr'])).next()
@@ -368,7 +368,7 @@
                                        "remote server.")
 
         if username is None:
-            username = CONF.scenario.ssh_user
+            username = CONF.validation.image_ssh_user
         # Set this with 'keypair' or others to log in with keypair or
         # username/password.
         if CONF.validation.auth_method == 'keypair':
@@ -376,7 +376,7 @@
             if private_key is None:
                 private_key = self.keypair['private_key']
         else:
-            password = CONF.compute.image_ssh_password
+            password = CONF.validation.image_ssh_password
             private_key = None
         linux_client = remote_client.RemoteClient(ip, username,
                                                   pkey=private_key,
@@ -457,7 +457,7 @@
             servers = servers['servers']
         for server in servers:
             console_output = self.servers_client.get_console_output(
-                server['id'], length=None)['output']
+                server['id'])['output']
             LOG.debug('Console output for %s\nbody=\n%s',
                       server['id'], console_output)
 
@@ -812,8 +812,9 @@
     def _get_server_port_id_and_ip4(self, server, ip_addr=None):
         ports = self._list_ports(device_id=server['id'], status='ACTIVE',
                                  fixed_ip=ip_addr)
-        # it might happen here that this port has more then one ip address
-        # as in case of dual stack- when this port is created on 2 subnets
+        # A port can have more then one IP address in some cases.
+        # If the network is dual-stack (IPv4 + IPv6), this port is associated
+        # with 2 subnets
         port_map = [(p["id"], fxip["ip_address"])
                     for p in ports
                     for fxip in p["fixed_ips"]
@@ -1095,7 +1096,7 @@
         return rules
 
     def _ssh_to_server(self, server, private_key):
-        ssh_login = CONF.compute.image_ssh_user
+        ssh_login = CONF.validation.image_ssh_user
         return self.get_remote_client(server,
                                       username=ssh_login,
                                       private_key=private_key)
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 25e3e6f..2ef3cee 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -84,7 +84,7 @@
         self.assertEqual(volume, got_volume)
 
     def nova_reboot(self, server):
-        self.servers_client.reboot_server(server['id'], 'SOFT')
+        self.servers_client.reboot_server(server['id'], type='SOFT')
         self._wait_for_server_status(server, 'ACTIVE')
 
     def check_partitions(self):
@@ -95,9 +95,9 @@
     def create_and_add_security_group_to_server(self, server):
         secgroup = self._create_security_group()
         self.servers_client.add_security_group(server['id'],
-                                               secgroup['name'])
+                                               name=secgroup['name'])
         self.addCleanup(self.servers_client.remove_security_group,
-                        server['id'], secgroup['name'])
+                        server['id'], name=secgroup['name'])
 
         def wait_for_secgroup_add():
             body = (self.servers_client.show_server(server['id'])
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index a45a730..d6dd6f3 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -74,7 +74,7 @@
 
     def _check_network_connectivity(self, server, keypair, floating_ip,
                                     should_connect=True):
-        username = CONF.compute.image_ssh_user
+        username = CONF.validation.image_ssh_user
         private_key = keypair['private_key']
         self._check_tenant_network_connectivity(
             server, username, private_key,
@@ -112,7 +112,7 @@
     @test.services('compute', 'network')
     def test_server_connectivity_reboot(self):
         server, keypair, floating_ip = self._setup_network_and_servers()
-        self.servers_client.reboot_server(server['id'], reboot_type='SOFT')
+        self.servers_client.reboot_server(server['id'], type='SOFT')
         self._wait_server_status_and_check_network_connectivity(
             server, keypair, floating_ip)
 
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 20ccc59..44942b0 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -172,7 +172,7 @@
         return self.keypairs[server['key_name']]['private_key']
 
     def _check_tenant_network_connectivity(self):
-        ssh_login = CONF.compute.image_ssh_user
+        ssh_login = CONF.validation.image_ssh_user
         for server in self.servers:
             # call the common method in the parent class
             super(TestNetworkBasicOps, self).\
@@ -195,7 +195,7 @@
         :param should_check_floating_ip_status: bool. should status of
         floating_ip be checked or not
         """
-        ssh_login = CONF.compute.image_ssh_user
+        ssh_login = CONF.validation.image_ssh_user
         floating_ip, server = self.floating_ip_tuple
         ip_address = floating_ip.floating_ip_address
         private_key = None
@@ -744,20 +744,28 @@
     def test_port_security_macspoofing_port(self):
         """Tests port_security extension enforces mac spoofing
 
-        1. create a new network
-        2. connect VM to new network
-        4. check VM can ping new network DHCP port
-        5. spoof mac on new new network interface
-        6. check Neutron enforces mac spoofing and blocks pings via spoofed
-            interface
-        7. disable port-security on the spoofed port
-        8. check Neutron allows pings via spoofed interface
+        Neutron security groups always apply anti-spoof rules on the VMs. This
+        allows traffic to originate and terminate at the VM as expected, but
+        prevents traffic to pass through the VM. Anti-spoof rules are not
+        required in cases where the VM routes traffic through it.
+
+        The test steps are :
+        1. Create a new network.
+        2. Connect (hotplug) the VM to a new network.
+        3. Check the VM can ping the DHCP interface of this network.
+        4. Spoof the mac address of the new VM interface.
+        5. Check the Security Group enforces mac spoofing and blocks pings via
+           spoofed interface (VM cannot ping the DHCP interface).
+        6. Disable port-security of the spoofed port- set the flag to false.
+        7. Retest 3rd step and check that the Security Group allows pings via
+        the spoofed interface.
         """
+
         spoof_mac = "00:00:00:00:00:01"
 
         # Create server
         self._setup_network_and_servers()
-        self.check_public_network_connectivity(should_connect=False)
+        self.check_public_network_connectivity(should_connect=True)
         self._create_new_network()
         self._hotplug_server()
         fip, server = self.floating_ip_tuple
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index d6ad46a..40c7680 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -114,7 +114,7 @@
         return ips
 
     def prepare_server(self, networks=None):
-        username = CONF.compute.image_ssh_user
+        username = CONF.validation.image_ssh_user
 
         networks = networks or [self.network]
 
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index e266dc2..4e5a1e0 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -512,7 +512,7 @@
         tenant = self.primary_tenant
         ip = self._get_server_ip(tenant.access_point,
                                  floating=self.floating_ip_access)
-        ssh_login = CONF.compute.image_ssh_user
+        ssh_login = CONF.validation.image_ssh_user
         private_key = tenant.keypair['private_key']
         self.check_vm_connectivity(ip,
                                    should_connect=False)
diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py
deleted file mode 100644
index 9d452ff..0000000
--- a/tempest/services/botoclients.py
+++ /dev/null
@@ -1,217 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import contextlib
-import types
-
-import boto
-import boto.ec2
-import boto.s3.connection
-from six.moves import configparser as ConfigParser
-from six.moves.urllib import parse as urlparse
-from tempest_lib import exceptions as lib_exc
-
-from tempest import config
-
-CONF = config.CONF
-
-
-class BotoClientBase(object):
-
-    ALLOWED_METHODS = set()
-
-    def __init__(self, identity_client):
-        self.identity_client = identity_client
-
-        self.ca_cert = CONF.identity.ca_certificates_file
-        self.connection_timeout = str(CONF.boto.http_socket_timeout)
-        self.num_retries = str(CONF.boto.num_retries)
-        self.build_timeout = CONF.boto.build_timeout
-
-        self.connection_data = {}
-
-    def _config_boto_timeout(self, timeout, retries):
-        try:
-            boto.config.add_section("Boto")
-        except ConfigParser.DuplicateSectionError:
-            pass
-        boto.config.set("Boto", "http_socket_timeout", timeout)
-        boto.config.set("Boto", "num_retries", retries)
-
-    def _config_boto_ca_certificates_file(self, ca_cert):
-        if ca_cert is None:
-            return
-
-        try:
-            boto.config.add_section("Boto")
-        except ConfigParser.DuplicateSectionError:
-            pass
-        boto.config.set("Boto", "ca_certificates_file", ca_cert)
-
-    def __getattr__(self, name):
-        """Automatically creates methods for the allowed methods set."""
-        if name in self.ALLOWED_METHODS:
-            def func(self, *args, **kwargs):
-                with contextlib.closing(self.get_connection()) as conn:
-                    return getattr(conn, name)(*args, **kwargs)
-
-            func.__name__ = name
-            setattr(self, name, types.MethodType(func, self, self.__class__))
-            setattr(self.__class__, name,
-                    types.MethodType(func, None, self.__class__))
-            return getattr(self, name)
-        else:
-            raise AttributeError(name)
-
-    def get_connection(self):
-        self._config_boto_timeout(self.connection_timeout, self.num_retries)
-        self._config_boto_ca_certificates_file(self.ca_cert)
-
-        ec2_client_args = {'aws_access_key_id': CONF.boto.aws_access,
-                           'aws_secret_access_key': CONF.boto.aws_secret}
-        if not all(ec2_client_args.values()):
-            ec2_client_args = self.get_aws_credentials(self.identity_client)
-
-        self.connection_data.update(ec2_client_args)
-        return self.connect_method(**self.connection_data)
-
-    def get_aws_credentials(self, identity_client):
-        """Obtain existing, or create new AWS credentials
-
-        :param identity_client: identity client with embedded credentials
-        :return: EC2 credentials
-        """
-        ec2_cred_list = identity_client.list_user_ec2_credentials(
-            identity_client.user_id)['credentials']
-        for cred in ec2_cred_list:
-            if cred['tenant_id'] == identity_client.tenant_id:
-                ec2_cred = cred
-                break
-        else:
-            ec2_cred = (identity_client.create_user_ec2_credentials(
-                identity_client.user_id,
-                tenant_id=identity_client.tenant_id)['credential'])
-        if not all((ec2_cred, ec2_cred['access'], ec2_cred['secret'])):
-            raise lib_exc.NotFound("Unable to get access and secret keys")
-        else:
-            ec2_cred_aws = {}
-            ec2_cred_aws['aws_access_key_id'] = ec2_cred['access']
-            ec2_cred_aws['aws_secret_access_key'] = ec2_cred['secret']
-        return ec2_cred_aws
-
-
-class APIClientEC2(BotoClientBase):
-
-    def connect_method(self, *args, **kwargs):
-        return boto.connect_ec2(*args, **kwargs)
-
-    def __init__(self, identity_client):
-        super(APIClientEC2, self).__init__(identity_client)
-        insecure_ssl = CONF.identity.disable_ssl_certificate_validation
-        purl = urlparse.urlparse(CONF.boto.ec2_url)
-
-        region_name = CONF.compute.region
-        if not region_name:
-            region_name = CONF.identity.region
-        region = boto.ec2.regioninfo.RegionInfo(name=region_name,
-                                                endpoint=purl.hostname)
-        port = purl.port
-        if port is None:
-            if purl.scheme is not "https":
-                port = 80
-            else:
-                port = 443
-        else:
-            port = int(port)
-        self.connection_data.update({"is_secure": purl.scheme == "https",
-                                     "validate_certs": not insecure_ssl,
-                                     "region": region,
-                                     "host": purl.hostname,
-                                     "port": port,
-                                     "path": purl.path})
-
-    ALLOWED_METHODS = set(('create_key_pair', 'get_key_pair',
-                           'delete_key_pair', 'import_key_pair',
-                           'get_all_key_pairs',
-                           'get_all_tags',
-                           'create_image', 'get_image',
-                           'register_image', 'deregister_image',
-                           'get_all_images', 'get_image_attribute',
-                           'modify_image_attribute', 'reset_image_attribute',
-                           'get_all_kernels',
-                           'create_volume', 'delete_volume',
-                           'get_all_volume_status', 'get_all_volumes',
-                           'get_volume_attribute', 'modify_volume_attribute'
-                           'bundle_instance', 'cancel_spot_instance_requests',
-                           'confirm_product_instanc',
-                           'get_all_instance_status', 'get_all_instances',
-                           'get_all_reserved_instances',
-                           'get_all_spot_instance_requests',
-                           'get_instance_attribute', 'monitor_instance',
-                           'monitor_instances', 'unmonitor_instance',
-                           'unmonitor_instances',
-                           'purchase_reserved_instance_offering',
-                           'reboot_instances', 'request_spot_instances',
-                           'reset_instance_attribute', 'run_instances',
-                           'start_instances', 'stop_instances',
-                           'terminate_instances',
-                           'attach_network_interface', 'attach_volume',
-                           'detach_network_interface', 'detach_volume',
-                           'get_console_output',
-                           'delete_network_interface', 'create_subnet',
-                           'create_network_interface', 'delete_subnet',
-                           'get_all_network_interfaces',
-                           'allocate_address', 'associate_address',
-                           'disassociate_address', 'get_all_addresses',
-                           'release_address',
-                           'create_snapshot', 'delete_snapshot',
-                           'get_all_snapshots', 'get_snapshot_attribute',
-                           'modify_snapshot_attribute',
-                           'reset_snapshot_attribute', 'trim_snapshots',
-                           'get_all_regions', 'get_all_zones',
-                           'get_all_security_groups', 'create_security_group',
-                           'delete_security_group', 'authorize_security_group',
-                           'authorize_security_group_egress',
-                           'revoke_security_group',
-                           'revoke_security_group_egress'))
-
-
-class ObjectClientS3(BotoClientBase):
-
-    def connect_method(self, *args, **kwargs):
-        return boto.connect_s3(*args, **kwargs)
-
-    def __init__(self, identity_client):
-        super(ObjectClientS3, self).__init__(identity_client)
-        insecure_ssl = CONF.identity.disable_ssl_certificate_validation
-        purl = urlparse.urlparse(CONF.boto.s3_url)
-        port = purl.port
-        if port is None:
-            if purl.scheme is not "https":
-                port = 80
-            else:
-                port = 443
-        else:
-            port = int(port)
-        self.connection_data.update({"is_secure": purl.scheme == "https",
-                                     "validate_certs": not insecure_ssl,
-                                     "host": purl.hostname,
-                                     "port": port,
-                                     "calling_format": boto.s3.connection.
-                                     OrdinaryCallingFormat()})
-
-    ALLOWED_METHODS = set(('create_bucket', 'delete_bucket', 'generate_url',
-                           'get_all_buckets', 'get_bucket', 'delete_key',
-                           'lookup'))
diff --git a/tempest/services/compute/json/base.py b/tempest/services/compute/json/base.py
new file mode 100644
index 0000000..02e9f8b
--- /dev/null
+++ b/tempest/services/compute/json/base.py
@@ -0,0 +1,25 @@
+# Copyright 2015 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.common import service_client
+
+
+class BaseComputeClient(service_client.ServiceClient):
+    api_microversion = None
+
+    def get_headers(self):
+        headers = super(BaseComputeClient, self).get_headers()
+        if self.api_microversion:
+            headers['X-OpenStack-Nova-API-Version'] = self.api_microversion
+        return headers
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index aa9e6c6..c20295b 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -152,17 +152,21 @@
         self.validate_response(schema, resp, body)
         return service_client.ResponseBody(resp, body)
 
-    def create_backup(self, server_id, backup_type, rotation, name):
-        """Backup a server instance."""
-        return self.action(server_id, "createBackup",
-                           backup_type=backup_type,
-                           rotation=rotation,
-                           name=name)
+    def create_backup(self, server_id, **kwargs):
+        """Backup a server instance.
 
-    def change_password(self, server_id, adminPass):
-        """Changes the root password for the server."""
-        return self.action(server_id, 'changePassword',
-                           adminPass=adminPass)
+        Available params: see http://developer.openstack.org/
+                              api-ref-compute-v2.1.html#createBackup
+        """
+        return self.action(server_id, "createBackup", **kwargs)
+
+    def change_password(self, server_id, **kwargs):
+        """Change the root password for the server.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-compute-v2.1.html#changePassword
+        """
+        return self.action(server_id, 'changePassword', **kwargs)
 
     def show_password(self, server_id):
         resp, body = self.get("servers/%s/os-server-password" %
@@ -183,12 +187,19 @@
                                resp, body)
         return service_client.ResponseBody(resp, body)
 
-    def reboot_server(self, server_id, reboot_type):
-        """Reboots a server."""
-        return self.action(server_id, 'reboot', type=reboot_type)
+    def reboot_server(self, server_id, **kwargs):
+        """Reboot a server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#reboot
+        """
+        return self.action(server_id, 'reboot', **kwargs)
 
     def rebuild_server(self, server_id, image_ref, **kwargs):
-        """Rebuilds a server with a new image.
+        """Rebuild a server with a new image.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#rebuild
 
         Most parameters except the following are passed to the API without
         any changes.
@@ -205,7 +216,10 @@
                            rebuild_schema, **kwargs)
 
     def resize_server(self, server_id, flavor_ref, **kwargs):
-        """Changes the flavor of a server.
+        """Change the flavor of a server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#resize
 
         Most parameters except the following are passed to the API without
         any changes.
@@ -217,13 +231,21 @@
         return self.action(server_id, 'resize', **kwargs)
 
     def confirm_resize_server(self, server_id, **kwargs):
-        """Confirms the flavor change for a server."""
+        """Confirm the flavor change for a server.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-compute-v2.1.html#confirmResize
+        """
         return self.action(server_id, 'confirmResize',
                            schema.server_actions_confirm_resize,
                            **kwargs)
 
     def revert_resize_server(self, server_id, **kwargs):
-        """Reverts a server back to its original flavor."""
+        """Revert a server back to its original flavor.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-compute-v2.1.html#revertResize
+        """
         return self.action(server_id, 'revertResize', **kwargs)
 
     def list_server_metadata(self, server_id):
@@ -313,67 +335,132 @@
         self.validate_response(schema.list_volume_attachments, resp, body)
         return service_client.ResponseBody(resp, body)
 
-    def add_security_group(self, server_id, name):
-        """Adds a security group to the server."""
-        return self.action(server_id, 'addSecurityGroup', name=name)
+    def add_security_group(self, server_id, **kwargs):
+        """Add a security group to the server.
 
-    def remove_security_group(self, server_id, name):
-        """Removes a security group from the server."""
-        return self.action(server_id, 'removeSecurityGroup', name=name)
+        Available params: TODO
+        """
+        # TODO(oomichi): The api-site doesn't contain this API description.
+        # So the above should be changed to the api-site link after
+        # adding the description on the api-site.
+        # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1524199
+        return self.action(server_id, 'addSecurityGroup', **kwargs)
+
+    def remove_security_group(self, server_id, **kwargs):
+        """Remove a security group from the server.
+
+        Available params: TODO
+        """
+        # TODO(oomichi): The api-site doesn't contain this API description.
+        # So the above should be changed to the api-site link after
+        # adding the description on the api-site.
+        # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1524199
+        return self.action(server_id, 'removeSecurityGroup', **kwargs)
 
     def live_migrate_server(self, server_id, **kwargs):
-        """This should be called with administrator privileges ."""
+        """This should be called with administrator privileges.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#migrateLive
+        """
         return self.action(server_id, 'os-migrateLive', **kwargs)
 
     def migrate_server(self, server_id, **kwargs):
-        """Migrates a server to a new host."""
+        """Migrate a server to a new host.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#migrate
+        """
         return self.action(server_id, 'migrate', **kwargs)
 
     def lock_server(self, server_id, **kwargs):
-        """Locks the given server."""
+        """Lock the given server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#lock
+        """
         return self.action(server_id, 'lock', **kwargs)
 
     def unlock_server(self, server_id, **kwargs):
-        """UNlocks the given server."""
+        """UNlock the given server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#unlock
+        """
         return self.action(server_id, 'unlock', **kwargs)
 
     def suspend_server(self, server_id, **kwargs):
-        """Suspends the provided server."""
+        """Suspend the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#suspend
+        """
         return self.action(server_id, 'suspend', **kwargs)
 
     def resume_server(self, server_id, **kwargs):
-        """Un-suspends the provided server."""
+        """Un-suspend the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#resume
+        """
         return self.action(server_id, 'resume', **kwargs)
 
     def pause_server(self, server_id, **kwargs):
-        """Pauses the provided server."""
+        """Pause the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#pause
+        """
         return self.action(server_id, 'pause', **kwargs)
 
     def unpause_server(self, server_id, **kwargs):
-        """Un-pauses the provided server."""
+        """Un-pause the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#unpause
+        """
         return self.action(server_id, 'unpause', **kwargs)
 
-    def reset_state(self, server_id, state='error'):
-        """Resets the state of a server to active/error."""
-        return self.action(server_id, 'os-resetState', state=state)
+    def reset_state(self, server_id, **kwargs):
+        """Reset the state of a server to active/error.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#resetState
+        """
+        return self.action(server_id, 'os-resetState', **kwargs)
 
     def shelve_server(self, server_id, **kwargs):
-        """Shelves the provided server."""
+        """Shelve the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#shelve
+        """
         return self.action(server_id, 'shelve', **kwargs)
 
     def unshelve_server(self, server_id, **kwargs):
-        """Un-shelves the provided server."""
+        """Un-shelve the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#unshelve
+        """
         return self.action(server_id, 'unshelve', **kwargs)
 
     def shelve_offload_server(self, server_id, **kwargs):
-        """Shelve-offload the provided server."""
+        """Shelve-offload the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#shelveOffload
+        """
         return self.action(server_id, 'shelveOffload', **kwargs)
 
-    def get_console_output(self, server_id, length):
-        kwargs = {'length': length} if length else {}
+    def get_console_output(self, server_id, **kwargs):
+        """Get console output.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#getConsoleOutput
+        """
         return self.action(server_id, 'os-getConsoleOutput',
-                           schema.get_console_output,
-                           **kwargs)
+                           schema.get_console_output, **kwargs)
 
     def list_virtual_interfaces(self, server_id):
         """List the virtual interfaces used in an instance."""
@@ -384,10 +471,12 @@
         return service_client.ResponseBody(resp, body)
 
     def rescue_server(self, server_id, **kwargs):
-        """Rescue the provided server."""
-        return self.action(server_id, 'rescue',
-                           schema.rescue_server,
-                           **kwargs)
+        """Rescue the provided server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#rescue
+        """
+        return self.action(server_id, 'rescue', schema.rescue_server, **kwargs)
 
     def unrescue_server(self, server_id):
         """Unrescue the provided server."""
@@ -415,31 +504,58 @@
         return service_client.ResponseBody(resp, body)
 
     def force_delete_server(self, server_id, **kwargs):
-        """Force delete a server."""
+        """Force delete a server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#forceDelete
+        """
         return self.action(server_id, 'forceDelete', **kwargs)
 
     def restore_soft_deleted_server(self, server_id, **kwargs):
-        """Restore a soft-deleted server."""
+        """Restore a soft-deleted server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#restore
+        """
         return self.action(server_id, 'restore', **kwargs)
 
     def reset_network(self, server_id, **kwargs):
-        """Resets the Network of a server"""
+        """Reset the Network of a server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#resetNetwork
+        """
         return self.action(server_id, 'resetNetwork', **kwargs)
 
     def inject_network_info(self, server_id, **kwargs):
-        """Inject the Network Info into server"""
+        """Inject the Network Info into server.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#injectNetworkInfo
+        """
         return self.action(server_id, 'injectNetworkInfo', **kwargs)
 
-    def get_vnc_console(self, server_id, console_type):
-        """Get URL of VNC console."""
+    def get_vnc_console(self, server_id, **kwargs):
+        """Get URL of VNC console.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#getVNCConsole
+        """
         return self.action(server_id, "os-getVNCConsole",
-                           schema.get_vnc_console,
-                           type=console_type)
+                           schema.get_vnc_console, **kwargs)
 
     def add_fixed_ip(self, server_id, **kwargs):
-        """Add a fixed IP to input server instance."""
+        """Add a fixed IP to server instance.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#addFixedIp
+        """
         return self.action(server_id, 'addFixedIp', **kwargs)
 
     def remove_fixed_ip(self, server_id, **kwargs):
-        """Remove input fixed IP from input server instance."""
+        """Remove input fixed IP from input server instance.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-compute-v2.1.html#removeFixedIp
+        """
         return self.action(server_id, 'removeFixedIp', **kwargs)
diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py
index 3e7a598..54596be 100644
--- a/tempest/services/identity/v2/json/identity_client.py
+++ b/tempest/services/identity/v2/json/identity_client.py
@@ -26,116 +26,6 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def create_role(self, name):
-        """Create a role."""
-        post_body = {
-            'name': name,
-        }
-        post_body = json.dumps({'role': post_body})
-        resp, body = self.post('OS-KSADM/roles', post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_role(self, role_id):
-        """Get a role by its id."""
-        resp, body = self.get('OS-KSADM/roles/%s' % role_id)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def create_tenant(self, name, **kwargs):
-        """Create a tenant
-
-        name (required): New tenant name
-        description: Description of new tenant (default is none)
-        enabled <true|false>: Initial tenant status (default is true)
-        """
-        post_body = {
-            'name': name,
-            'description': kwargs.get('description', ''),
-            'enabled': kwargs.get('enabled', True),
-        }
-        post_body = json.dumps({'tenant': post_body})
-        resp, body = self.post('tenants', post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def delete_role(self, role_id):
-        """Delete a role."""
-        resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
-        self.expected_success(204, resp.status)
-        return resp, body
-
-    def list_user_roles(self, tenant_id, user_id):
-        """Returns a list of roles assigned to a user for a tenant."""
-        url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def assign_user_role(self, tenant_id, user_id, role_id):
-        """Add roles to a user on a tenant."""
-        resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
-                              (tenant_id, user_id, role_id), "")
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def delete_user_role(self, tenant_id, user_id, role_id):
-        """Removes a role assignment for a user on a tenant."""
-        resp, body = self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
-                                 (tenant_id, user_id, role_id))
-        self.expected_success(204, resp.status)
-        return service_client.ResponseBody(resp, body)
-
-    def delete_tenant(self, tenant_id):
-        """Delete a tenant."""
-        resp, body = self.delete('tenants/%s' % str(tenant_id))
-        self.expected_success(204, resp.status)
-        return service_client.ResponseBody(resp, body)
-
-    def show_tenant(self, tenant_id):
-        """Get tenant details."""
-        resp, body = self.get('tenants/%s' % str(tenant_id))
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def list_roles(self):
-        """Returns roles."""
-        resp, body = self.get('OS-KSADM/roles')
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def list_tenants(self):
-        """Returns tenants."""
-        resp, body = self.get('tenants')
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
-    def update_tenant(self, tenant_id, **kwargs):
-        """Updates a tenant."""
-        body = self.show_tenant(tenant_id)['tenant']
-        name = kwargs.get('name', body['name'])
-        desc = kwargs.get('description', body['description'])
-        en = kwargs.get('enabled', body['enabled'])
-        post_body = {
-            'id': tenant_id,
-            'name': name,
-            'description': desc,
-            'enabled': en,
-        }
-        post_body = json.dumps({'tenant': post_body})
-        resp, body = self.post('tenants/%s' % tenant_id, post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
     def create_user(self, name, password, tenant_id, email, **kwargs):
         """Create a user."""
         post_body = {
@@ -205,13 +95,6 @@
         self.expected_success(204, resp.status)
         return service_client.ResponseBody(resp, body)
 
-    def list_tenant_users(self, tenant_id):
-        """List users for a Tenant."""
-        resp, body = self.get('/tenants/%s/users' % tenant_id)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return service_client.ResponseBody(resp, body)
-
     def create_service(self, name, type, **kwargs):
         """Create a service."""
         post_body = {
diff --git a/tempest/services/identity/v2/json/roles_client.py b/tempest/services/identity/v2/json/roles_client.py
new file mode 100644
index 0000000..de8f9cb
--- /dev/null
+++ b/tempest/services/identity/v2/json/roles_client.py
@@ -0,0 +1,73 @@
+#    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 oslo_serialization import jsonutils as json
+
+from tempest.common import service_client
+
+
+class RolesClient(service_client.ServiceClient):
+    api_version = "v2.0"
+
+    def create_role(self, name):
+        """Create a role."""
+        post_body = {
+            'name': name,
+        }
+        post_body = json.dumps({'role': post_body})
+        resp, body = self.post('OS-KSADM/roles', post_body)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def show_role(self, role_id):
+        """Get a role by its id."""
+        resp, body = self.get('OS-KSADM/roles/%s' % role_id)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def delete_role(self, role_id):
+        """Delete a role."""
+        resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
+        self.expected_success(204, resp.status)
+        return resp, body
+
+    def list_user_roles(self, tenant_id, user_id):
+        """Returns a list of roles assigned to a user for a tenant."""
+        url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
+        resp, body = self.get(url)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def assign_user_role(self, tenant_id, user_id, role_id):
+        """Add roles to a user on a tenant."""
+        resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
+                              (tenant_id, user_id, role_id), "")
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def delete_user_role(self, tenant_id, user_id, role_id):
+        """Removes a role assignment for a user on a tenant."""
+        resp, body = self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s' %
+                                 (tenant_id, user_id, role_id))
+        self.expected_success(204, resp.status)
+        return service_client.ResponseBody(resp, body)
+
+    def list_roles(self):
+        """Returns roles."""
+        resp, body = self.get('OS-KSADM/roles')
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v2/json/tenants_client.py b/tempest/services/identity/v2/json/tenants_client.py
new file mode 100644
index 0000000..937ae6f
--- /dev/null
+++ b/tempest/services/identity/v2/json/tenants_client.py
@@ -0,0 +1,84 @@
+# Copyright 2015 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from oslo_serialization import jsonutils as json
+
+from tempest.common import service_client
+
+
+class TenantsClient(service_client.ServiceClient):
+    api_version = "v2.0"
+
+    def create_tenant(self, name, **kwargs):
+        """Create a tenant
+
+        name (required): New tenant name
+        description: Description of new tenant (default is none)
+        enabled <true|false>: Initial tenant status (default is true)
+        """
+        post_body = {
+            'name': name,
+            'description': kwargs.get('description', ''),
+            'enabled': kwargs.get('enabled', True),
+        }
+        post_body = json.dumps({'tenant': post_body})
+        resp, body = self.post('tenants', post_body)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def delete_tenant(self, tenant_id):
+        """Delete a tenant."""
+        resp, body = self.delete('tenants/%s' % str(tenant_id))
+        self.expected_success(204, resp.status)
+        return service_client.ResponseBody(resp, body)
+
+    def show_tenant(self, tenant_id):
+        """Get tenant details."""
+        resp, body = self.get('tenants/%s' % str(tenant_id))
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def list_tenants(self):
+        """Returns tenants."""
+        resp, body = self.get('tenants')
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def update_tenant(self, tenant_id, **kwargs):
+        """Updates a tenant."""
+        body = self.show_tenant(tenant_id)['tenant']
+        name = kwargs.get('name', body['name'])
+        desc = kwargs.get('description', body['description'])
+        en = kwargs.get('enabled', body['enabled'])
+        post_body = {
+            'id': tenant_id,
+            'name': name,
+            'description': desc,
+            'enabled': en,
+        }
+        post_body = json.dumps({'tenant': post_body})
+        resp, body = self.post('tenants/%s' % tenant_id, post_body)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
+
+    def list_tenant_users(self, tenant_id):
+        """List users for a Tenant."""
+        resp, body = self.get('/tenants/%s/users' % tenant_id)
+        self.expected_success(200, resp.status)
+        body = json.loads(body)
+        return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index bbd8804..972db99 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -81,13 +81,13 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def update_user_password(self, user_id, password, original_password):
-        """Updates a user password."""
-        update_user = {
-            'password': password,
-            'original_password': original_password
-        }
-        update_user = json.dumps({'user': update_user})
+    def update_user_password(self, user_id, **kwargs):
+        """Update a user password
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-identity-v3.html#changeUserPassword
+        """
+        update_user = json.dumps({'user': kwargs})
         resp, _ = self.post('users/%s/password' % user_id, update_user)
         self.expected_success(204, resp.status)
         return service_client.ResponseBody(resp)
@@ -394,19 +394,13 @@
         self.expected_success(204, resp.status)
         return service_client.ResponseBody(resp, body)
 
-    def create_trust(self, trustor_user_id, trustee_user_id, project_id,
-                     role_names, impersonation, expires_at):
-        """Creates a trust."""
-        roles = [{'name': n} for n in role_names]
-        post_body = {
-            'trustor_user_id': trustor_user_id,
-            'trustee_user_id': trustee_user_id,
-            'project_id': project_id,
-            'impersonation': impersonation,
-            'roles': roles,
-            'expires_at': expires_at
-        }
-        post_body = json.dumps({'trust': post_body})
+    def create_trust(self, **kwargs):
+        """Creates a trust.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-identity-v3-ext.html#createTrust
+        """
+        post_body = json.dumps({'trust': kwargs})
         resp, body = self.post('OS-TRUST/trusts', post_body)
         self.expected_success(201, resp.status)
         body = json.loads(body)
diff --git a/tempest/services/image/v2/json/images_client.py b/tempest/services/image/v2/json/images_client.py
index 44062ea..72b203a 100644
--- a/tempest/services/image/v2/json/images_client.py
+++ b/tempest/services/image/v2/json/images_client.py
@@ -55,6 +55,11 @@
         return self._http
 
     def update_image(self, image_id, patch):
+        """Update an image.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-image-v2.html#updateImage-v2
+        """
         data = json.dumps(patch)
         headers = {"Content-Type": "application/openstack-images-v2.0"
                                    "-json-patch"}
@@ -63,21 +68,13 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
-    def create_image(self, name, container_format, disk_format, **kwargs):
-        params = {
-            "name": name,
-            "container_format": container_format,
-            "disk_format": disk_format,
-        }
+    def create_image(self, **kwargs):
+        """Create an image.
 
-        for option in kwargs:
-            value = kwargs.get(option)
-            if isinstance(value, dict) or isinstance(value, tuple):
-                params.update(value)
-            else:
-                params[option] = value
-
-        data = json.dumps(params)
+        Available params: see http://developer.openstack.org/
+                              api-ref-image-v2.html#createImage-v2
+        """
+        data = json.dumps(kwargs)
         resp, body = self.post('v2/images', data)
         self.expected_success(201, resp.status)
         body = json.loads(body)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 08316be..6e3b0fe 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -157,23 +157,6 @@
             message = '(%s) %s' % (caller, message)
         raise exceptions.TimeoutException(message)
 
-    def update_quotas(self, tenant_id, **kwargs):
-        put_body = {'quota': kwargs}
-        uri = '/quotas/%s' % tenant_id
-        return self.update_resource(uri, put_body)
-
-    def reset_quotas(self, tenant_id):
-        uri = '/quotas/%s' % tenant_id
-        return self.delete_resource(uri)
-
-    def show_quotas(self, tenant_id, **fields):
-        uri = '/quotas/%s' % tenant_id
-        return self.show_resource(uri, **fields)
-
-    def list_quotas(self, **filters):
-        uri = '/quotas'
-        return self.list_resources(uri, **filters)
-
     def create_router(self, name, admin_state_up=True, **kwargs):
         post_body = {'router': kwargs}
         post_body['router']['name'] = name
@@ -257,15 +240,18 @@
         uri = '/ports?device_id=%s' % uuid
         return self.list_resources(uri)
 
-    def update_agent(self, agent_id, agent_info):
+    def update_agent(self, agent_id, **kwargs):
         """Update agent
 
         :param agent_info: Agent update information.
         E.g {"admin_state_up": True}
         """
+        # TODO(piyush): Current api-site doesn't contain this API description.
+        # After fixing the api-site, we need to fix here also for putting the
+        # link to api-site.
+        # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526673
         uri = '/agents/%s' % agent_id
-        agent = {"agent": agent_info}
-        return self.update_resource(uri, agent)
+        return self.update_resource(uri, kwargs)
 
     def show_agent(self, agent_id, **fields):
         uri = '/agents/%s' % agent_id
@@ -287,6 +273,7 @@
         # TODO(piyush): Current api-site doesn't contain this API description.
         # After fixing the api-site, we need to fix here also for putting the
         # link to api-site.
+        # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526670
         uri = '/agents/%s/l3-routers' % agent_id
         return self.create_resource(uri, kwargs)
 
@@ -307,13 +294,14 @@
                                                network_id)
         return self.delete_resource(uri)
 
-    def update_extra_routes(self, router_id, routes):
+    def update_extra_routes(self, router_id, **kwargs):
+        """Update Extra routes.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#updateExtraRoutes
+        """
         uri = '/routers/%s' % router_id
-        put_body = {
-            'router': {
-                'routes': routes
-            }
-        }
+        put_body = {'router': kwargs}
         return self.update_resource(uri, put_body)
 
     def delete_extra_routes(self, router_id):
diff --git a/tempest/services/network/json/quotas_client.py b/tempest/services/network/json/quotas_client.py
new file mode 100644
index 0000000..9b65a54
--- /dev/null
+++ b/tempest/services/network/json/quotas_client.py
@@ -0,0 +1,35 @@
+# Copyright 2015 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.services.network.json import base
+
+
+class QuotasClient(base.BaseNetworkClient):
+
+    def update_quotas(self, tenant_id, **kwargs):
+        put_body = {'quota': kwargs}
+        uri = '/quotas/%s' % tenant_id
+        return self.update_resource(uri, put_body)
+
+    def reset_quotas(self, tenant_id):
+        uri = '/quotas/%s' % tenant_id
+        return self.delete_resource(uri)
+
+    def show_quotas(self, tenant_id, **fields):
+        uri = '/quotas/%s' % tenant_id
+        return self.show_resource(uri, **fields)
+
+    def list_quotas(self, **filters):
+        uri = '/quotas'
+        return self.list_resources(uri, **filters)
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index 05530b1..abdeba2 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -30,17 +30,6 @@
     def serialize(self, body):
         return json.dumps(body)
 
-    def add_sample(self, sample_list, meter_name, meter_unit, volume,
-                   sample_type, resource_id, **kwargs):
-        sample = {"counter_name": meter_name, "counter_unit": meter_unit,
-                  "counter_volume": volume, "counter_type": sample_type,
-                  "resource_id": resource_id}
-        for key in kwargs:
-            sample[key] = kwargs[key]
-
-        sample_list.append(self.serialize(sample))
-        return sample_list
-
     def create_sample(self, meter_name, sample_list):
         uri = "%s/meters/%s" % (self.uri_prefix, meter_name)
         body = self.serialize(sample_list)
diff --git a/tempest/stress/README.rst b/tempest/stress/README.rst
index 4f1f56c..33842fd 100644
--- a/tempest/stress/README.rst
+++ b/tempest/stress/README.rst
@@ -33,17 +33,17 @@
 
 The stress test framework can automatically discover test inside the tempest
 test suite. All test flag with the `@stresstest` decorator will be executed.
-In order to use this discovery you have to be in the tempest root directory
-and execute the following:
+In order to use this discovery you have to install tempest CLI, be in the
+tempest root directory and execute the following:
 
-	run-tempest-stress -a -d 30
+	tempest run-stress -a -d 30
 
 Running the sample test
 -----------------------
 
 To test installation, do the following:
 
-	run-tempest-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
+	tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
 
 This sample test tries to create a few VMs and kill a few VMs.
 
diff --git a/tempest/stress/actions/volume_attach_verify.py b/tempest/stress/actions/volume_attach_verify.py
index 2a23291..8bbbfc4 100644
--- a/tempest/stress/actions/volume_attach_verify.py
+++ b/tempest/stress/actions/volume_attach_verify.py
@@ -161,7 +161,7 @@
         self._create_sec_group()
         self._create_keypair()
         private_key = self.key['private_key']
-        username = CONF.compute.image_ssh_user
+        username = CONF.validation.image_ssh_user
         self.remote_client = remote_client.RemoteClient(self.floating['ip'],
                                                         username,
                                                         pkey=private_key)
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index d252b84..5c25e32 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -74,12 +74,11 @@
     for user in users:
         if user['name'].startswith("stress_user"):
             admin_manager.identity_client.delete_user(user['id'])
-
-    tenants = admin_manager.identity_client.list_tenants()['tenants']
+    tenants = admin_manager.tenants_client.list_tenants()['tenants']
     LOG.info("Cleanup::remove %s tenants" % len(tenants))
     for tenant in tenants:
         if tenant['name'].startswith("stress_tenant"):
-            admin_manager.identity_client.delete_tenant(tenant['id'])
+            admin_manager.tenants_client.delete_tenant(tenant['id'])
 
     # We have to delete snapshots first or
     # volume deletion may block
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 8359efd..a550d71 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -146,14 +146,18 @@
                 password = "pass"
                 if CONF.identity.auth_version == 'v2':
                     identity_client = admin_manager.identity_client
+                    projects_client = admin_manager.tenants_client
+                    roles_client = admin_manager.roles_client
                 else:
                     identity_client = admin_manager.identity_v3_client
+                    projects_client = None
+                    roles_client = None
                 credentials_client = cred_client.get_creds_client(
-                    identity_client)
+                    identity_client, projects_client, roles_client)
                 project = credentials_client.create_project(
                     name=tenant_name, description=tenant_name)
                 user = credentials_client.create_user(username, password,
-                                                      project['id'], "email")
+                                                      project, "email")
                 # Add roles specified in config file
                 for conf_role in CONF.auth.tempest_roles:
                     credentials_client.assign_user_role(user, project,
diff --git a/tempest/test.py b/tempest/test.py
index 30eb93d..407df3b 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -436,15 +436,21 @@
         """
         if CONF.identity.auth_version == 'v2':
             client = self.os_admin.identity_client
+            project_client = self.os_admin.tenants_client
+            roles_client = self.os_admin.roles_client
         else:
             client = self.os_admin.identity_v3_client
+            project_client = None
+            roles_client = None
 
         try:
             domain = client.auth_provider.credentials.project_domain_name
         except AttributeError:
             domain = 'Default'
 
-        return cred_client.get_creds_client(client, domain)
+        return cred_client.get_creds_client(client, project_client,
+                                            roles_client,
+                                            project_domain_name=domain)
 
     @classmethod
     def get_identity_version(cls):
diff --git a/tempest/test_discover/test_discover.py b/tempest/test_discover/test_discover.py
index dac7d91..330f370 100644
--- a/tempest/test_discover/test_discover.py
+++ b/tempest/test_discover/test_discover.py
@@ -30,8 +30,7 @@
     base_path = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
     base_path = os.path.split(base_path)[0]
     # Load local tempest tests
-    for test_dir in ['tempest/api', 'tempest/scenario',
-                     'tempest/thirdparty']:
+    for test_dir in ['tempest/api', 'tempest/scenario']:
         full_test_dir = os.path.join(base_path, test_dir)
         if not pattern:
             suite.addTests(loader.discover(full_test_dir,
diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py
index d328d56..56bc96c 100644
--- a/tempest/tests/cmd/test_javelin.py
+++ b/tempest/tests/cmd/test_javelin.py
@@ -85,24 +85,24 @@
 class TestCreateResources(JavelinUnitTest):
     def test_create_tenants(self):
 
-        self.fake_client.identity.list_tenants.return_value = {'tenants': []}
+        self.fake_client.tenants.list_tenants.return_value = {'tenants': []}
         self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
                                               return_value=self.fake_client))
 
         javelin.create_tenants([self.fake_object['name']])
 
-        mocked_function = self.fake_client.identity.create_tenant
+        mocked_function = self.fake_client.tenants.create_tenant
         mocked_function.assert_called_once_with(self.fake_object['name'])
 
     def test_create_duplicate_tenant(self):
-        self.fake_client.identity.list_tenants.return_value = {'tenants': [
+        self.fake_client.tenants.list_tenants.return_value = {'tenants': [
             {'name': self.fake_object['name']}]}
         self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin",
                                               return_value=self.fake_client))
 
         javelin.create_tenants([self.fake_object['name']])
 
-        mocked_function = self.fake_client.identity.create_tenant
+        mocked_function = self.fake_client.tenants.create_tenant
         self.assertFalse(mocked_function.called)
 
     def test_create_users(self):
@@ -299,7 +299,7 @@
                                               return_value=fake_auth))
         javelin.destroy_tenants([fake_tenant])
 
-        mocked_function = fake_auth.identity.delete_tenant
+        mocked_function = fake_auth.tenants.delete_tenant
         mocked_function.assert_called_once_with(fake_tenant['id'])
 
     def test_destroy_users(self):
@@ -308,7 +308,7 @@
         fake_tenant = self.fake_object['tenant']
 
         fake_auth = self.fake_client
-        fake_auth.identity.list_tenants.return_value = \
+        fake_auth.tenants.list_tenants.return_value = \
             {'tenants': [fake_tenant]}
         fake_auth.identity.list_users.return_value = {'users': [fake_user]}
 
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index 78064a7..d520985 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -24,6 +24,10 @@
 from tempest import exceptions
 from tempest.services.identity.v2.json import identity_client as \
     json_iden_client
+from tempest.services.identity.v2.json import roles_client as \
+    json_roles_client
+from tempest.services.identity.v2.json import tenants_client as \
+    json_tenants_client
 from tempest.services.network.json import network_client as json_network_client
 from tempest.tests import base
 from tempest.tests import fake_config
@@ -74,7 +78,7 @@
 
     def _mock_tenant_create(self, id, name):
         tenant_fix = self.useFixture(mockpatch.PatchObject(
-            json_iden_client.IdentityClient,
+            json_tenants_client.TenantsClient,
             'create_tenant',
             return_value=(service_client.ResponseBody
                           (200, {'tenant': {'id': id, 'name': name}}))))
@@ -82,7 +86,7 @@
 
     def _mock_list_roles(self, id, name):
         roles_fix = self.useFixture(mockpatch.PatchObject(
-            json_iden_client.IdentityClient,
+            json_roles_client.RolesClient,
             'list_roles',
             return_value=(service_client.ResponseBody
                           (200,
@@ -93,7 +97,7 @@
 
     def _mock_list_2_roles(self):
         roles_fix = self.useFixture(mockpatch.PatchObject(
-            json_iden_client.IdentityClient,
+            json_roles_client.RolesClient,
             'list_roles',
             return_value=(service_client.ResponseBody
                           (200,
@@ -104,7 +108,7 @@
 
     def _mock_assign_user_role(self):
         tenant_fix = self.useFixture(mockpatch.PatchObject(
-            json_iden_client.IdentityClient,
+            json_roles_client.RolesClient,
             'assign_user_role',
             return_value=(service_client.ResponseBody
                           (200, {}))))
@@ -112,7 +116,7 @@
 
     def _mock_list_role(self):
         roles_fix = self.useFixture(mockpatch.PatchObject(
-            json_iden_client.IdentityClient,
+            json_roles_client.RolesClient,
             'list_roles',
             return_value=(service_client.ResponseBody
                           (200, {'roles': [{'id': '1',
@@ -176,11 +180,11 @@
         self._mock_user_create('1234', 'fake_admin_user')
         self._mock_tenant_create('1234', 'fake_admin_tenant')
 
-        user_mock = mock.patch.object(json_iden_client.IdentityClient,
+        user_mock = mock.patch.object(json_roles_client.RolesClient,
                                       'assign_user_role')
         user_mock.start()
         self.addCleanup(user_mock.stop)
-        with mock.patch.object(json_iden_client.IdentityClient,
+        with mock.patch.object(json_roles_client.RolesClient,
                                'assign_user_role') as user_mock:
             admin_creds = creds.get_admin_creds()
         user_mock.assert_has_calls([
@@ -199,11 +203,11 @@
         self._mock_user_create('1234', 'fake_role_user')
         self._mock_tenant_create('1234', 'fake_role_tenant')
 
-        user_mock = mock.patch.object(json_iden_client.IdentityClient,
+        user_mock = mock.patch.object(json_roles_client.RolesClient,
                                       'assign_user_role')
         user_mock.start()
         self.addCleanup(user_mock.stop)
-        with mock.patch.object(json_iden_client.IdentityClient,
+        with mock.patch.object(json_roles_client.RolesClient,
                                'assign_user_role') as user_mock:
             role_creds = creds.get_creds_by_roles(
                 roles=['role1', 'role2'])
@@ -240,8 +244,8 @@
             'tempest.services.identity.v2.json.identity_client.'
             'IdentityClient.delete_user')
         tenant_mock = self.patch(
-            'tempest.services.identity.v2.json.identity_client.'
-            'IdentityClient.delete_tenant')
+            'tempest.services.identity.v2.json.tenants_client.'
+            'TenantsClient.delete_tenant')
         creds.clear_creds()
         # Verify user delete calls
         calls = user_mock.mock_calls
@@ -371,8 +375,8 @@
         creds.get_admin_creds()
         self.patch('tempest.services.identity.v2.json.identity_client.'
                    'IdentityClient.delete_user')
-        self.patch('tempest.services.identity.v2.json.identity_client.'
-                   'IdentityClient.delete_tenant')
+        self.patch('tempest.services.identity.v2.json.tenants_client.'
+                   'TenantsClient.delete_tenant')
         net = mock.patch.object(creds.networks_admin_client,
                                 'delete_network')
         net_mock = net.start()
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index e596aab..9c2b99e 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -29,7 +29,7 @@
         self.useFixture(fake_config.ConfigFixture())
         self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
         cfg.CONF.set_default('ip_version_for_ssh', 4, group='validation')
-        cfg.CONF.set_default('network_for_ssh', 'public', group='compute')
+        cfg.CONF.set_default('network_for_ssh', 'public', group='validation')
         cfg.CONF.set_default('connect_timeout', 1, group='validation')
 
         self.conn = remote_client.RemoteClient('127.0.0.1', 'user', 'pass')
@@ -79,7 +79,7 @@
     def test_get_number_of_vcpus(self):
         self.ssh_mock.mock.exec_command.return_value = '16'
         self.assertEqual(self.conn.get_number_of_vcpus(), 16)
-        self._assert_exec_called_with('grep -c processor /proc/cpuinfo')
+        self._assert_exec_called_with('grep -c ^processor /proc/cpuinfo')
 
     def test_get_partitions(self):
         proc_partitions = """major minor  #blocks  name
diff --git a/tempest/tests/services/compute/test_base_compute_client.py b/tempest/tests/services/compute/test_base_compute_client.py
new file mode 100644
index 0000000..13461e4
--- /dev/null
+++ b/tempest/tests/services/compute/test_base_compute_client.py
@@ -0,0 +1,72 @@
+# Copyright 2015 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 httplib2
+import mock
+from tempest_lib.common import rest_client
+
+from tempest.services.compute.json import base as base_compute_client
+from tempest.tests import fake_auth_provider
+from tempest.tests.services.compute import base
+
+
+class TestClientWithoutMicroversionHeader(base.BaseComputeServiceTest):
+
+    def setUp(self):
+        super(TestClientWithoutMicroversionHeader, self).setUp()
+        fake_auth = fake_auth_provider.FakeAuthProvider()
+        self.client = base_compute_client.BaseComputeClient(
+            fake_auth, 'compute', 'regionOne')
+
+    def test_no_microverion_header(self):
+        header = self.client.get_headers()
+        self.assertNotIn('X-OpenStack-Nova-API-Version', header)
+
+    def test_no_microverion_header_in_raw_request(self):
+        def raw_request(*args, **kwargs):
+            self.assertNotIn('X-OpenStack-Nova-API-Version', kwargs['headers'])
+            return (httplib2.Response({'status': 200}), {})
+
+        with mock.patch.object(rest_client.RestClient,
+                               'raw_request') as mock_get:
+            mock_get.side_effect = raw_request
+            self.client.get('fake_url')
+
+
+class TestClientWithMicroversionHeader(base.BaseComputeServiceTest):
+
+    def setUp(self):
+        super(TestClientWithMicroversionHeader, self).setUp()
+        fake_auth = fake_auth_provider.FakeAuthProvider()
+        self.client = base_compute_client.BaseComputeClient(
+            fake_auth, 'compute', 'regionOne')
+        self.client.api_microversion = '2.2'
+
+    def test_microverion_header(self):
+        header = self.client.get_headers()
+        self.assertIn('X-OpenStack-Nova-API-Version', header)
+        self.assertEqual(self.client.api_microversion,
+                         header['X-OpenStack-Nova-API-Version'])
+
+    def test_microverion_header_in_raw_request(self):
+        def raw_request(*args, **kwargs):
+            self.assertIn('X-OpenStack-Nova-API-Version', kwargs['headers'])
+            self.assertEqual(self.client.api_microversion,
+                             kwargs['headers']['X-OpenStack-Nova-API-Version'])
+            return (httplib2.Response({'status': 200}), {})
+
+        with mock.patch.object(rest_client.RestClient,
+                               'raw_request') as mock_get:
+            mock_get.side_effect = raw_request
+            self.client.get('fake_url')
diff --git a/tempest/tests/services/compute/test_servers_client.py b/tempest/tests/services/compute/test_servers_client.py
index 95b81c1..1fd0740 100644
--- a/tempest/tests/services/compute/test_servers_client.py
+++ b/tempest/tests/services/compute/test_servers_client.py
@@ -363,7 +363,7 @@
             {},
             status=202,
             server_id=self.server_id,
-            reboot_type='fake-reboot-type'
+            type='fake-reboot-type'
             )
 
     def test_rebuild_server_with_str_body(self):
@@ -995,5 +995,5 @@
             'tempest.common.service_client.ServiceClient.post',
             {'console': self.FAKE_VNC_CONSOLE},
             server_id=self.server_id,
-            console_type='fake-console-type'
+            type='fake-console-type'
             )
diff --git a/tempest/thirdparty/README.rst b/tempest/thirdparty/README.rst
deleted file mode 100644
index b0bfdf7..0000000
--- a/tempest/thirdparty/README.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-.. _third_party_field_guide:
-
-Tempest Field Guide to Third Party API tests
-============================================
-
-
-What are these tests?
----------------------
-
-Third party tests are tests for non native OpenStack APIs that are
-part of OpenStack projects. If we ship an API, we're really required
-to ensure that it's working.
-
-An example is that Nova Compute currently has EC2 API support in tree,
-which should be tested as part of normal process.
-
-
-Why are these tests in tempest?
--------------------------------
-
-If we ship an API in an OpenStack component, there should be tests in
-tempest to exercise it in some way.
-
-
-Scope of these tests
---------------------
-
-Third party API testing should be limited to the functional testing of
-third party API compliance. Complex scenarios should be avoided, and
-instead exercised with the OpenStack API, unless the third party API
-can't be tested without those scenarios.
-
-Whenever possible third party API testing should use a client as close
-to the third party API as possible. The point of these tests is API
-validation.
diff --git a/tempest/thirdparty/__init__.py b/tempest/thirdparty/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/thirdparty/__init__.py
+++ /dev/null
diff --git a/tempest/thirdparty/boto/__init__.py b/tempest/thirdparty/boto/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/thirdparty/boto/__init__.py
+++ /dev/null
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
deleted file mode 100644
index cfd3747..0000000
--- a/tempest/thirdparty/boto/test.py
+++ /dev/null
@@ -1,694 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import contextlib
-import logging as orig_logging
-import os
-import re
-
-import boto
-from boto import ec2
-from boto import exception
-from boto import s3
-from oslo_log import log as logging
-import six
-from six.moves.urllib import parse as urlparse
-from tempest_lib import exceptions as lib_exc
-
-from tempest.common import credentials_factory as credentials
-from tempest.common.utils import file_utils
-from tempest import config
-from tempest import exceptions
-import tempest.test
-from tempest.thirdparty.boto.utils import wait
-
-CONF = config.CONF
-LOG = logging.getLogger(__name__)
-
-
-def decision_maker():
-    A_I_IMAGES_READY = True  # ari,ami,aki
-    S3_CAN_CONNECT_ERROR = None
-    EC2_CAN_CONNECT_ERROR = None
-    secret_matcher = re.compile("[A-Za-z0-9+/]{32,}")  # 40 in other system
-    id_matcher = re.compile("[A-Za-z0-9]{20,}")
-
-    def all_read(*args):
-        return all(map(file_utils.have_effective_read_access, args))
-
-    materials_path = CONF.boto.s3_materials_path
-    ami_path = materials_path + os.sep + CONF.boto.ami_manifest
-    aki_path = materials_path + os.sep + CONF.boto.aki_manifest
-    ari_path = materials_path + os.sep + CONF.boto.ari_manifest
-
-    A_I_IMAGES_READY = all_read(ami_path, aki_path, ari_path)
-    boto_logger = logging.getLogger('boto')
-    level = boto_logger.logger.level
-    # suppress logging for boto
-    boto_logger.logger.setLevel(orig_logging.CRITICAL)
-
-    def _cred_sub_check(connection_data):
-        if not id_matcher.match(connection_data["aws_access_key_id"]):
-            raise Exception("Invalid AWS access Key")
-        if not secret_matcher.match(connection_data["aws_secret_access_key"]):
-            raise Exception("Invalid AWS secret Key")
-        raise Exception("Unknown (Authentication?) Error")
-    # NOTE(andreaf) Setting up an extra manager here is redundant,
-    # and should be removed.
-    openstack = credentials.ConfiguredUserManager()
-    try:
-        if urlparse.urlparse(CONF.boto.ec2_url).hostname is None:
-            raise Exception("Failed to get hostname from the ec2_url")
-        ec2client = openstack.ec2api_client
-        try:
-            ec2client.get_all_regions()
-        except exception.BotoServerError as exc:
-                if exc.error_code is None:
-                    raise Exception("EC2 target does not looks EC2 service")
-                _cred_sub_check(ec2client.connection_data)
-
-    except lib_exc.Unauthorized:
-        EC2_CAN_CONNECT_ERROR = "AWS credentials not set," +\
-                                " also failed to get it from keystone"
-    except Exception as exc:
-        EC2_CAN_CONNECT_ERROR = str(exc)
-
-    try:
-        if urlparse.urlparse(CONF.boto.s3_url).hostname is None:
-            raise Exception("Failed to get hostname from the s3_url")
-        s3client = openstack.s3_client
-        try:
-            s3client.get_bucket("^INVALID*#()@INVALID.")
-        except exception.BotoServerError as exc:
-            if exc.status == 403:
-                _cred_sub_check(s3client.connection_data)
-    except Exception as exc:
-        S3_CAN_CONNECT_ERROR = str(exc)
-    except lib_exc.Unauthorized:
-        S3_CAN_CONNECT_ERROR = "AWS credentials not set," +\
-                               " failed to get them even by keystoneclient"
-    boto_logger.logger.setLevel(level)
-    return {'A_I_IMAGES_READY': A_I_IMAGES_READY,
-            'S3_CAN_CONNECT_ERROR': S3_CAN_CONNECT_ERROR,
-            'EC2_CAN_CONNECT_ERROR': EC2_CAN_CONNECT_ERROR}
-
-
-class BotoExceptionMatcher(object):
-    STATUS_RE = r'[45]\d\d'
-    CODE_RE = '.*'  # regexp makes sense in group match
-
-    def match(self, exc):
-        """Check boto exception
-
-        :returns: Returns with an error string if it does not match,
-                  returns with None when it matches.
-        """
-        if not isinstance(exc, exception.BotoServerError):
-            return "%r not an BotoServerError instance" % exc
-        LOG.info("Status: %s , error_code: %s", exc.status, exc.error_code)
-        if re.match(self.STATUS_RE, str(exc.status)) is None:
-            return ("Status code (%s) does not match"
-                    "the expected re pattern \"%s\""
-                    % (exc.status, self.STATUS_RE))
-        if re.match(self.CODE_RE, str(exc.error_code)) is None:
-            return ("Error code (%s) does not match" +
-                    "the expected re pattern \"%s\"") %\
-                   (exc.error_code, self.CODE_RE)
-        return None
-
-
-class ClientError(BotoExceptionMatcher):
-    STATUS_RE = r'4\d\d'
-
-
-class ServerError(BotoExceptionMatcher):
-    STATUS_RE = r'5\d\d'
-
-
-def _add_matcher_class(error_cls, error_data, base=BotoExceptionMatcher):
-    """Usable for adding an ExceptionMatcher(s) into the exception tree.
-
-       The not leaf elements does wildcard match
-    """
-    # in error_code just literal and '.' characters expected
-    if not isinstance(error_data, six.string_types):
-        (error_code, status_code) = map(str, error_data)
-    else:
-        status_code = None
-        error_code = error_data
-    parts = error_code.split('.')
-    basematch = ""
-    num_parts = len(parts)
-    max_index = num_parts - 1
-    add_cls = error_cls
-    for i_part in six.moves.xrange(num_parts):
-        part = parts[i_part]
-        leaf = i_part == max_index
-        if not leaf:
-            match = basematch + part + "[.].*"
-        else:
-            match = basematch + part
-
-        basematch += part + "[.]"
-        if not hasattr(add_cls, part):
-            cls_dict = {"CODE_RE": match}
-            if leaf and status_code is not None:
-                cls_dict["STATUS_RE"] = status_code
-            cls = type(part, (base, ), cls_dict)
-            setattr(add_cls, part, cls())
-            add_cls = cls
-        elif leaf:
-            raise LookupError("Tries to redefine an error code \"%s\"" % part)
-        else:
-            add_cls = getattr(add_cls, part)
-
-
-# TODO(afazekas): classmethod handling
-def friendly_function_name_simple(call_able):
-    name = ""
-    if hasattr(call_able, "im_class"):
-        name += call_able.im_class.__name__ + "."
-    name += call_able.__name__
-    return name
-
-
-def friendly_function_call_str(call_able, *args, **kwargs):
-    string = friendly_function_name_simple(call_able)
-    string += "(" + ", ".join(map(str, args))
-    if len(kwargs):
-        if len(args):
-            string += ", "
-    string += ", ".join("=".join(map(str, (key, value)))
-                        for (key, value) in kwargs.items())
-    return string + ")"
-
-
-class BotoTestCase(tempest.test.BaseTestCase):
-    """Recommended to use as base class for boto related test."""
-
-    credentials = ['primary']
-
-    @classmethod
-    def skip_checks(cls):
-        super(BotoTestCase, cls).skip_checks()
-        if not CONF.compute_feature_enabled.ec2_api:
-            raise cls.skipException("The EC2 API is not available")
-        if not CONF.identity_feature_enabled.api_v2 or \
-                not CONF.identity.auth_version == 'v2':
-            raise cls.skipException("Identity v2 is not available")
-
-    @classmethod
-    def resource_setup(cls):
-        super(BotoTestCase, cls).resource_setup()
-        cls.conclusion = decision_maker()
-        # The trash contains cleanup functions and parameters in tuples
-        # (function, *args, **kwargs)
-        cls._resource_trash_bin = {}
-        cls._sequence = -1
-        if (hasattr(cls, "EC2") and
-            cls.conclusion['EC2_CAN_CONNECT_ERROR'] is not None):
-            raise cls.skipException("EC2 " + cls.__name__ + ": " +
-                                    cls.conclusion['EC2_CAN_CONNECT_ERROR'])
-        if (hasattr(cls, "S3") and
-            cls.conclusion['S3_CAN_CONNECT_ERROR'] is not None):
-            raise cls.skipException("S3 " + cls.__name__ + ": " +
-                                    cls.conclusion['S3_CAN_CONNECT_ERROR'])
-
-    @classmethod
-    def addResourceCleanUp(cls, function, *args, **kwargs):
-        """Adds CleanUp callable, used by tearDownClass.
-
-        Recommended to a use (deep)copy on the mutable args.
-        """
-        cls._sequence = cls._sequence + 1
-        cls._resource_trash_bin[cls._sequence] = (function, args, kwargs)
-        return cls._sequence
-
-    @classmethod
-    def cancelResourceCleanUp(cls, key):
-        """Cancel Clean up request."""
-        del cls._resource_trash_bin[key]
-
-    # TODO(afazekas): Add "with" context handling
-    def assertBotoError(self, excMatcher, callableObj,
-                        *args, **kwargs):
-        """Example usage:
-
-            self.assertBotoError(self.ec2_error_code.client.
-                                 InvalidKeyPair.Duplicate,
-                                 self.client.create_keypair,
-                                 key_name)
-        """
-        try:
-            callableObj(*args, **kwargs)
-        except exception.BotoServerError as exc:
-            error_msg = excMatcher.match(exc)
-            if error_msg is not None:
-                raise self.failureException(error_msg)
-        else:
-            raise self.failureException("BotoServerError not raised")
-
-    @classmethod
-    def resource_cleanup(cls):
-        """Calls the callables added by addResourceCleanUp
-
-        when you overwrite this function don't forget to call this too.
-        """
-        fail_count = 0
-        trash_keys = sorted(cls._resource_trash_bin, reverse=True)
-        for key in trash_keys:
-            (function, pos_args, kw_args) = cls._resource_trash_bin[key]
-            try:
-                func_name = friendly_function_call_str(function, *pos_args,
-                                                       **kw_args)
-                LOG.debug("Cleaning up: %s" % func_name)
-                function(*pos_args, **kw_args)
-            except BaseException:
-                fail_count += 1
-                LOG.exception("Cleanup failed %s" % func_name)
-            finally:
-                del cls._resource_trash_bin[key]
-        super(BotoTestCase, cls).resource_cleanup()
-        # NOTE(afazekas): let the super called even on exceptions
-        # The real exceptions already logged, if the super throws another,
-        # does not causes hidden issues
-        if fail_count:
-            raise exceptions.TearDownException(num=fail_count)
-
-    ec2_error_code = BotoExceptionMatcher()
-    # InsufficientInstanceCapacity can be both server and client error
-    ec2_error_code.server = ServerError()
-    ec2_error_code.client = ClientError()
-    s3_error_code = BotoExceptionMatcher()
-    s3_error_code.server = ServerError()
-    s3_error_code.client = ClientError()
-    valid_image_state = set(('available', 'pending', 'failed'))
-    # NOTE(afazekas): 'paused' is not valid status in EC2, but it does not have
-    # a good mapping, because it uses memory, but not really a running machine
-    valid_instance_state = set(('pending', 'running', 'shutting-down',
-                                'terminated', 'stopping', 'stopped', 'paused'))
-    valid_volume_status = set(('creating', 'available', 'in-use',
-                               'deleting', 'deleted', 'error'))
-    valid_snapshot_status = set(('pending', 'completed', 'error'))
-
-    gone_set = set(('_GONE',))
-
-    @classmethod
-    def get_lfunction_gone(cls, obj):
-        # NOTE: If the object is instance of a well know type returns back with
-        # with the corresponding function otherwise it assumes the obj itself
-        # is the function.
-        ec = cls.ec2_error_code
-        if isinstance(obj, ec2.instance.Instance):
-            colusure_matcher = ec.client.InvalidInstanceID.NotFound
-            status_attr = "state"
-        elif isinstance(obj, ec2.image.Image):
-            colusure_matcher = ec.client.InvalidAMIID.NotFound
-            status_attr = "state"
-        elif isinstance(obj, ec2.snapshot.Snapshot):
-            colusure_matcher = ec.client.InvalidSnapshot.NotFound
-            status_attr = "status"
-        elif isinstance(obj, ec2.volume.Volume):
-            colusure_matcher = ec.client.InvalidVolume.NotFound
-            status_attr = "status"
-        else:
-            return obj
-
-        def _status():
-            try:
-                obj.update(validate=True)
-            except ValueError:
-                return "_GONE"
-            except exception.EC2ResponseError as exc:
-                if colusure_matcher.match(exc) is None:
-                    return "_GONE"
-                else:
-                    raise
-            return getattr(obj, status_attr)
-
-        return _status
-
-    def state_wait_gone(self, lfunction, final_set, valid_set):
-        if not isinstance(final_set, set):
-            final_set = set((final_set,))
-        final_set |= self.gone_set
-        lfunction = self.get_lfunction_gone(lfunction)
-        state = wait.state_wait(lfunction, final_set, valid_set)
-        self.assertIn(state, valid_set | self.gone_set)
-        return state
-
-    def waitImageState(self, lfunction, wait_for):
-        return self.state_wait_gone(lfunction, wait_for,
-                                    self.valid_image_state)
-
-    def waitInstanceState(self, lfunction, wait_for):
-        return self.state_wait_gone(lfunction, wait_for,
-                                    self.valid_instance_state)
-
-    def waitSnapshotStatus(self, lfunction, wait_for):
-        return self.state_wait_gone(lfunction, wait_for,
-                                    self.valid_snapshot_status)
-
-    def waitVolumeStatus(self, lfunction, wait_for):
-        return self.state_wait_gone(lfunction, wait_for,
-                                    self.valid_volume_status)
-
-    def assertImageStateWait(self, lfunction, wait_for):
-        state = self.waitImageState(lfunction, wait_for)
-        self.assertIn(state, wait_for)
-
-    def assertInstanceStateWait(self, lfunction, wait_for):
-        state = self.waitInstanceState(lfunction, wait_for)
-        self.assertIn(state, wait_for)
-
-    def assertVolumeStatusWait(self, lfunction, wait_for):
-        state = self.waitVolumeStatus(lfunction, wait_for)
-        self.assertIn(state, wait_for)
-
-    def assertSnapshotStatusWait(self, lfunction, wait_for):
-        state = self.waitSnapshotStatus(lfunction, wait_for)
-        self.assertIn(state, wait_for)
-
-    def assertAddressDisassociatedWait(self, address):
-
-        def _disassociate():
-            cli = self.ec2_client
-            addresses = cli.get_all_addresses(addresses=(address.public_ip,))
-            if len(addresses) != 1:
-                return "INVALID"
-            if addresses[0].instance_id:
-                LOG.info("%s associated to %s",
-                         address.public_ip,
-                         addresses[0].instance_id)
-                return "ASSOCIATED"
-            return "DISASSOCIATED"
-
-        state = wait.state_wait(_disassociate, "DISASSOCIATED",
-                                set(("ASSOCIATED", "DISASSOCIATED")))
-        self.assertEqual(state, "DISASSOCIATED")
-
-    def assertAddressReleasedWait(self, address):
-
-        def _address_delete():
-            # NOTE(afazekas): the filter gives back IP
-            # even if it is not associated to my tenant
-            if (address.public_ip not in map(lambda a: a.public_ip,
-                self.ec2_client.get_all_addresses())):
-                    return "DELETED"
-            return "NOTDELETED"
-
-        state = wait.state_wait(_address_delete, "DELETED")
-        self.assertEqual(state, "DELETED")
-
-    def assertReSearch(self, regexp, string):
-        if re.search(regexp, string) is None:
-            raise self.failureException("regexp: '%s' not found in '%s'" %
-                                        (regexp, string))
-
-    def assertNotReSearch(self, regexp, string):
-        if re.search(regexp, string) is not None:
-            raise self.failureException("regexp: '%s' found in '%s'" %
-                                        (regexp, string))
-
-    def assertReMatch(self, regexp, string):
-        if re.match(regexp, string) is None:
-            raise self.failureException("regexp: '%s' not matches on '%s'" %
-                                        (regexp, string))
-
-    def assertNotReMatch(self, regexp, string):
-        if re.match(regexp, string) is not None:
-            raise self.failureException("regexp: '%s' matches on '%s'" %
-                                        (regexp, string))
-
-    @classmethod
-    def destroy_bucket(cls, connection_data, bucket):
-        """Destroys the bucket and its content, just for teardown."""
-        exc_num = 0
-        try:
-            with contextlib.closing(
-                    boto.connect_s3(**connection_data)) as conn:
-                if isinstance(bucket, basestring):
-                    bucket = conn.lookup(bucket)
-                    assert isinstance(bucket, s3.bucket.Bucket)
-                for obj in bucket.list():
-                    try:
-                        bucket.delete_key(obj.key)
-                        obj.close()
-                    except BaseException:
-                        LOG.exception("Failed to delete key %s " % obj.key)
-                        exc_num += 1
-            conn.delete_bucket(bucket)
-        except BaseException:
-            LOG.exception("Failed to destroy bucket %s " % bucket)
-            exc_num += 1
-        if exc_num:
-            raise exceptions.TearDownException(num=exc_num)
-
-    @classmethod
-    def destroy_reservation(cls, reservation):
-        """Terminate instances in a reservation, just for teardown."""
-        exc_num = 0
-
-        def _instance_state():
-            try:
-                instance.update(validate=True)
-            except ValueError:
-                return "_GONE"
-            except exception.EC2ResponseError as exc:
-                if cls.ec2_error_code.\
-                        client.InvalidInstanceID.NotFound.match(exc) is None:
-                    return "_GONE"
-                # NOTE(afazekas): incorrect code,
-                # but the resource must be destroyed
-                if exc.error_code == "InstanceNotFound":
-                    return "_GONE"
-
-            return instance.state
-
-        for instance in reservation.instances:
-            try:
-                instance.terminate()
-                wait.re_search_wait(_instance_state, "_GONE")
-            except BaseException:
-                LOG.exception("Failed to terminate instance %s " % instance)
-                exc_num += 1
-        if exc_num:
-            raise exceptions.TearDownException(num=exc_num)
-
-    # NOTE(afazekas): The incorrect ErrorCodes makes very, very difficult
-    # to write better teardown
-
-    @classmethod
-    def destroy_security_group_wait(cls, group):
-        """Delete group.
-
-           Use just for teardown!
-        """
-        # NOTE(afazekas): should wait/try until all related instance terminates
-        group.delete()
-
-    @classmethod
-    def destroy_volume_wait(cls, volume):
-        """Delete volume, tries to detach first.
-
-           Use just for teardown!
-        """
-        exc_num = 0
-        snaps = volume.snapshots()
-        if len(snaps):
-            LOG.critical("%s Volume has %s snapshot(s)", volume.id,
-                         map(snaps.id, snaps))
-
-        # NOTE(afazekas): detaching/attaching not valid EC2 status
-        def _volume_state():
-            volume.update(validate=True)
-            try:
-                # NOTE(gmann): Make sure volume is attached.
-                # Checking status as 'not "available"' is not enough to make
-                # sure volume is attached as it can be in "error" state
-                if volume.status == "in-use":
-                    volume.detach(force=True)
-            except BaseException:
-                LOG.exception("Failed to detach volume %s" % volume)
-                # exc_num += 1 "nonlocal" not in python2
-            return volume.status
-
-        try:
-            wait.re_search_wait(_volume_state, "available")
-            # not validates status
-            LOG.info(_volume_state())
-            volume.delete()
-        except BaseException:
-            LOG.exception("Failed to delete volume %s" % volume)
-            exc_num += 1
-        if exc_num:
-            raise exceptions.TearDownException(num=exc_num)
-
-    @classmethod
-    def destroy_snapshot_wait(cls, snapshot):
-        """delete snapshot, wait until it ceases to exist."""
-        snapshot.delete()
-
-        def _update():
-            snapshot.update(validate=True)
-
-        wait.wait_exception(_update)
-
-
-# you can specify tuples if you want to specify the status pattern
-for code in ('AddressLimitExceeded', 'AttachmentLimitExceeded', 'AuthFailure',
-             'Blocked', 'CustomerGatewayLimitExceeded', 'DependencyViolation',
-             'DiskImageSizeTooLarge', 'FilterLimitExceeded',
-             'Gateway.NotAttached', 'IdempotentParameterMismatch',
-             'IncorrectInstanceState', 'IncorrectState',
-             'InstanceLimitExceeded', 'InsufficientInstanceCapacity',
-             'InsufficientReservedInstancesCapacity',
-             'InternetGatewayLimitExceeded', 'InvalidAMIAttributeItemValue',
-             'InvalidAMIID.Malformed', 'InvalidAMIID.NotFound',
-             'InvalidAMIID.Unavailable', 'InvalidAssociationID.NotFound',
-             'InvalidAttachment.NotFound', 'InvalidConversionTaskId',
-             'InvalidCustomerGateway.DuplicateIpAddress',
-             'InvalidCustomerGatewayID.NotFound', 'InvalidDevice.InUse',
-             'InvalidDhcpOptionsID.NotFound', 'InvalidFormat',
-             'InvalidFilter', 'InvalidGatewayID.NotFound',
-             'InvalidGroup.Duplicate', 'InvalidGroupId.Malformed',
-             'InvalidGroup.InUse', 'InvalidGroup.NotFound',
-             'InvalidGroup.Reserved', 'InvalidInstanceID.Malformed',
-             'InvalidInstanceID.NotFound',
-             'InvalidInternetGatewayID.NotFound', 'InvalidIPAddress.InUse',
-             'InvalidKeyPair.Duplicate', 'InvalidKeyPair.Format',
-             'InvalidKeyPair.NotFound', 'InvalidManifest',
-             'InvalidNetworkAclEntry.NotFound',
-             'InvalidNetworkAclID.NotFound', 'InvalidParameterCombination',
-             'InvalidParameterValue', 'InvalidPermission.Duplicate',
-             'InvalidPermission.Malformed', 'InvalidReservationID.Malformed',
-             'InvalidReservationID.NotFound', 'InvalidRoute.NotFound',
-             'InvalidRouteTableID.NotFound',
-             'InvalidSecurity.RequestHasExpired',
-             'InvalidSnapshotID.Malformed', 'InvalidSnapshot.NotFound',
-             'InvalidUserID.Malformed', 'InvalidReservedInstancesId',
-             'InvalidReservedInstancesOfferingId',
-             'InvalidSubnetID.NotFound', 'InvalidVolumeID.Duplicate',
-             'InvalidVolumeID.Malformed', 'InvalidVolumeID.ZoneMismatch',
-             'InvalidVolume.NotFound', 'InvalidVpcID.NotFound',
-             'InvalidVpnConnectionID.NotFound',
-             'InvalidVpnGatewayID.NotFound',
-             'InvalidZone.NotFound', 'LegacySecurityGroup',
-             'MissingParameter', 'NetworkAclEntryAlreadyExists',
-             'NetworkAclEntryLimitExceeded', 'NetworkAclLimitExceeded',
-             'NonEBSInstance', 'PendingSnapshotLimitExceeded',
-             'PendingVerification', 'OptInRequired', 'RequestLimitExceeded',
-             'ReservedInstancesLimitExceeded', 'Resource.AlreadyAssociated',
-             'ResourceLimitExceeded', 'RouteAlreadyExists',
-             'RouteLimitExceeded', 'RouteTableLimitExceeded',
-             'RulesPerSecurityGroupLimitExceeded',
-             'SecurityGroupLimitExceeded',
-             'SecurityGroupsPerInstanceLimitExceeded',
-             'SnapshotLimitExceeded', 'SubnetLimitExceeded',
-             'UnknownParameter', 'UnsupportedOperation',
-             'VolumeLimitExceeded', 'VpcLimitExceeded',
-             'VpnConnectionLimitExceeded',
-             'VpnGatewayAttachmentLimitExceeded', 'VpnGatewayLimitExceeded'):
-    _add_matcher_class(BotoTestCase.ec2_error_code.client,
-                       code, base=ClientError)
-
-for code in ('InsufficientAddressCapacity', 'InsufficientInstanceCapacity',
-             'InsufficientReservedInstanceCapacity', 'InternalError',
-             'Unavailable'):
-    _add_matcher_class(BotoTestCase.ec2_error_code.server,
-                       code, base=ServerError)
-
-
-for code in (('AccessDenied', 403),
-             ('AccountProblem', 403),
-             ('AmbiguousGrantByEmailAddress', 400),
-             ('BadDigest', 400),
-             ('BucketAlreadyExists', 409),
-             ('BucketAlreadyOwnedByYou', 409),
-             ('BucketNotEmpty', 409),
-             ('CredentialsNotSupported', 400),
-             ('CrossLocationLoggingProhibited', 403),
-             ('EntityTooSmall', 400),
-             ('EntityTooLarge', 400),
-             ('ExpiredToken', 400),
-             ('IllegalVersioningConfigurationException', 400),
-             ('IncompleteBody', 400),
-             ('IncorrectNumberOfFilesInPostRequest', 400),
-             ('InlineDataTooLarge', 400),
-             ('InvalidAccessKeyId', 403),
-             'InvalidAddressingHeader',
-             ('InvalidArgument', 400),
-             ('InvalidBucketName', 400),
-             ('InvalidBucketState', 409),
-             ('InvalidDigest', 400),
-             ('InvalidLocationConstraint', 400),
-             ('InvalidPart', 400),
-             ('InvalidPartOrder', 400),
-             ('InvalidPayer', 403),
-             ('InvalidPolicyDocument', 400),
-             ('InvalidRange', 416),
-             ('InvalidRequest', 400),
-             ('InvalidSecurity', 403),
-             ('InvalidSOAPRequest', 400),
-             ('InvalidStorageClass', 400),
-             ('InvalidTargetBucketForLogging', 400),
-             ('InvalidToken', 400),
-             ('InvalidURI', 400),
-             ('KeyTooLong', 400),
-             ('MalformedACLError', 400),
-             ('MalformedPOSTRequest', 400),
-             ('MalformedXML', 400),
-             ('MaxMessageLengthExceeded', 400),
-             ('MaxPostPreDataLengthExceededError', 400),
-             ('MetadataTooLarge', 400),
-             ('MethodNotAllowed', 405),
-             ('MissingAttachment'),
-             ('MissingContentLength', 411),
-             ('MissingRequestBodyError', 400),
-             ('MissingSecurityElement', 400),
-             ('MissingSecurityHeader', 400),
-             ('NoLoggingStatusForKey', 400),
-             ('NoSuchBucket', 404),
-             ('NoSuchKey', 404),
-             ('NoSuchLifecycleConfiguration', 404),
-             ('NoSuchUpload', 404),
-             ('NoSuchVersion', 404),
-             ('NotSignedUp', 403),
-             ('NotSuchBucketPolicy', 404),
-             ('OperationAborted', 409),
-             ('PermanentRedirect', 301),
-             ('PreconditionFailed', 412),
-             ('Redirect', 307),
-             ('RequestIsNotMultiPartContent', 400),
-             ('RequestTimeout', 400),
-             ('RequestTimeTooSkewed', 403),
-             ('RequestTorrentOfBucketError', 400),
-             ('SignatureDoesNotMatch', 403),
-             ('TemporaryRedirect', 307),
-             ('TokenRefreshRequired', 400),
-             ('TooManyBuckets', 400),
-             ('UnexpectedContent', 400),
-             ('UnresolvableGrantByEmailAddress', 400),
-             ('UserKeyMustBeSpecified', 400)):
-    _add_matcher_class(BotoTestCase.s3_error_code.client,
-                       code, base=ClientError)
-
-
-for code in (('InternalError', 500),
-             ('NotImplemented', 501),
-             ('ServiceUnavailable', 503),
-             ('SlowDown', 503)):
-    _add_matcher_class(BotoTestCase.s3_error_code.server,
-                       code, base=ServerError)
diff --git a/tempest/thirdparty/boto/test_ec2_instance_run.py b/tempest/thirdparty/boto/test_ec2_instance_run.py
deleted file mode 100644
index 6c1b362..0000000
--- a/tempest/thirdparty/boto/test_ec2_instance_run.py
+++ /dev/null
@@ -1,363 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from oslo_log import log as logging
-
-from tempest.common.utils import data_utils
-from tempest.common.utils.linux import remote_client
-from tempest import config
-from tempest import exceptions
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-from tempest.thirdparty.boto.utils import s3
-from tempest.thirdparty.boto.utils import wait
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class InstanceRunTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(InstanceRunTest, cls).setup_clients()
-        cls.s3_client = cls.os.s3_client
-        cls.ec2_client = cls.os.ec2api_client
-
-    @classmethod
-    def resource_setup(cls):
-        super(InstanceRunTest, cls).resource_setup()
-        if not cls.conclusion['A_I_IMAGES_READY']:
-            raise cls.skipException("".join(("EC2 ", cls.__name__,
-                                    ": requires ami/aki/ari manifest")))
-        cls.zone = CONF.boto.aws_zone
-        cls.materials_path = CONF.boto.s3_materials_path
-        ami_manifest = CONF.boto.ami_manifest
-        aki_manifest = CONF.boto.aki_manifest
-        ari_manifest = CONF.boto.ari_manifest
-        cls.instance_type = CONF.boto.instance_type
-        cls.bucket_name = data_utils.rand_name("s3bucket")
-        cls.keypair_name = data_utils.rand_name("keypair")
-        cls.keypair = cls.ec2_client.create_key_pair(cls.keypair_name)
-        cls.addResourceCleanUp(cls.ec2_client.delete_key_pair,
-                               cls.keypair_name)
-        bucket = cls.s3_client.create_bucket(cls.bucket_name)
-        cls.addResourceCleanUp(cls.destroy_bucket,
-                               cls.s3_client.connection_data,
-                               cls.bucket_name)
-        s3.s3_upload_dir(bucket, cls.materials_path)
-        cls.images = {"ami":
-                      {"name": data_utils.rand_name("ami-name"),
-                       "location": cls.bucket_name + "/" + ami_manifest},
-                      "aki":
-                      {"name": data_utils.rand_name("aki-name"),
-                       "location": cls.bucket_name + "/" + aki_manifest},
-                      "ari":
-                      {"name": data_utils.rand_name("ari-name"),
-                       "location": cls.bucket_name + "/" + ari_manifest}}
-        for image_type in ("aki", "ari"):
-            image = cls.images[image_type]
-            image["image_id"] = cls.ec2_client.register_image(
-                name=image["name"],
-                image_location=image["location"])
-            cls.addResourceCleanUp(cls.ec2_client.deregister_image,
-                                   image["image_id"])
-        image = cls.images["ami"]
-        image["image_id"] = cls.ec2_client.register_image(
-            name=image["name"],
-            image_location=image["location"],
-            kernel_id=cls.images["aki"]["image_id"],
-            ramdisk_id=cls.images["ari"]["image_id"])
-        cls.addResourceCleanUp(cls.ec2_client.deregister_image,
-                               image["image_id"])
-
-        for image in cls.images.itervalues():
-            def _state():
-                retr = cls.ec2_client.get_image(image["image_id"])
-                return retr.state
-            state = wait.state_wait(_state, "available")
-            if state != "available":
-                for _image in cls.images.itervalues():
-                    cls.ec2_client.deregister_image(_image["image_id"])
-                raise exceptions.EC2RegisterImageException(
-                    image_id=image["image_id"])
-
-    def _terminate_reservation(self, reservation, rcuk):
-        for instance in reservation.instances:
-            instance.terminate()
-        for instance in reservation.instances:
-            self.assertInstanceStateWait(instance, '_GONE')
-        self.cancelResourceCleanUp(rcuk)
-
-    @test.idempotent_id('c881fbb7-d56e-4054-9d76-1c3a60a207b0')
-    def test_run_idempotent_instances(self):
-        # EC2 run instances idempotently
-
-        def _run_instance(client_token):
-            reservation = self.ec2_client.run_instances(
-                image_id=self.images["ami"]["image_id"],
-                kernel_id=self.images["aki"]["image_id"],
-                ramdisk_id=self.images["ari"]["image_id"],
-                instance_type=self.instance_type,
-                client_token=client_token)
-            rcuk = self.addResourceCleanUp(self.destroy_reservation,
-                                           reservation)
-            return (reservation, rcuk)
-
-        reservation_1, rcuk_1 = _run_instance('token_1')
-        reservation_2, rcuk_2 = _run_instance('token_2')
-        reservation_1a, rcuk_1a = _run_instance('token_1')
-
-        self.assertIsNotNone(reservation_1)
-        self.assertIsNotNone(reservation_2)
-        self.assertIsNotNone(reservation_1a)
-
-        # same reservation for token_1
-        self.assertEqual(reservation_1.id, reservation_1a.id)
-
-        # Cancel cleanup -- since it's a duplicate, it's
-        # handled by rcuk1
-        self.cancelResourceCleanUp(rcuk_1a)
-
-        self._terminate_reservation(reservation_1, rcuk_1)
-        self._terminate_reservation(reservation_2, rcuk_2)
-
-    @test.idempotent_id('2ea26a39-f96c-48fc-8374-5c10ec184c67')
-    def test_run_stop_terminate_instance(self):
-        # EC2 run, stop and terminate instance
-        image_ami = self.ec2_client.get_image(self.images["ami"]
-                                              ["image_id"])
-        reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
-                                    ramdisk_id=self.images["ari"]["image_id"],
-                                    instance_type=self.instance_type)
-        rcuk = self.addResourceCleanUp(self.destroy_reservation, reservation)
-
-        for instance in reservation.instances:
-            LOG.info("state: %s", instance.state)
-            if instance.state != "running":
-                self.assertInstanceStateWait(instance, "running")
-
-        for instance in reservation.instances:
-            instance.stop()
-            LOG.info("state: %s", instance.state)
-            if instance.state != "stopped":
-                self.assertInstanceStateWait(instance, "stopped")
-
-        self._terminate_reservation(reservation, rcuk)
-
-    @test.idempotent_id('3d77225a-5cec-4e54-a017-9ebf11a266e6')
-    def test_run_stop_terminate_instance_with_tags(self):
-        # EC2 run, stop and terminate instance with tags
-        image_ami = self.ec2_client.get_image(self.images["ami"]
-                                              ["image_id"])
-        reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
-                                    ramdisk_id=self.images["ari"]["image_id"],
-                                    instance_type=self.instance_type)
-        rcuk = self.addResourceCleanUp(self.destroy_reservation, reservation)
-
-        for instance in reservation.instances:
-            LOG.info("state: %s", instance.state)
-            if instance.state != "running":
-                self.assertInstanceStateWait(instance, "running")
-            instance.add_tag('key1', value='value1')
-
-        tags = self.ec2_client.get_all_tags()
-        td = dict((item.name, item.value) for item in tags)
-
-        self.assertIn('key1', td)
-        self.assertEqual('value1', td['key1'])
-
-        tags = self.ec2_client.get_all_tags(filters={'key': 'key1'})
-        td = dict((item.name, item.value) for item in tags)
-        self.assertIn('key1', td)
-        self.assertEqual('value1', td['key1'])
-
-        tags = self.ec2_client.get_all_tags(filters={'value': 'value1'})
-        td = dict((item.name, item.value) for item in tags)
-        self.assertIn('key1', td)
-        self.assertEqual('value1', td['key1'])
-
-        tags = self.ec2_client.get_all_tags(filters={'key': 'value2'})
-        td = dict((item.name, item.value) for item in tags)
-        self.assertNotIn('key1', td)
-
-        for instance in reservation.instances:
-            instance.remove_tag('key1', value='value1')
-
-        tags = self.ec2_client.get_all_tags()
-
-        # NOTE: Volume-attach and detach causes metadata (tags) to be created
-        # for the volume. So exclude them while asserting.
-        self.assertNotIn('key1', tags)
-
-        for instance in reservation.instances:
-            instance.stop()
-            LOG.info("state: %s", instance.state)
-            if instance.state != "stopped":
-                self.assertInstanceStateWait(instance, "stopped")
-
-        self._terminate_reservation(reservation, rcuk)
-
-    @test.idempotent_id('252945b5-3294-4fda-ae21-928a42f63f76')
-    def test_run_terminate_instance(self):
-        # EC2 run, terminate immediately
-        image_ami = self.ec2_client.get_image(self.images["ami"]
-                                              ["image_id"])
-        reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
-                                    ramdisk_id=self.images["ari"]["image_id"],
-                                    instance_type=self.instance_type)
-
-        for instance in reservation.instances:
-            instance.terminate()
-        self.assertInstanceStateWait(instance, '_GONE')
-
-    @test.idempotent_id('ab836c29-737b-4101-9fb9-87045eaf89e9')
-    def test_compute_with_volumes(self):
-        # EC2 1. integration test (not strict)
-        image_ami = self.ec2_client.get_image(self.images["ami"]["image_id"])
-        sec_group_name = data_utils.rand_name("securitygroup")
-        group_desc = sec_group_name + " security group description "
-        security_group = self.ec2_client.create_security_group(sec_group_name,
-                                                               group_desc)
-        self.addResourceCleanUp(self.destroy_security_group_wait,
-                                security_group)
-        self.assertTrue(
-            self.ec2_client.authorize_security_group(
-                sec_group_name,
-                ip_protocol="icmp",
-                cidr_ip="0.0.0.0/0",
-                from_port=-1,
-                to_port=-1))
-        self.assertTrue(
-            self.ec2_client.authorize_security_group(
-                sec_group_name,
-                ip_protocol="tcp",
-                cidr_ip="0.0.0.0/0",
-                from_port=22,
-                to_port=22))
-        reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
-                                    ramdisk_id=self.images["ari"]["image_id"],
-                                    instance_type=self.instance_type,
-                                    key_name=self.keypair_name,
-                                    security_groups=(sec_group_name,))
-
-        LOG.debug("Instance booted - state: %s",
-                  reservation.instances[0].state)
-
-        self.addResourceCleanUp(self.destroy_reservation,
-                                reservation)
-        volume = self.ec2_client.create_volume(CONF.volume.volume_size,
-                                               self.zone)
-        LOG.debug("Volume created - status: %s", volume.status)
-
-        self.addResourceCleanUp(self.destroy_volume_wait, volume)
-        instance = reservation.instances[0]
-        if instance.state != "running":
-            self.assertInstanceStateWait(instance, "running")
-        LOG.debug("Instance now running - state: %s", instance.state)
-
-        address = self.ec2_client.allocate_address()
-        rcuk_a = self.addResourceCleanUp(address.delete)
-        self.assertTrue(address.associate(instance.id))
-
-        rcuk_da = self.addResourceCleanUp(address.disassociate)
-        # TODO(afazekas): ping test. dependecy/permission ?
-
-        self.assertVolumeStatusWait(volume, "available")
-        # NOTE(afazekas): it may be reports available before it is available
-
-        ssh = remote_client.RemoteClient(address.public_ip,
-                                         CONF.compute.ssh_user,
-                                         pkey=self.keypair.material)
-        text = data_utils.rand_name("Pattern text for console output")
-        try:
-            resp = ssh.write_to_console(text)
-        except Exception:
-            if not CONF.compute_feature_enabled.console_output:
-                LOG.debug('Console output not supported, cannot log')
-            else:
-                console_output = instance.get_console_output().output
-                LOG.debug('Console output for %s\nbody=\n%s',
-                          instance.id, console_output)
-            raise
-
-        self.assertFalse(resp)
-
-        def _output():
-            output = instance.get_console_output()
-            return output.output
-
-        wait.re_search_wait(_output, text)
-        part_lines = ssh.get_partitions().split('\n')
-        volume.attach(instance.id, "/dev/vdh")
-
-        def _volume_state():
-            """Return volume state realizing that 'in-use' is overloaded."""
-            volume.update(validate=True)
-            status = volume.status
-            attached = volume.attach_data.status
-            LOG.debug("Volume %s is in status: %s, attach_status: %s",
-                      volume.id, status, attached)
-            # Nova reports 'in-use' on 'attaching' volumes because we
-            # have a single volume status, and EC2 has 2. Ensure that
-            # if we aren't attached yet we return something other than
-            # 'in-use'
-            if status == 'in-use' and attached != 'attached':
-                return 'attaching'
-            else:
-                return status
-
-        wait.re_search_wait(_volume_state, "in-use")
-
-        # NOTE(afazekas):  Different Hypervisor backends names
-        # differently the devices,
-        # now we just test is the partition number increased/decrised
-
-        def _part_state():
-            current = ssh.get_partitions().split('\n')
-            LOG.debug("Partition map for instance: %s", current)
-            if current > part_lines:
-                return 'INCREASE'
-            if current < part_lines:
-                return 'DECREASE'
-            return 'EQUAL'
-
-        wait.state_wait(_part_state, 'INCREASE')
-        part_lines = ssh.get_partitions().split('\n')
-
-        # TODO(afazekas): Resource compare to the flavor settings
-
-        volume.detach()
-
-        self.assertVolumeStatusWait(volume, "available")
-
-        wait.state_wait(_part_state, 'DECREASE')
-
-        instance.stop()
-        address.disassociate()
-        self.assertAddressDisassociatedWait(address)
-        self.cancelResourceCleanUp(rcuk_da)
-        address.release()
-        self.assertAddressReleasedWait(address)
-        self.cancelResourceCleanUp(rcuk_a)
-
-        LOG.debug("Instance %s state: %s", instance.id, instance.state)
-        if instance.state != "stopped":
-            self.assertInstanceStateWait(instance, "stopped")
-        # TODO(afazekas): move steps from teardown to the test case
-
-
-# TODO(afazekas): Snapshot/volume read/write test case
diff --git a/tempest/thirdparty/boto/test_ec2_keys.py b/tempest/thirdparty/boto/test_ec2_keys.py
deleted file mode 100644
index 1b58cb4..0000000
--- a/tempest/thirdparty/boto/test_ec2_keys.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.common.utils import data_utils
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-def compare_key_pairs(a, b):
-    return (a.name == b.name and
-            a.fingerprint == b.fingerprint)
-
-
-class EC2KeysTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(EC2KeysTest, cls).setup_clients()
-        cls.client = cls.os.ec2api_client
-
-    @classmethod
-    def resource_setup(cls):
-        super(EC2KeysTest, cls).resource_setup()
-        cls.ec = cls.ec2_error_code
-
-# TODO(afazekas): merge create, delete, get test cases
-    @test.idempotent_id('54236804-01b7-4cfe-a6f9-bce1340feec8')
-    def test_create_ec2_keypair(self):
-        # EC2 create KeyPair
-        key_name = data_utils.rand_name("keypair")
-        self.addResourceCleanUp(self.client.delete_key_pair, key_name)
-        keypair = self.client.create_key_pair(key_name)
-        self.assertTrue(compare_key_pairs(keypair,
-                        self.client.get_key_pair(key_name)))
-
-    @test.idempotent_id('3283b898-f90c-4952-b238-3e42b8c3f34f')
-    def test_delete_ec2_keypair(self):
-        # EC2 delete KeyPair
-        key_name = data_utils.rand_name("keypair")
-        self.client.create_key_pair(key_name)
-        self.client.delete_key_pair(key_name)
-        self.assertIsNone(self.client.get_key_pair(key_name))
-
-    @test.idempotent_id('fd89bd26-4d4d-4cf3-a303-65dd9158fcdc')
-    def test_get_ec2_keypair(self):
-        # EC2 get KeyPair
-        key_name = data_utils.rand_name("keypair")
-        self.addResourceCleanUp(self.client.delete_key_pair, key_name)
-        keypair = self.client.create_key_pair(key_name)
-        self.assertTrue(compare_key_pairs(keypair,
-                        self.client.get_key_pair(key_name)))
-
-    @test.idempotent_id('daa73da1-e11c-4558-8d76-a716be79a401')
-    def test_duplicate_ec2_keypair(self):
-        # EC2 duplicate KeyPair
-        key_name = data_utils.rand_name("keypair")
-        self.addResourceCleanUp(self.client.delete_key_pair, key_name)
-        keypair = self.client.create_key_pair(key_name)
-        self.assertBotoError(self.ec.client.InvalidKeyPair.Duplicate,
-                             self.client.create_key_pair,
-                             key_name)
-        self.assertTrue(compare_key_pairs(keypair,
-                        self.client.get_key_pair(key_name)))
diff --git a/tempest/thirdparty/boto/test_ec2_security_groups.py b/tempest/thirdparty/boto/test_ec2_security_groups.py
deleted file mode 100644
index 594dc8b..0000000
--- a/tempest/thirdparty/boto/test_ec2_security_groups.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.common.utils import data_utils
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-class EC2SecurityGroupTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(EC2SecurityGroupTest, cls).setup_clients()
-        cls.client = cls.os.ec2api_client
-
-    @test.idempotent_id('519b566e-0c38-4629-905e-7d6b6355f524')
-    def test_create_authorize_security_group(self):
-        # EC2 Create, authorize/revoke security group
-        group_name = data_utils.rand_name("securty_group")
-        group_description = group_name + " security group description "
-        group = self.client.create_security_group(group_name,
-                                                  group_description)
-        self.addResourceCleanUp(self.client.delete_security_group, group_name)
-        groups_get = self.client.get_all_security_groups(
-            groupnames=(group_name,))
-        self.assertEqual(len(groups_get), 1)
-        group_get = groups_get[0]
-        self.assertEqual(group.name, group_get.name)
-        self.assertEqual(group.name, group_get.name)
-        # ping (icmp_echo) and other icmp allowed from everywhere
-        # from_port and to_port act as icmp type
-        success = self.client.authorize_security_group(group_name,
-                                                       ip_protocol="icmp",
-                                                       cidr_ip="0.0.0.0/0",
-                                                       from_port=-1,
-                                                       to_port=-1)
-        self.assertTrue(success)
-        # allow standard ssh port from anywhere
-        success = self.client.authorize_security_group(group_name,
-                                                       ip_protocol="tcp",
-                                                       cidr_ip="0.0.0.0/0",
-                                                       from_port=22,
-                                                       to_port=22)
-        self.assertTrue(success)
-        # TODO(afazekas): Duplicate tests
-        group_get = self.client.get_all_security_groups(
-            groupnames=(group_name,))[0]
-        # remove listed rules
-        for ip_permission in group_get.rules:
-            for cidr in ip_permission.grants:
-                self.assertTrue(self.client.revoke_security_group(group_name,
-                                ip_protocol=ip_permission.ip_protocol,
-                                cidr_ip=cidr,
-                                from_port=ip_permission.from_port,
-                                to_port=ip_permission.to_port))
-
-        group_get = self.client.get_all_security_groups(
-            groupnames=(group_name,))[0]
-        # all rules should be removed now
-        self.assertEqual(0, len(group_get.rules))
diff --git a/tempest/thirdparty/boto/test_ec2_volumes.py b/tempest/thirdparty/boto/test_ec2_volumes.py
deleted file mode 100644
index 483d4c3..0000000
--- a/tempest/thirdparty/boto/test_ec2_volumes.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from oslo_log import log as logging
-
-from tempest import config
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-CONF = config.CONF
-LOG = logging.getLogger(__name__)
-
-
-def compare_volumes(a, b):
-    return (a.id == b.id and
-            a.size == b.size)
-
-
-class EC2VolumesTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def skip_checks(cls):
-        super(EC2VolumesTest, cls).skip_checks()
-        if not CONF.service_available.cinder:
-            skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-
-    @classmethod
-    def setup_clients(cls):
-        super(EC2VolumesTest, cls).setup_clients()
-        cls.client = cls.os.ec2api_client
-
-    @classmethod
-    def resource_setup(cls):
-        super(EC2VolumesTest, cls).resource_setup()
-        cls.zone = CONF.boto.aws_zone
-
-    @test.idempotent_id('663f0077-c743-48ad-8ae0-46821cbc0918')
-    def test_create_get_delete(self):
-        # EC2 Create, get, delete Volume
-        volume = self.client.create_volume(CONF.volume.volume_size, self.zone)
-        cuk = self.addResourceCleanUp(self.client.delete_volume, volume.id)
-        self.assertIn(volume.status, self.valid_volume_status)
-        retrieved = self.client.get_all_volumes((volume.id,))
-        self.assertEqual(1, len(retrieved))
-        self.assertTrue(compare_volumes(volume, retrieved[0]))
-        self.assertVolumeStatusWait(volume, "available")
-        self.client.delete_volume(volume.id)
-        self.cancelResourceCleanUp(cuk)
-
-    @test.idempotent_id('c6b60d7a-1af7-4f8e-af21-d539d9496149')
-    def test_create_volume_from_snapshot(self):
-        # EC2 Create volume from snapshot
-        volume = self.client.create_volume(CONF.volume.volume_size, self.zone)
-        self.addResourceCleanUp(self.client.delete_volume, volume.id)
-        self.assertVolumeStatusWait(volume, "available")
-        snap = self.client.create_snapshot(volume.id)
-        self.addResourceCleanUp(self.destroy_snapshot_wait, snap)
-        self.assertSnapshotStatusWait(snap, "completed")
-
-        svol = self.client.create_volume(CONF.volume.volume_size, self.zone,
-                                         snapshot=snap)
-        cuk = self.addResourceCleanUp(svol.delete)
-        self.assertVolumeStatusWait(svol, "available")
-        svol.delete()
-        self.cancelResourceCleanUp(cuk)
diff --git a/tempest/thirdparty/boto/test_s3_buckets.py b/tempest/thirdparty/boto/test_s3_buckets.py
deleted file mode 100644
index f008973..0000000
--- a/tempest/thirdparty/boto/test_s3_buckets.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.common.utils import data_utils
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-class S3BucketsTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(S3BucketsTest, cls).setup_clients()
-        cls.client = cls.os.s3_client
-
-    @test.idempotent_id('4678525d-8da0-4518-81c1-f1f67d595b00')
-    def test_create_and_get_delete_bucket(self):
-        # S3 Create, get and delete bucket
-        bucket_name = data_utils.rand_name("s3bucket")
-        cleanup_key = self.addResourceCleanUp(self.client.delete_bucket,
-                                              bucket_name)
-        bucket = self.client.create_bucket(bucket_name)
-        self.assertTrue(bucket.name == bucket_name)
-        bucket = self.client.get_bucket(bucket_name)
-        self.assertTrue(bucket.name == bucket_name)
-        self.client.delete_bucket(bucket_name)
-        self.assertBotoError(self.s3_error_code.client.NoSuchBucket,
-                             self.client.get_bucket, bucket_name)
-        self.cancelResourceCleanUp(cleanup_key)
diff --git a/tempest/thirdparty/boto/test_s3_ec2_images.py b/tempest/thirdparty/boto/test_s3_ec2_images.py
deleted file mode 100644
index c41c7ac..0000000
--- a/tempest/thirdparty/boto/test_s3_ec2_images.py
+++ /dev/null
@@ -1,126 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import os
-
-from tempest.common.utils import data_utils
-from tempest import config
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-from tempest.thirdparty.boto.utils import s3
-
-CONF = config.CONF
-
-
-class S3ImagesTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(S3ImagesTest, cls).setup_clients()
-        cls.s3_client = cls.os.s3_client
-        cls.images_client = cls.os.ec2api_client
-
-    @classmethod
-    def resource_setup(cls):
-        super(S3ImagesTest, cls).resource_setup()
-        if not cls.conclusion['A_I_IMAGES_READY']:
-            raise cls.skipException("".join(("EC2 ", cls.__name__,
-                                    ": requires ami/aki/ari manifest")))
-        cls.materials_path = CONF.boto.s3_materials_path
-        cls.ami_manifest = CONF.boto.ami_manifest
-        cls.aki_manifest = CONF.boto.aki_manifest
-        cls.ari_manifest = CONF.boto.ari_manifest
-        cls.ami_path = cls.materials_path + os.sep + cls.ami_manifest
-        cls.aki_path = cls.materials_path + os.sep + cls.aki_manifest
-        cls.ari_path = cls.materials_path + os.sep + cls.ari_manifest
-        cls.bucket_name = data_utils.rand_name("bucket")
-        bucket = cls.s3_client.create_bucket(cls.bucket_name)
-        cls.addResourceCleanUp(cls.destroy_bucket,
-                               cls.s3_client.connection_data,
-                               cls.bucket_name)
-        s3.s3_upload_dir(bucket, cls.materials_path)
-
-    @test.idempotent_id('f9d360a5-0188-4c77-9db2-4c34c28d12a5')
-    def test_register_get_deregister_ami_image(self):
-        # Register and deregister ami image
-        image = {"name": data_utils.rand_name("ami-name"),
-                 "location": self.bucket_name + "/" + self.ami_manifest,
-                 "type": "ami"}
-        image["image_id"] = self.images_client.register_image(
-            name=image["name"],
-            image_location=image["location"])
-        # NOTE(afazekas): delete_snapshot=True might trigger boto lib? bug
-        image["cleanUp"] = self.addResourceCleanUp(
-            self.images_client.deregister_image,
-            image["image_id"])
-        self.assertEqual(image["image_id"][0:3], image["type"])
-        retrieved_image = self.images_client.get_image(image["image_id"])
-        self.assertTrue(retrieved_image.name == image["name"])
-        self.assertTrue(retrieved_image.id == image["image_id"])
-        if retrieved_image.state != "available":
-            self.assertImageStateWait(retrieved_image, "available")
-        self.images_client.deregister_image(image["image_id"])
-        self.assertNotIn(image["image_id"], str(
-            self.images_client.get_all_images()))
-        self.cancelResourceCleanUp(image["cleanUp"])
-
-    @test.idempotent_id('42cca5b0-453b-4618-b99f-dbc039db426f')
-    def test_register_get_deregister_aki_image(self):
-        # Register and deregister aki image
-        image = {"name": data_utils.rand_name("aki-name"),
-                 "location": self.bucket_name + "/" + self.aki_manifest,
-                 "type": "aki"}
-        image["image_id"] = self.images_client.register_image(
-            name=image["name"],
-            image_location=image["location"])
-        image["cleanUp"] = self.addResourceCleanUp(
-            self.images_client.deregister_image,
-            image["image_id"])
-        self.assertEqual(image["image_id"][0:3], image["type"])
-        retrieved_image = self.images_client.get_image(image["image_id"])
-        self.assertTrue(retrieved_image.name == image["name"])
-        self.assertTrue(retrieved_image.id == image["image_id"])
-        self.assertIn(retrieved_image.state, self.valid_image_state)
-        if retrieved_image.state != "available":
-            self.assertImageStateWait(retrieved_image, "available")
-        self.images_client.deregister_image(image["image_id"])
-        self.assertNotIn(image["image_id"], str(
-            self.images_client.get_all_images()))
-        self.cancelResourceCleanUp(image["cleanUp"])
-
-    @test.idempotent_id('1359e860-841c-43bb-80f3-bb389cbfd81d')
-    def test_register_get_deregister_ari_image(self):
-        # Register and deregister ari image
-        image = {"name": data_utils.rand_name("ari-name"),
-                 "location": "/" + self.bucket_name + "/" + self.ari_manifest,
-                 "type": "ari"}
-        image["image_id"] = self.images_client.register_image(
-            name=image["name"],
-            image_location=image["location"])
-        image["cleanUp"] = self.addResourceCleanUp(
-            self.images_client.deregister_image,
-            image["image_id"])
-        self.assertEqual(image["image_id"][0:3], image["type"])
-        retrieved_image = self.images_client.get_image(image["image_id"])
-        self.assertIn(retrieved_image.state, self.valid_image_state)
-        if retrieved_image.state != "available":
-            self.assertImageStateWait(retrieved_image, "available")
-        self.assertIn(retrieved_image.state, self.valid_image_state)
-        self.assertTrue(retrieved_image.name == image["name"])
-        self.assertTrue(retrieved_image.id == image["image_id"])
-        self.images_client.deregister_image(image["image_id"])
-        self.cancelResourceCleanUp(image["cleanUp"])
-
-# TODO(afazekas): less copy-paste style
diff --git a/tempest/thirdparty/boto/test_s3_objects.py b/tempest/thirdparty/boto/test_s3_objects.py
deleted file mode 100644
index c42d85c..0000000
--- a/tempest/thirdparty/boto/test_s3_objects.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import contextlib
-
-import boto.s3.key
-
-from tempest.common.utils import data_utils
-from tempest import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-class S3BucketsTest(boto_test.BotoTestCase):
-
-    @classmethod
-    def setup_clients(cls):
-        super(S3BucketsTest, cls).setup_clients()
-        cls.client = cls.os.s3_client
-
-    @test.idempotent_id('4eea567a-b46a-405b-a475-6097e1faebde')
-    def test_create_get_delete_object(self):
-        # S3 Create, get and delete object
-        bucket_name = data_utils.rand_name("s3bucket")
-        object_name = data_utils.rand_name("s3object")
-        content = 'x' * 42
-        bucket = self.client.create_bucket(bucket_name)
-        self.addResourceCleanUp(self.destroy_bucket,
-                                self.client.connection_data,
-                                bucket_name)
-
-        self.assertTrue(bucket.name == bucket_name)
-        with contextlib.closing(boto.s3.key.Key(bucket)) as key:
-            key.key = object_name
-            key.set_contents_from_string(content)
-            readback = key.get_contents_as_string()
-            self.assertTrue(readback == content)
-            bucket.delete_key(key)
-            self.assertBotoError(self.s3_error_code.client.NoSuchKey,
-                                 key.get_contents_as_string)
diff --git a/tempest/thirdparty/boto/utils/__init__.py b/tempest/thirdparty/boto/utils/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/thirdparty/boto/utils/__init__.py
+++ /dev/null
diff --git a/tempest/thirdparty/boto/utils/s3.py b/tempest/thirdparty/boto/utils/s3.py
deleted file mode 100644
index 55c1b0a..0000000
--- a/tempest/thirdparty/boto/utils/s3.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import contextlib
-import os
-import re
-
-import boto
-import boto.s3.key
-
-from oslo_log import log as logging
-
-LOG = logging.getLogger(__name__)
-
-
-def s3_upload_dir(bucket, path, prefix="", connection_data=None):
-    if isinstance(bucket, basestring):
-        with contextlib.closing(boto.connect_s3(**connection_data)) as conn:
-            bucket = conn.lookup(bucket)
-    for root, dirs, files in os.walk(path):
-        for fil in files:
-            with contextlib.closing(boto.s3.key.Key(bucket)) as key:
-                source = root + os.sep + fil
-                target = re.sub("^" + re.escape(path) + "?/", prefix, source)
-                if os.sep != '/':
-                    target = re.sub(re.escape(os.sep), '/', target)
-                key.key = target
-                LOG.info("Uploading %s to %s/%s", source, bucket.name, target)
-                key.set_contents_from_filename(source)
diff --git a/tempest/thirdparty/boto/utils/wait.py b/tempest/thirdparty/boto/utils/wait.py
deleted file mode 100644
index 8771ed7..0000000
--- a/tempest/thirdparty/boto/utils/wait.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import re
-import time
-
-import boto.exception
-from oslo_log import log as logging
-import testtools
-
-from tempest import config
-
-CONF = config.CONF
-LOG = logging.getLogger(__name__)
-
-
-def state_wait(lfunction, final_set=set(), valid_set=None):
-    # TODO(afazekas): evaluate using ABC here
-    if not isinstance(final_set, set):
-        final_set = set((final_set,))
-    if not isinstance(valid_set, set) and valid_set is not None:
-        valid_set = set((valid_set,))
-    start_time = time.time()
-    old_status = status = lfunction()
-    while True:
-        if status != old_status:
-            LOG.info('State transition "%s" ==> "%s" %d second', old_status,
-                     status, time.time() - start_time)
-        if status in final_set:
-            return status
-        if valid_set is not None and status not in valid_set:
-            return status
-        dtime = time.time() - start_time
-        if dtime > CONF.boto.build_timeout:
-            raise testtools.TestCase\
-                .failureException("State change timeout exceeded!"
-                                  '(%ds) While waiting'
-                                  'for %s at "%s"' %
-                                  (dtime, final_set, status))
-        time.sleep(CONF.boto.build_interval)
-        old_status = status
-        status = lfunction()
-
-
-def re_search_wait(lfunction, regexp):
-    """Stops waiting on success."""
-    start_time = time.time()
-    while True:
-        text = lfunction()
-        result = re.search(regexp, text)
-        if result is not None:
-            LOG.info('Pattern "%s" found in %d second in "%s"',
-                     regexp,
-                     time.time() - start_time,
-                     text)
-            return result
-        dtime = time.time() - start_time
-        if dtime > CONF.boto.build_timeout:
-            raise testtools.TestCase\
-                .failureException('Pattern find timeout exceeded!'
-                                  '(%ds) While waiting for'
-                                  '"%s" pattern in "%s"' %
-                                  (dtime, regexp, text))
-        time.sleep(CONF.boto.build_interval)
-
-
-def wait_no_exception(lfunction, exc_class=None, exc_matcher=None):
-    """Stops waiting on success."""
-    start_time = time.time()
-    if exc_matcher is not None:
-        exc_class = boto.exception.BotoServerError
-
-    if exc_class is None:
-        exc_class = BaseException
-    while True:
-        result = None
-        try:
-            result = lfunction()
-            LOG.info('No Exception in %d second',
-                     time.time() - start_time)
-            return result
-        except exc_class as exc:
-            if exc_matcher is not None:
-                res = exc_matcher.match(exc)
-                if res is not None:
-                    LOG.info(res)
-                    raise exc
-        # Let the other exceptions propagate
-        dtime = time.time() - start_time
-        if dtime > CONF.boto.build_timeout:
-            raise testtools.TestCase\
-                .failureException("Wait timeout exceeded! (%ds)" % dtime)
-        time.sleep(CONF.boto.build_interval)
-
-
-# NOTE(afazekas): EC2/boto normally raise exception instead of empty list
-def wait_exception(lfunction):
-    """Returns with the exception or raises one."""
-    start_time = time.time()
-    while True:
-        try:
-            lfunction()
-        except BaseException as exc:
-            LOG.info('Exception in %d second',
-                     time.time() - start_time)
-            return exc
-        dtime = time.time() - start_time
-        if dtime > CONF.boto.build_timeout:
-            raise testtools.TestCase\
-                .failureException("Wait timeout exceeded! (%ds)" % dtime)
-        time.sleep(CONF.boto.build_interval)
-
-# TODO(afazekas): consider strategy design pattern..
