diff --git a/doc/source/plugin.rst b/doc/source/plugin.rst
index 72db6e9..a41038c 100644
--- a/doc/source/plugin.rst
+++ b/doc/source/plugin.rst
@@ -20,8 +20,43 @@
 to tempest-lib. In that situation, file a bug, push a migration patch, etc. to
 expedite providing the interface in a reliable manner.
 
+Plugin Cookiecutter
+-------------------
+
+In order to create the basic structure with base classes and test directories
+you can use the tempest-plugin-cookiecutter project::
+
+  > cookiecutter https://git.openstack.org/openstack/tempest-plugin-cookiecutter
+
+  Cloning into 'tempest-plugin-cookiecutter'...
+  remote: Counting objects: 17, done.
+  remote: Compressing objects: 100% (13/13), done.
+  remote: Total 17 (delta 1), reused 14 (delta 1)
+  Unpacking objects: 100% (17/17), done.
+  Checking connectivity... done.
+  project (default is "sample")? foo
+  testclass (default is "SampleTempestPlugin")? FooTempestPlugin
+
+This would create a folder called ``foo_tempest_plugin/`` with all necessary
+basic classes. You only need to move/create your test in
+``foo_tempest_plugin/tests``.
+
+Entry Point
+-----------
+
+Once you've created your plugin class you need to add an entry point to your
+project to enable tempest to find the plugin. The entry point must be added
+to the "tempest.test_plugins" namespace.
+
+If you are using pbr this is fairly straightforward, in the setup.cfg just add
+something like the following::
+
+  [entry_points]
+  tempest.test_plugins =
+      plugin_name = module.path:PluginClass
+
 Plugin Class
-------------
+============
 
 To provide tempest with all the required information it needs to be able to run
 your plugin you need to create a plugin class which tempest will load and call
@@ -42,28 +77,13 @@
 as the source for the abstract class will be prudent.
 
 Abstract Plugin Class
-^^^^^^^^^^^^^^^^^^^^^
+---------------------
 
 .. autoclass:: tempest.test_discover.plugins.TempestPlugin
    :members:
 
-Entry Point
------------
-
-Once you've created your plugin class you need to add an entry point to your
-project to enable tempest to find the plugin. The entry point must be added
-to the "tempest.test_plugins" namespace.
-
-If you are using pbr this is fairly straightforward, in the setup.cfg just add
-something like the following::
-
-  [entry_points]
-  tempest.test_plugins =
-      plugin_name = module.path:PluginClass
-
 Plugin Structure
-----------------
-
+================
 While there are no hard and fast rules for the structure a plugin, there are
 basically no constraints on what the plugin looks like as long as the 2 steps
 above are done. However,  there are some recommended patterns to follow to make
@@ -92,7 +112,7 @@
 being added in the plugin act and behave like the rest of tempest.
 
 Dealing with configuration options
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+----------------------------------
 
 Historically Tempest didn't provide external guarantees on its configuration
 options. However, with the introduction of the plugin interface this is no
diff --git a/requirements.txt b/requirements.txt
index c0a9254..59d6856 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,11 +13,11 @@
 testrepository>=0.0.18
 pyOpenSSL>=0.14
 oslo.concurrency>=2.3.0 # Apache-2.0
-oslo.config>=2.3.0 # Apache-2.0
+oslo.config>=2.6.0 # Apache-2.0
 oslo.i18n>=1.5.0 # Apache-2.0
 oslo.log>=1.8.0 # Apache-2.0
-oslo.serialization>=1.4.0 # Apache-2.0
-oslo.utils>=2.0.0 # Apache-2.0
+oslo.serialization>=1.10.0 # Apache-2.0
+oslo.utils!=2.6.0,>=2.4.0 # Apache-2.0
 six>=1.9.0
 iso8601>=0.1.9
 fixtures>=1.3.1
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index 34ec78d..f186a7d 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -14,8 +14,6 @@
 #    under the License.
 
 
-from collections import namedtuple
-
 import testtools
 
 from tempest.api.compute import base
@@ -26,9 +24,6 @@
 CONF = config.CONF
 
 
-CreatedServer = namedtuple('CreatedServer', 'server_id, volume_backed')
-
-
 class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
     _host_key = 'OS-EXT-SRV-ATTR:host'
 
@@ -39,14 +34,6 @@
         cls.admin_servers_client = cls.os_adm.servers_client
         cls.admin_migration_client = cls.os_adm.migrations_client
 
