Merge "Volume: remove a useless `_delete_volume_type` alias"
diff --git a/HACKING.rst b/HACKING.rst
index 4095c4b..b66fa24 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -16,7 +16,7 @@
 - [T107] Check that a service tag isn't in the module path
 - [T108] Check no hyphen at the end of rand_name() argument
 - [T109] Cannot use testtools.skip decorator; instead use
-         decorators.skip_because from tempest-lib
+         decorators.skip_because from tempest.lib
 - [T110] Check that service client names of GET should be consistent
 - [T111] Check that service client names of DELETE should be consistent
 - [T112] Check that tempest.lib should not import local tempest code
@@ -157,33 +157,7 @@
 
 Negative Tests
 --------------
-Newly added negative tests should use the negative test framework. First step
-is to create an interface description in a python file under
-`tempest/api_schema/request/`. These descriptions consists of two important
-sections for the test (one of those is mandatory):
-
- - A resource (part of the URL of the request): Resources needed for a test
-   must be created in `setUpClass` and registered with `set_resource` e.g.:
-   `cls.set_resource("server", server['id'])`
-
- - A json schema: defines properties for a request.
-
-After that a test class must be added to automatically generate test scenarios
-out of the given interface description::
-
-    load_tests = test.NegativeAutoTest.load_tests
-
-    @test.SimpleNegativeAutoTest
-    class SampleTestNegativeTestJSON(<your base class>, test.NegativeAutoTest):
-        _service = 'compute'
-        _schema = <your schema file>
-
-The class decorator `SimpleNegativeAutoTest` will automatically generate test
-cases out of the given schema in the attribute `_schema`.
-
-All negative tests should be added into a separate negative test file.
-If such a file doesn't exist for the particular resource being tested a new
-test file should be added.
+TODO: Write the guideline related to negative tests.
 
 Test skips because of Known Bugs
 --------------------------------
@@ -333,9 +307,9 @@
         # The created server should be in the detailed list of all servers
         ...
 
-Tempest-lib includes a ``check-uuid`` tool that will test for the existence
+Tempest.lib includes a ``check-uuid`` tool that will test for the existence
 and uniqueness of idempotent_id metadata for every test. If you have
-tempest-lib installed you run the tool against Tempest by calling from the
+tempest installed you run the tool against Tempest by calling from the
 tempest repo::
 
     check-uuid
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 245386b..bcb1e3e 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -9,23 +9,38 @@
 config file which explains the purpose of each individual option. You can see
 the sample config file here: :ref:`tempest-sampleconf`
 
-Auth/Credentials
+Test Credentials
 ----------------
 
-Tempest currently has two different ways in configuration to provide credentials
-to use when running Tempest. One is a traditional set of configuration options
-in the tempest.conf file. These options are clearly labelled in the ``identity``
-section and let you specify a set of credentials for a regular user, a global
-admin user, and an alternate user, consisting of a username, password, and
-project name.
+Tempest allows for configuring a set of admin credentials in the ``auth``
+section, via the following parameters:
 
-The other method to provide credentials is using the accounts.yaml file. This
-file is used to specify an arbitrary number of users available to run tests
-with. You can specify the location of the file in the ``auth`` section in the
+ #. ``admin_username``
+ #. ``admin_password``
+ #. ``admin_project_name``
+ #. ``admin_domain_name``
+
+Admin credentials are not mandatory to run Tempest, but when provided they
+can be used to:
+
+- Run tests for admin APIs
+- Generate test credentials on the fly (see `Dynamic Credentials`_)
+
+Tempest allows for configuring pre-provisioned test credentials as well.
+This can be done in two different ways.
+
+One is to provide credentials is using the accounts.yaml file (see
+`Pre-Provisioned Credentials`_). This file is used to specify an arbitrary
+number of users available to run tests with.
+You can specify the location of the file in the ``auth`` section in the
 tempest.conf file. To see the specific format used in the file please refer to
-the accounts.yaml.sample file included in Tempest.  Eventually the config
-options for providing credentials to Tempest will be deprecated and removed in
-favor of the accounts.yaml file.
+the accounts.yaml.sample file included in Tempest.
+
+A second way - now deprecated - is a set of configuration options in the
+tempest.conf file (see `Legacy Credentials`_). These options are clearly
+labelled in the ``identity`` section and let you specify a set of credentials
+for a regular user and an alternate user, consisting of a username, password,
+project and domain name.
 
 Keystone Connection Info
 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -81,8 +96,9 @@
 configured to use dynamic credentials.
 
 
