Merge "Add option for whether the cloud supports floating ips"
diff --git a/HACKING.rst b/HACKING.rst
index c0a857c..cef4f21 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -232,9 +232,9 @@
   and xml version of the same test class there could still be a race between
   methods.
 
-- The rand_name() function from tempest.common.utils.data_utils should be used
-  anywhere a resource is created with a name. Static naming should be avoided
-  to prevent resource conflicts.
+- The rand_name() function from tempest.lib.common.utils.data_utils should be
+  used anywhere a resource is created with a name. Static naming should be
+  avoided to prevent resource conflicts.
 
 - If the execution of a set of tests is required to be serialized then locking
   can be used to perform this. See AggregatesAdminTest in
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 2314222..4accd94 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -52,8 +52,7 @@
  #. ``uri_v3``
 
 The ``auth_version`` option is used to tell Tempest whether it should be using
-keystone's v2 or v3 api for communicating with keystone. (except for the
-identity api tests which will test a specific version) The two uri options are
+keystone's v2 or v3 api for communicating with keystone. The two uri options are
 used to tell Tempest the url of the keystone endpoint. The ``uri`` option is
 used for keystone v2 request and ``uri_v3`` is used for keystone v3. You want to
 ensure that which ever version you set for ``auth_version`` has its uri option
diff --git a/doc/source/write_tests.rst b/doc/source/write_tests.rst
index 2363fa6..4e3bfa2 100644
--- a/doc/source/write_tests.rst
+++ b/doc/source/write_tests.rst
@@ -178,16 +178,16 @@
 +-------------------+---------------------+
 | Credentials Entry | Manager Variable    |
 +===================+=====================+
-| primary           | cls.os              |
+| primary           | cls.os_primary      |
 +-------------------+---------------------+
-| admin             | cls.os_adm          |
+| admin             | cls.os_admin        |
 +-------------------+---------------------+
 | alt               | cls.os_alt          |
 +-------------------+---------------------+
 | [$label, $role]   | cls.os_roles_$label |
 +-------------------+---------------------+
 
-By default cls.os is available since it is allocated in the base tempest test
+By default cls.os_primary is available since it is allocated in the base tempest test
 class (located in tempest/test.py). If your TestCase inherits from a different
 direct parent class (it'll still inherit from the BaseTestCase, just not
 directly) be sure to check if that class overrides allocated credentials.
@@ -270,13 +270,13 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      self.os.servers_client.create_server(...)
+      self.os_primary.servers_client.create_server(...)
 
-is all you need to do. As described previously, in the above example the ``self.os``
-is created automatically because the base test class sets the ``credentials``
-attribute to allocate a primary credential set and initializes the client
-manager as ``self.os``. This same access pattern can be used for all of the
-clients in Tempest.
+is all you need to do. As described previously, in the above example the
+``self.os_primary`` is created automatically because the base test class sets the
+``credentials`` attribute to allocate a primary credential set and initializes
+the client manager as ``self.os_primary``. This same access pattern can be used
+for all of the clients in Tempest.
 
 Credentials Objects
 -------------------
@@ -293,7 +293,7 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      credentials = self.os.credentials
+      credentials = self.os_primary.credentials
 
 The credentials object provides access to all of the credential information you
 would need to make API requests. For example, building off the previous