-    @classmethod
-    def resource_setup(cls):
-        super(LiveBlockMigrationTestJSON, cls).resource_setup()
-
-        # list of CreatedServer namedtuples
-        # TODO(mriedem): Remove the instance variable and shared server re-use
-        cls.created_servers = []
-
     def _get_compute_hostnames(self):
         body = self.admin_hosts_client.list_hosts()['hosts']
         return [
@@ -62,18 +49,12 @@
     def _get_host_for_server(self, server_id):
         return self._get_server_details(server_id)[self._host_key]
 
-    def _migrate_server_to(self, server_id, dest_host):
-        # volume backed instances shouldn't be block migrated
-        for id, volume_backed in self.created_servers:
-            if server_id == id:
-                use_block_migration = not volume_backed
-                break
-        else:
-            raise ValueError('Server with id %s not found.' % server_id)
-        bmflm = (CONF.compute_feature_enabled.
-                 block_migration_for_live_migration and use_block_migration)
+    def _migrate_server_to(self, server_id, dest_host, volume_backed):
+        block_migration = (CONF.compute_feature_enabled.
+                           block_migration_for_live_migration and
+                           not volume_backed)
         body = self.admin_servers_client.live_migrate_server(
-            server_id, host=dest_host, block_migration=bmflm,
+            server_id, host=dest_host, block_migration=block_migration,
             disk_over_commit=False)
         return body
 
@@ -85,19 +66,10 @@
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
-    def _get_an_active_server(self, volume_backed=False):
-        for server_id, vol_backed in self.created_servers:
-            if ('ACTIVE' == self._get_server_status(server_id) and
-                    volume_backed == vol_backed):
-                return server_id
-        else:
+    def _create_server(self, volume_backed=False):
             server = self.create_test_server(wait_until="ACTIVE",
                                              volume_backed=volume_backed)
-            server_id = server['id']
-            new_server = CreatedServer(server_id=server_id,
-                                       volume_backed=volume_backed)
-            self.created_servers.append(new_server)
-            return server_id
+            return server['id']
 
     def _volume_clean_up(self, server_id, volume_id):
         body = self.volumes_client.show_volume(volume_id)['volume']
@@ -117,11 +89,11 @@
         :param volume_backed: If the instance is volume backed or not. If
                               volume_backed, *block* migration is not used.
         """
-        # Live block migrate an instance to another host
+        # Live migrate an instance to another host
         if len(self._get_compute_hostnames()) < 2:
             raise self.skipTest(
                 "Less than 2 compute nodes, skipping migration test.")
-        server_id = self._get_an_active_server(volume_backed=volume_backed)
+        server_id = self._create_server(volume_backed=volume_backed)
         actual_host = self._get_host_for_server(server_id)
         target_host = self._get_host_other_than(actual_host)
 
@@ -130,7 +102,7 @@
             waiters.wait_for_server_status(self.admin_servers_client,
                                            server_id, state)
 
-        self._migrate_server_to(server_id, target_host)
+        self._migrate_server_to(server_id, target_host, volume_backed)
         waiters.wait_for_server_status(self.servers_client, server_id, state)
         migration_list = (self.admin_migration_client.list_migrations()
                           ['migrations'])
@@ -178,11 +150,10 @@
                       block_migrate_cinder_iscsi,
                       'Block Live migration not configured for iSCSI')
     def test_iscsi_volume(self):
-        # Live block migrate an instance to another host
         if len(self._get_compute_hostnames()) < 2:
             raise self.skipTest(
                 "Less than 2 compute nodes, skipping migration test.")
-        server_id = self._get_an_active_server()
+        server_id = self._create_server()
         actual_host = self._get_host_for_server(server_id)
         target_host = self._get_host_other_than(actual_host)
 
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 26cf180..17adfa5 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -221,7 +221,7 @@
         ext_gw_info = {}
         if external_network_id:
             ext_gw_info['network_id'] = external_network_id
-        if enable_snat:
+        if enable_snat is not None:
             ext_gw_info['enable_snat'] = enable_snat
         body = cls.client.create_router(
             router_name, external_gateway_info=ext_gw_info,
diff --git a/tempest/api_schema/response/compute/v2_1/hypervisors.py b/tempest/api_schema/response/compute/v2_1/hypervisors.py
deleted file mode 100644
index 05901b6..0000000
--- a/tempest/api_schema/response/compute/v2_1/hypervisors.py
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright 2014 NEC Corporation.  All rights reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import copy
-
-from tempest.api_schema.response.compute.v2_1 import parameter_types
-
-get_hypervisor_statistics = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'hypervisor_statistics': {
-                'type': 'object',
-                'properties': {
-                    'count': {'type': 'integer'},
-                    'current_workload': {'type': 'integer'},
-                    'disk_available_least': {'type': ['integer', 'null']},
-                    'free_disk_gb': {'type': 'integer'},
-                    'free_ram_mb': {'type': 'integer'},
-                    'local_gb': {'type': 'integer'},
-                    'local_gb_used': {'type': 'integer'},
-                    'memory_mb': {'type': 'integer'},
-                    'memory_mb_used': {'type': 'integer'},
-                    'running_vms': {'type': 'integer'},
-                    'vcpus': {'type': 'integer'},
-                    'vcpus_used': {'type': 'integer'}
-                },
-                'additionalProperties': False,
-                'required': ['count', 'current_workload',
-                             'disk_available_least', 'free_disk_gb',
-                             'free_ram_mb', 'local_gb', 'local_gb_used',
-                             'memory_mb', 'memory_mb_used', 'running_vms',
-                             'vcpus', 'vcpus_used']
-            }
-        },
-        'additionalProperties': False,
-        'required': ['hypervisor_statistics']
-    }
-}
-
-
-hypervisor_detail = {
-    'type': 'object',
-    'properties': {
-        'status': {'type': 'string'},
-        'state': {'type': 'string'},
-        'cpu_info': {'type': 'string'},
-        'current_workload': {'type': 'integer'},
-        'disk_available_least': {'type': ['integer', 'null']},
-        'host_ip': parameter_types.ip_address,
-        'free_disk_gb': {'type': 'integer'},
-        'free_ram_mb': {'type': 'integer'},
-        'hypervisor_hostname': {'type': 'string'},
-        'hypervisor_type': {'type': 'string'},
-        'hypervisor_version': {'type': 'integer'},
-        'id': {'type': ['integer', 'string']},
-        'local_gb': {'type': 'integer'},
-        'local_gb_used': {'type': 'integer'},
-        'memory_mb': {'type': 'integer'},
-        'memory_mb_used': {'type': 'integer'},
-        'running_vms': {'type': 'integer'},
-        'service': {
-            'type': 'object',
-            'properties': {
-                'host': {'type': 'string'},
-                'id': {'type': ['integer', 'string']},
-                'disabled_reason': {'type': ['string', 'null']}
-            },
-            'additionalProperties': False,
-            'required': ['host', 'id']
-        },
-        'vcpus': {'type': 'integer'},
-        'vcpus_used': {'type': 'integer'}
-    },
-    'additionalProperties': False,
-    # NOTE: When loading os-hypervisor-status extension,
-    # a response contains status and state. So these params
-    # should not be required.
-    'required': ['cpu_info', 'current_workload',
-                 'disk_available_least', 'host_ip',
-                 'free_disk_gb', 'free_ram_mb',
-                 'hypervisor_hostname', 'hypervisor_type',
-                 'hypervisor_version', 'id', 'local_gb',
-                 'local_gb_used', 'memory_mb', 'memory_mb_used',
-                 'running_vms', 'service', 'vcpus', 'vcpus_used']
-}
-
-list_hypervisors_detail = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'hypervisors': {
-                'type': 'array',
-                'items': hypervisor_detail
-            }
-        },
-        'additionalProperties': False,
-        'required': ['hypervisors']
-    }
-}
-
-get_hypervisor = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'hypervisor': hypervisor_detail
-        },
-        'additionalProperties': False,
-        'required': ['hypervisor']
-    }
-}
-
-list_search_hypervisors = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'hypervisors': {
-                'type': 'array',
-                'items': {
-                    'type': 'object',
-                    'properties': {
-                        'status': {'type': 'string'},
-                        'state': {'type': 'string'},
-                        'id': {'type': ['integer', 'string']},
-                        'hypervisor_hostname': {'type': 'string'}
-                    },
-                    'additionalProperties': False,
-                    # NOTE: When loading os-hypervisor-status extension,
-                    # a response contains status and state. So these params
-                    # should not be required.
-                    'required': ['id', 'hypervisor_hostname']
-                }
-            }
-        },
-        'additionalProperties': False,
-        'required': ['hypervisors']
-    }
-}
-
-get_hypervisor_uptime = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'hypervisor': {
-                'type': 'object',
-                'properties': {
-                    'status': {'type': 'string'},
-                    'state': {'type': 'string'},
-                    'id': {'type': ['integer', 'string']},
-                    'hypervisor_hostname': {'type': 'string'},
-                    'uptime': {'type': 'string'}
-                },
-                'additionalProperties': False,
-                # NOTE: When loading os-hypervisor-status extension,
-                # a response contains status and state. So these params
-                # should not be required.
-                'required': ['id', 'hypervisor_hostname', 'uptime']
-            }
-        },
-        'additionalProperties': False,
-        'required': ['hypervisor']
-    }
-}
-
-get_hypervisors_servers = copy.deepcopy(list_search_hypervisors)
-get_hypervisors_servers['response_body']['properties']['hypervisors']['items'][
-    'properties']['servers'] = {
-        'type': 'array',
-        'items': {
-            'type': 'object',
-            'properties': {
-                'uuid': {'type': 'string'},
-                'name': {'type': 'string'}
-            },
-            'additionalProperties': False,
-        }
-    }
-# In V2 API, if there is no servers (VM) on the Hypervisor host then 'servers'
-# attribute will not be present in response body So it is not 'required'.
diff --git a/tempest/clients.py b/tempest/clients.py
index 43dd316..84e8544 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -33,6 +33,8 @@
 from tempest_lib.services.compute.floating_ips_bulk_client import \
     FloatingIPsBulkClient
 from tempest_lib.services.compute.hosts_client import HostsClient
+from tempest_lib.services.compute.hypervisor_client import \
+    HypervisorClient
 from tempest_lib.services.identity.v2.token_client import TokenClient
 from tempest_lib.services.identity.v3.token_client import V3TokenClient
 
@@ -46,8 +48,6 @@
 from tempest.services import botoclients
 from tempest.services.compute.json.floating_ips_client import \
     FloatingIPsClient
-from tempest.services.compute.json.hypervisor_client import \
-    HypervisorClient
 from tempest.services.compute.json.images_client import ImagesClient
 from tempest.services.compute.json.instance_usage_audit_log_client import \
     InstanceUsagesAuditLogClient
diff --git a/tempest/cmd/main.py b/tempest/cmd/main.py
index 762e982..577df9b 100644
--- a/tempest/cmd/main.py
+++ b/tempest/cmd/main.py
@@ -16,8 +16,7 @@
 
 from cliff import app
 from cliff import commandmanager
-
-TEMPEST_CLI_VERSION = '0.1'
+from pbr import version
 
 
 class Main(app.App):
@@ -27,7 +26,7 @@
     def __init__(self):
         super(Main, self).__init__(
             description='Tempest cli application',
-            version=TEMPEST_CLI_VERSION,
+            version=version.VersionInfo('tempest').version_string(),
             command_manager=commandmanager.CommandManager('tempest.cm'),
             )
 
diff --git a/tempest/common/cred_client.py b/tempest/common/cred_client.py
index 4d391d0..79a502a 100644
--- a/tempest/common/cred_client.py
+++ b/tempest/common/cred_client.py
@@ -14,14 +14,11 @@
 
 from oslo_log import log as logging
 import six
+from tempest_lib import auth
 from tempest_lib import exceptions as lib_exc
 
-from tempest.common import cred_provider
-from tempest import config
-from tempest import exceptions
 from tempest.services.identity.v2.json import identity_client as v2_identity
 
-CONF = config.CONF
 LOG = logging.getLogger(__name__)
 
 
@@ -36,7 +33,6 @@
     def __init__(self, identity_client):
         # The client implies version and credentials
         self.identity_client = identity_client
-        self.credentials = self.identity_client.auth_provider.credentials
 
     def create_user(self, username, password, project, email):
         user = self.identity_client.create_user(
@@ -75,6 +71,13 @@
 
     @abc.abstractmethod
     def get_credentials(self, user, project, password):
+        """Produces a Credentials object from the details provided
+
+        :param user: a user dict
+        :param project: a project dict
+        :param password: the password as a string
+        :return: a Credentials object with all the available credential details
+        """
         pass
 
     def delete_user(self, user_id):
@@ -93,7 +96,11 @@
         return tenant
 
     def get_credentials(self, user, project, password):
-        return cred_provider.get_credentials(
+        # User and project already include both ID and name here,
+        # so there's no need to use the fill_in mode
+        return auth.get_credentials(
+            auth_url=None,
+            fill_in=False,
             identity_version='v2',
             username=user['name'], user_id=user['id'],
             tenant_name=project['name'], tenant_id=project['id'],
@@ -114,8 +121,8 @@
                 params={'name': domain_name})['domains'][0]
         except lib_exc.NotFound:
             # TODO(andrea) we could probably create the domain on the fly
-            msg = "Configured domain %s could not be found" % domain_name
-            raise exceptions.InvalidConfiguration(msg)
+            msg = "Requested domain %s could not be found" % domain_name
+            raise lib_exc.InvalidCredentials(msg)
 
     def create_project(self, name, description):
         project = self.identity_client.create_project(
@@ -124,11 +131,16 @@
         return project
 
     def get_credentials(self, user, project, password):
-        return cred_provider.get_credentials(
+        # User, project and domain already include both ID and name here,
+        # so there's no need to use the fill_in mode.
+        return auth.get_credentials(
+            auth_url=None,
+            fill_in=False,
             identity_version='v3',
             username=user['name'], user_id=user['id'],
             project_name=project['name'], project_id=project['id'],
             password=password,
+            project_domain_id=self.creds_domain['id'],
             project_domain_name=self.creds_domain['name'])
 
     def delete_project(self, project_id):
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index eb4c4a8..3575998 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -98,17 +98,22 @@
 
 @six.add_metaclass(abc.ABCMeta)
 class CredentialProvider(object):
-    def __init__(self, identity_version, name=None,
-                 network_resources=None):
+    def __init__(self, identity_version, name=None, network_resources=None,
+                 credentials_domain=None, admin_role=None):
         """A CredentialProvider supplies credentials to test classes.
         :param identity_version: Identity version of the credentials provided
         :param name: Name of the calling test. Included in provisioned
                      credentials when credentials are provisioned on the fly
         :param network_resources: Network resources required for the
                                   credentials
+        :param credentials_domain: Domain credentials belong to
+        :param admin_role: Name of the role of the admin account
         """
-        self.name = name or "test_creds"
         self.identity_version = identity_version
+        self.name = name or "test_creds"
+        self.network_resources = network_resources
+        self.credentials_domain = credentials_domain or 'Default'
+        self.admin_role = admin_role
         if not auth.is_identity_version_supported(self.identity_version):
             raise exceptions.InvalidIdentityVersion(
                 identity_version=self.identity_version)
diff --git a/tempest/common/credentials.py b/tempest/common/credentials.py
index 1b2eca7..76f8afe 100644
--- a/tempest/common/credentials.py
+++ b/tempest/common/credentials.py
@@ -37,16 +37,21 @@
         return dynamic_creds.DynamicCredentialProvider(
             name=name,
             network_resources=network_resources,
-            identity_version=identity_version)
+            identity_version=identity_version,
+            credentials_domain=CONF.auth.default_credentials_domain_name,
+            admin_role=CONF.identity.admin_role)
     else:
         if (CONF.auth.test_accounts_file and
                 os.path.isfile(CONF.auth.test_accounts_file)):
             # Most params are not relevant for pre-created accounts
             return preprov_creds.PreProvisionedCredentialProvider(
-                name=name, identity_version=identity_version)
+                name=name, identity_version=identity_version,
+                credentials_domain=CONF.auth.default_credentials_domain_name,
+                admin_role=CONF.identity.admin_role)
         else:
             return preprov_creds.NonLockingCredentialProvider(
-                name=name, identity_version=identity_version)
+                name=name, identity_version=identity_version,
+                admin_role=CONF.identity.admin_role)
 
 
 # We want a helper function here to check and see if admin credentials
@@ -63,7 +68,8 @@
     elif (CONF.auth.test_accounts_file and
             os.path.isfile(CONF.auth.test_accounts_file)):
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
-            identity_version=identity_version, name='check_admin')
+            identity_version=identity_version, name='check_admin',
+            admin_role=CONF.identity.admin_role)
         if not check_accounts.admin_available():
             is_admin = False
     else:
@@ -89,10 +95,12 @@
     if (CONF.auth.test_accounts_file and
             os.path.isfile(CONF.auth.test_accounts_file)):
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
-            identity_version=identity_version, name='check_alt')
+            identity_version=identity_version, name='check_alt',
+            admin_role=CONF.identity.admin_role)
     else:
         check_accounts = preprov_creds.NonLockingCredentialProvider(
-            identity_version=identity_version, name='check_alt')
+            identity_version=identity_version, name='check_alt',
+            admin_role=CONF.identity.admin_role)
     try:
         if not check_accounts.is_multi_user():
             return False
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index d9cfac8..e2df560 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -30,11 +30,12 @@
 
 class DynamicCredentialProvider(cred_provider.CredentialProvider):
 
-    def __init__(self, identity_version, name=None,
-                 network_resources=None):
+    def __init__(self, identity_version, name=None, network_resources=None,
+                 credentials_domain=None, admin_role=None):
         super(DynamicCredentialProvider, self).__init__(
-            identity_version, name, network_resources)
-        self.network_resources = network_resources
+            identity_version=identity_version, name=name,
+            network_resources=network_resources,
+            credentials_domain=credentials_domain, admin_role=admin_role)
         self._creds = {}
         self.ports = []
         self.default_admin_creds = cred_provider.get_configured_credentials(
@@ -49,7 +50,7 @@
         if self.identity_version == 'v3':
             self.creds_domain_name = (
                 self.default_admin_creds.project_domain_name or
-                CONF.auth.default_credentials_domain_name)
+                self.credentials_domain)
         self.creds_client = cred_client.get_creds_client(
             self.identity_admin_client, self.creds_domain_name)
 
@@ -98,7 +99,7 @@
         role_assigned = False
         if admin:
             self.creds_client.assign_user_role(user, project,
-                                               CONF.identity.admin_role)
+                                               self.admin_role)
             role_assigned = True
         # Add roles specified in config file
         for conf_role in CONF.auth.tempest_roles:
diff --git a/tempest/common/preprov_creds.py b/tempest/common/preprov_creds.py
index 48eae25..dd27f08 100644
--- a/tempest/common/preprov_creds.py
+++ b/tempest/common/preprov_creds.py
@@ -39,9 +39,11 @@
 
 class PreProvisionedCredentialProvider(cred_provider.CredentialProvider):
 
-    def __init__(self, identity_version, name=None):
+    def __init__(self, identity_version, name=None, credentials_domain=None,
+                 admin_role=None):
         super(PreProvisionedCredentialProvider, self).__init__(
-            identity_version=identity_version, name=name)
+            identity_version=identity_version, name=name,
+            credentials_domain=credentials_domain, admin_role=admin_role)
         if (CONF.auth.test_accounts_file and
                 os.path.isfile(CONF.auth.test_accounts_file)):
             accounts = read_accounts_yaml(CONF.auth.test_accounts_file)
@@ -49,7 +51,7 @@
         else:
             accounts = {}
             self.use_default_creds = True
-        self.hash_dict = self.get_hash_dict(accounts)
+        self.hash_dict = self.get_hash_dict(accounts, admin_role)
         self.accounts_dir = os.path.join(lockutils.get_lock_path(CONF),
                                          'test_accounts')
         self._creds = {}
@@ -63,7 +65,7 @@
         return hash_dict
 
     @classmethod
-    def get_hash_dict(cls, accounts):
+    def get_hash_dict(cls, accounts, admin_role):
         hash_dict = {'roles': {}, 'creds': {}, 'networks': {}}
         # Loop over the accounts read from the yaml file
         for account in accounts:
@@ -87,8 +89,8 @@
             # subdict with the hash
             for type in types:
                 if type == 'admin':
-                    hash_dict = cls._append_role(CONF.identity.admin_role,
-                                                 temp_hash_key, hash_dict)
+                    hash_dict = cls._append_role(admin_role, temp_hash_key,
+                                                 hash_dict)
                 elif type == 'operator':
                     hash_dict = cls._append_role(
                         CONF.object_storage.operator_role, temp_hash_key,
@@ -173,9 +175,9 @@
         # privlege set which could potentially cause issues on tests where that
         # is not expected. So unless the admin role isn't specified do not
         # allocate admin.
-        admin_hashes = self.hash_dict['roles'].get(CONF.identity.admin_role,
+        admin_hashes = self.hash_dict['roles'].get(self.admin_role,
                                                    None)
-        if ((not roles or CONF.identity.admin_role not in roles) and
+        if ((not roles or self.admin_role not in roles) and
                 admin_hashes):
             useable_hashes = [x for x in hashes if x not in admin_hashes]
         else:
@@ -217,7 +219,7 @@
             if ('user_domain_name' in init_attributes and 'user_domain_name'
                     not in hash_attributes):
                 # Allow for the case of domain_name populated from config
-                domain_name = CONF.auth.default_credentials_domain_name
+                domain_name = self.credentials_domain
                 hash_attributes['user_domain_name'] = domain_name
             if all([getattr(creds, k) == hash_attributes[k] for
                    k in init_attributes]):
@@ -266,7 +268,7 @@
             self.remove_credentials(creds)
 
     def get_admin_creds(self):
-        return self.get_creds_by_roles([CONF.identity.admin_role])
+        return self.get_creds_by_roles([self.admin_role])
 
     def is_role_available(self, role):
         if self.use_default_creds:
@@ -277,7 +279,7 @@
             return False
 
     def admin_available(self):
-        return self.is_role_available(CONF.identity.admin_role)
+        return self.is_role_available(self.admin_role)
 
     def _wrap_creds_with_network(self, hash):
         creds_dict = self.hash_dict['creds'][hash]
@@ -306,8 +308,7 @@
         if self.identity_version == 'v3':
             user_domain_fields = set(['user_domain_name', 'user_domain_id'])
             if not user_domain_fields.intersection(set(creds_dict.keys())):
-                _domain = CONF.auth.default_credentials_domain_name
-                creds_dict['user_domain_name'] = _domain
+                creds_dict['user_domain_name'] = self.credentials_domain
         return creds_dict
 
 
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 036914e..a10dc83 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -450,21 +450,21 @@
                   image_name, server['name'])
         return snapshot_image
 
-    def nova_volume_attach(self):
+    def nova_volume_attach(self, server, volume_to_attach):
         volume = self.servers_client.attach_volume(
-            self.server['id'], volumeId=self.volume['id'], device='/dev/%s'
+            server['id'], volumeId=volume_to_attach['id'], device='/dev/%s'
             % CONF.compute.volume_device_name)['volumeAttachment']
-        self.assertEqual(self.volume['id'], volume['id'])
+        self.assertEqual(volume_to_attach['id'], volume['id'])
         self.volumes_client.wait_for_volume_status(volume['id'], 'in-use')
-        # Refresh the volume after the attachment
-        self.volume = self.volumes_client.show_volume(volume['id'])['volume']
 
-    def nova_volume_detach(self):
-        self.servers_client.detach_volume(self.server['id'], self.volume['id'])
-        self.volumes_client.wait_for_volume_status(self.volume['id'],
-                                                   'available')
+        # Return the updated volume after the attachment
+        return self.volumes_client.show_volume(volume['id'])['volume']
 
-        volume = self.volumes_client.show_volume(self.volume['id'])['volume']
+    def nova_volume_detach(self, server, volume):
+        self.servers_client.detach_volume(server['id'], volume['id'])
+        self.volumes_client.wait_for_volume_status(volume['id'], 'available')
+
+        volume = self.volumes_client.show_volume(volume['id'])['volume']
         self.assertEqual('available', volume['status'])
 
     def rebuild_server(self, server_id, image=None,
@@ -573,8 +573,10 @@
             floating_ip['ip'], thing['id'])
         return floating_ip
 
-    def create_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt'):
-        ssh_client = self.get_remote_client(server_or_ip)
+    def create_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt',
+                         private_key=None):
+        ssh_client = self.get_remote_client(server_or_ip,
+                                            private_key=private_key)
         if dev_name is not None:
             ssh_client.make_fs(dev_name)
             ssh_client.mount(dev_name, mount_path)
@@ -586,8 +588,10 @@
             ssh_client.umount(mount_path)
         return timestamp
 
-    def get_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt'):
-        ssh_client = self.get_remote_client(server_or_ip)
+    def get_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt',
+                      private_key=None):
+        ssh_client = self.get_remote_client(server_or_ip,
+                                            private_key=private_key)
         if dev_name is not None:
             ssh_client.mount(dev_name, mount_path)
         timestamp = ssh_client.exec_command('sudo cat %s/timestamp'
diff --git a/tempest/scenario/test_encrypted_cinder_volumes.py b/tempest/scenario/test_encrypted_cinder_volumes.py
index b66eb59..3f0123d 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -54,8 +54,8 @@
         self.volume = self.create_volume(volume_type=volume_type['name'])
 
     def attach_detach_volume(self):
-        self.nova_volume_attach()
-        self.nova_volume_detach()
+        self.volume = self.nova_volume_attach(self.server, self.volume)
+        self.nova_volume_detach(self.server, self.volume)
 
     @test.idempotent_id('79165fb4-5534-4b9d-8429-97ccffb8f86e')
     @test.services('compute', 'volume', 'image')
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index eac8311..22aa06c 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -40,66 +40,61 @@
 
     """
 
-    def _wait_for_server_status(self, status):
-        server_id = self.server['id']
+    def _wait_for_server_status(self, server, status):
+        server_id = server['id']
         # Raise on error defaults to True, which is consistent with the
         # original function from scenario tests here
         waiters.wait_for_server_status(self.servers_client,
                                        server_id, status)
 
-    def nova_keypair_add(self):
-        self.keypair = self.create_keypair()
-
-    def nova_boot(self):
-        create_kwargs = {'key_name': self.keypair['name']}
-        self.server = self.create_server(image=self.image,
-                                         create_kwargs=create_kwargs)
+    def nova_boot(self, keypair):
+        create_kwargs = {'key_name': keypair['name']}
+        return self.create_server(image=self.image,
+                                  create_kwargs=create_kwargs)
 
     def nova_list(self):
         servers = self.servers_client.list_servers()
         # The list servers in the compute client is inconsistent...
-        servers = servers['servers']
-        self.assertIn(self.server['id'], [x['id'] for x in servers])
+        return servers['servers']
 
-    def nova_show(self):
-        got_server = (self.servers_client.show_server(self.server['id'])
+    def nova_show(self, server):
+        got_server = (self.servers_client.show_server(server['id'])
                       ['server'])
         excluded_keys = ['OS-EXT-AZ:availability_zone']
         # Exclude these keys because of LP:#1486475
         excluded_keys.extend(['OS-EXT-STS:power_state', 'updated'])
         self.assertThat(
-            self.server, custom_matchers.MatchesDictExceptForKeys(
+            server, custom_matchers.MatchesDictExceptForKeys(
                 got_server, excluded_keys=excluded_keys))
 
     def cinder_create(self):
-        self.volume = self.create_volume()
+        return self.create_volume()
 
     def cinder_list(self):
-        volumes = self.volumes_client.list_volumes()['volumes']
-        self.assertIn(self.volume['id'], [x['id'] for x in volumes])
+        return self.volumes_client.list_volumes()['volumes']
 
-    def cinder_show(self):
-        volume = self.volumes_client.show_volume(self.volume['id'])['volume']
-        self.assertEqual(self.volume, volume)
+    def cinder_show(self, volume):
+        got_volume = self.volumes_client.show_volume(volume['id'])['volume']
+        self.assertEqual(volume, got_volume)
 
-    def nova_reboot(self):
-        self.servers_client.reboot_server(self.server['id'], 'SOFT')
-        self._wait_for_server_status('ACTIVE')
+    def nova_reboot(self, server):
+        self.servers_client.reboot_server(server['id'], 'SOFT')
+        self._wait_for_server_status(server, 'ACTIVE')
 
     def check_partitions(self):
         # NOTE(andreaf) The device name may be different on different guest OS
         partitions = self.linux_client.get_partitions()
         self.assertEqual(1, partitions.count(CONF.compute.volume_device_name))
 
-    def create_and_add_security_group(self):
+    def create_and_add_security_group_to_server(self, server):
         secgroup = self._create_security_group()
-        self.servers_client.add_security_group(self.server['id'],
+        self.servers_client.add_security_group(server['id'],
                                                secgroup['name'])
         self.addCleanup(self.servers_client.remove_security_group,
-                        self.server['id'], secgroup['name'])
+                        server['id'], secgroup['name'])
 
         def wait_for_secgroup_add():
-            body = (self.servers_client.show_server(self.server['id'])
+            body = (self.servers_client.show_server(server['id'])
                     ['server'])
             return {'name': secgroup['name']} in body['security_groups']
 
@@ -107,29 +102,39 @@
                                     CONF.compute.build_timeout,
                                     CONF.compute.build_interval):
             msg = ('Timed out waiting for adding security group %s to server '
-                   '%s' % (secgroup['id'], self.server['id']))
+                   '%s' % (secgroup['id'], server['id']))
             raise exceptions.TimeoutException(msg)
 
     @test.idempotent_id('bdbb5441-9204-419d-a225-b4fdbfb1a1a8')
     @test.services('compute', 'volume', 'image', 'network')
     def test_minimum_basic_scenario(self):
         self.glance_image_create()
-        self.nova_keypair_add()
-        self.nova_boot()
-        self.nova_list()
-        self.nova_show()
-        self.cinder_create()
-        self.cinder_list()
-        self.cinder_show()
-        self.nova_volume_attach()
-        self.addCleanup(self.nova_volume_detach)
-        self.cinder_show()
 
-        self.floating_ip = self.create_floating_ip(self.server)
-        self.create_and_add_security_group()
+        keypair = self.create_keypair()
 
-        self.linux_client = self.get_remote_client(self.floating_ip['ip'])
-        self.nova_reboot()
+        server = self.nova_boot(keypair)
+        servers = self.nova_list()
+        self.assertIn(server['id'], [x['id'] for x in servers])
 
-        self.linux_client = self.get_remote_client(self.floating_ip['ip'])
+        self.nova_show(server)
+
+        volume = self.cinder_create()
+        volumes = self.cinder_list()
+        self.assertIn(volume['id'], [x['id'] for x in volumes])
+
+        self.cinder_show(volume)
+
+        volume = self.nova_volume_attach(server, volume)
+        self.addCleanup(self.nova_volume_detach, server, volume)
+        self.cinder_show(volume)
+
+        floating_ip = self.create_floating_ip(server)
+        self.create_and_add_security_group_to_server(server)
+
+        self.linux_client = self.get_remote_client(
+            floating_ip['ip'], private_key=keypair['private_key'])
+        self.nova_reboot(server)
+
+        self.linux_client = self.get_remote_client(
+            floating_ip['ip'], private_key=keypair['private_key'])
         self.check_partitions()
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 62b2976..704342f 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -56,7 +56,7 @@
         super(TestNetworkAdvancedServerOps, cls).setup_credentials()
 
     def _setup_network_and_servers(self):
-        self.keypair = self.create_keypair()
+        keypair = self.create_keypair()
         security_group = self._create_security_group()
         network, subnet, router = self.create_networks()
         public_network_id = CONF.network.public_network_id
@@ -64,91 +64,103 @@
             'networks': [
                 {'uuid': network.id},
             ],
-            'key_name': self.keypair['name'],
+            'key_name': keypair['name'],
             'security_groups': [{'name': security_group['name']}],
         }
         server_name = data_utils.rand_name('server-smoke')
-        self.server = self.create_server(name=server_name,
-                                         create_kwargs=create_kwargs)
-        self.floating_ip = self.create_floating_ip(self.server,
-                                                   public_network_id)
+        server = self.create_server(name=server_name,
+                                    create_kwargs=create_kwargs)
+        floating_ip = self.create_floating_ip(server, public_network_id)
         # Verify that we can indeed connect to the server before we mess with
         # it's state
-        self._wait_server_status_and_check_network_connectivity()
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
-    def _check_network_connectivity(self, should_connect=True):
+        return server, keypair, floating_ip
+
+    def _check_network_connectivity(self, server, keypair, floating_ip,
+                                    should_connect=True):
         username = CONF.compute.image_ssh_user
-        private_key = self.keypair['private_key']
+        private_key = keypair['private_key']
         self._check_tenant_network_connectivity(
-            self.server, username, private_key,
+            server, username, private_key,
             should_connect=should_connect,
-            servers_for_debug=[self.server])
-        floating_ip = self.floating_ip.floating_ip_address
+            servers_for_debug=[server])
+        floating_ip_addr = floating_ip.floating_ip_address
         # Check FloatingIP status before checking the connectivity