-Pre-Provisioned Credentials (aka accounts.yaml or accounts file)
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+Pre-Provisioned Credentials
+"""""""""""""""""""""""""""
+
 For a long time using dynamic credentials was the only method available if you
 wanted to enable parallel execution of Tempest tests. However, this was
 insufficient for certain use cases because of the admin credentials requirement
@@ -116,9 +132,10 @@
 to the tests using the credentials, and failure to do this will likely cause
 unexpected failures in some tests.
 
+Pre-Provisioned Credentials are also know as accounts.yaml or accounts file.
 
-Legacy Credentials (aka credentials config options)
-"""""""""""""""""""""""""""""""""""""""""""""""""""
+Legacy Credentials
+""""""""""""""""""
 **Starting in the Liberty release this mechanism was deprecated; it will be
 removed in a future release.**
 
@@ -132,9 +149,6 @@
  #. ``username``
  #. ``password``
  #. ``project_name``
- #. ``admin_username``
- #. ``admin_password``
- #. ``admin_project_name``
  #. ``alt_username``
  #. ``alt_password``
  #. ``alt_project_name``
diff --git a/doc/source/library.rst b/doc/source/library.rst
index 64bd2c2..a89512c 100644
--- a/doc/source/library.rst
+++ b/doc/source/library.rst
@@ -7,15 +7,14 @@
 test suites an interface for reusing pieces of tempest code. Any public
 interface that lives in tempest/lib in the tempest repo is treated as a stable
 public interface and it should be safe to external consume that. Every effort
-goes into maintaining backwards compatibility with any change. Just as with
-tempest-lib the library is self contained and doesn't have any dependency on
-other tempest internals outside of lib. (including no usage of tempest
-configuration)
+goes into maintaining backwards compatibility with any change.
+The library is self contained and doesn't have any dependency on
+other tempest internals outside of lib (including no usage of tempest
+configuration).
 
 Stability
 ---------
