Merge "Update docstring for create_test_server"
diff --git a/README.rst b/README.rst
index 725a890..53c7de5 100644
--- a/README.rst
+++ b/README.rst
@@ -1,13 +1,8 @@
 Tempest - The OpenStack Integration Test Suite
 ==============================================
 
-.. image:: https://img.shields.io/pypi/v/tempest.svg
-    :target: https://pypi.python.org/pypi/tempest/
-    :alt: Latest Version
-
-.. image:: https://img.shields.io/pypi/dm/tempest.svg
-    :target: https://pypi.python.org/pypi/tempest/
-    :alt: Downloads
+The documentation for Tempest is officially hosted at:
+http://docs.openstack.org/developer/tempest/
 
 This is a set of integration tests to be run against a live OpenStack
 cluster. Tempest has batteries of tests for OpenStack API validation,
@@ -63,19 +58,21 @@
    This can be done within a venv, but the assumption for this guide is that
    the Tempest cli entry point will be in your shell's PATH.
 
-#. Installing Tempest will create a /etc/tempest dir which will contain the
-   sample config file packaged with Tempest. The contents of /etc/tempest will
-   be copied to all local working dirs, so if there is any common configuration
-   you'd like to be shared between anyone setting up local Tempest working dirs
-   it's recommended that you copy or rename tempest.conf.sample to tempest.conf
-   and make those changes to that file in /etc/tempest
+#. Installing Tempest may create a /etc/tempest dir, however if one isn't
+   created you can create one or use ~/.tempest/etc or ~/.config/tempest in
+   place of /etc/tempest. If none of these dirs are created tempest will create
+   ~/.tempest/etc when it's needed. The contents of this dir will always
+   automatically be copied to all etc/ dirs in local workspaces as an initial
+   setup step. So if there is any common configuration you'd like to be shared
+   between local Tempest workspaces it's recommended that you pre-populate it
+   before running ``tempest init``.
 
-#. Setup a local working Tempest dir. This is done by using the tempest init
+#. Setup a local Tempest workspace. This is done by using the tempest init
    command::
 
     $ tempest init cloud-01
 
-   works the same as::
+   which also works the same as::
 
     $ mkdir cloud-01 && cd cloud-01 && tempest init
 
@@ -88,11 +85,23 @@
    config files located in the etc/ subdir created by the ``tempest init``
    command. Tempest is expecting a tempest.conf file in etc/ so if only a
    sample exists you must rename or copy it to tempest.conf before making
-   any changes to it otherwise Tempest will not know how to load it.
+   any changes to it otherwise Tempest will not know how to load it. For
+   details on configuring tempest refer to the :ref:`tempest-configuration`.
 
 #. Once the configuration is done you're now ready to run Tempest. This can
-   be done with testr directly or any `testr`_ based test runner, like
-   `ostestr`_. For example, from the working dir running::
+   be done using the :ref:`tempest_run` command. This can be done by either
+   running::
+
+     $ tempest run
+
+   from the Tempest workspace directory. Or you can use the ``--workspace``
+   argument to run in the workspace you created regarless of your current
+   working directory. For example::
+
+     $ tempest run --workspace cloud-01
+
+   There is also the option to use testr directly, or any `testr`_ based test
+   runner, like `ostestr`_. For example, from the workspace dir run::
 
      $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))'
 
diff --git a/doc/source/run.rst b/doc/source/run.rst
index 07fa5f7..ce7f03e 100644
--- a/doc/source/run.rst
+++ b/doc/source/run.rst
@@ -1,3 +1,5 @@
+.. _tempest_run:
+
 -----------
 Tempest Run
 -----------
diff --git a/doc/source/test-removal.rst b/doc/source/test-removal.rst
index 6570bb7..79a5846 100644
--- a/doc/source/test-removal.rst
+++ b/doc/source/test-removal.rst
@@ -31,7 +31,7 @@
 
  #. The tests proposed for removal must have equiv. coverage in a different
     project's test suite (whether this is another gating test project, or an in
-    tree funcitonal test suite) For API tests preferably the other project will
+    tree functional test suite). For API tests preferably the other project will
     have a similar source of friction in place to prevent breaking api changes
     so that we don't regress and let breaking api changes slip through the
     gate.
@@ -62,7 +62,7 @@
 
 SELECT * from tests where test_id like "%test_id%";
 (where $test_id is the full test_id, but truncated to the class because of
-setupclass or teardownclass failures)
+setupClass or tearDownClass failures)
 
 You can access the infra mysql subunit2sql db w/ read-only permissions with:
 
@@ -113,7 +113,7 @@
 well ahead of the scheduled meeting. Since the meeting time will be well known
 ahead of time anyone who depends on the tests will have ample time beforehand
 to outline any concerns on the before the meeting. To give ample time for
-people to respond to removal proposals please add things to the agend by the
+people to respond to removal proposals please add things to the agenda by the
 Monday before the meeting.
 
 The other option is to raise the removal on the openstack-dev mailing list.
@@ -163,6 +163,6 @@
 anything that lives in tempest which doesn't test one of these projects can be
 removed assuming there is equivalent testing elsewhere. Preferably using the
 `tempest plugin mechanism`_
-to mantain continuity after migrating the tests out of tempest
+to maintain continuity after migrating the tests out of tempest.
 
 .. _tempest plugin mechanism: http://docs.openstack.org/developer/tempest/plugin.html
diff --git a/releasenotes/notes/service_client_config-8a1d7b4de769c633.yaml b/releasenotes/notes/service_client_config-8a1d7b4de769c633.yaml
new file mode 100644
index 0000000..3e43f9a
--- /dev/null
+++ b/releasenotes/notes/service_client_config-8a1d7b4de769c633.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - A new helper method `service_client_config` has been added
+    to the stable module config.py that returns extracts from
+    configuration into a dictionary the configuration settings
+    relevant for the initisialisation of a service client.
diff --git a/requirements.txt b/requirements.txt
index 7d01f69..216dd50 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,11 +10,11 @@
 testrepository>=0.0.18 # Apache-2.0/BSD
 pyOpenSSL>=0.14 # Apache-2.0
 oslo.concurrency>=3.8.0 # Apache-2.0
-oslo.config>=3.10.0 # Apache-2.0
+oslo.config>=3.12.0 # Apache-2.0
 oslo.i18n>=2.1.0 # Apache-2.0
 oslo.log>=1.14.0 # Apache-2.0
 oslo.serialization>=1.10.0 # Apache-2.0
-oslo.utils>=3.11.0 # Apache-2.0
+oslo.utils>=3.15.0 # Apache-2.0
 six>=1.9.0 # MIT
 fixtures>=3.0.0 # Apache-2.0/BSD
 testscenarios>=0.4 # Apache-2.0/BSD
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
index decccf3..d5ba76c 100644
--- a/tempest/api/data_processing/base.py
+++ b/tempest/api/data_processing/base.py
@@ -349,7 +349,7 @@
             return None
 
         for plugin in CONF.data_processing_feature_enabled.plugins:
-            if plugin in DEFAULT_TEMPLATES.keys():
+            if plugin in DEFAULT_TEMPLATES:
                 break
         else:
             plugin = ''
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 607bebe..bee77df 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -13,10 +13,15 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import testtools
+
 from tempest.api.identity import base
 from tempest.common.utils import data_utils
+from tempest import config
 from tempest import test
 
+CONF = config.CONF
+
 
 class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
 
@@ -52,6 +57,37 @@
         self.assertEqual(project_name, body['name'])
         self.assertEqual(self.data.domain['id'], body['domain_id'])
 
+    @testtools.skipUnless(CONF.identity_feature_enabled.reseller,
+                          'Reseller not available.')
+    @test.idempotent_id('1854f9c0-70bc-4d11-a08a-1c789d339e3d')
+    def test_project_create_with_parent(self):
+        # Create root project without providing a parent_id
+        self.data.setup_test_domain()
+        domain_id = self.data.domain['id']
+
+        root_project_name = data_utils.rand_name('root_project')
+        root_project = self.projects_client.create_project(
+            root_project_name, domain_id=domain_id)['project']
+        self.addCleanup(
+            self.projects_client.delete_project, root_project['id'])
+
+        root_project_id = root_project['id']
+        parent_id = root_project['parent_id']
+        self.assertEqual(root_project_name, root_project['name'])
+        # If not provided, the parent_id must point to the top level
+        # project in the hierarchy, i.e. its domain
+        self.assertEqual(domain_id, parent_id)
+
+        # Create a project using root_project_id as parent_id
+        project_name = data_utils.rand_name('project')
+        project = self.projects_client.create_project(
+            project_name, domain_id=domain_id,
+            parent_id=root_project_id)['project']
+        self.addCleanup(self.projects_client.delete_project, project['id'])
+        parent_id = project['parent_id']
+        self.assertEqual(project_name, project['name'])
+        self.assertEqual(root_project_id, parent_id)
+
     @test.idempotent_id('1f66dc76-50cc-4741-a200-af984509e480')
     def test_project_create_enabled(self):
         # Create a project that is enabled
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 7a1e3a5..df39390 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -218,21 +218,21 @@
     def teardown_all(self):
         for user in self.users:
             test_utils.call_and_ignore_notfound_exc(
-                self.users_client.delete_user, user)
+                self.users_client.delete_user, user['id'])
         for tenant in self.tenants:
             test_utils.call_and_ignore_notfound_exc(
-                self.projects_client.delete_tenant, tenant)
+                self.projects_client.delete_tenant, tenant['id'])
         for project in reversed(self.projects):
             test_utils.call_and_ignore_notfound_exc(
-                self.projects_client.delete_project, project)
+                self.projects_client.delete_project, project['id'])
         for role in self.roles:
             test_utils.call_and_ignore_notfound_exc(
-                self.roles_client.delete_role, role)
+                self.roles_client.delete_role, role['id'])
         for domain in self.domains:
             test_utils.call_and_ignore_notfound_exc(
-                self.domains_client.update_domain, domain, enabled=False)
+                self.domains_client.update_domain, domain['id'], enabled=False)
             test_utils.call_and_ignore_notfound_exc(
-                self.domains_client.delete_domain, domain)
+                self.domains_client.delete_domain, domain['id'])
 
 
 class DataGeneratorV2(BaseDataGenerator):
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index b2892e5..92dfc56 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -14,6 +14,7 @@
 #    under the License.
 
 import netaddr