-        self.check_floating_ip_status(self.floating_ip, 'ACTIVE')
-        self.check_public_network_connectivity(floating_ip, username,
+        self.check_floating_ip_status(floating_ip, 'ACTIVE')
+        self.check_public_network_connectivity(floating_ip_addr, username,
                                                private_key, should_connect,
-                                               servers=[self.server])
+                                               servers=[server])
 
-    def _wait_server_status_and_check_network_connectivity(self):
-        waiters.wait_for_server_status(self.servers_client,
-                                       self.server['id'], 'ACTIVE')
-        self._check_network_connectivity()
+    def _wait_server_status_and_check_network_connectivity(self, server,
+                                                           keypair,
+                                                           floating_ip):
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'ACTIVE')
+        self._check_network_connectivity(server, keypair, floating_ip)
 
     @test.idempotent_id('61f1aa9a-1573-410e-9054-afa557cab021')
     @test.stresstest(class_setup_per='process')
     @test.services('compute', 'network')
     def test_server_connectivity_stop_start(self):
-        self._setup_network_and_servers()
-        self.servers_client.stop_server(self.server['id'])
-        waiters.wait_for_server_status(self.servers_client,
-                                       self.server['id'], 'SHUTOFF')
-        self._check_network_connectivity(should_connect=False)
-        self.servers_client.start_server(self.server['id'])
-        self._wait_server_status_and_check_network_connectivity()
+        server, keypair, floating_ip = self._setup_network_and_servers()
+        self.servers_client.stop_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'SHUTOFF')
+        self._check_network_connectivity(server, keypair, floating_ip,
+                                         should_connect=False)
+        self.servers_client.start_server(server['id'])
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
     @test.idempotent_id('7b6860c2-afa3-4846-9522-adeb38dfbe08')
     @test.services('compute', 'network')
     def test_server_connectivity_reboot(self):
