Merge "Remove unused _get_file_size()"
diff --git a/releasenotes/notes/routers-client-as-library-25a363379da351f6.yaml b/releasenotes/notes/routers-client-as-library-25a363379da351f6.yaml
new file mode 100644
index 0000000..35cf2c4
--- /dev/null
+++ b/releasenotes/notes/routers-client-as-library-25a363379da351f6.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - Define routers_client as stable library interface.
+    The routers_client module is defined as library interface,
+    so the other projects can use the module as stable library
+    without any maintenance changes.
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 0724566..427a748 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -19,6 +19,7 @@
 from tempest.common.utils import data_utils
 from tempest.common import waiters
 from tempest import config
+from tempest import exceptions
 from tempest import test
 
 CONF = config.CONF
@@ -36,7 +37,17 @@
     @classmethod
     def setup_clients(cls):
         super(ImagesMetadataTestJSON, cls).setup_clients()
-        cls.glance_client = cls.os.image_client
+        # Check if glance v1 is available to determine which client to use. We
+        # prefer glance v1 for the compute API tests since the compute image
+        # API proxy was written for glance v1.
+        if CONF.image_feature_enabled.api_v1:
+            cls.glance_client = cls.os.image_client
+        elif CONF.image_feature_enabled.api_v2:
+            cls.glance_client = cls.os.image_client_v2
+        else:
+            raise exceptions.InvalidConfiguration(
+                'Either api_v1 or api_v2 must be True in '
+                '[image-feature-enabled].')
         cls.client = cls.compute_images_client
 
     @classmethod
@@ -45,14 +56,22 @@
         cls.image_id = None
 
         name = data_utils.rand_name('image')
+        if CONF.image_feature_enabled.api_v1:
+            kwargs = dict(is_public=False)
+        else:
+            kwargs = dict(visibility='private')
         body = cls.glance_client.create_image(name=name,
                                               container_format='bare',
                                               disk_format='raw',
-                                              is_public=False)['image']
+                                              **kwargs)
+        body = body['image'] if 'image' in body else body
         cls.image_id = body['id']
         cls.images.append(cls.image_id)
         image_file = six.StringIO(('*' * 1024))
-        cls.glance_client.update_image(cls.image_id, data=image_file)
+        if CONF.image_feature_enabled.api_v1:
+            cls.glance_client.update_image(cls.image_id, data=image_file)
+        else:
+            cls.glance_client.store_image_file(cls.image_id, data=image_file)
         waiters.wait_for_image_status(cls.client, cls.image_id, 'ACTIVE')
 
     def setUp(self):
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index af840cc..e74ca67 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -22,6 +22,7 @@
 from tempest.common.utils import data_utils
 from tempest.common import waiters
 from tempest import config
+from tempest import exceptions
 from tempest import test
 
 CONF = config.CONF
@@ -40,7 +41,17 @@
     def setup_clients(cls):
         super(ListImageFiltersTestJSON, cls).setup_clients()
         cls.client = cls.compute_images_client
-        cls.glance_client = cls.os.image_client
+        # Check if glance v1 is available to determine which client to use. We
+        # prefer glance v1 for the compute API tests since the compute image
+        # API proxy was written for glance v1.
+        if CONF.image_feature_enabled.api_v1:
+            cls.glance_client = cls.os.image_client
+        elif CONF.image_feature_enabled.api_v2:
+            cls.glance_client = cls.os.image_client_v2
+        else:
+            raise exceptions.InvalidConfiguration(
+                'Either api_v1 or api_v2 must be True in '
+                '[image-feature-enabled].')
 
     @classmethod
     def resource_setup(cls):
@@ -48,17 +59,25 @@
 
         def _create_image():
             name = data_utils.rand_name('image')
+            if CONF.image_feature_enabled.api_v1:
+                kwargs = dict(is_public=False)
+            else:
+                kwargs = dict(visibility='private')
             body = cls.glance_client.create_image(name=name,
                                                   container_format='bare',
                                                   disk_format='raw',
-                                                  is_public=False)['image']
+                                                  **kwargs)
+            body = body['image'] if 'image' in body else body
             image_id = body['id']
             cls.images.append(image_id)
             # Wait 1 second between creation and upload to ensure a delta
             # between created_at and updated_at.
             time.sleep(1)
             image_file = six.StringIO(('*' * 1024))
-            cls.glance_client.update_image(image_id, data=image_file)
+            if CONF.image_feature_enabled.api_v1:
+                cls.glance_client.update_image(image_id, data=image_file)
+            else:
+                cls.glance_client.store_image_file(image_id, data=image_file)
             waiters.wait_for_image_status(cls.client, image_id, 'ACTIVE')
             body = cls.client.show_image(image_id)['image']
             return body
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 66aec84..3a4428a 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -24,6 +24,7 @@
 from tempest.common.utils.linux import remote_client
 from tempest.common import waiters
 from tempest import config
+from tempest import exceptions
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
 from tempest import test
@@ -320,6 +321,19 @@
     def test_create_backup(self):
         # Positive test:create backup successfully and rotate backups correctly
         # create the first and the second backup