+import six
 
 from tempest.api.network import base
 from tempest import config
@@ -90,7 +91,8 @@
         body = self.ports_client.update_port(
             port_id, allowed_address_pairs=allowed_address_pairs)
         allowed_address_pair = body['port']['allowed_address_pairs']
-        self.assertEqual(allowed_address_pair, allowed_address_pairs)
+        six.assertCountEqual(self, allowed_address_pair,
+                             allowed_address_pairs)
 
     @test.idempotent_id('9599b337-272c-47fd-b3cf-509414414ac4')
     def test_update_port_with_address_pair(self):
diff --git a/tempest/api/orchestration/stacks/test_soft_conf.py b/tempest/api/orchestration/stacks/test_soft_conf.py
index 6a4e2b9..aa0b46a 100644
--- a/tempest/api/orchestration/stacks/test_soft_conf.py
+++ b/tempest/api/orchestration/stacks/test_soft_conf.py
@@ -45,7 +45,7 @@
 
     def _validate_config(self, configuration, api_config):
         # Assert all expected keys are present with matching data
-        for k in configuration.keys():
+        for k in configuration:
             self.assertEqual(configuration[k],
                              api_config['software_config'][k])
 
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 66bab51..b6dc488 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -27,17 +27,17 @@
 CONF = config.CONF
 
 
-class VolumesBackupsV2Test(base.BaseVolumeAdminTest):
+class VolumesBackupsAdminV2Test(base.BaseVolumeAdminTest):
 
     @classmethod
     def skip_checks(cls):
-        super(VolumesBackupsV2Test, cls).skip_checks()
+        super(VolumesBackupsAdminV2Test, cls).skip_checks()
         if not CONF.volume_feature_enabled.backup:
             raise cls.skipException("Cinder backup feature disabled")
 
     @classmethod
     def resource_setup(cls):
-        super(VolumesBackupsV2Test, cls).resource_setup()
+        super(VolumesBackupsAdminV2Test, cls).resource_setup()
 
         cls.volume = cls.create_volume()
 
@@ -167,5 +167,5 @@
                                                          'available')
 
 
-class VolumesBackupsV1Test(VolumesBackupsV2Test):
+class VolumesBackupsAdminV1Test(VolumesBackupsAdminV2Test):
     _api_version = 1
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index e9be529..087b9a8 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -76,6 +76,7 @@
         else:
             cls.snapshots_client = cls.os.snapshots_v2_client
             cls.volumes_client = cls.os.volumes_v2_client
+            cls.backups_client = cls.os.backups_v2_client
             cls.volumes_extension_client = cls.os.volumes_v2_extension_client
             cls.availability_zone_client = (
                 cls.os.volume_v2_availability_zone_client)
diff --git a/tempest/api/volume/test_volumes_backup.py b/tempest/api/volume/test_volumes_backup.py
new file mode 100644
index 0000000..87146db
--- /dev/null
+++ b/tempest/api/volume/test_volumes_backup.py
@@ -0,0 +1,72 @@
+# Copyright 2016 Red Hat, Inc.
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.api.volume import base
+from tempest.common.utils import data_utils
+from tempest.common import waiters
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class VolumesBackupsV2Test(base.BaseVolumeTest):
+
+    @classmethod
+    def skip_checks(cls):
+        super(VolumesBackupsV2Test, cls).skip_checks()
+        if not CONF.volume_feature_enabled.backup:
+            raise cls.skipException("Cinder backup feature disabled")
+
+    @classmethod
+    def resource_setup(cls):
+        super(VolumesBackupsV2Test, cls).resource_setup()
+
+        cls.volume = cls.create_volume()
+
+    @test.idempotent_id('07af8f6d-80af-44c9-a5dc-c8427b1b62e6')
+    @test.services('compute')
+    def test_backup_create_attached_volume(self):
+        """Test backup create using force flag.
+
+        Cinder allows to create a volume backup, whether the volume status
+        is "available" or "in-use".
+        """
+        # Create a server
+        server_name = data_utils.rand_name('instance')
+        server = self.create_server(name=server_name, wait_until='ACTIVE')
+        self.addCleanup(self.servers_client.delete_server, server['id'])
+        # Attach volume to instance
+        self.servers_client.attach_volume(server['id'],
+                                          volumeId=self.volume['id'])
+        waiters.wait_for_volume_status(self.volumes_client,
+                                       self.volume['id'], 'in-use')
+        self.addCleanup(waiters.wait_for_volume_status, self.volumes_client,
+                        self.volume['id'], 'available')
+        self.addCleanup(self.servers_client.detach_volume, server['id'],
+                        self.volume['id'])
+        # Create backup using force flag
+        backup_name = data_utils.rand_name('Backup')
+        backup = self.backups_client.create_backup(
+            volume_id=self.volume['id'],
+            name=backup_name, force=True)['backup']
+        self.addCleanup(self.backups_client.delete_backup, backup['id'])
+        self.backups_client.wait_for_backup_status(backup['id'],
+                                                   'available')
+        self.assertEqual(backup_name, backup['name'])
+
+
+class VolumesBackupsV1Test(VolumesBackupsV2Test):
+    _api_version = 1
diff --git a/tempest/clients.py b/tempest/clients.py
index ef03e80..fd010f2 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -21,6 +21,7 @@
 from tempest import config
 from tempest import exceptions
 from tempest.lib import auth
+from tempest.lib import exceptions as lib_exc
 from tempest.lib.services import compute
 from tempest.lib.services import image
 from tempest.lib.services import network
@@ -39,15 +40,10 @@
 class Manager(service_clients.ServiceClients):
     """Top level manager for OpenStack tempest clients"""
 
-    default_params = {
-        'disable_ssl_certificate_validation':
-            CONF.identity.disable_ssl_certificate_validation,
-        'ca_certs': CONF.identity.ca_certificates_file,
-        'trace_requests': CONF.debug.trace_requests
-    }
+    default_params = config.service_client_config()
 
-    # NOTE: Tempest uses timeout values of compute API if project specific
-    # timeout values don't exist.
+    # TODO(andreaf) This is only used by data_processing and baremetal clients,
+    # and should be removed once they are out of Tempest
     default_params_with_timeout_values = {
         'build_interval': CONF.compute.build_interval,
         'build_timeout': CONF.compute.build_timeout
@@ -65,7 +61,11 @@
         _, identity_uri = get_auth_provider_class(credentials)
         super(Manager, self).__init__(
             credentials=credentials, identity_uri=identity_uri, scope=scope,
-            region=CONF.identity.region, **self.default_params)
+            region=CONF.identity.region,
+            client_parameters=self._prepare_configuration())
+        # TODO(andreaf) When clients are initialised without the right
+        # parameters available, the calls below will trigger a KeyError.
+        # We should catch that and raise a better error.
         self._set_compute_clients()
         self._set_identity_clients()
         self._set_volume_clients()
@@ -96,15 +96,38 @@
         self.negative_client = negative_rest_client.NegativeRestClient(
             self.auth_provider, service, **self.default_params)
 
+    def _prepare_configuration(self):
+        """Map values from CONF into Manager parameters
+
+        This uses `config.service_client_config` for all services to collect
+        most configuration items needed to init the clients.
+        """
+        # NOTE(andreaf) Configuration items will be passed in future patches
+        # into ClientFactory objects, but for now we update all the
+        # _set_*_client methods to consume them so we can verify that the
+        # configuration collected is correct
+
+        configuration = {}
+
+        # Setup the parameters for all Tempest services.
+        # NOTE(andreaf) Since client.py is an internal module of Tempest,
+        # it doesn't have to consider plugin configuration.
+        for service in service_clients.tempest_modules():
+            try:
+                # NOTE(andreaf) Use the unversioned service name to fetch
+                # the configuration since configuration is not versioned.
+                service_for_config = service.split('.')[0]
+                if service_for_config not in configuration:
+                    configuration[service_for_config] = (
+                        config.service_client_config(service_for_config))
+            except lib_exc.UnknownServiceClient:
+                LOG.warn(
+                    'Could not load configuration for service %s' % service)
+
+        return configuration
+
     def _set_network_clients(self):
-        params = {
-            'service': CONF.network.catalog_type,
-            'region': 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
-        }
-        params.update(self.default_params)
+        params = self.parameters['network']
         self.network_agents_client = network.AgentsClient(
             self.auth_provider, **params)
         self.network_extensions_client = network.ExtensionsClient(
@@ -135,20 +158,13 @@
             self.auth_provider, **params)
 
     def _set_image_clients(self):
-        params = {
-            'service': CONF.image.catalog_type,
-            'region': CONF.image.region or CONF.identity.region,
-            'endpoint_type': CONF.image.endpoint_type,
-            'build_interval': CONF.image.build_interval,
-            'build_timeout': CONF.image.build_timeout
-        }
-        params.update(self.default_params)
-
         if CONF.service_available.glance:
+            params = self.parameters['image']
             self.image_client = image.v1.ImagesClient(
                 self.auth_provider, **params)
             self.image_member_client = image.v1.ImageMembersClient(
                 self.auth_provider, **params)
+
             self.image_client_v2 = image.v2.ImagesClient(
                 self.auth_provider, **params)
             self.image_member_client_v2 = image.v2.ImageMembersClient(
@@ -161,14 +177,7 @@
                 self.auth_provider, **params)
 
     def _set_compute_clients(self):