-        self._setup_network_and_servers()
-        self.servers_client.reboot_server(self.server['id'],
-                                          reboot_type='SOFT')
-        self._wait_server_status_and_check_network_connectivity()
+        server, keypair, floating_ip = self._setup_network_and_servers()
+        self.servers_client.reboot_server(server['id'], reboot_type='SOFT')
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
     @test.idempotent_id('88a529c2-1daa-4c85-9aec-d541ba3eb699')
     @test.services('compute', 'network')
     def test_server_connectivity_rebuild(self):
-        self._setup_network_and_servers()
+        server, keypair, floating_ip = self._setup_network_and_servers()
         image_ref_alt = CONF.compute.image_ref_alt
-        self.servers_client.rebuild_server(self.server['id'],
+        self.servers_client.rebuild_server(server['id'],
                                            image_ref=image_ref_alt)
-        self._wait_server_status_and_check_network_connectivity()
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
     @test.idempotent_id('2b2642db-6568-4b35-b812-eceed3fa20ce')
     @testtools.skipUnless(CONF.compute_feature_enabled.pause,
                           'Pause is not available.')
     @test.services('compute', 'network')
     def test_server_connectivity_pause_unpause(self):
-        self._setup_network_and_servers()
-        self.servers_client.pause_server(self.server['id'])
-        waiters.wait_for_server_status(self.servers_client,
-                                       self.server['id'], 'PAUSED')
-        self._check_network_connectivity(should_connect=False)
-        self.servers_client.unpause_server(self.server['id'])
-        self._wait_server_status_and_check_network_connectivity()
+        server, keypair, floating_ip = self._setup_network_and_servers()
+        self.servers_client.pause_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'PAUSED')
+        self._check_network_connectivity(server, keypair, floating_ip,
+                                         should_connect=False)
+        self.servers_client.unpause_server(server['id'])
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
     @test.idempotent_id('5cdf9499-541d-4923-804e-b9a60620a7f0')
     @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
                           'Suspend is not available.')
     @test.services('compute', 'network')
     def test_server_connectivity_suspend_resume(self):