+
+        # Check if glance v1 is available to determine which client to use. We
+        # prefer glance v1 for the compute API tests since the compute image
+        # API proxy was written for glance v1.
+        if CONF.image_feature_enabled.api_v1:
+            glance_client = self.os.image_client
+        elif CONF.image_feature_enabled.api_v2:
+            glance_client = self.os.image_client_v2
+        else:
+            raise exceptions.InvalidConfiguration(
+                'Either api_v1 or api_v2 must be True in '
+                '[image-feature-enabled].')
+
         backup1 = data_utils.rand_name('backup-1')
         resp = self.client.create_backup(self.server_id,
                                          backup_type='daily',
@@ -331,7 +345,7 @@
         def _clean_oldest_backup(oldest_backup):
             if oldest_backup_exist:
                 try:
-                    self.os.image_client.delete_image(oldest_backup)
+                    glance_client.delete_image(oldest_backup)
                 except lib_exc.NotFound:
                     pass
                 else:
@@ -341,7 +355,7 @@
 
         image1_id = data_utils.parse_image_id(resp['location'])
         self.addCleanup(_clean_oldest_backup, image1_id)
-        waiters.wait_for_image_status(self.os.image_client,
+        waiters.wait_for_image_status(glance_client,
                                       image1_id, 'active')
 
         backup2 = data_utils.rand_name('backup-2')
@@ -351,8 +365,8 @@
                                          rotation=2,
                                          name=backup2).response
         image2_id = data_utils.parse_image_id(resp['location'])
-        self.addCleanup(self.os.image_client.delete_image, image2_id)
-        waiters.wait_for_image_status(self.os.image_client,
+        self.addCleanup(glance_client.delete_image, image2_id)
+        waiters.wait_for_image_status(glance_client,
                                       image2_id, 'active')
 
         # verify they have been created
@@ -361,12 +375,20 @@
             'backup_type': "daily",
             'instance_uuid': self.server_id,
         }
-        image_list = self.os.image_client.list_images(
-            detail=True,
-            properties=properties,
-            status='active',
-            sort_key='created_at',
-            sort_dir='asc')['images']
+        if CONF.image_feature_enabled.api_v1:
+            params = dict(
+                properties=properties, status='active',
+                sort_key='created_at', sort_dir='asc',)
+            image_list = glance_client.list_images(
+                detail=True,
+                **params)['images']
+        else:
+            # Additional properties are flattened in glance v2.
+            params = dict(
+                status='active', sort_key='created_at', sort_dir='asc')
+            params.update(properties)
+            image_list = glance_client.list_images(params)['images']
+
         self.assertEqual(2, len(image_list))
         self.assertEqual((backup1, backup2),
                          (image_list[0]['name'], image_list[1]['name']))
@@ -380,17 +402,16 @@
                                          rotation=2,
                                          name=backup3).response
         image3_id = data_utils.parse_image_id(resp['location'])
-        self.addCleanup(self.os.image_client.delete_image, image3_id)
+        self.addCleanup(glance_client.delete_image, image3_id)
         # the first back up should be deleted
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
-        self.os.image_client.wait_for_resource_deletion(image1_id)
+        glance_client.wait_for_resource_deletion(image1_id)
         oldest_backup_exist = False
-        image_list = self.os.image_client.list_images(
-            detail=True,
-            properties=properties,
-            status='active',
-            sort_key='created_at',
-            sort_dir='asc')['images']
+        if CONF.image_feature_enabled.api_v1:
+            image_list = glance_client.list_images(
+                detail=True, **params)['images']
+        else:
+            image_list = glance_client.list_images(params)['images']
         self.assertEqual(2, len(image_list),
                          'Unexpected number of images for '
                          'v2:test_create_backup; was the oldest backup not '
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 398a0b8..ba416e4 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -303,7 +303,7 @@
             )
 
         test_routes.sort(key=lambda x: x['destination'])
-        extra_route = self.routers_client.update_extra_routes(
+        extra_route = self.routers_client.update_router(
             router['id'], routes=test_routes)
         show_body = self.routers_client.show_router(router['id'])
         # Assert the number of routes
@@ -325,13 +325,13 @@
                              routes[i]['destination'])
             self.assertEqual(test_routes[i]['nexthop'], routes[i]['nexthop'])
 
-        self.routers_client.delete_extra_routes(router['id'])
+        self._delete_extra_routes(router['id'])
         show_body_after_deletion = self.routers_client.show_router(
             router['id'])
         self.assertEmpty(show_body_after_deletion['router']['routes'])
 
     def _delete_extra_routes(self, router_id):
-        self.routers_client.delete_extra_routes(router_id)
+        self.routers_client.update_router(router_id, routes=None)
 
     @test.idempotent_id('a8902683-c788-4246-95c7-ad9c6d63a4d9')
     def test_update_router_admin_state(self):
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 38913ce..76cd36c 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -18,6 +18,7 @@
 from tempest.common.utils import data_utils
 from tempest.common import waiters
 from tempest import config
+from tempest import exceptions
 from tempest.lib.common.utils import test_utils
 from tempest import test
 
@@ -30,7 +31,16 @@
     def setup_clients(cls):
         super(VolumesV2ActionsTest, cls).setup_clients()
         cls.client = cls.volumes_client
-        cls.image_client = cls.os.image_client
+        if CONF.service_available.glance:
+            # Check if glance v1 is available to determine which client to use.
+            if CONF.image_feature_enabled.api_v1:
+                cls.image_client = cls.os.image_client
+            elif CONF.image_feature_enabled.api_v2:
+                cls.image_client = cls.os.image_client_v2
+            else:
+                raise exceptions.InvalidConfiguration(
+                    'Either api_v1 or api_v2 must be True in '
+                    '[image-feature-enabled].')
 
     @classmethod
     def resource_setup(cls):
diff --git a/tempest/clients.py b/tempest/clients.py
index 19f1a2a..bc56710 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -88,6 +88,7 @@
 from tempest.lib.services.network.ports_client import PortsClient
 from tempest.lib.services.network.quotas_client import QuotasClient \
     as NetworkQuotasClient
+from tempest.lib.services.network.routers_client import RoutersClient
 from tempest.lib.services.network.security_group_rules_client import \
     SecurityGroupRulesClient
 from tempest.lib.services.network.security_groups_client import \
@@ -133,7 +134,6 @@
 from tempest.services.image.v1.json.images_client import ImagesClient
 from tempest.services.image.v2.json.images_client import \
     ImagesClient as ImagesV2Client