-        params = {
-            'service': CONF.compute.catalog_type,
-            'region': CONF.compute.region or CONF.identity.region,
-            'endpoint_type': CONF.compute.endpoint_type,
-            'build_interval': CONF.compute.build_interval,
-            'build_timeout': CONF.compute.build_timeout
-        }
-        params.update(self.default_params)
+        params = self.parameters['compute']
 
         self.agents_client = compute.AgentsClient(self.auth_provider, **params)
         self.compute_networks_client = compute.NetworksClient(
@@ -234,10 +243,11 @@
         # NOTE: The following client needs special timeout values because
         # the API is a proxy for the other component.
         params_volume = copy.deepcopy(params)
-        params_volume.update({
-            'build_interval': CONF.volume.build_interval,
-            'build_timeout': CONF.volume.build_timeout
-        })
+        # Optional parameters
+        for _key in ('build_interval', 'build_timeout'):
+            _value = self.parameters['volume'].get(_key)
+            if _value:
+                params_volume[_key] = _value
         self.volumes_extensions_client = compute.VolumesClient(
             self.auth_provider, **params_volume)
         self.compute_versions_client = compute.VersionsClient(
@@ -246,14 +256,10 @@
             self.auth_provider, **params_volume)
 
     def _set_identity_clients(self):
-        params = {
-            'service': CONF.identity.catalog_type,
-            'region': CONF.identity.region
-        }
-        params.update(self.default_params_with_timeout_values)
+        params = self.parameters['identity']
 
         # Clients below use the admin endpoint type of Keystone API v2
-        params_v2_admin = params.copy()
+        params_v2_admin = copy.copy(params)
         params_v2_admin['endpoint_type'] = CONF.identity.v2_admin_endpoint_type
         self.endpoints_client = identity.v2.EndpointsClient(self.auth_provider,
                                                             **params_v2_admin)
@@ -269,7 +275,7 @@
             self.auth_provider, **params_v2_admin)
 
         # Clients below use the public endpoint type of Keystone API v2
-        params_v2_public = params.copy()
+        params_v2_public = copy.copy(params)
         params_v2_public['endpoint_type'] = (
             CONF.identity.v2_public_endpoint_type)
         self.identity_public_client = identity.v2.IdentityClient(
@@ -279,8 +285,9 @@
         self.users_public_client = identity.v2.UsersClient(
             self.auth_provider, **params_v2_public)
 
-        # Clients below use the endpoint type of Keystone API v3
-        params_v3 = params.copy()
+        # Clients below use the endpoint type of Keystone API v3, which is set
+        # in endpoint_type
+        params_v3 = copy.copy(params)
         params_v3['endpoint_type'] = CONF.identity.v3_endpoint_type
         self.domains_client = identity.v3.DomainsClient(self.auth_provider,
                                                         **params_v3)
@@ -326,14 +333,8 @@
                 raise exceptions.InvalidConfiguration(msg)
 
     def _set_volume_clients(self):
-        params = {
-            'service': CONF.volume.catalog_type,
-            'region': CONF.volume.region or CONF.identity.region,
-            'endpoint_type': CONF.volume.endpoint_type,
-            'build_interval': CONF.volume.build_interval,
-            'build_timeout': CONF.volume.build_timeout
-        }
-        params.update(self.default_params)
+        # Mandatory parameters (always defined)
+        params = self.parameters['volume']
 
         self.volume_qos_client = volume.v1.QosSpecsClient(self.auth_provider,
                                                           **params)
@@ -381,12 +382,8 @@
             volume.v2.AvailabilityZoneClient(self.auth_provider, **params)
 
     def _set_object_storage_clients(self):
-        params = {
-            'service': CONF.object_storage.catalog_type,
-            'region': CONF.object_storage.region or CONF.identity.region,
-            'endpoint_type': CONF.object_storage.endpoint_type
-        }
-        params.update(self.default_params_with_timeout_values)
+        # Mandatory parameters (always defined)
+        params = self.parameters['object-storage']
 
         self.account_client = object_storage.AccountClient(self.auth_provider,
                                                            **params)
@@ -404,12 +401,8 @@
 
 
 def get_auth_provider(credentials, pre_auth=False, scope='project'):
-    default_params = {
-        'disable_ssl_certificate_validation':
-            CONF.identity.disable_ssl_certificate_validation,
-        'ca_certs': CONF.identity.ca_certificates_file,
-        'trace_requests': CONF.debug.trace_requests
-    }
+    # kwargs for auth provider match the common ones used by service clients
+    default_params = config.service_client_config()
     if credentials is None:
         raise exceptions.InvalidCredentials(
             'Credentials must be specified')
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index 80de6f5..af86fe3 100644
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -106,7 +106,7 @@
         self._load_json()
 
     def _cleanup(self):
-        print ("Begin cleanup")
+        print("Begin cleanup")
         is_dry_run = self.options.dry_run
         is_preserve = not self.options.delete_tempest_conf_objects
         is_save_state = False
@@ -124,7 +124,7 @@
                   'is_save_state': is_save_state}
         tenant_service = cleanup_service.TenantService(admin_mgr, **kwargs)
         tenants = tenant_service.list()
-        print ("Process %s tenants" % len(tenants))
+        print("Process %s tenants" % len(tenants))
 
         # Loop through list of tenants and clean them up.
         for tenant in tenants:
@@ -155,7 +155,7 @@
             self._remove_admin_role(tenant_id)
 
     def _clean_tenant(self, tenant):
-        print ("Cleaning tenant:  %s " % tenant['name'])
+        print("Cleaning tenant:  %s " % tenant['name'])
         is_dry_run = self.options.dry_run
         dry_run_data = self.dry_run_data
         is_preserve = not self.options.delete_tempest_conf_objects
@@ -266,7 +266,7 @@
             return False
 
     def _init_state(self):