@@ -304,7 +304,7 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      credentials = self.os.credentials
+      credentials = self.os_primary.credentials
       username = credentials.username
       user_id = credentials.user_id
       password = credentials.password
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index c4db5e3..ba8a214 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -151,7 +151,7 @@
         """Tests that no networking is allocated for the server."""
         # create the server with no networking
         server, _ = compute.create_test_server(
-            self.os, networks='none', wait_until='ACTIVE')
+            self.os_primary, networks='none', wait_until='ACTIVE')
         self.addCleanup(self.delete_server, server['id'])
         # get the server ips
         addresses = self.servers_client.list_addresses(
@@ -176,7 +176,7 @@
         # - Third request sees net1 and net2 for the tenant and fails with a
         #   NetworkAmbiguous 400 error.
         _, servers = compute.create_test_server(
-            self.os, networks='auto', wait_until='ACTIVE',
+            self.os_primary, networks='auto', wait_until='ACTIVE',
             min_count=3)
         server_nets = set()
         for server in servers:
diff --git a/tempest/api/compute/admin/test_delete_server.py b/tempest/api/compute/admin/test_delete_server.py
index 2569161..83444b9 100644
--- a/tempest/api/compute/admin/test_delete_server.py
+++ b/tempest/api/compute/admin/test_delete_server.py
@@ -29,7 +29,7 @@
     def setup_clients(cls):
         super(DeleteServersAdminTestJSON, cls).setup_clients()
         cls.non_admin_client = cls.servers_client
-        cls.admin_client = cls.os_adm.servers_client
+        cls.admin_client = cls.os_admin.servers_client
 
     @decorators.idempotent_id('99774678-e072-49d1-9d2a-49a59bc56063')
     def test_delete_server_while_in_error_state(self):
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index a492b43..789049b 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -133,7 +133,7 @@
         # self.create_test_server() here as this method creates the server
         # in the "primary" (i.e non-admin) tenant.
         test_server, _ = compute.create_test_server(
-            self.os_adm, wait_until="ACTIVE", name=name, **network_kwargs)
+            self.os_admin, wait_until="ACTIVE", name=name, **network_kwargs)
         self.addCleanup(self.client.delete_server, test_server['id'])
         server = self.client.show_server(test_server['id'])['server']
         self.assertEqual(server['status'], 'ACTIVE')
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 141b9f3..d893446 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -204,7 +204,7 @@
             kwargs['name'] = data_utils.rand_name(cls.__name__ + "-server")
         tenant_network = cls.get_tenant_network()
         body, servers = compute.create_test_server(
-            cls.os,
+            cls.os_primary,
             validatable,
             validation_resources=cls.validation_resources,
             tenant_network=tenant_network,
@@ -350,7 +350,7 @@
     @classmethod
     def delete_volume(cls, volume_id):
         """Deletes the given volume and waits for it to be gone."""
-        cls._delete_volume(cls.volumes_extensions_client, volume_id)
+        cls._delete_volume(cls.volumes_client, volume_id)
 
     @classmethod
     def get_server_ip(cls, server):
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index e50b29a..6c5cc79 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -264,7 +264,8 @@
 
         # create two servers
         _, servers = compute.create_test_server(
-            self.os, tenant_network=network, wait_until='ACTIVE', min_count=2)
+            self.os_primary, tenant_network=network,
+            wait_until='ACTIVE', min_count=2)
         # add our cleanups for the servers since we bypassed the base class
         for server in servers:
             self.addCleanup(self.delete_server, server['id'])
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 7cbb513..059454d 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -24,7 +24,7 @@
     def test_multiple_create(self):
         tenant_network = self.get_tenant_network()
         body, servers = compute.create_test_server(
-            self.os,
+            self.os_primary,
             wait_until='ACTIVE',
             min_count=2,
             tenant_network=tenant_network)
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 76b9c44..6f072b2 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -531,6 +531,10 @@
         self.client.unshelve_server(self.server_id)
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
+        images = self.compute_images_client.list_images(**params)['images']
+        msg = ('After unshelve, shelved image is not deleted.')
+        self.assertEmpty(images, msg)
+
     @decorators.idempotent_id('af8eafd4-38a7-4a4b-bdbc-75145a580560')
     def test_stop_start_server(self):
         self.client.stop_server(self.server_id)
diff --git a/tempest/api/compute/volumes/test_volume_snapshots.py b/tempest/api/compute/volumes/test_volume_snapshots.py
index 2f3a06e..0f436eb 100644
--- a/tempest/api/compute/volumes/test_volume_snapshots.py
+++ b/tempest/api/compute/volumes/test_volume_snapshots.py
@@ -27,6 +27,11 @@
 
 class VolumesSnapshotsTestJSON(base.BaseV2ComputeTest):
 