-        self._setup_network_and_servers()
-        self.servers_client.suspend_server(self.server['id'])
-        waiters.wait_for_server_status(self.servers_client, self.server['id'],
+        server, keypair, floating_ip = self._setup_network_and_servers()
+        self.servers_client.suspend_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
                                        'SUSPENDED')
-        self._check_network_connectivity(should_connect=False)
-        self.servers_client.resume_server(self.server['id'])
-        self._wait_server_status_and_check_network_connectivity()
+        self._check_network_connectivity(server, keypair, floating_ip,
+                                         should_connect=False)
+        self.servers_client.resume_server(server['id'])
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
 
     @test.idempotent_id('719eb59d-2f42-4b66-b8b1-bb1254473967')
     @testtools.skipUnless(CONF.compute_feature_enabled.resize,
@@ -159,10 +171,11 @@
         if resize_flavor == CONF.compute.flavor_ref:
             msg = "Skipping test - flavor_ref and flavor_ref_alt are identical"
             raise self.skipException(msg)
-        self._setup_network_and_servers()
-        self.servers_client.resize_server(self.server['id'],
+        server, keypair, floating_ip = self._setup_network_and_servers()
+        self.servers_client.resize_server(server['id'],
                                           flavor_ref=resize_flavor)
-        waiters.wait_for_server_status(self.servers_client, self.server['id'],
+        waiters.wait_for_server_status(self.servers_client, server['id'],
                                        'VERIFY_RESIZE')
-        self.servers_client.confirm_resize_server(self.server['id'])
-        self._wait_server_status_and_check_network_connectivity()
+        self.servers_client.confirm_resize_server(server['id'])
+        self._wait_server_status_and_check_network_connectivity(
+            server, keypair, floating_ip)
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
index dbc9bbb..bc80412 100644
--- a/tempest/scenario/test_shelve_instance.py
+++ b/tempest/scenario/test_shelve_instance.py
@@ -55,12 +55,12 @@
                                        'ACTIVE')
 
     def _create_server_then_shelve_and_unshelve(self, boot_from_volume=False):
-        self.keypair = self.create_keypair()
+        keypair = self.create_keypair()
 
-        self.security_group = self._create_security_group()
-        security_groups = [{'name': self.security_group['name']}]
+        security_group = self._create_security_group()
+        security_groups = [{'name': security_group['name']}]
         create_kwargs = {
-            'key_name': self.keypair['name'],
+            'key_name': keypair['name'],
             'security_groups': security_groups
         }
 
@@ -86,18 +86,22 @@
                             floating_ip['id'])
             self.floating_ips_client.associate_floating_ip_to_server(
                 floating_ip['ip'], server['id'])
-            timestamp = self.create_timestamp(floating_ip['ip'])
+            timestamp = self.create_timestamp(
+                floating_ip['ip'], private_key=keypair['private_key'])
         else:
-            timestamp = self.create_timestamp(server)
+            timestamp = self.create_timestamp(
+                server, private_key=keypair['private_key'])
 
         # Prevent bug #1257594 from coming back
         # Unshelve used to boot the instance with the original image, not
         # with the instance snapshot
         self._shelve_then_unshelve_server(server)
         if CONF.compute.use_floatingip_for_ssh:
-            timestamp2 = self.get_timestamp(floating_ip['ip'])
+            timestamp2 = self.get_timestamp(floating_ip['ip'],
+                                            private_key=keypair['private_key'])
         else:
-            timestamp2 = self.get_timestamp(server)
+            timestamp2 = self.get_timestamp(server,
+                                            private_key=keypair['private_key'])
         self.assertEqual(timestamp, timestamp2)
 
     @test.idempotent_id('1164e700-0af0-4a4c-8792-35909a88743c')
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 79b809f..5ac3a7e 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -36,44 +36,47 @@
 
     """
 
-    def _boot_image(self, image_id):
-        security_groups = [{'name': self.security_group['name']}]
+    def _boot_image(self, image_id, keypair, security_group):
+        security_groups = [{'name': security_group['name']}]
         create_kwargs = {
-            'key_name': self.keypair['name'],
+            'key_name': keypair['name'],
             'security_groups': security_groups
         }
         return self.create_server(image=image_id, create_kwargs=create_kwargs)
 
-    def _add_keypair(self):
-        self.keypair = self.create_keypair()
-
     @test.idempotent_id('608e604b-1d63-4a82-8e3e-91bc665c90b4')
     @testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
                           'Snapshotting is not available.')
     @test.services('compute', 'network', 'image')
     def test_snapshot_pattern(self):
         # prepare for booting an instance
-        self._add_keypair()
-        self.security_group = self._create_security_group()
+        keypair = self.create_keypair()
+        security_group = self._create_security_group()
 
         # boot an instance and create a timestamp file in it
-        server = self._boot_image(CONF.compute.image_ref)
+        server = self._boot_image(CONF.compute.image_ref, keypair,
+                                  security_group)
         if CONF.compute.use_floatingip_for_ssh:
             fip_for_server = self.create_floating_ip(server)
-            timestamp = self.create_timestamp(fip_for_server['ip'])
+            timestamp = self.create_timestamp(
+                fip_for_server['ip'], private_key=keypair['private_key'])
         else:
-            timestamp = self.create_timestamp(server)
+            timestamp = self.create_timestamp(
+                server, private_key=keypair['private_key'])
 
         # snapshot the instance
         snapshot_image = self.create_server_snapshot(server=server)
 
         # boot a second instance from the snapshot
-        server_from_snapshot = self._boot_image(snapshot_image['id'])
+        server_from_snapshot = self._boot_image(snapshot_image['id'],
+                                                keypair, security_group)
 
         # check the existence of the timestamp file in the second instance
         if CONF.compute.use_floatingip_for_ssh:
             fip_for_snapshot = self.create_floating_ip(server_from_snapshot)
-            timestamp2 = self.get_timestamp(fip_for_snapshot['ip'])
+            timestamp2 = self.get_timestamp(fip_for_snapshot['ip'],
+                                            private_key=keypair['private_key'])
         else:
-            timestamp2 = self.get_timestamp(server_from_snapshot)
+            timestamp2 = self.get_timestamp(server_from_snapshot,
+                                            private_key=keypair['private_key'])
         self.assertEqual(timestamp, timestamp2)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index a4f9896..6eceeb2 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -63,20 +63,17 @@
         self.snapshots_client.wait_for_snapshot_status(volume_snapshot['id'],
                                                        status)
 
-    def _boot_image(self, image_id):
-        security_groups = [{'name': self.security_group['name']}]
+    def _boot_image(self, image_id, keypair, security_group):
+        security_groups = [{'name': security_group['name']}]
         create_kwargs = {
-            'key_name': self.keypair['name'],
+            'key_name': keypair['name'],
             'security_groups': security_groups
         }
         return self.create_server(image=image_id, create_kwargs=create_kwargs)
 
-    def _add_keypair(self):
-        self.keypair = self.create_keypair()
-
     def _create_volume_snapshot(self, volume):
         snapshot_name = data_utils.rand_name('scenario-snapshot')
-        _, snapshot = self.snapshots_client.create_snapshot(
+        snapshot = self.snapshots_client.create_snapshot(
             volume['id'], display_name=snapshot_name)['snapshot']
 
         def cleaner():
@@ -111,8 +108,9 @@
         self.servers_client.detach_volume(server['id'], volume['id'])
         self._wait_for_volume_status(volume, 'available')
 
-    def _wait_for_volume_available_on_the_system(self, server_or_ip):
-        ssh = self.get_remote_client(server_or_ip)
+    def _wait_for_volume_available_on_the_system(self, server_or_ip,
+                                                 private_key):
+        ssh = self.get_remote_client(server_or_ip, private_key=private_key)
 
         def _func():
             part = ssh.get_partitions()
@@ -131,12 +129,13 @@
     @tempest.test.services('compute', 'network', 'volume', 'image')
     def test_stamp_pattern(self):
         # prepare for booting an instance
-        self._add_keypair()
-        self.security_group = self._create_security_group()
+        keypair = self.create_keypair()
+        security_group = self._create_security_group()
 
         # boot an instance and create a timestamp file in it
         volume = self._create_volume()
-        server = self._boot_image(CONF.compute.image_ref)
+        server = self._boot_image(CONF.compute.image_ref, keypair,
+                                  security_group)
 
         # create and add floating IP to server1
         if CONF.compute.use_floatingip_for_ssh:
@@ -146,9 +145,11 @@
             ip_for_server = server
 
         self._attach_volume(server, volume)
-        self._wait_for_volume_available_on_the_system(ip_for_server)
+        self._wait_for_volume_available_on_the_system(ip_for_server,
+                                                      keypair['private_key'])
         timestamp = self.create_timestamp(ip_for_server,
-                                          CONF.compute.volume_device_name)
+                                          CONF.compute.volume_device_name,
+                                          private_key=keypair['private_key'])
         self._detach_volume(server, volume)
 
         # snapshot the volume
@@ -162,7 +163,8 @@
             snapshot_id=volume_snapshot['id'])
 
         # boot second instance from the snapshot(instance2)
-        server_from_snapshot = self._boot_image(snapshot_image['id'])
+        server_from_snapshot = self._boot_image(snapshot_image['id'],
+                                                keypair, security_group)
 
         # create and add floating IP to server_from_snapshot
         if CONF.compute.use_floatingip_for_ssh:
@@ -174,9 +176,11 @@
 
         # attach volume2 to instance2
         self._attach_volume(server_from_snapshot, volume_from_snapshot)
-        self._wait_for_volume_available_on_the_system(ip_for_snapshot)
+        self._wait_for_volume_available_on_the_system(ip_for_snapshot,
+                                                      keypair['private_key'])
 
         # check the existence of the timestamp file in the volume2
         timestamp2 = self.get_timestamp(ip_for_snapshot,
-                                        CONF.compute.volume_device_name)
+                                        CONF.compute.volume_device_name,
+                                        private_key=keypair['private_key'])
         self.assertEqual(timestamp, timestamp2)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index d4bddc0..678fcfc 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -11,7 +11,6 @@
 #    under the License.
 
 from oslo_log import log
-from tempest_lib import decorators
 
 from tempest.common.utils import data_utils
 from tempest.common import waiters
@@ -164,7 +163,6 @@
         ssh_client = self._ssh_to_server(instance_from_snapshot, keypair)
         self._check_content_of_written_file(ssh_client, text)
 
-    @decorators.skip_because(bug='1489581')
     @test.idempotent_id('36c34c67-7b54-4b59-b188-02a2f458a63b')
     @test.services('compute', 'volume', 'image')
     def test_create_ebs_image_and_check_boot(self):
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
deleted file mode 100644
index ba06f23..0000000
--- a/tempest/services/compute/json/hypervisor_client.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2013 IBM Corporation.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest.api_schema.response.compute.v2_1 import hypervisors as schema
-from tempest.common import service_client
-
-
-class HypervisorClient(service_client.ServiceClient):
-
-    def list_hypervisors(self, detail=False):
-        """List hypervisors information."""
-        url = 'os-hypervisors'
-        _schema = schema.list_search_hypervisors
-        if detail:
-            url += '/detail'
-            _schema = schema.list_hypervisors_detail
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        self.validate_response(_schema, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_hypervisor(self, hypervisor_id):
-        """Display the details of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s' % hypervisor_id)
-        body = json.loads(body)
-        self.validate_response(schema.get_hypervisor, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def list_servers_on_hypervisor(self, hypervisor_name):
-        """List instances belonging to the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/servers' % hypervisor_name)
-        body = json.loads(body)
-        self.validate_response(schema.get_hypervisors_servers, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_hypervisor_statistics(self):
-        """Get hypervisor statistics over all compute nodes."""
-        resp, body = self.get('os-hypervisors/statistics')
-        body = json.loads(body)
-        self.validate_response(schema.get_hypervisor_statistics, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_hypervisor_uptime(self, hypervisor_id):
-        """Display the uptime of the specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/uptime' % hypervisor_id)
-        body = json.loads(body)
-        self.validate_response(schema.get_hypervisor_uptime, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def search_hypervisor(self, hypervisor_name):
-        """Search specified hypervisor."""
-        resp, body = self.get('os-hypervisors/%s/search' % hypervisor_name)
-        body = json.loads(body)
-        self.validate_response(schema.list_search_hypervisors, resp, body)
-        return service_client.ResponseBody(resp, body)
diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py
index 709ca6f..a53ed5f 100644
--- a/tempest/tests/common/test_admin_available.py
+++ b/tempest/tests/common/test_admin_available.py
@@ -30,10 +30,10 @@
         self.useFixture(fake_config.ConfigFixture())
         self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
 
-    def run_test(self, tenant_isolation, use_accounts_file, admin_creds):
+    def run_test(self, dynamic_creds, use_accounts_file, admin_creds):
 
         cfg.CONF.set_default('use_dynamic_credentials',
-                             tenant_isolation, group='auth')
+                             dynamic_creds, group='auth')
         if use_accounts_file:
             accounts = [{'username': 'u1',
                          'tenant_name': 't1',
@@ -62,48 +62,54 @@
             self.useFixture(mockpatch.Patch('os.path.isfile',
                                             return_value=False))
             if admin_creds:
-                (u, t, p, d) = ('u', 't', 'p', 'd')
+                username = 'u'
+                tenant = 't'
+                password = 'p'
+                domain = 'd'
             else:
-                (u, t, p, d) = (None, None, None, None)
+                username = None
+                tenant = None
+                password = None
+                domain = None
 
-            cfg.CONF.set_default('admin_username', u, group='auth')
-            cfg.CONF.set_default('admin_tenant_name', t, group='auth')
-            cfg.CONF.set_default('admin_password', p, group='auth')
-            cfg.CONF.set_default('admin_domain_name', d, group='auth')
+            cfg.CONF.set_default('admin_username', username, group='auth')
+            cfg.CONF.set_default('admin_tenant_name', tenant, group='auth')
+            cfg.CONF.set_default('admin_password', password, group='auth')
+            cfg.CONF.set_default('admin_domain_name', domain, group='auth')
 
-        expected = admin_creds is not None or tenant_isolation
+        expected = admin_creds is not None or dynamic_creds
         observed = credentials.is_admin_available(
             identity_version=self.identity_version)
         self.assertEqual(expected, observed)
 
-    # Tenant isolation implies admin so only one test case for True
-    def test__tenant_isolation__accounts_file__no_admin(self):
-        self.run_test(tenant_isolation=True,
+    # Dynamic credentials implies admin so only one test case for True
+    def test__dynamic_creds__accounts_file__no_admin(self):
+        self.run_test(dynamic_creds=True,
                       use_accounts_file=True,
                       admin_creds=None)
 
-    def test__no_tenant_isolation__accounts_file__no_admin(self):
-        self.run_test(tenant_isolation=False,
+    def test__no_dynamic_creds__accounts_file__no_admin(self):
+        self.run_test(dynamic_creds=False,
                       use_accounts_file=True,
                       admin_creds=None)
 
-    def test__no_tenant_isolation__accounts_file__admin_role(self):
-        self.run_test(tenant_isolation=False,
+    def test__no_dynamic_creds__accounts_file__admin_role(self):
+        self.run_test(dynamic_creds=False,
                       use_accounts_file=True,
                       admin_creds='role')
 
-    def test__no_tenant_isolation__accounts_file__admin_type(self):
-        self.run_test(tenant_isolation=False,
+    def test__no_dynamic_creds__accounts_file__admin_type(self):
+        self.run_test(dynamic_creds=False,
                       use_accounts_file=True,
                       admin_creds='type')
 
-    def test__no_tenant_isolation__no_accounts_file__no_admin(self):
-        self.run_test(tenant_isolation=False,
+    def test__no_dynamic_creds__no_accounts_file__no_admin(self):
+        self.run_test(dynamic_creds=False,
                       use_accounts_file=False,
                       admin_creds=None)
 
-    def test__no_tenant_isolation__no_accounts_file__admin(self):
-        self.run_test(tenant_isolation=False,
+    def test__no_dynamic_creds__no_accounts_file__admin(self):
+        self.run_test(dynamic_creds=False,
                       use_accounts_file=False,
                       admin_creds='role')
 
diff --git a/tempest/tests/common/test_alt_available.py b/tempest/tests/common/test_alt_available.py
new file mode 100644
index 0000000..6a86f73
--- /dev/null
+++ b/tempest/tests/common/test_alt_available.py
@@ -0,0 +1,117 @@
+# 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_config import cfg
+from oslotest import mockpatch
+
+from tempest.common import credentials
+from tempest import config
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class TestAltAvailable(base.TestCase):
+
+    identity_version = 'v2'
+
+    def setUp(self):
+        super(TestAltAvailable, self).setUp()
+        self.useFixture(fake_config.ConfigFixture())
+        self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
+
+    def run_test(self, dynamic_creds, use_accounts_file, creds):
+
+        cfg.CONF.set_default('use_dynamic_credentials',
+                             dynamic_creds, group='auth')
+        if use_accounts_file:
+            accounts = [dict(username="u%s" % ii,
+                             tenant_name="t%s" % ii,
+                             password="p") for ii in creds]
+            self.useFixture(mockpatch.Patch(
+                'tempest.common.preprov_creds.read_accounts_yaml',
+                return_value=accounts))
+            cfg.CONF.set_default('test_accounts_file',
+                                 use_accounts_file, group='auth')
+            self.useFixture(mockpatch.Patch('os.path.isfile',
+                                            return_value=True))
+        else:
+            self.useFixture(mockpatch.Patch('os.path.isfile',
+                                            return_value=False))
+            cred_prefix = ['', 'alt_']
+            for ii in range(0, 2):
+                if len(creds) > ii:
+                    username = 'u%s' % creds[ii]
+                    tenant = 't%s' % creds[ii]
+                    password = 'p'
+                    domain = 'd'
+                else:
+                    username = None
+                    tenant = None
+                    password = None
+                    domain = None
+
+                cfg.CONF.set_default('%susername' % cred_prefix[ii], username,
+                                     group='identity')
+                cfg.CONF.set_default('%stenant_name' % cred_prefix[ii], tenant,
+                                     group='identity')
+                cfg.CONF.set_default('%spassword' % cred_prefix[ii], password,
+                                     group='identity')
+                cfg.CONF.set_default('%sdomain_name' % cred_prefix[ii], domain,
+                                     group='identity')
+
+        expected = len(set(creds)) > 1 or dynamic_creds
+        observed = credentials.is_alt_available(
+            identity_version=self.identity_version)
+        self.assertEqual(expected, observed)
+
+    # Dynamic credentials implies alt so only one test case for True
+    def test__dynamic_creds__accounts_file__one_user(self):
+        self.run_test(dynamic_creds=True,
+                      use_accounts_file=False,
+                      creds=['1', '2'])
+
+    def test__no_dynamic_creds__accounts_file__one_user(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=True,
+                      creds=['1'])
+
+    def test__no_dynamic_creds__accounts_file__two_users(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=True,
+                      creds=['1', '2'])
+
+    def test__no_dynamic_creds__accounts_file__two_users_identical(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=True,
+                      creds=['1', '1'])
+
+    def test__no_dynamic_creds__no_accounts_file__one_user(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=False,
+                      creds=['1'])
+
+    def test__no_dynamic_creds__no_accounts_file__two_users(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=False,
+                      creds=['1', '2'])
+
+    def test__no_dynamic_creds__no_accounts_file__two_users_identical(self):
+        self.run_test(dynamic_creds=False,
+                      use_accounts_file=False,
+                      creds=['1', '1'])
+
+
+class TestAltAvailableV3(TestAltAvailable):
+
+    identity_version = 'v3'
diff --git a/tempest/tests/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
similarity index 99%
rename from tempest/tests/test_dynamic_creds.py
rename to tempest/tests/common/test_dynamic_creds.py
index 08b2ab6..59a5523 100644
--- a/tempest/tests/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -33,7 +33,8 @@
 class TestDynamicCredentialProvider(base.TestCase):
 
     fixed_params = {'name': 'test class',
-                    'identity_version': 'v2'}
+                    'identity_version': 'v2',
+                    'admin_role': 'admin'}
 
     def setUp(self):
         super(TestDynamicCredentialProvider, self).setUp()
diff --git a/tempest/tests/common/test_preprov_creds.py b/tempest/tests/common/test_preprov_creds.py
index e813b2e..8a014af 100644
--- a/tempest/tests/common/test_preprov_creds.py
+++ b/tempest/tests/common/test_preprov_creds.py
@@ -37,7 +37,8 @@
 class TestPreProvisionedCredentials(base.TestCase):
 
     fixed_params = {'name': 'test class',
-                    'identity_version': 'v2'}
+                    'identity_version': 'v2',
+                    'admin_role': 'admin'}
 
     def setUp(self):
         super(TestPreProvisionedCredentials, self).setUp()
@@ -103,7 +104,8 @@
     def test_get_hash_dict(self):
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
-        hash_dict = test_account_class.get_hash_dict(self.test_accounts)
+        hash_dict = test_account_class.get_hash_dict(
+            self.test_accounts, self.fixed_params['admin_role'])
         hash_list = self._get_hash_list(self.test_accounts)
         for hash in hash_list:
             self.assertIn(hash, hash_dict['creds'].keys())
@@ -332,7 +334,8 @@
 class TestNotLockingAccount(base.TestCase):
 
     fixed_params = {'name': 'test class',
-                    'identity_version': 'v2'}
+                    'identity_version': 'v2',
+                    'admin_role': 'admin'}
 
     def setUp(self):
         super(TestNotLockingAccount, self).setUp()
diff --git a/tempest/tests/services/compute/test_hypervisor_client.py b/tempest/tests/services/compute/test_hypervisor_client.py
deleted file mode 100644
index 441e7e6..0000000
--- a/tempest/tests/services/compute/test_hypervisor_client.py
+++ /dev/null
@@ -1,167 +0,0 @@
-# Copyright 2015 IBM Corp.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.services.compute.json import hypervisor_client
-from tempest.tests import fake_auth_provider
-from tempest.tests.services.compute import base
-
-
-class TestHypervisorClient(base.BaseComputeServiceTest):
-
-    hypervisor_id = "1"
-    hypervisor_name = "hyper.hostname.com"
-
-    def setUp(self):
-        super(TestHypervisorClient, self).setUp()
-        fake_auth = fake_auth_provider.FakeAuthProvider()
-        self.client = hypervisor_client.HypervisorClient(
-            fake_auth, 'compute', 'regionOne')
-
-    def test_list_hypervisor_str_body(self):
-        self._test_list_hypervisor(bytes_body=False)
-
-    def test_list_hypervisor_byte_body(self):
-        self._test_list_hypervisor(bytes_body=True)
-
-    def _test_list_hypervisor(self, bytes_body=False):
-        expected = {"hypervisors": [{
-            "id": 1,
-            "hypervisor_hostname": "hypervisor1.hostname.com"},
-            {
-            "id": 2,
-            "hypervisor_hostname": "hypervisor2.hostname.com"}]}
-        self.check_service_client_function(
-            self.client.list_hypervisors,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body)
-
-    def test_show_hypervisor_str_body(self):
-        self._test_show_hypervisor(bytes_body=False)
-
-    def test_show_hypervisor_byte_body(self):
-        self._test_show_hypervisor(bytes_body=True)
-
-    def _test_show_hypervisor(self, bytes_body=False):
-        expected = {"hypervisor": {
-            "cpu_info": "?",
-            "current_workload": 0,
-            "disk_available_least": 1,
-            "host_ip": "10.10.10.10",
-            "free_disk_gb": 1028,
-            "free_ram_mb": 7680,
-            "hypervisor_hostname": "fake-mini",
-            "hypervisor_type": "fake",
-            "hypervisor_version": 1,
-            "id": 1,
-            "local_gb": 1028,
-            "local_gb_used": 0,
-            "memory_mb": 8192,
-            "memory_mb_used": 512,
-            "running_vms": 0,
-            "service": {
-                "host": "fake_host",
-                "id": 2},
-            "vcpus": 1,
-            "vcpus_used": 0}}
-        self.check_service_client_function(
-            self.client.show_hypervisor,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body,
-            hypervisor_id=self.hypervisor_id)
-
-    def test_list_servers_on_hypervisor_str_body(self):
-        self._test_list_servers_on_hypervisor(bytes_body=False)
-
-    def test_list_servers_on_hypervisor_byte_body(self):
-        self._test_list_servers_on_hypervisor(bytes_body=True)
-
-    def _test_list_servers_on_hypervisor(self, bytes_body=False):
-        expected = {"hypervisors": [{
-            "id": 1,
-            "hypervisor_hostname": "hyper.hostname.com",
-            "servers": [{
-                "uuid": "e1ae8fc4-b72d-4c2f-a427-30dd420b6277",
-                "name": "instance-00000001"},
-                {
-                "uuid": "e1ae8fc4-b72d-4c2f-a427-30dd42066666",
-                "name": "instance-00000002"}
-                ]}
-            ]}
-        self.check_service_client_function(
-            self.client.list_servers_on_hypervisor,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body,
-            hypervisor_name=self.hypervisor_name)
-
-    def test_show_hypervisor_statistics_str_body(self):
-        self._test_show_hypervisor_statistics(bytes_body=False)
-
-    def test_show_hypervisor_statistics_byte_body(self):
-        self._test_show_hypervisor_statistics(bytes_body=True)
-
-    def _test_show_hypervisor_statistics(self, bytes_body=False):
-        expected = {
-            "hypervisor_statistics": {
-                "count": 1,
-                "current_workload": 0,
-                "disk_available_least": 0,
-                "free_disk_gb": 1028,
-                "free_ram_mb": 7680,
-                "local_gb": 1028,
-                "local_gb_used": 0,
-                "memory_mb": 8192,
-                "memory_mb_used": 512,
-                "running_vms": 0,
-                "vcpus": 1,
-                "vcpus_used": 0}}
-        self.check_service_client_function(
-            self.client.show_hypervisor_statistics,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body)
-
-    def test_show_hypervisor_uptime_str_body(self):
-        self._test_show_hypervisor_uptime(bytes_body=False)
-
-    def test_show_hypervisor_uptime_byte_body(self):
-        self._test_show_hypervisor_uptime(bytes_body=True)
-
-    def _test_show_hypervisor_uptime(self, bytes_body=False):
-        expected = {
-            "hypervisor": {
-                "hypervisor_hostname": "fake-mini",
-                "id": 1,
-                "uptime": (" 08:32:11 up 93 days, 18:25, 12 users, "
-                           " load average: 0.20, 0.12, 0.14")
-            }}
-        self.check_service_client_function(
-            self.client.show_hypervisor_uptime,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body,
-            hypervisor_id=self.hypervisor_id)
-
-    def test_search_hypervisor_str_body(self):
-        self._test_search_hypervisor(bytes_body=False)
-
-    def test_search_hypervisor_byte_body(self):
-        self._test_search_hypervisor(bytes_body=True)
-
-    def _test_search_hypervisor(self, bytes_body=False):
-        expected = {"hypervisors": [{
-            "id": 2,
-            "hypervisor_hostname": "hyper.hostname.com"}]}
-        self.check_service_client_function(
-            self.client.search_hypervisor,
-            'tempest.common.service_client.ServiceClient.get',
-            expected, bytes_body,
-            hypervisor_name=self.hypervisor_name)