-        print ("Initializing saved state.")
+        print("Initializing saved state.")
         data = {}
         admin_mgr = self.admin_mgr
         kwargs = {'data': data,
diff --git a/tempest/cmd/list_plugins.py b/tempest/cmd/list_plugins.py
index 5f6b3e6..36e45a5 100644
--- a/tempest/cmd/list_plugins.py
+++ b/tempest/cmd/list_plugins.py
@@ -19,13 +19,10 @@
 """
 
 from cliff import command
-from oslo_log import log as logging
 import prettytable
 
 from tempest.test_discover.plugins import TempestTestPluginManager
 
-LOG = logging.getLogger(__name__)
-
 
 class TempestListPlugins(command.Command):
     def take_action(self, parsed_args):
diff --git a/tempest/cmd/main.py b/tempest/cmd/main.py
index acd97a8..641d11c 100644
--- a/tempest/cmd/main.py
+++ b/tempest/cmd/main.py
@@ -26,7 +26,7 @@
     def __init__(self):
         super(Main, self).__init__(
             description='Tempest cli application',
-            version=version.VersionInfo('tempest').version_string(),
+            version=version.VersionInfo('tempest').version_string_with_vcs(),
             command_manager=commandmanager.CommandManager('tempest.cm'),
             deferred_help=True,
             )
diff --git a/tempest/cmd/run.py b/tempest/cmd/run.py
index 8777c0e..b6b70d7 100644
--- a/tempest/cmd/run.py
+++ b/tempest/cmd/run.py
@@ -64,6 +64,14 @@
 directly with you current working directory being the workspace, Tempest will
 take care of managing everything to be executed from there.
 
+Running from Anywhere
+---------------------
+Tempest run provides you with an option to execute tempest from anywhere on
+your system. You are required to provide a config file in this case with the
+``--config-file`` option. When run tempest will create a .testrepository
+directory and a .testr.conf file in your current working directory. This way
+you can use testr commands directly to inspect the state of the previous run.
+
 Test Output
 ===========
 By default tempest run's output to STDOUT will be generated using the
@@ -80,20 +88,21 @@
 from cliff import command
 from os_testr import regex_builder
 from os_testr import subunit_trace
-from oslo_log import log as logging
 from testrepository.commands import run_argv
 
+from tempest.cmd import init
 from tempest.cmd import workspace
 from tempest import config
 
 
-LOG = logging.getLogger(__name__)
 CONF = config.CONF
 
 
 class TempestRun(command.Command):
 
-    def _set_env(self):
+    def _set_env(self, config_file=None):
+        if config_file:
+            CONF.set_config_path(os.path.abspath(config_file))
         # NOTE(mtreinish): This is needed so that testr doesn't gobble up any
         # stacktraces on failure.
         if 'TESTR_PDB' in os.environ:
@@ -108,9 +117,19 @@
             if returncode:
                 sys.exit(returncode)
 
+    def _create_testr_conf(self):
+        top_level_path = os.path.dirname(os.path.dirname(__file__))
+        discover_path = os.path.join(top_level_path, 'test_discover')
+        file_contents = init.TESTR_CONF % (top_level_path, discover_path)
+        with open('.testr.conf', 'w+') as testr_conf_file:
+                testr_conf_file.write(file_contents)
+
     def take_action(self, parsed_args):
-        self._set_env()
         returncode = 0
+        if parsed_args.config_file:
+            self._set_env(parsed_args.config_file)
+        else:
+            self._set_env()
         # Workspace execution mode
         if parsed_args.workspace:
             workspace_mgr = workspace.WorkspaceManager(
@@ -126,6 +145,10 @@
             # If you're running in local execution mode and there is not a
             # testrepository dir create one
             self._create_testrepository()
+        # local execution with config file mode
+        elif parsed_args.config_file:
+            self._create_testr_conf()
+            self._create_testrepository()
         else:
             print("No .testr.conf file was found for local execution")
             sys.exit(2)
@@ -157,6 +180,9 @@
                             dest='workspace_path',
                             help="The path to the workspace file, the default "
                                  "is ~/.tempest/workspace.yaml")
+        # Configuration flags
+        parser.add_argument('--config-file', default=None, dest='config_file',
+                            help='Configuration file to run tempest with')
         # test selection args
         regex = parser.add_mutually_exclusive_group()
         regex.add_argument('--smoke', action='store_true',
@@ -177,7 +203,7 @@
         parser.add_argument('--list-tests', '-l', action='store_true',
                             help='List tests',
                             default=False)
-        # exectution args
+        # execution args
         parser.add_argument('--concurrency', '-w',
                             help="The number of workers to use, defaults to "
                                  "the number of cpus")
diff --git a/tempest/cmd/workspace.py b/tempest/cmd/workspace.py
index cc82284..b36cf4e 100644
--- a/tempest/cmd/workspace.py
+++ b/tempest/cmd/workspace.py
@@ -53,13 +53,11 @@
 
 from cliff import command
 from oslo_concurrency import lockutils
-from oslo_log import log as logging
 import prettytable
 import yaml
 
 from tempest import config
 
-LOG = logging.getLogger(__name__)
 CONF = config.CONF
 
 
@@ -185,25 +183,35 @@
 
         subparsers = parser.add_subparsers()
 
-        list_parser = subparsers.add_parser('list')
+        list_parser = subparsers.add_parser(
+            'list', help='Outputs the name and path of all known tempest '
+            'workspaces')
         list_parser.set_defaults(list=True)
 
-        register_parser = subparsers.add_parser('register')
+        register_parser = subparsers.add_parser(
+            'register', help='Registers a new tempest workspace via a given '
+            '--name and --path')
         register_parser.add_argument('--name', required=True)
         register_parser.add_argument('--path', required=True)
         register_parser.set_defaults(register=True)
 
-        update_parser = subparsers.add_parser('rename')
+        update_parser = subparsers.add_parser(
+            'rename', help='Renames a tempest workspace from --old-name to '
+            '--new-name')
         update_parser.add_argument('--old-name', required=True)
         update_parser.add_argument('--new-name', required=True)
         update_parser.set_defaults(rename=True)
 
-        move_parser = subparsers.add_parser('move')
+        move_parser = subparsers.add_parser(
+            'move', help='Changes the path of a given tempest workspace '
+            '--name to --path')
         move_parser.add_argument('--name', required=True)
         move_parser.add_argument('--path', required=True)
         move_parser.set_defaults(move=True)
 
-        remove_parser = subparsers.add_parser('remove')
+        remove_parser = subparsers.add_parser(
+            'remove', help='Deletes the entry for a given tempest workspace '
+            '--name')
         remove_parser.add_argument('--name', required=True)
         remove_parser.set_defaults(remove=True)
 
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index bf6c537..1b450ab 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -94,7 +94,7 @@
                           self.router)
 
     def set_resources(self, **kwargs):
-        for key in kwargs.keys():
+        for key in kwargs:
             if hasattr(self, key):
                 setattr(self, key, kwargs[key])
 
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index 5f0685e..f57c18a 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -14,7 +14,7 @@
 from oslo_log import log as logging
 
 from tempest import exceptions
-from tempest.lib.common.utils import misc as misc_utils
+from tempest.lib.common.utils import test_utils
 
 LOG = logging.getLogger(__name__)
 
@@ -31,7 +31,7 @@
         list returns a 404, there are no found networks, or the found network
         is invalid
     """
-    caller = misc_utils.find_test_caller()
+    caller = test_utils.find_test_caller()
 
     if not name:
         raise exceptions.InvalidTestResource(type='network', name=name)
@@ -84,7 +84,7 @@
            tenant network is available in the creds provider
     :returns: a dict with 'id' and 'name' of the network
     """
-    caller = misc_utils.find_test_caller()
+    caller = test_utils.find_test_caller()
     net_creds = creds_provider.get_primary_creds()
     network = getattr(net_creds, 'network', None)
     if not network or not network.get('name'):
diff --git a/tempest/common/image.py b/tempest/common/image.py
index 72e3a72..95a7d1a 100644
--- a/tempest/common/image.py
+++ b/tempest/common/image.py
@@ -47,6 +47,11 @@
     fields_copy = copy.deepcopy(metadata)
 
     copy_from = fields_copy.pop('copy_from', None)
+    purge = fields_copy.pop('purge_props', None)
+
+    if purge is not None:
+        headers['x-glance-registry-purge-props'] = purge
+
     if copy_from is not None:
         headers['x-glance-api-copy-from'] = copy_from
 
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index e083167..df08e30 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -18,7 +18,7 @@
 from tempest.common import image as common_image
 from tempest import config
 from tempest import exceptions
-from tempest.lib.common.utils import misc as misc_utils
+from tempest.lib.common.utils import test_utils
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.image.v1 import images_client as images_v1_client
 
@@ -91,7 +91,7 @@
                         'timeout': timeout})
             message += ' Current status: %s.' % server_status
             message += ' Current task state: %s.' % task_state
-            caller = misc_utils.find_test_caller()
+            caller = test_utils.find_test_caller()
             if caller:
                 message = '(%s) %s' % (caller, message)
             raise exceptions.TimeoutException(message)
@@ -162,7 +162,7 @@
                                           'status': status,
                                           'current_status': current_status,
                                           'timeout': client.build_timeout})
-    caller = misc_utils.find_test_caller()
+    caller = test_utils.find_test_caller()
     if caller:
         message = '(%s) %s' % (caller, message)
     raise exceptions.TimeoutException(message)
@@ -235,7 +235,7 @@
                         'status': status,
                         'timeout': client.build_timeout})
             message += ' Current state of %s: %s.' % (attr, status_curr)
-            caller = misc_utils.find_test_caller()
+            caller = test_utils.find_test_caller()
             if caller:
                 message = '(%s) %s' % (caller, message)
             raise exceptions.TimeoutException(message)
diff --git a/tempest/config.py b/tempest/config.py
index eb5e23a..0c2b913 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -25,6 +25,7 @@
 from oslo_log import log as logging
 import testtools
 
+from tempest.lib import exceptions
 from tempest.test_discover import plugins
 
 
@@ -191,7 +192,12 @@
                 help="A list of enabled identity extensions with a special "
                      "entry all which indicates every extension is enabled. "
                      "Empty list indicates all extensions are disabled. "
-                     "To get the list of extensions run: 'keystone discover'")
+                     "To get the list of extensions run: 'keystone discover'"),
+    # TODO(rodrigods): Remove the reseller flag when Kilo and Liberty is end
+    # of life.
+    cfg.BoolOpt('reseller',
+                default=False,
+                help='Does the environment support reseller?')
 ]
 
 compute_group = cfg.OptGroup(name='compute',
@@ -366,7 +372,7 @@
                 default=True,
                 help='Does the test environment have the nova cert running?'),
     cfg.BoolOpt('personality',
-                default=True,
+                default=False,
                 help='Does the test environment support server personality'),
     cfg.BoolOpt('attach_encrypted_volume',
                 default=True,
@@ -1345,3 +1351,84 @@
             return f(self, *func_args, **func_kwargs)
         return wrapper
     return decorator
+
+
+def service_client_config(service_client_name=None):
+    """Return a dict with the parameters to init service clients
+
+    Extracts from CONF the settings specific to the service_client_name and
+    api_version, and formats them as dict ready to be passed to the service
+    clients __init__:
+
+        * `region` (default to identity)
+        * `catalog_type`
+        * `endpoint_type`
+        * `build_timeout` (object-storage and identity default to compute)
+        * `build_interval` (object-storage and identity default to compute)
+
+    The following common settings are always returned, even if
+    `service_client_name` is None:
+
+        * `disable_ssl_certificate_validation`
+        * `ca_certs`
+        * `trace_requests`
+
+    The dict returned by this does not fit a few service clients:
+
+        * The endpoint type is not returned for identity client, since it takes
+          three different values for v2 admin, v2 public and v3
+        * The `ServersClient` from compute accepts an optional
+          `enable_instance_password` parameter, which is not returned.
+        * The `VolumesClient` for both v1 and v2 volume accept an optional
+          `default_volume_size` parameter, which is not returned.
+        * The `TokenClient` and `V3TokenClient` have a very different
+          interface, only auth_url is needed for them.
+
+    :param service_client_name: str Name of the service. Supported values are
+        'compute', 'identity', 'image', 'network', 'object-storage', 'volume'
+    :return: dictionary of __init__ parameters for the service clients
+    :rtype: dict
+    """
+    _parameters = {
+        'disable_ssl_certificate_validation':
+            CONF.identity.disable_ssl_certificate_validation,
+        'ca_certs': CONF.identity.ca_certificates_file,
+        'trace_requests': CONF.debug.trace_requests
+    }
+
+    if service_client_name is None:
+        return _parameters
+
+    # Get the group of options first, by normalising the service_group_name
+    # Services with a '-' in the name have an '_' in the option group name
+    config_group = service_client_name.replace('-', '_')
+    # NOTE(andreaf) Check if the config group exists. This allows for this
+    # helper to be used for settings from registered plugins as well
+    try:
+        options = getattr(CONF, config_group)
+    except cfg.NoSuchOptError:
+        # Option group not defined
+        raise exceptions.UnknownServiceClient(services=service_client_name)
+    # Set endpoint_type
+    # Identity uses different settings depending on API version, so do not
+    # return the endpoint at all.
+    if service_client_name != 'identity':
+        _parameters['endpoint_type'] = getattr(options, 'endpoint_type')
+    # Set build_*
+    # Object storage and identity groups do not have conf settings for
+    # build_* parameters, and we default to compute in any case
+    for setting in ['build_timeout', 'build_interval']:
+        if not hasattr(options, setting) or not getattr(options, setting):
+            _parameters[setting] = getattr(CONF.compute, setting)
+        else:
+            _parameters[setting] = getattr(options, setting)
+    # Set region
+    # If a service client does not define region or region is not set
+    # default to the identity region
+    if not hasattr(options, 'region') or not getattr(options, 'region'):
+        _parameters['region'] = CONF.identity.region
+    else:
+        _parameters['region'] = getattr(options, 'region')
+    # Set service
+    _parameters['service'] = getattr(options, 'catalog_type')
+    return _parameters
diff --git a/tempest/lib/api_schema/response/compute/v2_1/servers.py b/tempest/lib/api_schema/response/compute/v2_1/servers.py
index 3289f04..44497db 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/servers.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/servers.py
@@ -174,7 +174,16 @@
     'OS-EXT-SRV-ATTR:host': {'type': ['string', 'null']},
     'OS-EXT-SRV-ATTR:instance_name': {'type': 'string'},
     'OS-EXT-SRV-ATTR:hypervisor_hostname': {'type': ['string', 'null']},
-    'os-extended-volumes:volumes_attached': {'type': 'array'},
+    'os-extended-volumes:volumes_attached': {
+        'type': 'array',
+        'items': {
+            'type': 'object',
+            'properties': {
+                'id': {'type': 'string'}
+            },
+            'additionalProperties': False,
+        },
+    },
     'config_drive': {'type': 'string'}
 })
 server_detail['properties']['addresses']['patternProperties'][
diff --git a/tempest/lib/auth.py b/tempest/lib/auth.py
index 425758f..54a7002 100644
--- a/tempest/lib/auth.py
+++ b/tempest/lib/auth.py
@@ -665,7 +665,7 @@
                 msg = ('Cannot have conflicting values for %s and %s' %
                        (key1, key2))
                 raise exceptions.InvalidCredentials(msg)
-        for key in attr.keys():
+        for key in attr:
             if key in self.ATTRIBUTES:
                 setattr(self, key, attr[key])
             else:
diff --git a/tempest/lib/base.py b/tempest/lib/base.py
index 227ac37..f687343 100644
--- a/tempest/lib/base.py
+++ b/tempest/lib/base.py
@@ -13,14 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import logging
 import os
 
 import fixtures
 import testtools
 
-LOG = logging.getLogger(__name__)
-
 
 class BaseTestCase(testtools.testcase.WithAttributes, testtools.TestCase):
     setUpClassCalled = False
diff --git a/tempest/lib/cmd/skip_tracker.py b/tempest/lib/cmd/skip_tracker.py
index f35b14c..d95aa46 100755
--- a/tempest/lib/cmd/skip_tracker.py
+++ b/tempest/lib/cmd/skip_tracker.py
@@ -103,7 +103,7 @@
 
 def get_results(result_dict):
     results = []
-    for bug_no in result_dict.keys():
+    for bug_no in result_dict:
         for method in result_dict[bug_no]:
             results.append((method, bug_no))
     return results
diff --git a/tempest/lib/exceptions.py b/tempest/lib/exceptions.py
index 2a6a788..5ca78f9 100644
--- a/tempest/lib/exceptions.py
+++ b/tempest/lib/exceptions.py
@@ -225,3 +225,7 @@
     message = ("Command '%(command)s', exit status: %(exit_status)d, "
                "stderr:\n%(stderr)s\n"
                "stdout:\n%(stdout)s")
+
+
+class UnknownServiceClient(TempestException):
+    message = "Service clients named %(services)s are not known"
diff --git a/tempest/lib/services/image/v2/image_members_client.py b/tempest/lib/services/image/v2/image_members_client.py
index 2ae7516..d0ab165 100644
--- a/tempest/lib/services/image/v2/image_members_client.py
+++ b/tempest/lib/services/image/v2/image_members_client.py
@@ -19,6 +19,11 @@
     api_version = "v2"
 
     def list_image_members(self, image_id):
+        """List image members.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#listImageMembers-v2
+        """
         url = 'images/%s/members' % image_id
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
@@ -52,12 +57,22 @@
         return rest_client.ResponseBody(resp, body)
 
     def show_image_member(self, image_id, member_id):
+        """Show an image member.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#showImageMember-v2
+        """
         url = 'images/%s/members/%s' % (image_id, member_id)
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
         return rest_client.ResponseBody(resp, json.loads(body))
 
     def delete_image_member(self, image_id, member_id):
+        """Delete an image member.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#deleteImageMember-v2
+        """
         url = 'images/%s/members/%s' % (image_id, member_id)
         resp, _ = self.delete(url)
         self.expected_success(204, resp.status)
diff --git a/tempest/lib/services/image/v2/images_client.py b/tempest/lib/services/image/v2/images_client.py
index 71e7c6b..4276847 100644
--- a/tempest/lib/services/image/v2/images_client.py
+++ b/tempest/lib/services/image/v2/images_client.py
@@ -115,18 +115,33 @@
         return rest_client.ResponseBody(resp, body)
 
     def show_image_file(self, image_id):
+        """Show an image file.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#showImageFile-v2
+        """
         url = 'images/%s/file' % image_id
         resp, body = self.get(url)
         self.expected_success(200, resp.status)
         return rest_client.ResponseBodyData(resp, body)
 
     def add_image_tag(self, image_id, tag):
+        """Add an image tag.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#addImageTag-v2
+        """
         url = 'images/%s/tags/%s' % (image_id, tag)
         resp, body = self.put(url, body=None)
         self.expected_success(204, resp.status)
         return rest_client.ResponseBody(resp, body)
 
     def delete_image_tag(self, image_id, tag):
+        """Delete an image tag.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#deleteImageTag-v2
+        """
         url = 'images/%s/tags/%s' % (image_id, tag)
         resp, _ = self.delete(url)
         self.expected_success(204, resp.status)
diff --git a/tempest/lib/services/image/v2/namespaces_client.py b/tempest/lib/services/image/v2/namespaces_client.py
index 97400e1..5bd096d 100644
--- a/tempest/lib/services/image/v2/namespaces_client.py
+++ b/tempest/lib/services/image/v2/namespaces_client.py
@@ -58,6 +58,11 @@
         return rest_client.ResponseBody(resp, body)
 
     def delete_namespace(self, namespace):
+        """Delete a namespace.
+
+        Available params: http://developer.openstack.org/
+                          api-ref-image-v2.html#deleteNamespace-v2
+        """
         url = 'metadefs/namespaces/%s' % namespace
         resp, _ = self.delete(url)
         self.expected_success(204, resp.status)
diff --git a/tempest/lib/services/network/metering_labels_client.py b/tempest/lib/services/network/metering_labels_client.py
old mode 100644
new mode 100755
index 2350ecd..12a5834
--- a/tempest/lib/services/network/metering_labels_client.py
+++ b/tempest/lib/services/network/metering_labels_client.py
@@ -16,18 +16,41 @@
 class MeteringLabelsClient(base.BaseNetworkClient):
 
     def create_metering_label(self, **kwargs):
+        """Creates an L3 metering label.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#
+                              createMeteringLabel
+        """
         uri = '/metering/metering-labels'
         post_data = {'metering_label': kwargs}
         return self.create_resource(uri, post_data)
 
     def show_metering_label(self, metering_label_id, **fields):
+        """Shows details for a metering label.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#showMeteringLabel
+        """
         uri = '/metering/metering-labels/%s' % metering_label_id
         return self.show_resource(uri, **fields)
 
     def delete_metering_label(self, metering_label_id):
+        """Deletes an L3 metering label.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#
+                              deleteMeteringLabel
+        """
         uri = '/metering/metering-labels/%s' % metering_label_id
         return self.delete_resource(uri)
 
     def list_metering_labels(self, **filters):
+        """Lists all L3 metering labels that belong to the tenant.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#
+                              listMeteringLabels
+        """
         uri = '/metering/metering-labels'
         return self.list_resources(uri, **filters)
diff --git a/tempest/lib/services/network/networks_client.py b/tempest/lib/services/network/networks_client.py
old mode 100644
new mode 100755
index 24c2ec5..19fa1db
--- a/tempest/lib/services/network/networks_client.py
+++ b/tempest/lib/services/network/networks_client.py
@@ -16,11 +16,21 @@
 class NetworksClient(base.BaseNetworkClient):
 
     def create_network(self, **kwargs):
+        """Creates a network.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#createNetwork
+        """
         uri = '/networks'
         post_data = {'network': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_network(self, network_id, **kwargs):
+        """Updates a network.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#updateNetwork
+        """
         uri = '/networks/%s' % network_id
         post_data = {'network': kwargs}
         return self.update_resource(uri, post_data)
diff --git a/tempest/lib/services/network/ports_client.py b/tempest/lib/services/network/ports_client.py
old mode 100644
new mode 100755
index eba11d3..71f1103
--- a/tempest/lib/services/network/ports_client.py
+++ b/tempest/lib/services/network/ports_client.py
@@ -17,24 +17,49 @@
 class PortsClient(base.BaseNetworkClient):
 
     def create_port(self, **kwargs):
+        """Creates a port on a network.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#createPort
+        """
         uri = '/ports'
         post_data = {'port': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_port(self, port_id, **kwargs):
+        """Updates a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#updatePort
+        """
         uri = '/ports/%s' % port_id
         post_data = {'port': kwargs}
         return self.update_resource(uri, post_data)
 
     def show_port(self, port_id, **fields):
+        """Shows details for a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#showPort
+        """
         uri = '/ports/%s' % port_id
         return self.show_resource(uri, **fields)
 
     def delete_port(self, port_id):
+        """Deletes a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#removePort
+        """
         uri = '/ports/%s' % port_id
         return self.delete_resource(uri)
 
     def list_ports(self, **filters):
+        """Lists ports to which the tenant has access.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#listPorts
+        """
         uri = '/ports'
         return self.list_resources(uri, **filters)
 
diff --git a/tempest/lib/services/network/security_groups_client.py b/tempest/lib/services/network/security_groups_client.py
old mode 100644
new mode 100755
index 0e25339..5c89a6f
--- a/tempest/lib/services/network/security_groups_client.py
+++ b/tempest/lib/services/network/security_groups_client.py
@@ -16,23 +16,48 @@
 class SecurityGroupsClient(base.BaseNetworkClient):
 
     def create_security_group(self, **kwargs):
+        """Creates an OpenStack Networking security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#createSecGroup
+        """
         uri = '/security-groups'
         post_data = {'security_group': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_security_group(self, security_group_id, **kwargs):
+        """Updates a security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#updateSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         post_data = {'security_group': kwargs}
         return self.update_resource(uri, post_data)
 
     def show_security_group(self, security_group_id, **fields):
+        """Shows details for a security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#showSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         return self.show_resource(uri, **fields)
 
     def delete_security_group(self, security_group_id):
+        """Deletes an OpenStack Networking security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#deleteSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         return self.delete_resource(uri)
 
     def list_security_groups(self, **filters):
+        """Lists OpenStack Networking security groups.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#listSecGroups
+        """
         uri = '/security-groups'
         return self.list_resources(uri, **filters)
diff --git a/tempest/lib/services/network/subnets_client.py b/tempest/lib/services/network/subnets_client.py
old mode 100644
new mode 100755
index 63ed13e..9de4a33
--- a/tempest/lib/services/network/subnets_client.py
+++ b/tempest/lib/services/network/subnets_client.py
@@ -16,11 +16,21 @@
 class SubnetsClient(base.BaseNetworkClient):
 
     def create_subnet(self, **kwargs):
+        """Creates a subnet on a network.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#createSubnet
+        """
         uri = '/subnets'
         post_data = {'subnet': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_subnet(self, subnet_id, **kwargs):
+        """Updates a subnet.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#updateSubnet
+        """
         uri = '/subnets/%s' % subnet_id
         post_data = {'subnet': kwargs}
         return self.update_resource(uri, post_data)
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index cace90b..086b82d 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -74,7 +74,7 @@
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(azone, aggregate['availability_zone'])
         self.assertEqual(hosts, aggregate['hosts'])
-        for meta_key in metadata.keys():
+        for meta_key in metadata:
             self.assertIn(meta_key, aggregate['metadata'])
             self.assertEqual(metadata[meta_key],
                              aggregate['metadata'][meta_key])
diff --git a/tempest/service_clients.py b/tempest/service_clients.py
index 3208c8d..386e621 100644
--- a/tempest/service_clients.py
+++ b/tempest/service_clients.py
@@ -18,6 +18,22 @@
 from tempest.lib import exceptions
 
 
+def tempest_modules():
+    """List of service client modules available in Tempest.
+
+    Provides a list of service modules available Tempest.
+    """
+    return set(['compute', 'identity.v2', 'identity.v3', 'image.v1',
+                'image.v2', 'network', 'object-storage', 'volume.v1',
+                'volume.v2', 'volume.v3'])
+
+
+def available_modules():
+    """List of service client modules available in Tempest and plugins"""
+    # TODO(andreaf) For now this returns only tempest_modules
+    return tempest_modules()
+
+
 class ServiceClients(object):
     """Service client provider class
 
@@ -30,7 +46,8 @@
 
         >>> from tempest import service_clients
         >>> johndoe = cred_provider.get_creds_by_role(['johndoe'])
-        >>> johndoe_clients = service_clients.ServiceClients(johndoe)
+        >>> johndoe_clients = service_clients.ServiceClients(johndoe,
+        >>>                                                  identity_uri)
         >>> johndoe_servers = johndoe_clients.servers_client.list_servers()
 
     """
@@ -40,17 +57,45 @@
     # initialises this class using values from tempest CONF object. The wrapper
     # class should only be used by tests hosted in Tempest.
 
-    def __init__(self, credentials, identity_uri, region=None,
-                 scope='project', disable_ssl_certificate_validation=True,
-                 ca_certs=None, trace_requests=''):
+    def __init__(self, credentials, identity_uri, region=None, scope='project',
+                 disable_ssl_certificate_validation=True, ca_certs=None,
+                 trace_requests='', client_parameters=None):
         """Service Clients provider
 
         Instantiate a `ServiceClients` object, from a set of credentials and an
         identity URI. The identity version is inferred from the credentials
         object. Optionally auth scope can be provided.
+
+        A few parameters can be given a value which is applied as default
+        for all service clients: region, dscv, ca_certs, trace_requests.
+
         Parameters dscv, ca_certs and trace_requests all apply to the auth
         provider as well as any service clients provided by this manager.
 
+        Any other client parameter must be set via client_parameters.
+        The list of available parameters is defined in the service clients
+        interfaces. For reference, most clients will accept 'region',
+        'service', 'endpoint_type', 'build_timeout' and 'build_interval', which
+        are all inherited from RestClient.
+
+        The `config` module in Tempest exposes an helper function
+        `service_client_config` that can be used to extract from configuration
+        a dictionary ready to be injected in kwargs.
+
+        Exceptions are:
+        - Token clients for 'identity' have a very different interface
+        - Volume client for 'volume' accepts 'default_volume_size'
+        - Servers client from 'compute' accepts 'enable_instance_password'
+
+        Examples:
+
+            >>> identity_params = config.service_client_config('identity')
+            >>> params = {
+            >>>     'identity': identity_params,
+            >>>     'compute': {'region': 'region2'}}
+            >>> manager = lib_manager.Manager(
+            >>>     my_creds, identity_uri, client_parameters=params)
+
         :param credentials: An instance of `auth.Credentials`
         :param identity_uri: URI of the identity API. This should be a
                              mandatory parameter, and it will so soon.
@@ -60,12 +105,26 @@
                                                   service clients.
         :param ca_certs Applies to auth and to all service clients.
         :param trace_requests Applies to auth and to all service clients.
+        :param client_parameters Dictionary with parameters for service
+            clients. Keys of the dictionary are the service client service
+            name, as declared in `service_clients.available_modules()` except
+            for the version. Values are dictionaries of parameters that are
+            going to be passed to all clients in the service client module.
+
+        Examples:
+
+            >>> params_service_x = {'param_name': 'param_value'}
+            >>> client_parameters = { 'service_x': params_service_x }
+
+            >>> params_service_y = config.service_client_config('service_y')
+            >>> client_parameters['service_y'] = params_service_y
+
         """
         self.credentials = credentials
         self.identity_uri = identity_uri
         if not identity_uri:
             raise exceptions.InvalidCredentials(
-                'Manager requires a non-empty identity_uri.')
+                'ServiceClients requires a non-empty identity_uri.')
         self.region = region
         # Check if passed or default credentials are valid
         if not self.credentials.is_valid():
@@ -88,3 +147,32 @@
             self.credentials, self.identity_uri, scope=scope,
             disable_ssl_certificate_validation=self.dscv,
             ca_certs=self.ca_certs, trace_requests=self.trace_requests)