-from tempest.services.network.json.routers_client import RoutersClient
 from tempest.services.object_storage.account_client import AccountClient
 from tempest.services.object_storage.container_client import ContainerClient
 from tempest.services.object_storage.object_client import ObjectClient
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index 5fab961..94a646a 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -98,12 +98,12 @@
 from tempest.lib.common.utils import data_utils
 import tempest.lib.exceptions
 from tempest.lib.services.network import networks_client
+from tempest.lib.services.network import routers_client
 from tempest.lib.services.network import subnets_client
 from tempest.services.identity.v2.json import identity_client
 from tempest.services.identity.v2.json import roles_client
 from tempest.services.identity.v2.json import tenants_client
 from tempest.services.identity.v2.json import users_client
-from tempest.services.network.json import routers_client
 
 LOG = None
 CONF = config.CONF
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index f2a69c7..6a65fcb 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -128,13 +128,13 @@
 from tempest.lib.services.compute import servers_client
 from tempest.lib.services.network import networks_client
 from tempest.lib.services.network import ports_client
+from tempest.lib.services.network import routers_client
 from tempest.lib.services.network import subnets_client
 from tempest.services.identity.v2.json import identity_client
 from tempest.services.identity.v2.json import roles_client
 from tempest.services.identity.v2.json import tenants_client
 from tempest.services.identity.v2.json import users_client
 from tempest.services.image.v2.json import images_client
-from tempest.services.network.json import routers_client
 from tempest.services.object_storage import container_client
 from tempest.services.object_storage import object_client
 from tempest.services.volume.v1.json import volumes_client
diff --git a/tempest/hacking/ignored_list_T110.txt b/tempest/hacking/ignored_list_T110.txt
index 4ef9012..be875ee 100644
--- a/tempest/hacking/ignored_list_T110.txt
+++ b/tempest/hacking/ignored_list_T110.txt
@@ -2,4 +2,3 @@
 ./tempest/services/volume/base/base_qos_client.py
 ./tempest/services/volume/base/base_backups_client.py
 ./tempest/services/baremetal/base.py
-./tempest/services/network/json/routers_client.py
diff --git a/tempest/services/network/json/routers_client.py b/tempest/lib/services/network/routers_client.py
similarity index 79%
rename from tempest/services/network/json/routers_client.py
rename to tempest/lib/services/network/routers_client.py
index 22f5a37..78ffa77 100644
--- a/tempest/services/network/json/routers_client.py
+++ b/tempest/lib/services/network/routers_client.py
@@ -42,25 +42,6 @@
         uri = '/routers'
         return self.list_resources(uri, **filters)
 