+    # These tests will fail with a 404 starting from microversion 2.36. For
+    # more information, see:
+    # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+    max_microversion = '2.35'
+
     @classmethod
     def skip_checks(cls):
         super(VolumesSnapshotsTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 43c837a..d9ee5b1 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -27,6 +27,11 @@
 
 class VolumesGetTestJSON(base.BaseV2ComputeTest):
 
+    # These tests will fail with a 404 starting from microversion 2.36. For
+    # more information, see:
+    # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+    max_microversion = '2.35'
+
     @classmethod
     def skip_checks(cls):
         super(VolumesGetTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 0d8214f..b2aebe7 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -27,6 +27,11 @@
     # If you are running a Devstack environment, ensure that the
     # VOLUME_BACKING_FILE_SIZE is at least 4G in your localrc
 
+    # These tests will fail with a 404 starting from microversion 2.36. For
+    # more information, see:
+    # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+    max_microversion = '2.35'
+
     @classmethod
     def skip_checks(cls):
         super(VolumesTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 80db1be..87f7d8a 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -24,6 +24,11 @@
 
 class VolumesNegativeTest(base.BaseV2ComputeTest):
 
+    # These tests will fail with a 404 starting from microversion 2.36. For
+    # more information, see:
+    # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+    max_microversion = '2.35'
+
     @classmethod
     def skip_checks(cls):
         super(VolumesNegativeTest, cls).skip_checks()
diff --git a/tempest/api/identity/admin/v3/test_oauth_consumers.py b/tempest/api/identity/admin/v3/test_oauth_consumers.py
index f06fb8f..970ead3 100644
--- a/tempest/api/identity/admin/v3/test_oauth_consumers.py
+++ b/tempest/api/identity/admin/v3/test_oauth_consumers.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 from tempest.api.identity import base
-from tempest.common.utils import data_utils
+from tempest.lib.common.utils import data_utils
 from tempest.lib.common.utils import test_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as exceptions
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index b341ab7..76723f4 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -43,7 +43,8 @@
         else:
             msg = ("The container format and the disk format don't match. "
                    "Container format: %(container)s, Disk format: %(disk)s." %
-                   {'container': container_format, 'disk': disk_format})
+                   {'container': container_format, 'disk':
+                       CONF.image.disk_formats})
             raise exceptions.InvalidConfiguration(msg)
     else:
         disk_format = CONF.image.disk_formats[0]
diff --git a/tempest/api/volume/admin/test_volume_quota_classes.py b/tempest/api/volume/admin/test_volume_quota_classes.py
index 016d87a..b8a61fd 100644
--- a/tempest/api/volume/admin/test_volume_quota_classes.py
+++ b/tempest/api/volume/admin/test_volume_quota_classes.py
@@ -73,7 +73,7 @@
 
         # Verify current project's default quotas
         default_quotas = self.admin_quotas_client.show_default_quota_set(
-            self.os_adm.credentials.tenant_id)['quota_set']
+            self.os_admin.credentials.tenant_id)['quota_set']
         self.assertThat(default_quotas.items(),
                         matchers.ContainsAll(body.items()))
 
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 3f33c7b..eace92d 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -224,7 +224,7 @@
 
         tenant_network = self.get_tenant_network()
         body, _ = compute.create_test_server(
-            self.os,
+            self.os_primary,
             tenant_network=tenant_network,
             name=name,
             **kwargs)
diff --git a/tempest/clients.py b/tempest/clients.py
index 4baa31d..7b6cc19 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -41,8 +41,7 @@
         _, identity_uri = get_auth_provider_class(credentials)
         super(Manager, self).__init__(
             credentials=credentials, identity_uri=identity_uri, scope=scope,
-            region=CONF.identity.region,
-            client_parameters=self._prepare_configuration())
+            region=CONF.identity.region)
         # 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.
@@ -62,35 +61,6 @@
             build_timeout=CONF.orchestration.build_timeout,
             **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) Once all service clients in Tempest are migrated
-        # to tempest.lib, their configuration will be picked up from the
-        # registry, and this method will become redundant.
-
-        configuration = {}
-
-        # Setup the parameters for all Tempest services which are not in lib.
-        # NOTE(andreaf) Since client.py is an internal module of Tempest,
-        # it doesn't have to consider plugin configuration.
-        for service in clients._tempest_internal_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.warning(
-                    'Could not load configuration for service %s', service)
-
-        return configuration
-
     def _set_network_clients(self):
         self.network_agents_client = self.network.AgentsClient()
         self.network_extensions_client = self.network.ExtensionsClient()
@@ -296,8 +266,10 @@
             self.volume_v2.TransfersClient()
 
     def _set_object_storage_clients(self):