-Just as tempest-lib before it any code that lives in tempest/lib will be treated
-as a stable interface, nothing has changed in regards to interface stability.
+Any code that lives in tempest/lib will be treated as a stable interface.
 This means that any public interface under the tempest/lib directory is
 expected to be a stable interface suitable for public consumption. However, for
 any interfaces outside of tempest/lib in the tempest tree (unless otherwise
diff --git a/doc/source/plugin.rst b/doc/source/plugin.rst
index 2622c22..ad26741 100644
--- a/doc/source/plugin.rst
+++ b/doc/source/plugin.rst
@@ -11,13 +11,13 @@
 =================
 
 Creating a plugin is fairly straightforward and doesn't require much additional
-effort on top of creating a test suite using tempest-lib. One thing to note with
+effort on top of creating a test suite using tempest.lib. One thing to note with
 doing this is that the interfaces exposed by tempest are not considered stable
 (with the exception of configuration variables which ever effort goes into
 ensuring backwards compatibility). You should not need to import anything from
 tempest itself except where explicitly noted. If there is an interface from
 tempest that you need to rely on in your plugin it likely needs to be migrated
-to tempest-lib. In that situation, file a bug, push a migration patch, etc. to
+to tempest.lib. In that situation, file a bug, push a migration patch, etc. to
 expedite providing the interface in a reliable manner.
 
 Plugin Cookiecutter
@@ -102,11 +102,6 @@
 Then you need to ensure you locally define all of the methods in the abstract
 class, you can refer to the api doc below for a reference of what that entails.
 
-Also, note eventually this abstract class will likely live in tempest-lib, when
-that migration occurs a deprecation shim will be added to tempest so as to not
-break any existing plugins. But, when that occurs migrating to using tempest-lib
-as the source for the abstract class will be prudent.
-
 Abstract Plugin Class
 ---------------------
 
diff --git a/requirements.txt b/requirements.txt
index 79ae42e..dd73257 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,6 @@
 # process, which may cause wedges in the gate later.
 pbr>=1.6 # Apache-2.0
 cliff!=1.16.0,!=1.17.0,>=1.15.0 # Apache-2.0
-anyjson>=0.3.3 # BSD
 jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
 testtools>=1.4.0 # MIT
 paramiko>=1.16.0 # LGPL
@@ -17,7 +16,6 @@
 oslo.serialization>=1.10.0 # Apache-2.0
 oslo.utils>=3.5.0 # Apache-2.0
 six>=1.9.0 # MIT
-iso8601>=0.1.9 # MIT
 fixtures<2.0,>=1.3.1 # Apache-2.0/BSD
 testscenarios>=0.4 # Apache-2.0/BSD
 PyYAML>=3.1.0 # MIT
diff --git a/tempest/api/identity/v3/test_projects.py b/tempest/api/identity/v3/test_projects.py
index 995b77e..1574ab7 100644
--- a/tempest/api/identity/v3/test_projects.py
+++ b/tempest/api/identity/v3/test_projects.py
@@ -33,7 +33,7 @@
         # user can successfully authenticate using his credentials and
         # project name from received projects list
         for project in resp['projects']:
-            # 'user_domain_id' needs to be specified otherwise tempest_lib
+            # 'user_domain_id' needs to be specified otherwise tempest.lib
             # assumes it to be 'default'
             token_id, body = self.non_admin_token.get_token(
                 username=self.os.credentials.username,
diff --git a/tempest/api/identity/v3/test_tokens.py b/tempest/api/identity/v3/test_tokens.py
index 593bf2a..d5bed96 100644
--- a/tempest/api/identity/v3/test_tokens.py
+++ b/tempest/api/identity/v3/test_tokens.py
@@ -30,7 +30,7 @@
         password = creds.password
         user_domain_id = creds.user_domain_id
 
-        # 'user_domain_id' needs to be specified otherwise tempest_lib assumes
+        # 'user_domain_id' needs to be specified otherwise tempest.lib assumes
         # it to be 'default'
         token_id, resp = self.non_admin_token.get_token(
             user_id=user_id,
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index f19717e..00acc7d 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -32,14 +32,9 @@
     @classmethod
     def resource_setup(cls):
         super(VolumeMultiBackendV2Test, cls).resource_setup()
-        # support 2 backends names, deprecated_for_removal.
-        # keep support 2 backend names, in case they are not empty
-        if CONF.volume.backend1_name and CONF.volume.backend2_name:
-            cls.backend_names = {CONF.volume.backend1_name,
-                                 CONF.volume.backend2_name}
-        else:
-            # read backend name from a list .
-            cls.backend_names = set(CONF.volume.backend_names)
+
+        # read backend name from a list .
+        cls.backend_names = set(CONF.volume.backend_names)
 
         cls.name_field = cls.special_fields['name_field']
         cls.volume_type_id_list = []
diff --git a/tempest/cmd/init.py b/tempest/cmd/init.py
index ac67ce4..9a3a4ed 100644
--- a/tempest/cmd/init.py
+++ b/tempest/cmd/init.py
@@ -54,21 +54,28 @@
     real_prefix = getattr(sys, 'real_prefix', None)
     base_prefix = getattr(sys, 'base_prefix', None)
     prefix = sys.prefix
+    global_conf_dir = '/etc/tempest'
     if (real_prefix is None and
-            (base_prefix is None or base_prefix == prefix)):
+            (base_prefix is None or base_prefix == prefix) and
+            os.path.isdir(global_conf_dir)):
         # Probably not running in a virtual environment.
         # NOTE(andreaf) we cannot distinguish this case from the case of
         # a virtual environment created with virtualenv, and running python3.
         # Also if it appears we are not in virtual env and fail to find
         # global config: '/etc/tempest', fall back to
         # '[sys.prefix]/etc/tempest'
-        global_conf_dir = '/etc/tempest'
-        if os.path.isdir(global_conf_dir):
-            return global_conf_dir
-        else:
-            return os.path.join(prefix, 'etc/tempest')
+        return global_conf_dir
     else:
-        return os.path.join(prefix, 'etc/tempest')
+        conf_dir = os.path.join(prefix, 'etc/tempest')
+        if os.path.isdir(conf_dir):
+            return conf_dir
+        else:
+            # NOTE: The prefix is gotten from the path which pyconfig.h is
+            # installed under. Some envs contain it under /usr/include, not
+            # /user/local/include. Then prefix becomes /usr on such envs.
+            # However, etc/tempest is installed under /usr/local and the bove
+            # path logic mismatches. This is a workaround for such envs.
+            return os.path.join(prefix, 'local/etc/tempest')
 
 
 class TempestInit(command.Command):
@@ -91,8 +98,7 @@
     def update_local_conf(self, conf_path, lock_dir, log_dir):
         config_parse = moves.configparser.SafeConfigParser()
         config_parse.optionxform = str
-        with open(conf_path, 'w+') as conf_file:
-            config_parse.readfp(conf_file)
+        with open(conf_path, 'a+') as conf_file:
             # Set local lock_dir in tempest conf
             if not config_parse.has_section('oslo_concurrency'):
                 config_parse.add_section('oslo_concurrency')
@@ -101,6 +107,7 @@
             config_parse.set('DEFAULT', 'log_dir', log_dir)
             # Set default log filename to tempest.log
             config_parse.set('DEFAULT', 'log_file', 'tempest.log')
+            config_parse.write(conf_file)
 
     def copy_config(self, etc_dir, config_dir):
         shutil.copytree(config_dir, etc_dir)
diff --git a/tempest/common/credentials_factory.py b/tempest/common/credentials_factory.py
index 3923aec..6cb43f3 100644
--- a/tempest/common/credentials_factory.py
+++ b/tempest/common/credentials_factory.py
@@ -26,7 +26,7 @@
 
 """This module provides factories of credential and credential providers
 
-Credentials providers and clients are (going to be) part of tempest-lib,
+Credentials providers and clients are (going to be) part of tempest.lib,
 and so they may not hold any dependency to tempest configuration.
 
 Methods in this module collect the relevant configuration details and pass
diff --git a/tempest/config.py b/tempest/config.py
index 0292462..a09080d 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -700,22 +700,10 @@
                choices=['public', 'admin', 'internal',
                         'publicURL', 'adminURL', 'internalURL'],
                help="The endpoint type to use for the volume service."),
-    cfg.StrOpt('backend1_name',
-               default='',
-               help='Name of the backend1 (must be declared in cinder.conf)',
-               deprecated_for_removal=True),
-    cfg.StrOpt('backend2_name',
-               default='',
-               help='Name of the backend2 (must be declared in cinder.conf)',
-               deprecated_for_removal=True),
     cfg.ListOpt('backend_names',
                 default=['BACKEND_1', 'BACKEND_2'],
                 help='A list of backend names separated by comma. '
-                     'The backend name must be declared in cinder.conf',
-                deprecated_opts=[cfg.DeprecatedOpt('BACKEND_1',
-                                                   group='volume'),
-                                 cfg.DeprecatedOpt('BACKEND_2',
-                                                   group='volume')]),
+                     'The backend name must be declared in cinder.conf'),
     cfg.StrOpt('storage_protocol',
                default='iSCSI',
                help='Backend protocol to target when creating volume types'),
@@ -1159,7 +1147,7 @@
                                     'shelve, snapshot, and suspend')
 
 
-# NOTE(deva): Ironic tests have been ported to tempest-lib. New config options
+# NOTE(deva): Ironic tests have been ported to tempest.lib. New config options
 #             should be added to ironic/ironic_tempest_plugin/config.py.
 #             However, these options need to remain here for testing stable
 #             branches until Liberty release reaches EOL.
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index b8e052f..92f335f 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -116,7 +116,7 @@
 
 
 # NOTE(andreaf) This exception is added here to facilitate the migration
-# of get_network_from_name and preprov_creds to tempest-lib, and it should
+# of get_network_from_name and preprov_creds to tempest.lib, and it should
 # be migrated along with them
 class InvalidTestResource(TempestException):
     message = "%(name) is not a valid %(type), or the name is ambiguous"
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index d0e1fcb..5943adf 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -141,7 +141,7 @@
     """
     if TESTTOOLS_SKIP_DECORATOR.match(logical_line):
         yield (0, "T109: Cannot use testtools.skip decorator; instead use "
-               "decorators.skip_because from tempest-lib")
+               "decorators.skip_because from tempest.lib")
 
 
 def _common_service_clients_check(logical_line, physical_line, filename,
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index dfa4815..c23a78f 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -686,8 +686,9 @@
         unschedule_router = (self.admin_manager.network_agents_client.
                              delete_router_from_l3_agent)
 
-        agent_list = set(a["id"] for a in
-                         self._list_agents(agent_type="L3 agent"))
+        agent_list_alive = set(a["id"] for a in
+                               self._list_agents(agent_type="L3 agent") if
+                               a["alive"] is True)
         self._setup_network_and_servers()
 
         # NOTE(kevinbenton): we have to use the admin credentials to check
@@ -702,7 +703,7 @@
         # remove resource from agents
         hosting_agents = set(a["id"] for a in
                              list_hosts(self.router.id)['agents'])
-        no_migration = agent_list == hosting_agents
+        no_migration = agent_list_alive == hosting_agents
         LOG.info("Router will be assigned to {mig} hosting agent".
                  format(mig="the same" if no_migration else "a new"))
 
@@ -722,7 +723,7 @@
 
         # schedule resource to new agent
         target_agent = list(hosting_agents if no_migration else
-                            agent_list - hosting_agents)[0]
+                            agent_list_alive - hosting_agents)[0]
         schedule_router(target_agent,
                         router_id=self.router['id'])
         self.assertEqual(
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 78bda5d..0acd4ad 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -150,9 +150,6 @@
 
     def put_object_with_chunk(self, container, name, contents, chunk_size):
         """Put an object with Transfer-Encoding header"""
-        if self.base_url is None:
-            self._set_auth()
-
         headers = {'Transfer-Encoding': 'chunked'}
         if self.token:
             headers['X-Auth-Token'] = self.token
@@ -182,8 +179,6 @@
         if not data:
             headers['content-length'] = '0'
 
-        if self.base_url is None:
-            self._set_auth()
         headers['X-Auth-Token'] = self.token
 
         conn = put_object_connection(self.base_url, str(container),
diff --git a/tempest/tests/lib/base.py b/tempest/tests/base.py
similarity index 100%
rename from tempest/tests/lib/base.py
rename to tempest/tests/base.py
diff --git a/tempest/tests/cmd/test_javelin.py b/tempest/tests/cmd/test_javelin.py
index b8c9969..2d0256a 100644
--- a/tempest/tests/cmd/test_javelin.py
+++ b/tempest/tests/cmd/test_javelin.py
@@ -17,7 +17,7 @@
 
 from tempest.cmd import javelin
 from tempest.lib import exceptions as lib_exc
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class JavelinUnitTest(base.TestCase):
diff --git a/tempest/tests/cmd/test_list_plugins.py b/tempest/tests/cmd/test_list_plugins.py
index 782dde7..17ddb18 100644
--- a/tempest/tests/cmd/test_list_plugins.py
+++ b/tempest/tests/cmd/test_list_plugins.py
@@ -14,7 +14,7 @@
 
 import subprocess
 
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestTempestListPlugins(base.TestCase):
diff --git a/tempest/tests/cmd/test_tempest_init.py b/tempest/tests/cmd/test_tempest_init.py
index 6c5326a..685a0b3 100644
--- a/tempest/tests/cmd/test_tempest_init.py
+++ b/tempest/tests/cmd/test_tempest_init.py
@@ -18,7 +18,7 @@
 import fixtures
 
 from tempest.cmd import init
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestTempestInit(base.TestCase):
diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py
index 330c393..3b09673 100644
--- a/tempest/tests/cmd/test_verify_tempest_config.py
+++ b/tempest/tests/cmd/test_verify_tempest_config.py
@@ -19,8 +19,8 @@
 
 from tempest.cmd import verify_tempest_config
 from tempest import config
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestGetAPIVersions(base.TestCase):
diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py
index 7461c4b..01a9cd0 100644
--- a/tempest/tests/common/test_admin_available.py
+++ b/tempest/tests/common/test_admin_available.py
@@ -17,8 +17,8 @@
 
 from tempest.common import credentials_factory as credentials
 from tempest import config
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestAdminAvailable(base.TestCase):
diff --git a/tempest/tests/common/test_alt_available.py b/tempest/tests/common/test_alt_available.py
index 1a36068..d4cfab6 100644
--- a/tempest/tests/common/test_alt_available.py
+++ b/tempest/tests/common/test_alt_available.py
@@ -17,8 +17,8 @@
 
 from tempest.common import credentials_factory as credentials
 from tempest import config
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestAltAvailable(base.TestCase):
diff --git a/tempest/tests/common/test_configured_creds.py b/tempest/tests/common/test_configured_creds.py
index 2ce354d..3c242b3 100644
--- a/tempest/tests/common/test_configured_creds.py
+++ b/tempest/tests/common/test_configured_creds.py
@@ -21,8 +21,8 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.identity.v2 import token_client as v2_client
 from tempest.lib.services.identity.v3 import token_client as v3_client
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 from tempest.tests.lib import fake_identity
 
 
diff --git a/tempest/tests/common/test_credentials.py b/tempest/tests/common/test_credentials.py
index 3d09d9f..00f2d39 100644
--- a/tempest/tests/common/test_credentials.py
+++ b/tempest/tests/common/test_credentials.py
@@ -15,8 +15,8 @@
 from tempest.common import credentials_factory as credentials
 from tempest import config
 from tempest import exceptions
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestLegacyCredentialsProvider(base.TestCase):
diff --git a/tempest/tests/common/test_custom_matchers.py b/tempest/tests/common/test_custom_matchers.py
index d664961..2656a47 100644
--- a/tempest/tests/common/test_custom_matchers.py
+++ b/tempest/tests/common/test_custom_matchers.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 from tempest.common import custom_matchers
-from tempest.tests.lib import base
+from tempest.tests import base
 
 from testtools.tests.matchers import helpers
 
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index 1488793..8d4f33b 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -31,8 +31,8 @@
 from tempest.services.identity.v2.json import users_client as \
     json_users_client
 from tempest.services.network.json import routers_client
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 from tempest.tests.lib import fake_http
 from tempest.tests.lib import fake_identity
 
diff --git a/tempest/tests/common/test_preprov_creds.py b/tempest/tests/common/test_preprov_creds.py
index fba5b1f..b595c88 100644
--- a/tempest/tests/common/test_preprov_creds.py
+++ b/tempest/tests/common/test_preprov_creds.py
@@ -28,8 +28,8 @@
 from tempest.lib import auth
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.identity.v2 import token_client
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 from tempest.tests.lib import fake_identity
 
 
diff --git a/tempest/tests/common/test_waiters.py b/tempest/tests/common/test_waiters.py
index e0cef62..492bdca 100644
--- a/tempest/tests/common/test_waiters.py
+++ b/tempest/tests/common/test_waiters.py
@@ -19,7 +19,7 @@
 from tempest.common import waiters
 from tempest import exceptions
 from tempest.services.volume.base import base_volumes_client
-from tempest.tests.lib import base
+from tempest.tests import base
 import tempest.tests.utils as utils
 
 
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index b3bba72..e9146bc 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -19,8 +19,8 @@
 
 from tempest.common.utils.linux import remote_client
 from tempest import config
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestRemoteClient(base.TestCase):
diff --git a/tempest/tests/common/utils/test_file_utils.py b/tempest/tests/common/utils/test_file_utils.py
index 1a14592..937aefa 100644
--- a/tempest/tests/common/utils/test_file_utils.py
+++ b/tempest/tests/common/utils/test_file_utils.py
@@ -16,7 +16,7 @@
 import mock
 
 from tempest.common.utils import file_utils
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestFileUtils(base.TestCase):
diff --git a/tempest/tests/lib/cli/test_command_failed.py b/tempest/tests/lib/cli/test_command_failed.py
index 8ce34c2..388028a 100644
--- a/tempest/tests/lib/cli/test_command_failed.py
+++ b/tempest/tests/lib/cli/test_command_failed.py
@@ -11,7 +11,7 @@
 #    under the License.
 
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestOutputParser(base.TestCase):
diff --git a/tempest/tests/lib/cli/test_execute.py b/tempest/tests/lib/cli/test_execute.py
index b5f7145..b846c46 100644
--- a/tempest/tests/lib/cli/test_execute.py
+++ b/tempest/tests/lib/cli/test_execute.py
@@ -14,7 +14,7 @@
 
 from tempest.lib.cli import base as cli_base
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestExecute(base.TestCase):
diff --git a/tempest/tests/lib/cli/test_output_parser.py b/tempest/tests/lib/cli/test_output_parser.py
index a2c1b2d..d88dfc3 100644
--- a/tempest/tests/lib/cli/test_output_parser.py
+++ b/tempest/tests/lib/cli/test_output_parser.py
@@ -16,7 +16,7 @@
 
 from tempest.lib.cli import output_parser
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestOutputParser(base.TestCase):
diff --git a/tempest/tests/lib/common/test_api_version_request.py b/tempest/tests/lib/common/test_api_version_request.py
index bdaa936..58e7040 100644
--- a/tempest/tests/lib/common/test_api_version_request.py
+++ b/tempest/tests/lib/common/test_api_version_request.py
@@ -14,7 +14,7 @@
 
 from tempest.lib.common import api_version_request
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class APIVersionRequestTests(base.TestCase):
diff --git a/tempest/tests/lib/common/test_api_version_utils.py b/tempest/tests/lib/common/test_api_version_utils.py
index 591b87e..6206379 100644
--- a/tempest/tests/lib/common/test_api_version_utils.py
+++ b/tempest/tests/lib/common/test_api_version_utils.py
@@ -16,7 +16,7 @@
 
 from tempest.lib.common import api_version_utils
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestVersionSkipLogic(base.TestCase):
diff --git a/tempest/tests/lib/common/utils/test_data_utils.py b/tempest/tests/lib/common/utils/test_data_utils.py
index 493df89..f435461 100644
--- a/tempest/tests/lib/common/utils/test_data_utils.py
+++ b/tempest/tests/lib/common/utils/test_data_utils.py
@@ -16,7 +16,7 @@
 import netaddr
 
 from tempest.lib.common.utils import data_utils
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestDataUtils(base.TestCase):
diff --git a/tempest/tests/lib/common/utils/test_misc.py b/tempest/tests/lib/common/utils/test_misc.py
index e23d7fb..9597f5b 100644
--- a/tempest/tests/lib/common/utils/test_misc.py
+++ b/tempest/tests/lib/common/utils/test_misc.py
@@ -15,7 +15,7 @@
 
 
 from tempest.lib.common.utils import misc
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 @misc.singleton
diff --git a/tempest/tests/lib/services/compute/base.py b/tempest/tests/lib/services/compute/base.py
index c805de2..e77b436 100644
--- a/tempest/tests/lib/services/compute/base.py
+++ b/tempest/tests/lib/services/compute/base.py
@@ -15,7 +15,7 @@
 from oslo_serialization import jsonutils as json
 from oslotest import mockpatch
 
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_http
 
 
diff --git a/tempest/tests/lib/services/identity/v2/test_token_client.py b/tempest/tests/lib/services/identity/v2/test_token_client.py
index d91ecdc..7925152 100644
--- a/tempest/tests/lib/services/identity/v2/test_token_client.py
+++ b/tempest/tests/lib/services/identity/v2/test_token_client.py
@@ -19,7 +19,7 @@
 from tempest.lib.common import rest_client
 from tempest.lib import exceptions
 from tempest.lib.services.identity.v2 import token_client
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_http
 
 
diff --git a/tempest/tests/lib/services/identity/v3/test_token_client.py b/tempest/tests/lib/services/identity/v3/test_token_client.py
index 52b8e01..e9ef740 100644
--- a/tempest/tests/lib/services/identity/v3/test_token_client.py
+++ b/tempest/tests/lib/services/identity/v3/test_token_client.py
@@ -19,7 +19,7 @@
 from tempest.lib.common import rest_client
 from tempest.lib import exceptions
 from tempest.lib.services.identity.v3 import token_client
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_http
 
 
diff --git a/tempest/tests/lib/test_auth.py b/tempest/tests/lib/test_auth.py
index 50ad566..cc71c92 100644
--- a/tempest/tests/lib/test_auth.py
+++ b/tempest/tests/lib/test_auth.py
@@ -22,7 +22,7 @@
 from tempest.lib import exceptions
 from tempest.lib.services.identity.v2 import token_client as v2_client
 from tempest.lib.services.identity.v3 import token_client as v3_client
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_credentials
 from tempest.tests.lib import fake_identity
 
diff --git a/tempest/tests/lib/test_credentials.py b/tempest/tests/lib/test_credentials.py
index b8acf83..ca3baa1 100644
--- a/tempest/tests/lib/test_credentials.py
+++ b/tempest/tests/lib/test_credentials.py
@@ -19,7 +19,7 @@
 from tempest.lib import exceptions
 from tempest.lib.services.identity.v2 import token_client as v2_client
 from tempest.lib.services.identity.v3 import token_client as v3_client
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_identity
 
 
diff --git a/tempest/tests/lib/test_decorators.py b/tempest/tests/lib/test_decorators.py
index f83bcbb..f3a4e9c 100644
--- a/tempest/tests/lib/test_decorators.py
+++ b/tempest/tests/lib/test_decorators.py
@@ -18,7 +18,7 @@
 from tempest.lib import base as test
 from tempest.lib.common.utils import data_utils
 from tempest.lib import decorators
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestSkipBecauseDecorator(base.TestCase):
diff --git a/tempest/tests/lib/test_rest_client.py b/tempest/tests/lib/test_rest_client.py
index 572b446..2959294 100644
--- a/tempest/tests/lib/test_rest_client.py
+++ b/tempest/tests/lib/test_rest_client.py
@@ -22,7 +22,7 @@
 from tempest.lib.common import http
 from tempest.lib.common import rest_client
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 from tempest.tests.lib import fake_auth_provider
 from tempest.tests.lib import fake_http
 import tempest.tests.utils as utils
diff --git a/tempest/tests/lib/test_ssh.py b/tempest/tests/lib/test_ssh.py
index d001c51..b07f6bc 100644
--- a/tempest/tests/lib/test_ssh.py
+++ b/tempest/tests/lib/test_ssh.py
@@ -21,7 +21,7 @@
 
 from tempest.lib.common import ssh
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 import tempest.tests.utils as utils
 
 
diff --git a/tempest/tests/lib/test_tempest_lib.py b/tempest/tests/lib/test_tempest_lib.py
index 9731e96..d70e53d 100644
--- a/tempest/tests/lib/test_tempest_lib.py
+++ b/tempest/tests/lib/test_tempest_lib.py
@@ -19,7 +19,7 @@
 Tests for `tempest.lib` module.
 """
 
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestTempest_lib(base.TestCase):
diff --git a/tempest/tests/negative/test_negative_auto_test.py b/tempest/tests/negative/test_negative_auto_test.py
index 1795466..44ce567 100644
--- a/tempest/tests/negative/test_negative_auto_test.py
+++ b/tempest/tests/negative/test_negative_auto_test.py
@@ -15,8 +15,8 @@
 
 from tempest import config
 import tempest.test as test
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestNegativeAutoTest(base.TestCase):
diff --git a/tempest/tests/negative/test_negative_generators.py b/tempest/tests/negative/test_negative_generators.py
index e0d7f42..78fd80d 100644
--- a/tempest/tests/negative/test_negative_generators.py
+++ b/tempest/tests/negative/test_negative_generators.py
@@ -22,7 +22,7 @@
 from tempest.common.generator import base_generator
 from tempest.common.generator import negative_generator
 from tempest.common.generator import valid_generator
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestNegativeBasicGenerator(base.TestCase):
diff --git a/tempest/tests/stress/test_stress.py b/tempest/tests/stress/test_stress.py
index a35b4d7..dfe0291 100644
--- a/tempest/tests/stress/test_stress.py
+++ b/tempest/tests/stress/test_stress.py
@@ -18,7 +18,7 @@
 
 from oslo_log import log as logging
 from tempest.lib import exceptions
-from tempest.tests.lib import base
+from tempest.tests import base
 
 LOG = logging.getLogger(__name__)
 
diff --git a/tempest/tests/test_base_test.py b/tempest/tests/test_base_test.py
index 9ffb7a1..dc355b4 100644
--- a/tempest/tests/test_base_test.py
+++ b/tempest/tests/test_base_test.py
@@ -19,8 +19,8 @@
 from tempest.common import fixed_network
 from tempest import config
 from tempest import test
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestBaseTestCase(base.TestCase):
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
index ee68676..7c9579b 100644
--- a/tempest/tests/test_decorators.py
+++ b/tempest/tests/test_decorators.py
@@ -21,8 +21,8 @@
 from tempest import exceptions
 from tempest.lib.common.utils import data_utils
 from tempest import test
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class BaseDecoratorsTest(base.TestCase):
diff --git a/tempest/tests/test_glance_http.py b/tempest/tests/test_glance_http.py
index fdbc2d2..768cd05 100644
--- a/tempest/tests/test_glance_http.py
+++ b/tempest/tests/test_glance_http.py
@@ -22,8 +22,8 @@
 
 from tempest.common import glance_http
 from tempest import exceptions
+from tempest.tests import base
 from tempest.tests import fake_auth_provider
-from tempest.tests.lib import base
 from tempest.tests.lib import fake_http
 
 
diff --git a/tempest/tests/test_hacking.py b/tempest/tests/test_hacking.py
index 6b3aa0d..aba2aab 100644
--- a/tempest/tests/test_hacking.py
+++ b/tempest/tests/test_hacking.py
@@ -13,7 +13,7 @@
 #    under the License.
 
 from tempest.hacking import checks
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class HackingTestCase(base.TestCase):
diff --git a/tempest/tests/test_list_tests.py b/tempest/tests/test_list_tests.py
index 69527b1..38d4c5c 100644
--- a/tempest/tests/test_list_tests.py
+++ b/tempest/tests/test_list_tests.py
@@ -17,7 +17,7 @@
 import six
 import subprocess
 
-from tempest.tests.lib import base
+from tempest.tests import base
 
 
 class TestTestList(base.TestCase):
diff --git a/tempest/tests/test_microversions.py b/tempest/tests/test_microversions.py
index b80cf80..173accb 100644
--- a/tempest/tests/test_microversions.py
+++ b/tempest/tests/test_microversions.py
@@ -18,8 +18,8 @@
 from tempest.api.compute import base as compute_base
 from tempest import config
 from tempest.lib import exceptions
+from tempest.tests import base
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class VersionTestNoneTolatest(compute_base.BaseV2ComputeTest):
diff --git a/tempest/tests/test_negative_rest_client.py b/tempest/tests/test_negative_rest_client.py
index e46649c..9d9c20f 100644
--- a/tempest/tests/test_negative_rest_client.py
+++ b/tempest/tests/test_negative_rest_client.py
@@ -20,9 +20,9 @@
 
 from tempest.common import negative_rest_client
 from tempest import config
+from tempest.tests import base
 from tempest.tests import fake_auth_provider
 from tempest.tests import fake_config
-from tempest.tests.lib import base
 
 
 class TestNegativeRestClient(base.TestCase):
diff --git a/tempest/tests/test_tempest_plugin.py b/tempest/tests/test_tempest_plugin.py
index f66dfc8..c07e98c 100644
--- a/tempest/tests/test_tempest_plugin.py
+++ b/tempest/tests/test_tempest_plugin.py
@@ -14,8 +14,8 @@
 #    under the License.
 
 from tempest.test_discover import plugins
+from tempest.tests import base
 from tempest.tests import fake_tempest_plugin as fake_plugin
-from tempest.tests.lib import base
 
 
 class TestPluginDiscovery(base.TestCase):
diff --git a/tempest/tests/test_wrappers.py b/tempest/tests/test_wrappers.py
index edb9061..a4ef699 100644
--- a/tempest/tests/test_wrappers.py
+++ b/tempest/tests/test_wrappers.py
@@ -19,7 +19,7 @@
 
 import six
 
-from tempest.tests.lib import base
+from tempest.tests import base
 
 DEVNULL = open(os.devnull, 'wb')