+        # Setup some defaults for client parameters of registered services
+        client_parameters = client_parameters or {}
+        self.parameters = {}
+        # Parameters are provided for unversioned services
+        unversioned_services = set(
+            [x.split('.')[0] for x in available_modules()])
+        for service in unversioned_services:
+            self.parameters[service] = self._setup_parameters(
+                client_parameters.pop(service, {}))
+        # Check that no client parameters was supplied for unregistered clients
+        if client_parameters:
+            raise exceptions.UnknownServiceClient(
+                services=list(client_parameters.keys()))
+
+    def _setup_parameters(self, parameters):
+        """Setup default values for client parameters
+
+        Region by default is the region passed as an __init__ parameter.
+        Checks that no parameter for an unknown service is provided.
+        """
+        _parameters = {}
+        # Use region from __init__
+        if self.region:
+            _parameters['region'] = self.region
+        # Update defaults with specified parameters
+        _parameters.update(parameters)
+        # If any parameter is left, parameters for an unknown service were
+        # provided as input. Fail rather than ignore silently.
+        return _parameters
diff --git a/tempest/services/identity/v2/json/roles_client.py b/tempest/services/identity/v2/json/roles_client.py
deleted file mode 100644
index 15c8834..0000000
--- a/tempest/services/identity/v2/json/roles_client.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#    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 six.moves.urllib import parse as urllib
-
-from tempest.lib.common import rest_client
-
-
-class RolesClient(rest_client.RestClient):
-    api_version = "v2.0"
-
-    def create_role(self, **kwargs):
-        """Create a role.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#createRole
-        """
-        post_body = json.dumps({'role': kwargs})
-        resp, body = self.post('OS-KSADM/roles', post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def show_role(self, role_id_or_name):
-        """Get a role by its id or name.
-
-        Available params: see
-            http://developer.openstack.org/
-            api-ref-identity-v2-ext.html#showRoleByID
-            OR
-            http://developer.openstack.org/
-            api-ref-identity-v2-ext.html#showRoleByName
-        """
-        resp, body = self.get('OS-KSADM/roles/%s' % role_id_or_name)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def list_roles(self, **params):
-        """Returns roles.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#listRoles
-        """
-        url = 'OS-KSADM/roles'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def delete_role(self, role_id):
-        """Delete a role.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#deleteRole
-        """
-        resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
-        self.expected_success(204, resp.status)
-        return rest_client.ResponseBody(resp, body)
-
-    def create_user_role_on_project(self, tenant_id, user_id, role_id):
-        """Add roles to a user on a tenant.
-
-        Available params: see
-            http://developer.openstack.org/
-            api-ref-identity-v2-ext.html#grantRoleToUserOnTenant
-        """
-        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 rest_client.ResponseBody(resp, body)
-
-    def list_user_roles_on_project(self, tenant_id, user_id, **params):
-        """Returns a list of roles assigned to a user for a tenant."""
-        # TODO(gmann): Need to write API-ref link, Bug# 1592711
-        url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def delete_role_from_user_on_project(self, tenant_id, user_id, role_id):
-        """Removes a role assignment for a user on a tenant.
-
-        Available params: see
-            http://developer.openstack.org/
-            api-ref-identity-v2-ext.html#revokeRoleFromUserOnTenant
-        """
-        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 rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v2/json/tenants_client.py b/tempest/services/identity/v2/json/tenants_client.py
deleted file mode 100644
index 77ddaa5..0000000
--- a/tempest/services/identity/v2/json/tenants_client.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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 six.moves.urllib import parse as urllib
-
-from tempest.lib.common import rest_client
-
-
-class TenantsClient(rest_client.RestClient):
-    api_version = "v2.0"
-
-    def create_tenant(self, **kwargs):
-        """Create a tenant
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#createTenant
-        """
-        post_body = json.dumps({'tenant': kwargs})
-        resp, body = self.post('tenants', post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def delete_tenant(self, tenant_id):
-        """Delete a tenant.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#deleteTenant
-        """
-        resp, body = self.delete('tenants/%s' % str(tenant_id))
-        self.expected_success(204, resp.status)
-        return rest_client.ResponseBody(resp, body)
-
-    def show_tenant(self, tenant_id):
-        """Get tenant details.
-
-        Available params: see
-            http://developer.openstack.org/
-            api-ref-identity-v2-ext.html#admin-showTenantById
-        """
-        resp, body = self.get('tenants/%s' % str(tenant_id))
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def list_tenants(self, **params):
-        """Returns tenants.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#admin-listTenants
-        """
-        url = 'tenants'
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def update_tenant(self, tenant_id, **kwargs):
-        """Updates a tenant.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#updateTenant
-        """
-        if 'id' not in kwargs:
-            kwargs['id'] = tenant_id
-        post_body = json.dumps({'tenant': kwargs})
-        resp, body = self.post('tenants/%s' % tenant_id, post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def list_tenant_users(self, tenant_id, **params):
-        """List users for a Tenant.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#listUsersForTenant
-        """
-        url = '/tenants/%s/users' % tenant_id
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v2/json/users_client.py b/tempest/services/identity/v2/json/users_client.py
deleted file mode 100644
index 4ea17f9..0000000
--- a/tempest/services/identity/v2/json/users_client.py
+++ /dev/null
@@ -1,152 +0,0 @@
-#    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 six.moves.urllib import parse as urllib
-
-from tempest.lib.common import rest_client
-
-
-class UsersClient(rest_client.RestClient):
-    api_version = "v2.0"
-
-    def create_user(self, **kwargs):
-        """Create a user.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-admin-v2.html#admin-createUser
-        """
-        post_body = json.dumps({'user': kwargs})
-        resp, body = self.post('users', post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def update_user(self, user_id, **kwargs):
-        """Updates a user.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-admin-v2.html#admin-updateUser
-        """
-        put_body = json.dumps({'user': kwargs})
-        resp, body = self.put('users/%s' % user_id, put_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def show_user(self, user_id):
-        """GET a user.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-admin-v2.html#admin-showUser
-        """
-        resp, body = self.get("users/%s" % user_id)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def delete_user(self, user_id):
-        """Delete a user.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-admin-v2.html#admin-deleteUser
-        """
-        resp, body = self.delete("users/%s" % user_id)
-        self.expected_success(204, resp.status)
-        return rest_client.ResponseBody(resp, body)
-
-    def list_users(self, **params):
-        """Get the list of users.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-admin-v2.html#admin-listUsers
-        """
-        url = "users"
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-        resp, body = self.get(url)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def update_user_enabled(self, user_id, **kwargs):
-        """Enables or disables a user.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-identity-v2-ext.html#enableUser
-        """
-        # NOTE: The URL (users/<id>/enabled) is different from the api-site
-        # one (users/<id>/OS-KSADM/enabled) , but they are the same API
-        # because of the fact that in keystone/contrib/admin_crud/core.py
-        # both api use same action='set_user_enabled'
-        put_body = json.dumps({'user': kwargs})
-        resp, body = self.put('users/%s/enabled' % user_id, put_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def update_user_password(self, user_id, **kwargs):
-        """Update User Password."""
-        # 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/1524147
-        put_body = json.dumps({'user': kwargs})
-        resp, body = self.put('users/%s/OS-KSADM/password' % user_id, put_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def update_user_own_password(self, user_id, **kwargs):
-        """User updates own password"""
-        # 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/1524153
-        # NOTE: This API is used for updating user password by itself.
-        # Ref: http://lists.openstack.org/pipermail/openstack-dev/2015-December
-        #      /081803.html
-        patch_body = json.dumps({'user': kwargs})
-        resp, body = self.patch('OS-KSCRUD/users/%s' % user_id, patch_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def create_user_ec2_credential(self, user_id, **kwargs):
-        # 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.
-        post_body = json.dumps(kwargs)
-        resp, body = self.post('/users/%s/credentials/OS-EC2' % user_id,
-                               post_body)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def delete_user_ec2_credential(self, user_id, access):
-        resp, body = self.delete('/users/%s/credentials/OS-EC2/%s' %
-                                 (user_id, access))
-        self.expected_success(204, resp.status)
-        return rest_client.ResponseBody(resp, body)
-
-    def list_user_ec2_credentials(self, user_id):
-        resp, body = self.get('/users/%s/credentials/OS-EC2' % user_id)
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
-
-    def show_user_ec2_credential(self, user_id, access):
-        resp, body = self.get('/users/%s/credentials/OS-EC2/%s' %
-                              (user_id, access))
-        self.expected_success(200, resp.status)
-        body = json.loads(body)
-        return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/volume/base/base_snapshots_client.py b/tempest/services/volume/base/base_snapshots_client.py
index da7bb01..6d3f03b 100644
--- a/tempest/services/volume/base/base_snapshots_client.py
+++ b/tempest/services/volume/base/base_snapshots_client.py
@@ -10,7 +10,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from oslo_log import log as logging
 from oslo_serialization import jsonutils as json
 from six.moves.urllib import parse as urllib
 
@@ -18,9 +17,6 @@
 from tempest.lib import exceptions as lib_exc
 
 
-LOG = logging.getLogger(__name__)
-
-
 class BaseSnapshotsClient(rest_client.RestClient):
     """Base Client class to send CRUD Volume API requests."""
 
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 2beaaa9..925d765 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -249,13 +249,13 @@
             had_errors = True
         sum_runs += process['statistic']['runs']
         sum_fails += process['statistic']['fails']
-        print ("Process %d (%s): Run %d actions (%d failed)" % (
-               process['p_number'],
-               process['action'],
-               process['statistic']['runs'],
-               process['statistic']['fails']))
-    print ("Summary:")
-    print ("Run %d actions (%d failed)" % (sum_runs, sum_fails))
+        print("Process %d (%s): Run %d actions (%d failed)" % (
+            process['p_number'],
+            process['action'],
+            process['statistic']['runs'],
+            process['statistic']['fails']))
+    print("Summary:")
+    print("Run %d actions (%d failed)" % (sum_runs, sum_fails))
 
     if not had_errors and CONF.stress.full_clean_stack:
         LOG.info("cleaning up")
diff --git a/tempest/tests/common/test_image.py b/tempest/tests/common/test_image.py
index 34772a2..240df4d 100644
--- a/tempest/tests/common/test_image.py
+++ b/tempest/tests/common/test_image.py
@@ -46,7 +46,8 @@
             disk_format='vhd',
             copy_from='http://localhost/images/10',
             properties={'foo': 'bar'},
-            api={'abc': 'def'})
+            api={'abc': 'def'},
+            purge_props=True)
 
         expected = {
             'x-image-meta-name': 'test',
@@ -54,6 +55,7 @@
             'x-image-meta-disk_format': 'vhd',
             'x-glance-api-copy-from': 'http://localhost/images/10',
             'x-image-meta-property-foo': 'bar',
-            'x-glance-api-property-abc': 'def'
+            'x-glance-api-property-abc': 'def',
+            'x-glance-registry-purge-props': True
         }
         self.assertEqual(expected, observed)
diff --git a/tempest/tests/fake_config.py b/tempest/tests/fake_config.py
index 65164a0..71a4c81 100644
--- a/tempest/tests/fake_config.py
+++ b/tempest/tests/fake_config.py
@@ -57,3 +57,57 @@
     def __init__(self, parse_conf=True, config_path=None):
         self._set_attrs()
         self.lock_path = cfg.CONF.oslo_concurrency.lock_path
+
+fake_service1_group = cfg.OptGroup(name='fake-service1', title='Fake service1')
+
+FakeService1Group = [
+    cfg.StrOpt('catalog_type', default='fake-service1'),
+    cfg.StrOpt('endpoint_type', default='faketype'),
+    cfg.StrOpt('region', default='fake_region'),
+    cfg.IntOpt('build_timeout', default=99),
+    cfg.IntOpt('build_interval', default=9)]
+
+fake_service2_group = cfg.OptGroup(name='fake-service2', title='Fake service2')
+
+FakeService2Group = [
+    cfg.StrOpt('catalog_type', default='fake-service2'),
+    cfg.StrOpt('endpoint_type', default='faketype')]
+
+
+class ServiceClientsConfigFixture(conf_fixture.Config):
+
+    def __init__(self):
+        cfg.CONF([], default_config_files=[])
+        config._opts.append((fake_service1_group, FakeService1Group))
+        config._opts.append((fake_service2_group, FakeService2Group))
+        config.register_opts()
+        super(ServiceClientsConfigFixture, self).__init__()
+
+    def setUp(self):
+        super(ServiceClientsConfigFixture, self).setUp()
+        # Debug default values
+        self.conf.set_default('trace_requests', 'fake_module', 'debug')
+        # Identity default values
+        self.conf.set_default('disable_ssl_certificate_validation', True,
+                              group='identity')
+        self.conf.set_default('ca_certificates_file', '/fake/certificates',
+                              group='identity')
+        self.conf.set_default('region', 'fake_region', 'identity')
+        # Identity endpoints
+        self.conf.set_default('v3_endpoint_type', 'fake_v3_uri', 'identity')
+        self.conf.set_default('v2_public_endpoint_type', 'fake_v2_public_uri',
+                              'identity')
+        self.conf.set_default('v2_admin_endpoint_type', 'fake_v2_admin_uri',
+                              'identity')
+        # Compute default values
+        self.conf.set_default('build_interval', 88, group='compute')
+        self.conf.set_default('build_timeout', 8, group='compute')
+
+
+class ServiceClientsFakePrivate(config.TempestConfigPrivate):
+    def __init__(self, parse_conf=True, config_path=None):
+        self._set_attrs()
+        self.fake_service1 = cfg.CONF['fake-service1']
+        self.fake_service2 = cfg.CONF['fake-service2']
+        print('Services registered')
+        self.lock_path = cfg.CONF.oslo_concurrency.lock_path
diff --git a/tempest/tests/lib/fake_auth_provider.py b/tempest/tests/lib/fake_auth_provider.py
index 8095453..fa8ab47 100644
--- a/tempest/tests/lib/fake_auth_provider.py
+++ b/tempest/tests/lib/fake_auth_provider.py
@@ -31,5 +31,5 @@
 class FakeCredentials(object):
 
     def __init__(self, creds_dict):
-        for key in creds_dict.keys():
+        for key in creds_dict:
             setattr(self, key, creds_dict[key])
diff --git a/tempest/tests/lib/test_credentials.py b/tempest/tests/lib/test_credentials.py
index b6f2cf6..c910d6d 100644
--- a/tempest/tests/lib/test_credentials.py
+++ b/tempest/tests/lib/test_credentials.py
@@ -99,7 +99,7 @@
 
     def _test_is_not_valid(self, ignore_key):
         creds = self._get_credentials()
-        for attr in self.attributes.keys():
+        for attr in self.attributes:
             if attr == ignore_key:
                 continue
             temp_attr = getattr(creds, attr)
diff --git a/tempest/tests/test_config.py b/tempest/tests/test_config.py
new file mode 100644
index 0000000..2808a9c
--- /dev/null
+++ b/tempest/tests/test_config.py
@@ -0,0 +1,89 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import testtools
+
+from tempest import config
+from tempest.lib import exceptions
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class TestServiceClientConfig(base.TestCase):
+
+    expected_common_params = set(['disable_ssl_certificate_validation',
+                                  'ca_certs', 'trace_requests'])
+    expected_extra_params = set(['service', 'endpoint_type', 'region',
+                                 'build_timeout', 'build_interval'])
+
+    def setUp(self):
+        super(TestServiceClientConfig, self).setUp()
+        self.useFixture(fake_config.ServiceClientsConfigFixture())
+        self.patchobject(config, 'CONF',
+                         fake_config.ServiceClientsFakePrivate())
+        self.CONF = config.CONF
+
+    def test_service_client_config_no_service(self):
+        params = config.service_client_config()
+        for param_name in self.expected_common_params:
+            self.assertIn(param_name, params)
+        for param_name in self.expected_extra_params:
+            self.assertNotIn(param_name, params)
+        self.assertEqual(
+            self.CONF.identity.disable_ssl_certificate_validation,
+            params['disable_ssl_certificate_validation'])
+        self.assertEqual(self.CONF.identity.ca_certificates_file,
+                         params['ca_certs'])
+        self.assertEqual(self.CONF.debug.trace_requests,
+                         params['trace_requests'])
+
+    def test_service_client_config_service_all(self):
+        params = config.service_client_config(
+            service_client_name='fake-service1')
+        for param_name in self.expected_common_params:
+            self.assertIn(param_name, params)
+        for param_name in self.expected_extra_params:
+            self.assertIn(param_name, params)
+        self.assertEqual(self.CONF.fake_service1.catalog_type,
+                         params['service'])
+        self.assertEqual(self.CONF.fake_service1.endpoint_type,
+                         params['endpoint_type'])
+        self.assertEqual(self.CONF.fake_service1.region, params['region'])
+        self.assertEqual(self.CONF.fake_service1.build_timeout,
+                         params['build_timeout'])
+        self.assertEqual(self.CONF.fake_service1.build_interval,
+                         params['build_interval'])
+
+    def test_service_client_config_service_minimal(self):
+        params = config.service_client_config(
+            service_client_name='fake-service2')
+        for param_name in self.expected_common_params:
+            self.assertIn(param_name, params)
+        for param_name in self.expected_extra_params:
+            self.assertIn(param_name, params)
+        self.assertEqual(self.CONF.fake_service2.catalog_type,
+                         params['service'])
+        self.assertEqual(self.CONF.fake_service2.endpoint_type,
+                         params['endpoint_type'])
+        self.assertEqual(self.CONF.identity.region, params['region'])
+        self.assertEqual(self.CONF.compute.build_timeout,
+                         params['build_timeout'])
+        self.assertEqual(self.CONF.compute.build_interval,
+                         params['build_interval'])
+
+    def test_service_client_config_service_unknown(self):
+        unknown_service = 'unknown_service'
+        with testtools.ExpectedException(exceptions.UnknownServiceClient,
+                                         '.*' + unknown_service + '.*'):
+            config.service_client_config(service_client_name=unknown_service)
diff --git a/tempest/tests/test_service_clients.py b/tempest/tests/test_service_clients.py
index f67781c..a559086 100644
--- a/tempest/tests/test_service_clients.py
+++ b/tempest/tests/test_service_clients.py
@@ -12,6 +12,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
+import fixtures
 import testtools
 
 from tempest.lib import auth
@@ -23,7 +24,13 @@
 
 class TestServiceClients(base.TestCase):
 
-    def test__init__creds_v2_uri(self):
+    def setUp(self):
+        super(TestServiceClients, self).setUp()
+        self.useFixture(fixtures.MockPatch(
+            'tempest.service_clients.tempest_modules',
+            return_value=set(['fake_service1', 'fake_service2'])))
+
+    def test___init___creds_v2_uri(self):
         # Verify that no API request is made, since no mock
         # is required to run the test successfully
         creds = fake_credentials.FakeKeystoneV2Credentials()
@@ -32,7 +39,7 @@
         self.assertIsInstance(_manager.auth_provider,
                               auth.KeystoneV2AuthProvider)
 
-    def test__init__creds_v3_uri(self):
+    def test___init___creds_v3_uri(self):
         # Verify that no API request is made, since no mock
         # is required to run the test successfully
         creds = fake_credentials.FakeKeystoneV3Credentials()
@@ -41,22 +48,79 @@
         self.assertIsInstance(_manager.auth_provider,
                               auth.KeystoneV3AuthProvider)
 
-    def test__init__base_creds_uri(self):
+    def test___init___base_creds_uri(self):
         creds = fake_credentials.FakeCredentials()
         uri = 'fake_uri'
         with testtools.ExpectedException(exceptions.InvalidCredentials):
             service_clients.ServiceClients(creds, identity_uri=uri)
 
-    def test__init__invalid_creds_uri(self):
+    def test___init___invalid_creds_uri(self):
         creds = fake_credentials.FakeKeystoneV2Credentials()
         delattr(creds, 'username')
         uri = 'fake_uri'
         with testtools.ExpectedException(exceptions.InvalidCredentials):
             service_clients.ServiceClients(creds, identity_uri=uri)
 
-    def test__init__creds_uri_none(self):
+    def test___init___creds_uri_none(self):
         creds = fake_credentials.FakeKeystoneV2Credentials()
-        msg = "Invalid Credentials\nDetails: Manager requires a non-empty"
+        msg = ("Invalid Credentials\nDetails: ServiceClients requires a "
+               "non-empty")
         with testtools.ExpectedException(exceptions.InvalidCredentials,
                                          value_re=msg):
             service_clients.ServiceClients(creds, None)
+
+    def test___init___creds_uri_params(self):
+        creds = fake_credentials.FakeKeystoneV2Credentials()
+        expeted_params = {'fake_param1': 'fake_value1',
+                          'fake_param2': 'fake_value2'}
+        params = {'fake_service1': expeted_params}
+        uri = 'fake_uri'
+        _manager = service_clients.ServiceClients(creds, identity_uri=uri,
+                                                  client_parameters=params)
+        self.assertIn('fake_service1', _manager.parameters)
+        for _key in expeted_params:
+            self.assertIn(_key, _manager.parameters['fake_service1'].keys())
+            self.assertEqual(expeted_params[_key],
+                             _manager.parameters['fake_service1'].get(_key))
+
+    def test___init___creds_uri_params_unknown_services(self):
+        creds = fake_credentials.FakeKeystoneV2Credentials()
+        fake_params = {'fake_param1': 'fake_value1'}
+        params = {'unknown_service1': fake_params,
+                  'unknown_service2': fake_params}
+        uri = 'fake_uri'
+        msg = "(?=.*{0})(?=.*{1})".format(*list(params.keys()))
+        with testtools.ExpectedException(
+                exceptions.UnknownServiceClient, value_re=msg):
+            service_clients.ServiceClients(creds, identity_uri=uri,
+                                           client_parameters=params)
+
+    def _get_manager(self, init_region='fake_region'):
+        # Get a manager to invoke _setup_parameters on
+        creds = fake_credentials.FakeKeystoneV2Credentials()
+        return service_clients.ServiceClients(creds, identity_uri='fake_uri',
+                                              region=init_region)
+
+    def test__setup_parameters_none_no_region(self):
+        kwargs = {}
+        _manager = self._get_manager(init_region=None)
+        _params = _manager._setup_parameters(kwargs)
+        self.assertNotIn('region', _params)
+
+    def test__setup_parameters_none(self):
+        kwargs = {}
+        _manager = self._get_manager()
+        _params = _manager._setup_parameters(kwargs)
+        self.assertIn('region', _params)
+        self.assertEqual('fake_region', _params['region'])
+
+    def test__setup_parameters_all(self):
+        expected_params = {'region': 'fake_region1',
+                           'catalog_type': 'fake_service2_mod',
+                           'fake_param1': 'fake_value1',
+                           'fake_param2': 'fake_value2'}
+        _manager = self._get_manager()
+        _params = _manager._setup_parameters(expected_params)
+        for _key in _params.keys():
+            self.assertEqual(expected_params[_key],
+                             _params[_key])
diff --git a/tools/skip_tracker.py b/tools/skip_tracker.py
index b554514..55f41a6 100755
--- a/tools/skip_tracker.py
+++ b/tools/skip_tracker.py
@@ -95,7 +95,7 @@
 
 def get_results(result_dict):
     results = []
-    for bug_no in result_dict.keys():
+    for bug_no in result_dict:
         for method in result_dict[bug_no]:
             results.append((method, bug_no))
     return results