-        # Mandatory parameters (always defined)
-        params = self.parameters['object-storage']
+        # NOTE(andreaf) Load configuration from config. Once object storage
+        # is in lib, configuration will be pulled directly from the registry
+        # and this will not be required anymore.
+        params = config.service_client_config('object-storage')
 
         self.account_client = object_storage.AccountClient(self.auth_provider,
                                                            **params)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index ef4506c..2e55c2e 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -741,7 +741,7 @@
             :returns: True if subnet with cidr already exist in tenant
                   False else
             """
-            cidr_in_use = self.admin_manager.subnets_client.list_subnets(
+            cidr_in_use = self.os_admin.subnets_client.list_subnets(
                 tenant_id=tenant_id, cidr=cidr)['subnets']
             return len(cidr_in_use) != 0
 
@@ -790,7 +790,7 @@
         return subnet
 
     def _get_server_port_id_and_ip4(self, server, ip_addr=None):
-        ports = self.admin_manager.ports_client.list_ports(
+        ports = self.os_admin.ports_client.list_ports(
             device_id=server['id'], fixed_ip=ip_addr)['ports']
         # A port can have more than one IP address in some cases.
         # If the network is dual-stack (IPv4 + IPv6), this port is associated
@@ -820,7 +820,7 @@
         return port_map[0]
 
     def _get_network_by_name(self, network_name):
-        net = self.admin_manager.networks_client.list_networks(
+        net = self.os_admin.networks_client.list_networks(
             name=network_name)['networks']
         self.assertNotEqual(len(net), 0,
                             "Unable to get network by name: %s" % network_name)
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 8408a1e..c06d239 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -36,8 +36,8 @@
     def setup_clients(cls):
         super(TestAggregatesBasicOps, cls).setup_clients()
         # Use admin client by default
-        cls.aggregates_client = cls.admin_manager.aggregates_client
-        cls.hosts_client = cls.admin_manager.hosts_client
+        cls.aggregates_client = cls.os_admin.aggregates_client
+        cls.hosts_client = cls.os_admin.hosts_client
 
     def _create_aggregate(self, **kwargs):
         aggregate = (self.aggregates_client.create_aggregate(**kwargs)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 472d7b7..c76c082 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -128,21 +128,21 @@
         via checking the result of list_[networks,routers,subnets]
         """
 
-        seen_nets = self.admin_manager.networks_client.list_networks()
+        seen_nets = self.os_admin.networks_client.list_networks()
         seen_names = [n['name'] for n in seen_nets['networks']]
         seen_ids = [n['id'] for n in seen_nets['networks']]
         self.assertIn(self.network['name'], seen_names)
         self.assertIn(self.network['id'], seen_ids)
 
         if self.subnet:
-            seen_subnets = self.admin_manager.subnets_client.list_subnets()
+            seen_subnets = self.os_admin.subnets_client.list_subnets()
             seen_net_ids = [n['network_id'] for n in seen_subnets['subnets']]
             seen_subnet_ids = [n['id'] for n in seen_subnets['subnets']]
             self.assertIn(self.network['id'], seen_net_ids)
             self.assertIn(self.subnet['id'], seen_subnet_ids)
 
         if self.router:
-            seen_routers = self.admin_manager.routers_client.list_routers()
+            seen_routers = self.os_admin.routers_client.list_routers()
             seen_router_ids = [n['id'] for n in seen_routers['routers']]
             seen_router_names = [n['name'] for n in seen_routers['routers']]
             self.assertIn(self.router['name'],
@@ -243,7 +243,7 @@
             ip_address, private_key=private_key)
         old_nic_list = self._get_server_nics(ssh_client)
         # get a port from a list of one item