-    def update_extra_routes(self, router_id, **kwargs):
-        """Update Extra routes.
-
-        Available params: see http://developer.openstack.org/
-                              api-ref-networking-v2-ext.html#updateExtraRoutes
-        """
-        uri = '/routers/%s' % router_id
-        put_body = {'router': kwargs}
-        return self.update_resource(uri, put_body)
-
-    def delete_extra_routes(self, router_id):
-        uri = '/routers/%s' % router_id
-        put_body = {
-            'router': {
-                'routes': None
-            }
-        }
-        return self.update_resource(uri, put_body)
-
     def add_router_interface(self, router_id, **kwargs):
         """Add router interface.
 
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 8d0f2f6..bab875d 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -50,8 +50,15 @@
         cls.compute_floating_ips_client = (
             cls.manager.compute_floating_ips_client)
         if CONF.service_available.glance:
-            # Glance image client v1
-            cls.image_client = cls.manager.image_client
+            # Check if glance v1 is available to determine which client to use.
+            if CONF.image_feature_enabled.api_v1:
+                cls.image_client = cls.manager.image_client
+            elif CONF.image_feature_enabled.api_v2:
+                cls.image_client = cls.manager.image_client_v2
+            else:
+                raise exceptions.InvalidConfiguration(
+                    'Either api_v1 or api_v2 must be True in '
+                    '[image-feature-enabled].')
         # Compute image client
         cls.compute_images_client = cls.manager.compute_images_client
         cls.keypairs_client = cls.manager.keypairs_client
@@ -376,14 +383,23 @@
             'name': name,
             'container_format': fmt,
             'disk_format': disk_format or fmt,
-            'is_public': 'False',
         }
-        params['properties'] = properties
-        image = self.image_client.create_image(**params)['image']
+        if CONF.image_feature_enabled.api_v1:
+            params['is_public'] = 'False'
+            params['properties'] = properties
+        else:
+            params['visibility'] = 'private'
+            # Additional properties are flattened out in the v2 API.
+            params.update(properties)
+        body = self.image_client.create_image(**params)
+        image = body['image'] if 'image' in body else body
         self.addCleanup(self.image_client.delete_image, image['id'])
         self.assertEqual("queued", image['status'])
         with open(path, 'rb') as image_file:
-            self.image_client.update_image(image['id'], data=image_file)
+            if CONF.image_feature_enabled.api_v1:
+                self.image_client.update_image(image['id'], data=image_file)
+            else:
+                self.image_client.store_image_file(image['id'], image_file)
         return image['id']
 
     def glance_image_create(self):
@@ -450,9 +466,16 @@
             thing_id=image_id, thing_id_param='id',
             cleanup_callable=test_utils.call_and_ignore_notfound_exc,
             cleanup_args=[_image_client.delete_image, image_id])
-        snapshot_image = _image_client.check_image(image_id)
+        if CONF.image_feature_enabled.api_v1:
+            # In glance v1 the additional properties are stored in the headers.
+            snapshot_image = _image_client.check_image(image_id)
+            image_props = snapshot_image.get('properties', {})
+        else:
+            # In glance v2 the additional properties are flattened.
+            snapshot_image = _image_client.show_image(image_id)
+            image_props = snapshot_image
 
-        bdm = snapshot_image.get('properties', {}).get('block_device_mapping')
+        bdm = image_props.get('block_device_mapping')
         if bdm:
             bdm = json.loads(bdm)
             if bdm and 'snapshot_id' in bdm[0]:
diff --git a/tempest/services/network/json/__init__.py b/tempest/services/network/json/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/network/json/__init__.py
+++ /dev/null
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index f025418..a7a3a22 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -23,6 +23,7 @@
 from tempest.lib.common import rest_client
 from tempest.lib.services.identity.v2 import token_client as v2_token_client
 from tempest.lib.services.identity.v3 import token_client as v3_token_client
+from tempest.lib.services.network import routers_client
 from tempest.services.identity.v2.json import identity_client as v2_iden_client
 from tempest.services.identity.v2.json import roles_client as v2_roles_client
 from tempest.services.identity.v2.json import tenants_client as \
@@ -34,7 +35,6 @@
     v3_projects_client
 from tempest.services.identity.v3.json import roles_client as v3_roles_client
 from tempest.services.identity.v3.json import users_clients as v3_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 fake_http
@@ -333,7 +333,7 @@
         self._mock_subnet_create(creds, '1234', 'fake_subnet')
         self._mock_router_create('1234', 'fake_router')
         router_interface_mock = self.patch(
-            'tempest.services.network.json.routers_client.RoutersClient.'
+            'tempest.lib.services.network.routers_client.RoutersClient.'
             'add_router_interface')
         primary_creds = creds.get_primary_creds()
         router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
@@ -365,7 +365,7 @@
         self._mock_subnet_create(creds, '1234', 'fake_subnet')
         self._mock_router_create('1234', 'fake_router')
         router_interface_mock = self.patch(
-            'tempest.services.network.json.routers_client.RoutersClient.'
+            'tempest.lib.services.network.routers_client.RoutersClient.'
             'add_router_interface')
         creds.get_primary_creds()
         router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
@@ -397,7 +397,7 @@
         router = mock.patch.object(creds.routers_admin_client, 'delete_router')
         router_mock = router.start()
         remove_router_interface_mock = self.patch(
-            'tempest.services.network.json.routers_client.RoutersClient.'
+            'tempest.lib.services.network.routers_client.RoutersClient.'
             'remove_router_interface')
         return_values = ({'status': 200}, {'ports': []})
         port_list_mock = mock.patch.object(creds.ports_admin_client,
@@ -468,7 +468,7 @@
         self._mock_subnet_create(creds, '1234', 'fake_alt_subnet')
         self._mock_router_create('1234', 'fake_alt_router')
         router_interface_mock = self.patch(
-            'tempest.services.network.json.routers_client.RoutersClient.'
+            'tempest.lib.services.network.routers_client.RoutersClient.'
             'add_router_interface')
         alt_creds = creds.get_alt_creds()
         router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
@@ -492,7 +492,7 @@
         self._mock_subnet_create(creds, '1234', 'fake_admin_subnet')
         self._mock_router_create('1234', 'fake_admin_router')
         router_interface_mock = self.patch(
-            'tempest.services.network.json.routers_client.RoutersClient.'
+            'tempest.lib.services.network.routers_client.RoutersClient.'
             'add_router_interface')
         self._mock_list_roles('123456', 'admin')
         admin_creds = creds.get_admin_creds()
diff --git a/tempest/tests/lib/services/compute/base.py b/tempest/tests/lib/services/base.py
similarity index 97%
rename from tempest/tests/lib/services/compute/base.py
rename to tempest/tests/lib/services/base.py
index e77b436..a244aa2 100644
--- a/tempest/tests/lib/services/compute/base.py
+++ b/tempest/tests/lib/services/base.py
@@ -19,7 +19,7 @@
 from tempest.tests.lib import fake_http
 
 
-class BaseComputeServiceTest(base.TestCase):
+class BaseServiceTest(base.TestCase):
     def create_response(self, body, to_utf=False, status=200, headers=None):
         json_body = {}
         if body:
diff --git a/tempest/tests/lib/services/compute/test_agents_client.py b/tempest/tests/lib/services/compute/test_agents_client.py
index 3c5043d..880220e 100644
--- a/tempest/tests/lib/services/compute/test_agents_client.py
+++ b/tempest/tests/lib/services/compute/test_agents_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import agents_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestAgentsClient(base.BaseComputeServiceTest):
+class TestAgentsClient(base.BaseServiceTest):
     FAKE_CREATE_AGENT = {
         "agent": {
             "url": "http://foo.com",
diff --git a/tempest/tests/lib/services/compute/test_aggregates_client.py b/tempest/tests/lib/services/compute/test_aggregates_client.py
index a63380e..674d92a 100644
--- a/tempest/tests/lib/services/compute/test_aggregates_client.py
+++ b/tempest/tests/lib/services/compute/test_aggregates_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import aggregates_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestAggregatesClient(base.BaseComputeServiceTest):
+class TestAggregatesClient(base.BaseServiceTest):
     FAKE_SHOW_AGGREGATE = {
         "aggregate":
         {
diff --git a/tempest/tests/lib/services/compute/test_availability_zone_client.py b/tempest/tests/lib/services/compute/test_availability_zone_client.py
index d16cf0a..6608592 100644
--- a/tempest/tests/lib/services/compute/test_availability_zone_client.py
+++ b/tempest/tests/lib/services/compute/test_availability_zone_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import availability_zone_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestAvailabilityZoneClient(base.BaseComputeServiceTest):
+class TestAvailabilityZoneClient(base.BaseServiceTest):
 
     FAKE_AVAILABIRITY_ZONE_INFO = {
         "availabilityZoneInfo":
diff --git a/tempest/tests/lib/services/compute/test_baremetal_nodes_client.py b/tempest/tests/lib/services/compute/test_baremetal_nodes_client.py
index a867c06..81c54b5 100644
--- a/tempest/tests/lib/services/compute/test_baremetal_nodes_client.py
+++ b/tempest/tests/lib/services/compute/test_baremetal_nodes_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import baremetal_nodes_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestBareMetalNodesClient(base.BaseComputeServiceTest):
+class TestBareMetalNodesClient(base.BaseServiceTest):
 
     FAKE_NODE_INFO = {'cpus': '8',
                       'disk_gb': '64',
diff --git a/tempest/tests/lib/services/compute/test_base_compute_client.py b/tempest/tests/lib/services/compute/test_base_compute_client.py
index 49d29b3..69e8542 100644
--- a/tempest/tests/lib/services/compute/test_base_compute_client.py
+++ b/tempest/tests/lib/services/compute/test_base_compute_client.py
@@ -19,10 +19,10 @@
 from tempest.lib.services.compute import base_compute_client
 from tempest.tests.lib import fake_auth_provider
 from tempest.tests.lib import fake_http
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestMicroversionHeaderCheck(base.BaseComputeServiceTest):
+class TestMicroversionHeaderCheck(base.BaseServiceTest):
 
     def setUp(self):
         super(TestMicroversionHeaderCheck, self).setUp()
@@ -72,7 +72,7 @@
         return self.get_schema(self.schema_versions_info)
 
 
-class TestSchemaVersionsNone(base.BaseComputeServiceTest):
+class TestSchemaVersionsNone(base.BaseServiceTest):
     api_microversion = None
     expected_schema = 'schemav21'
 
@@ -130,7 +130,7 @@
         return self.get_schema(self.schema_versions_info)
 
 
-class TestSchemaVersionsNotFound(base.BaseComputeServiceTest):
+class TestSchemaVersionsNotFound(base.BaseServiceTest):
     api_microversion = '2.10'
     expected_schema = 'schemav210'
 
@@ -149,7 +149,7 @@
                           self.client.return_selected_schema)
 
 
-class TestClientWithoutMicroversionHeader(base.BaseComputeServiceTest):
+class TestClientWithoutMicroversionHeader(base.BaseServiceTest):
 
     def setUp(self):
         super(TestClientWithoutMicroversionHeader, self).setUp()
@@ -172,7 +172,7 @@
             self.client.get('fake_url')
 
 
-class TestClientWithMicroversionHeader(base.BaseComputeServiceTest):
+class TestClientWithMicroversionHeader(base.BaseServiceTest):
 
     def setUp(self):
         super(TestClientWithMicroversionHeader, self).setUp()
diff --git a/tempest/tests/lib/services/compute/test_certificates_client.py b/tempest/tests/lib/services/compute/test_certificates_client.py
index e8123bb..9faef6f 100644
--- a/tempest/tests/lib/services/compute/test_certificates_client.py
+++ b/tempest/tests/lib/services/compute/test_certificates_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import certificates_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestCertificatesClient(base.BaseComputeServiceTest):
+class TestCertificatesClient(base.BaseServiceTest):
 
     FAKE_CERTIFICATE = {
         "certificate": {
diff --git a/tempest/tests/lib/services/compute/test_extensions_client.py b/tempest/tests/lib/services/compute/test_extensions_client.py
index 7415988..d7e217e 100644
--- a/tempest/tests/lib/services/compute/test_extensions_client.py
+++ b/tempest/tests/lib/services/compute/test_extensions_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import extensions_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestExtensionsClient(base.BaseComputeServiceTest):
+class TestExtensionsClient(base.BaseServiceTest):
 
     FAKE_SHOW_EXTENSION = {
         "extension": {
diff --git a/tempest/tests/lib/services/compute/test_fixedIPs_client.py b/tempest/tests/lib/services/compute/test_fixedIPs_client.py
index 6999f24..65bda45 100644
--- a/tempest/tests/lib/services/compute/test_fixedIPs_client.py
+++ b/tempest/tests/lib/services/compute/test_fixedIPs_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import fixed_ips_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestFixedIPsClient(base.BaseComputeServiceTest):
+class TestFixedIPsClient(base.BaseServiceTest):
     FIXED_IP_INFO = {"fixed_ip": {"address": "10.0.0.1",
                                   "cidr": "10.11.12.0/24",
                                   "host": "localhost",
diff --git a/tempest/tests/lib/services/compute/test_flavors_client.py b/tempest/tests/lib/services/compute/test_flavors_client.py
index e22b4fe..445ee22 100644
--- a/tempest/tests/lib/services/compute/test_flavors_client.py
+++ b/tempest/tests/lib/services/compute/test_flavors_client.py
@@ -20,10 +20,10 @@
 from tempest.lib.services.compute import flavors_client
 from tempest.tests.lib import fake_auth_provider
 from tempest.tests.lib import fake_http
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestFlavorsClient(base.BaseComputeServiceTest):
+class TestFlavorsClient(base.BaseServiceTest):
 
     FAKE_FLAVOR = {
         "disk": 1,
diff --git a/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py b/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py
index f30719e..b0c00f0 100644
--- a/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py
+++ b/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import floating_ip_pools_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestFloatingIPPoolsClient(base.BaseComputeServiceTest):
+class TestFloatingIPPoolsClient(base.BaseServiceTest):
 
     FAKE_FLOATING_IP_POOLS = {
         "floating_ip_pools":
diff --git a/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py b/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py
index c16c985..ace76f8 100644
--- a/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py
+++ b/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py
@@ -15,10 +15,10 @@
 from tempest.tests.lib import fake_auth_provider
 
 from tempest.lib.services.compute import floating_ips_bulk_client
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestFloatingIPsBulkClient(base.BaseComputeServiceTest):
+class TestFloatingIPsBulkClient(base.BaseServiceTest):
 
     FAKE_FIP_BULK_LIST = {"floating_ip_info": [{
         "address": "10.10.10.1",
diff --git a/tempest/tests/lib/services/compute/test_floating_ips_client.py b/tempest/tests/lib/services/compute/test_floating_ips_client.py
index 3844ba8..92737f2 100644
--- a/tempest/tests/lib/services/compute/test_floating_ips_client.py
+++ b/tempest/tests/lib/services/compute/test_floating_ips_client.py
@@ -17,10 +17,10 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.compute import floating_ips_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestFloatingIpsClient(base.BaseComputeServiceTest):
+class TestFloatingIpsClient(base.BaseServiceTest):
 
     floating_ip = {"fixed_ip": None,
                    "id": "46d61064-13ba-4bf0-9557-69de824c3d6f",
diff --git a/tempest/tests/lib/services/compute/test_hosts_client.py b/tempest/tests/lib/services/compute/test_hosts_client.py
index d9ff513..78537c2 100644
--- a/tempest/tests/lib/services/compute/test_hosts_client.py
+++ b/tempest/tests/lib/services/compute/test_hosts_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import hosts_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestHostsClient(base.BaseComputeServiceTest):
+class TestHostsClient(base.BaseServiceTest):
     FAKE_HOST_DATA = {
         "host": {
             "resource": {
diff --git a/tempest/tests/lib/services/compute/test_hypervisor_client.py b/tempest/tests/lib/services/compute/test_hypervisor_client.py
index fab34da..89eb698 100644
--- a/tempest/tests/lib/services/compute/test_hypervisor_client.py
+++ b/tempest/tests/lib/services/compute/test_hypervisor_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import hypervisor_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestHypervisorClient(base.BaseComputeServiceTest):
+class TestHypervisorClient(base.BaseServiceTest):
 
     hypervisor_id = "1"
     hypervisor_name = "hyper.hostname.com"
diff --git a/tempest/tests/lib/services/compute/test_images_client.py b/tempest/tests/lib/services/compute/test_images_client.py
index 3ebc27f..a9a570d 100644
--- a/tempest/tests/lib/services/compute/test_images_client.py
+++ b/tempest/tests/lib/services/compute/test_images_client.py
@@ -19,10 +19,10 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.compute import images_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestImagesClient(base.BaseComputeServiceTest):
+class TestImagesClient(base.BaseServiceTest):
     # Data Dictionaries used for testing #
     FAKE_IMAGE_METADATA = {
         "list":
diff --git a/tempest/tests/lib/services/compute/test_instance_usage_audit_log_client.py b/tempest/tests/lib/services/compute/test_instance_usage_audit_log_client.py
index e8c22f1..21764ff 100644
--- a/tempest/tests/lib/services/compute/test_instance_usage_audit_log_client.py
+++ b/tempest/tests/lib/services/compute/test_instance_usage_audit_log_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import instance_usage_audit_log_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestInstanceUsagesAuditLogClient(base.BaseComputeServiceTest):
+class TestInstanceUsagesAuditLogClient(base.BaseServiceTest):
 
     FAKE_AUDIT_LOG = {
         "hosts_not_run": [
diff --git a/tempest/tests/lib/services/compute/test_interfaces_client.py b/tempest/tests/lib/services/compute/test_interfaces_client.py
index de8e268..4d78103 100644
--- a/tempest/tests/lib/services/compute/test_interfaces_client.py
+++ b/tempest/tests/lib/services/compute/test_interfaces_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import interfaces_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestInterfacesClient(base.BaseComputeServiceTest):
+class TestInterfacesClient(base.BaseServiceTest):
     # Data Values to be used for testing #
     FAKE_INTERFACE_DATA = {
         "fixed_ips": [{
diff --git a/tempest/tests/lib/services/compute/test_keypairs_client.py b/tempest/tests/lib/services/compute/test_keypairs_client.py
index 7c595ca..ed3b9dd 100644
--- a/tempest/tests/lib/services/compute/test_keypairs_client.py
+++ b/tempest/tests/lib/services/compute/test_keypairs_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import keypairs_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestKeyPairsClient(base.BaseComputeServiceTest):
+class TestKeyPairsClient(base.BaseServiceTest):
 
     FAKE_KEYPAIR = {"keypair": {
         "public_key": "ssh-rsa foo Generated-by-Nova",
diff --git a/tempest/tests/lib/services/compute/test_limits_client.py b/tempest/tests/lib/services/compute/test_limits_client.py
index d3f0aee..5f3fa5a 100644
--- a/tempest/tests/lib/services/compute/test_limits_client.py
+++ b/tempest/tests/lib/services/compute/test_limits_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import limits_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestLimitsClient(base.BaseComputeServiceTest):
+class TestLimitsClient(base.BaseServiceTest):
 
     def setUp(self):
         super(TestLimitsClient, self).setUp()
diff --git a/tempest/tests/lib/services/compute/test_migrations_client.py b/tempest/tests/lib/services/compute/test_migrations_client.py
index 5b1578d..be62c0c 100644
--- a/tempest/tests/lib/services/compute/test_migrations_client.py
+++ b/tempest/tests/lib/services/compute/test_migrations_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import migrations_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestMigrationsClient(base.BaseComputeServiceTest):
+class TestMigrationsClient(base.BaseServiceTest):
     FAKE_MIGRATION_INFO = {"migrations": [{
         "created_at": "2012-10-29T13:42:02",
         "dest_compute": "compute2",
diff --git a/tempest/tests/lib/services/compute/test_networks_client.py b/tempest/tests/lib/services/compute/test_networks_client.py
index 4f5c8b9..1908b57 100644
--- a/tempest/tests/lib/services/compute/test_networks_client.py
+++ b/tempest/tests/lib/services/compute/test_networks_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import networks_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestNetworksClient(base.BaseComputeServiceTest):
+class TestNetworksClient(base.BaseServiceTest):
 
     FAKE_NETWORK = {
         "bridge": None,
diff --git a/tempest/tests/lib/services/compute/test_quota_classes_client.py b/tempest/tests/lib/services/compute/test_quota_classes_client.py
index 4b67576..22d8b91 100644
--- a/tempest/tests/lib/services/compute/test_quota_classes_client.py
+++ b/tempest/tests/lib/services/compute/test_quota_classes_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import quota_classes_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestQuotaClassesClient(base.BaseComputeServiceTest):
+class TestQuotaClassesClient(base.BaseServiceTest):
 
     FAKE_QUOTA_CLASS_SET = {
         "injected_file_content_bytes": 10240,
diff --git a/tempest/tests/lib/services/compute/test_quotas_client.py b/tempest/tests/lib/services/compute/test_quotas_client.py
index 9f5d1f6..4c49e8d 100644
--- a/tempest/tests/lib/services/compute/test_quotas_client.py
+++ b/tempest/tests/lib/services/compute/test_quotas_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import quotas_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestQuotasClient(base.BaseComputeServiceTest):
+class TestQuotasClient(base.BaseServiceTest):
 
     FAKE_QUOTA_SET = {
         "quota_set": {
diff --git a/tempest/tests/lib/services/compute/test_security_group_default_rules_client.py b/tempest/tests/lib/services/compute/test_security_group_default_rules_client.py
index 581f7b1..86eee02 100644
--- a/tempest/tests/lib/services/compute/test_security_group_default_rules_client.py
+++ b/tempest/tests/lib/services/compute/test_security_group_default_rules_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import security_group_default_rules_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestSecurityGroupDefaultRulesClient(base.BaseComputeServiceTest):
+class TestSecurityGroupDefaultRulesClient(base.BaseServiceTest):
     FAKE_RULE = {
         "from_port": 80,
         "id": 1,
diff --git a/tempest/tests/lib/services/compute/test_security_group_rules_client.py b/tempest/tests/lib/services/compute/test_security_group_rules_client.py
index 9a7c04d..2b0a94d 100644
--- a/tempest/tests/lib/services/compute/test_security_group_rules_client.py
+++ b/tempest/tests/lib/services/compute/test_security_group_rules_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import security_group_rules_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestSecurityGroupRulesClient(base.BaseComputeServiceTest):
+class TestSecurityGroupRulesClient(base.BaseServiceTest):
 
     FAKE_SECURITY_GROUP_RULE = {
         "security_group_rule": {
diff --git a/tempest/tests/lib/services/compute/test_security_groups_client.py b/tempest/tests/lib/services/compute/test_security_groups_client.py
index 6a11c29..d293a08 100644
--- a/tempest/tests/lib/services/compute/test_security_groups_client.py
+++ b/tempest/tests/lib/services/compute/test_security_groups_client.py
@@ -17,10 +17,10 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.compute import security_groups_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestSecurityGroupsClient(base.BaseComputeServiceTest):
+class TestSecurityGroupsClient(base.BaseServiceTest):
 
     FAKE_SECURITY_GROUP_INFO = [{
         "description": "default",
diff --git a/tempest/tests/lib/services/compute/test_server_groups_client.py b/tempest/tests/lib/services/compute/test_server_groups_client.py
index cb163a8..bf03b84 100644
--- a/tempest/tests/lib/services/compute/test_server_groups_client.py
+++ b/tempest/tests/lib/services/compute/test_server_groups_client.py
@@ -17,10 +17,10 @@
 
 from tempest.lib.services.compute import server_groups_client
 from tempest.tests.lib import fake_http
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestServerGroupsClient(base.BaseComputeServiceTest):
+class TestServerGroupsClient(base.BaseServiceTest):
 
     server_group = {
         "id": "5bbcc3c4-1da2-4437-a48a-66f15b1b13f9",
diff --git a/tempest/tests/lib/services/compute/test_servers_client.py b/tempest/tests/lib/services/compute/test_servers_client.py
index 0078497..93550fd 100644
--- a/tempest/tests/lib/services/compute/test_servers_client.py
+++ b/tempest/tests/lib/services/compute/test_servers_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import servers_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestServersClient(base.BaseComputeServiceTest):
+class TestServersClient(base.BaseServiceTest):
 
     FAKE_SERVERS = {'servers': [{
         "id": "616fb98f-46ca-475e-917e-2563e5a8cd19",
diff --git a/tempest/tests/lib/services/compute/test_services_client.py b/tempest/tests/lib/services/compute/test_services_client.py
index 7add187..41da39c 100644
--- a/tempest/tests/lib/services/compute/test_services_client.py
+++ b/tempest/tests/lib/services/compute/test_services_client.py
@@ -16,10 +16,10 @@
 
 from tempest.lib.services.compute import services_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestServicesClient(base.BaseComputeServiceTest):
+class TestServicesClient(base.BaseServiceTest):
 
     FAKE_SERVICES = {
         "services":
diff --git a/tempest/tests/lib/services/compute/test_snapshots_client.py b/tempest/tests/lib/services/compute/test_snapshots_client.py
index b1d8ade..1629943 100644
--- a/tempest/tests/lib/services/compute/test_snapshots_client.py
+++ b/tempest/tests/lib/services/compute/test_snapshots_client.py
@@ -17,10 +17,10 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.compute import snapshots_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestSnapshotsClient(base.BaseComputeServiceTest):
+class TestSnapshotsClient(base.BaseServiceTest):
 
     FAKE_SNAPSHOT = {
         "createdAt": "2015-10-02T16:27:54.724209",
diff --git a/tempest/tests/lib/services/compute/test_tenant_networks_client.py b/tempest/tests/lib/services/compute/test_tenant_networks_client.py
index cfb68cc..f71aad9 100644
--- a/tempest/tests/lib/services/compute/test_tenant_networks_client.py
+++ b/tempest/tests/lib/services/compute/test_tenant_networks_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import tenant_networks_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestTenantNetworksClient(base.BaseComputeServiceTest):
+class TestTenantNetworksClient(base.BaseServiceTest):
 
     FAKE_NETWORK = {
         "cidr": "None",
diff --git a/tempest/tests/lib/services/compute/test_tenant_usages_client.py b/tempest/tests/lib/services/compute/test_tenant_usages_client.py
index 88d093d..49eae08 100644
--- a/tempest/tests/lib/services/compute/test_tenant_usages_client.py
+++ b/tempest/tests/lib/services/compute/test_tenant_usages_client.py
@@ -14,10 +14,10 @@
 
 from tempest.lib.services.compute import tenant_usages_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestTenantUsagesClient(base.BaseComputeServiceTest):
+class TestTenantUsagesClient(base.BaseServiceTest):
 
     FAKE_SERVER_USAGES = [{
         "ended_at": None,
diff --git a/tempest/tests/lib/services/compute/test_versions_client.py b/tempest/tests/lib/services/compute/test_versions_client.py
index fc6c1d2..06ecdc3 100644
--- a/tempest/tests/lib/services/compute/test_versions_client.py
+++ b/tempest/tests/lib/services/compute/test_versions_client.py
@@ -17,10 +17,10 @@
 
 from tempest.lib.services.compute import versions_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestVersionsClient(base.BaseComputeServiceTest):
+class TestVersionsClient(base.BaseServiceTest):
 
     FAKE_INIT_VERSION = {
         "version": {
diff --git a/tempest/tests/lib/services/compute/test_volumes_client.py b/tempest/tests/lib/services/compute/test_volumes_client.py
index d16f5b0..b81cdbb 100644
--- a/tempest/tests/lib/services/compute/test_volumes_client.py
+++ b/tempest/tests/lib/services/compute/test_volumes_client.py
@@ -19,10 +19,10 @@
 from tempest.lib import exceptions as lib_exc
 from tempest.lib.services.compute import volumes_client
 from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services.compute import base
+from tempest.tests.lib.services import base
 
 
-class TestVolumesClient(base.BaseComputeServiceTest):
+class TestVolumesClient(base.BaseServiceTest):
 
     FAKE_VOLUME = {
         "id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
diff --git a/tempest/services/network/__init__.py b/tempest/tests/lib/services/network/__init__.py
similarity index 100%
rename from tempest/services/network/__init__.py
rename to tempest/tests/lib/services/network/__init__.py
diff --git a/tempest/tests/lib/services/network/test_routers_client.py b/tempest/tests/lib/services/network/test_routers_client.py
new file mode 100644
index 0000000..2fa5993
--- /dev/null
+++ b/tempest/tests/lib/services/network/test_routers_client.py
@@ -0,0 +1,109 @@
+# Copyright 2016 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.lib.services.network import routers_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestRoutersClient(base.BaseServiceTest):
+    FAKE_CREATE_ROUTER = {
+        "router": {
+            "name": u'\u2740(*\xb4\u25e1`*)\u2740',
+            "external_gateway_info": {
+                "network_id": "8ca37218-28ff-41cb-9b10-039601ea7e6b",
+                "enable_snat": True,
+                "external_fixed_ips": [
+                    {
+                        "subnet_id": "255.255.255.0",
+                        "ip": "192.168.10.1"
+                    }
+                ]
+            },
+            "admin_state_up": True,
+            "id": "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e"
+        }
+    }
+
+    FAKE_UPDATE_ROUTER = {
+        "router": {
+            "name": u'\u2740(*\xb4\u25e1`*)\u2740',
+            "external_gateway_info": {
+                "network_id": "8ca37218-28ff-41cb-9b10-039601ea7e6b",
+                "enable_snat": True,
+                "external_fixed_ips": [
+                    {
+                        "subnet_id": "255.255.255.0",
+                        "ip": "192.168.10.1"
+                    }
+                ]
+            },
+            "admin_state_up": False,
+            "id": "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e"
+        }
+    }
+
+    def setUp(self):
+        super(TestRoutersClient, self).setUp()
+        fake_auth = fake_auth_provider.FakeAuthProvider()
+        self.client = routers_client.RoutersClient(fake_auth,
+                                                   'network', 'regionOne')
+
+    def _test_list_routers(self, bytes_body=False):
+        self.check_service_client_function(
+            self.client.list_routers,
+            'tempest.lib.common.rest_client.RestClient.get',
+            {"routers": []},
+            bytes_body)
+
+    def _test_create_router(self, bytes_body=False):
+        self.check_service_client_function(
+            self.client.create_router,
+            'tempest.lib.common.rest_client.RestClient.post',
+            self.FAKE_CREATE_ROUTER,
+            bytes_body,
+            name="another_router", admin_state_up="true", status=201)
+
+    def _test_update_router(self, bytes_body=False):
+        self.check_service_client_function(
+            self.client.update_router,
+            'tempest.lib.common.rest_client.RestClient.put',
+            self.FAKE_UPDATE_ROUTER,
+            bytes_body,
+            router_id="8604a0de-7f6b-409a-a47c-a1cc7bc77b2e",
+            admin_state_up=False)
+
+    def test_list_routers_with_str_body(self):
+        self._test_list_routers()
+
+    def test_list_routers_with_bytes_body(self):
+        self._test_list_routers(bytes_body=True)
+
+    def test_create_router_with_str_body(self):
+        self._test_create_router()
+
+    def test_create_router_with_bytes_body(self):
+        self._test_create_router(bytes_body=True)
+
+    def test_delete_router(self):
+        self.check_service_client_function(
+            self.client.delete_router,
+            'tempest.lib.common.rest_client.RestClient.delete',
+            {}, router_id="1", status=204)
+
+    def test_update_router_with_str_body(self):
+        self._test_update_router()
+
+    def test_update_router_with_bytes_body(self):
+        self._test_update_router(bytes_body=True)
diff --git a/tempest/tests/services/compute/__init__.py b/tempest/tests/services/compute/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/tests/services/compute/__init__.py
+++ /dev/null