-        port_list = self.admin_manager.ports_client.list_ports(
+        port_list = self.os_admin.ports_client.list_ports(
             device_id=server['id'])['ports']
         self.assertEqual(1, len(port_list))
         old_port = port_list[0]
@@ -259,7 +259,7 @@
         def check_ports():
             self.new_port_list = [
                 port for port in
-                self.admin_manager.ports_client.list_ports(
+                self.os_admin.ports_client.list_ports(
                     device_id=server['id'])['ports']
                 if port['id'] != old_port['id']
             ]
@@ -311,7 +311,7 @@
         # get all network ports in the new network
         internal_ips = (
             p['fixed_ips'][0]['ip_address'] for p in
-            self.admin_manager.ports_client.list_ports(
+            self.os_admin.ports_client.list_ports(
                 tenant_id=server['tenant_id'],
                 network_id=network['id'])['ports']
             if p['device_owner'].startswith('network')
@@ -332,7 +332,7 @@
         # which is always IPv4, so we must only test connectivity to
         # external IPv4 IPs if the external network is dualstack.
         v4_subnets = [
-            s for s in self.admin_manager.subnets_client.list_subnets(
+            s for s in self.os_admin.subnets_client.list_subnets(
                 network_id=CONF.network.public_network_id)['subnets']
             if s['ip_version'] == 4
         ]
@@ -632,7 +632,7 @@
         self._setup_network_and_servers()
         floating_ip, server = self.floating_ip_tuple
         server_id = server['id']
-        port_id = self.admin_manager.ports_client.list_ports(
+        port_id = self.os_admin.ports_client.list_ports(
             device_id=server_id)['ports'][0]['id']
         server_pip = server['addresses'][self.network['name']][0]['addr']
 
@@ -687,7 +687,7 @@
                              'Server should have been created from a '
                              'pre-existing port.')
         # Assert the port is bound to the server.
-        port_list = self.admin_manager.ports_client.list_ports(
+        port_list = self.os_admin.ports_client.list_ports(
             device_id=server['id'], network_id=self.network['id'])['ports']
         self.assertEqual(1, len(port_list),
                          'There should only be one port created for '
@@ -706,7 +706,7 @@
         # Boot another server with the same port to make sure nothing was
         # left around that could cause issues.
         server = self._create_server(self.network, port['id'])
-        port_list = self.admin_manager.ports_client.list_ports(
+        port_list = self.os_admin.ports_client.list_ports(
             device_id=server['id'], network_id=self.network['id'])['ports']
         self.assertEqual(1, len(port_list),
                          'There should only be one port created for '
@@ -731,23 +731,23 @@
         # TODO(yfried): refactor this test to be used for other agents (dhcp)
         # as well
 
-        list_hosts = (self.admin_manager.routers_client.
+        list_hosts = (self.os_admin.routers_client.
                       list_l3_agents_hosting_router)
-        schedule_router = (self.admin_manager.network_agents_client.
+        schedule_router = (self.os_admin.network_agents_client.
                            create_router_on_l3_agent)
-        unschedule_router = (self.admin_manager.network_agents_client.
+        unschedule_router = (self.os_admin.network_agents_client.
                              delete_router_from_l3_agent)
 
         agent_list_alive = set(
             a["id"] for a in
-            self.admin_manager.network_agents_client.list_agents(
+            self.os_admin.network_agents_client.list_agents(
                 agent_type="L3 agent")['agents'] if a["alive"] is True
         )
         self._setup_network_and_servers()
 
         # NOTE(kevinbenton): we have to use the admin credentials to check
         # for the distributed flag because self.router only has a project view.
-        admin = self.admin_manager.routers_client.show_router(
+        admin = self.os_admin.routers_client.show_router(
             self.router['id'])
         if admin['router'].get('distributed', False):
             msg = "Rescheduling test does not apply to distributed routers."
@@ -825,7 +825,7 @@
         self._create_new_network()
         self._hotplug_server()
         fip, server = self.floating_ip_tuple
-        new_ports = self.admin_manager.ports_client.list_ports(
+        new_ports = self.os_admin.ports_client.list_ports(
             device_id=server["id"], network_id=self.new_net["id"])['ports']
         spoof_port = new_ports[0]
         private_key = self._get_server_key(server)
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index 731aae8..3504a44 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -146,7 +146,7 @@
         """
         ports = [
             p["mac_address"] for p in
-            self.admin_manager.ports_client.list_ports(
+            self.os_admin.ports_client.list_ports(
                 device_id=sid, network_id=network_id)['ports']
         ]
 
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index d82d7b5..41c60f1 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -170,7 +170,7 @@
 
         cls.floating_ips = {}
         cls.tenants = {}
-        cls.primary_tenant = cls.TenantProperties(cls.os)
+        cls.primary_tenant = cls.TenantProperties(cls.os_primary)
         cls.alt_tenant = cls.TenantProperties(cls.os_alt)
         for tenant in [cls.primary_tenant, cls.alt_tenant]:
             cls.tenants[tenant.creds.tenant_id] = tenant
@@ -223,7 +223,7 @@
         # Checks that we see the newly created network/subnet/router via
         # checking the result of list_[networks,routers,subnets]
         # Check that (router, subnet) couple exist in port_list
-        seen_nets = self.admin_manager.networks_client.list_networks()
+        seen_nets = self.os_admin.networks_client.list_networks()
         seen_names = [n['name'] for n in seen_nets['networks']]
         seen_ids = [n['id'] for n in seen_nets['networks']]
 
@@ -232,13 +232,13 @@
 
         seen_subnets = [
             (n['id'], n['cidr'], n['network_id']) for n in
-            self.admin_manager.subnets_client.list_subnets()['subnets']
+            self.os_admin.subnets_client.list_subnets()['subnets']
         ]
         mysubnet = (tenant.subnet['id'], tenant.subnet['cidr'],
                     tenant.network['id'])
         self.assertIn(mysubnet, seen_subnets)
 
-        seen_routers = self.admin_manager.routers_client.list_routers()
+        seen_routers = self.os_admin.routers_client.list_routers()
         seen_router_ids = [n['id'] for n in seen_routers['routers']]
         seen_router_names = [n['name'] for n in seen_routers['routers']]
 
@@ -248,7 +248,7 @@
         myport = (tenant.router['id'], tenant.subnet['id'])
         router_ports = [
             (i['device_id'], f['subnet_id'])
-            for i in self.admin_manager.ports_client.list_ports(
+            for i in self.os_admin.ports_client.list_ports(
                 device_id=tenant.router['id'])['ports']
             if net_info.is_router_interface_port(i)
             for f in i['fixed_ips']
@@ -281,7 +281,7 @@
 
         # Verify servers are on different compute nodes
         if self.multi_node:
-            adm_get_server = self.admin_manager.servers_client.show_server
+            adm_get_server = self.os_admin.servers_client.show_server
             new_host = adm_get_server(server["id"])["server"][
                 "OS-EXT-SRV-ATTR:host"]
             host_list = [adm_get_server(s)["server"]["OS-EXT-SRV-ATTR:host"]
@@ -449,7 +449,7 @@
         mac_addr = mac_addr.strip().lower()
         # Get the fixed_ips and mac_address fields of all ports. Select
         # only those two columns to reduce the size of the response.
-        port_list = self.admin_manager.ports_client.list_ports(
+        port_list = self.os_admin.ports_client.list_ports(
             fields=['fixed_ips', 'mac_address'])['ports']
         port_detail_list = [
             (port['fixed_ips'][0]['subnet_id'],
@@ -543,7 +543,7 @@
                                            dest=self._get_server_ip(server),
                                            should_succeed=False)
             server_id = server['id']
-            port_id = self.admin_manager.ports_client.list_ports(
+            port_id = self.os_admin.ports_client.list_ports(
                 device_id=server_id)['ports'][0]['id']
 
             # update port with new security group and check connectivity
@@ -607,7 +607,7 @@
 
         access_point_ssh = self._connect_to_access_point(new_tenant)
         server_id = server['id']
-        port_id = self.admin_manager.ports_client.list_ports(
+        port_id = self.os_admin.ports_client.list_ports(
             device_id=server_id)['ports'][0]['id']
 
         # Flip the port's port security and check connectivity
@@ -649,7 +649,7 @@
         sec_groups = []
         server = self._create_server(name, tenant, sec_groups)
         server_id = server['id']
-        ports = self.admin_manager.ports_client.list_ports(
+        ports = self.os_admin.ports_client.list_ports(
             device_id=server_id)['ports']
         self.assertEqual(1, len(ports))
         for port in ports:
diff --git a/tempest/scenario/test_server_multinode.py b/tempest/scenario/test_server_multinode.py
index d9bff09..15f57d4 100644
--- a/tempest/scenario/test_server_multinode.py
+++ b/tempest/scenario/test_server_multinode.py
@@ -39,10 +39,10 @@
     def setup_clients(cls):
         super(TestServerMultinode, cls).setup_clients()
         # Use admin client by default
-        cls.manager = cls.admin_manager
+        cls.manager = cls.os_admin
         # this is needed so that we can use the availability_zone:host
         # scheduler hint, which is admin_only by default
-        cls.servers_client = cls.admin_manager.servers_client
+        cls.servers_client = cls.os_admin.servers_client
 
     @decorators.idempotent_id('9cecbe35-b9d4-48da-a37e-7ce70aa43d30')
     @decorators.attr(type='smoke')
diff --git a/tempest/test.py b/tempest/test.py
index e8108f4..f07c071 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -373,9 +373,9 @@
     @classmethod
     def resource_setup(cls):
         """Class level resource setup for test cases."""
-        if hasattr(cls, "os"):
+        if hasattr(cls, "os_primary"):
             cls.validation_resources = vresources.create_validation_resources(
-                cls.os, cls.validation_resources)
+                cls.os_primary, cls.validation_resources)
         else:
             LOG.warning("Client manager not found, validation resources not"
                         " created")
@@ -388,8 +388,8 @@
         resources, in case a failure during `resource_setup` should happen.
         """
         if cls.validation_resources:
-            if hasattr(cls, "os"):
-                vresources.clear_validation_resources(cls.os,
+            if hasattr(cls, "os_primary"):
+                vresources.clear_validation_resources(cls.os_primary,
                                                       cls.validation_resources)
                 cls.validation_resources = {}
             else: