Merge "Fix _create_loginable_secgroup_rule in scenario manager"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 02609ae..3ade411 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -467,6 +467,16 @@
 #endpoint_type = publicURL
 
 
+[data_processing-feature-enabled]
+
+#
+# From tempest.config
+#
+
+# List of enabled data processing plugins (list value)
+#plugins = vanilla,hdp
+
+
 [database]
 
 #
diff --git a/requirements.txt b/requirements.txt
index 2af8586..1ce2fc5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,7 +11,7 @@
 netaddr>=0.7.12
 python-ceilometerclient>=1.0.6
 python-glanceclient>=0.15.0
-python-keystoneclient>=0.11.1
+python-keystoneclient>=1.0.0
 python-novaclient>=2.18.0
 python-neutronclient>=2.3.6,<3
 python-cinderclient>=1.1.0
@@ -25,4 +25,4 @@
 iso8601>=0.1.9
 fixtures>=0.3.14
 testscenarios>=0.4
-tempest-lib
+tempest-lib>=0.1.0
diff --git a/tempest/api/baremetal/admin/test_ports.py b/tempest/api/baremetal/admin/test_ports.py
index 3392ab9..4aedaa4 100644
--- a/tempest/api/baremetal/admin/test_ports.py
+++ b/tempest/api/baremetal/admin/test_ports.py
@@ -87,6 +87,11 @@
         self._assertExpected(self.port, port)
 
     @test.attr(type='smoke')
+    def test_show_port_by_address(self):
+        _, port = self.client.show_port_by_address(self.port['address'])
+        self._assertExpected(self.port, port['ports'][0])
+
+    @test.attr(type='smoke')
     def test_show_port_with_links(self):
         _, port = self.client.show_port(self.port['uuid'])
         self.assertIn('links', port.keys())
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 6b6c8e7..c245eb4 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -174,7 +174,7 @@
         LOG.debug('Clearing server groups: %s', ','.join(cls.server_groups))
         for server_group_id in cls.server_groups:
             try:
-                cls.client.delete_server_group(server_group_id)
+                cls.servers_client.delete_server_group(server_group_id)
             except exceptions.NotFound:
                 # The server-group may have already been deleted which is OK.
                 pass
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index e45e941..c3b144d 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -49,20 +49,20 @@
 
     def setUp(self):
         super(ImagesMetadataTestJSON, self).setUp()
-        meta = {'key1': 'value1', 'key2': 'value2'}
+        meta = {'os_version': 'value1', 'os_distro': 'value2'}
         self.client.set_image_metadata(self.image_id, meta)
 
     @test.attr(type='gate')
     def test_list_image_metadata(self):
         # All metadata key/value pairs for an image should be returned
         resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'value1', 'key2': 'value2'}
+        expected = {'os_version': 'value1', 'os_distro': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
     @test.attr(type='gate')
     def test_set_image_metadata(self):
         # The metadata for the image should match the new values
-        req_metadata = {'meta2': 'value2', 'meta3': 'value3'}
+        req_metadata = {'os_version': 'value2', 'architecture': 'value3'}
         self.client.set_image_metadata(self.image_id,
                                        req_metadata)
 
@@ -72,37 +72,39 @@
     @test.attr(type='gate')
     def test_update_image_metadata(self):
         # The metadata for the image should match the updated values
-        req_metadata = {'key1': 'alt1', 'key3': 'value3'}
+        req_metadata = {'os_version': 'alt1', 'architecture': 'value3'}
         self.client.update_image_metadata(self.image_id,
                                           req_metadata)
 
         resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt1', 'key2': 'value2', 'key3': 'value3'}
+        expected = {'os_version': 'alt1',
+                    'os_distro': 'value2',
+                    'architecture': 'value3'}
         self.assertEqual(expected, resp_metadata)
 
     @test.attr(type='gate')
     def test_get_image_metadata_item(self):
         # The value for a specific metadata key should be returned
         meta = self.client.get_image_metadata_item(self.image_id,
-                                                   'key2')
-        self.assertEqual('value2', meta['key2'])
+                                                   'os_distro')
+        self.assertEqual('value2', meta['os_distro'])
 
     @test.attr(type='gate')
     def test_set_image_metadata_item(self):
         # The value provided for the given meta item should be set for
         # the image
-        meta = {'key1': 'alt'}
+        meta = {'os_version': 'alt'}
         self.client.set_image_metadata_item(self.image_id,
-                                            'key1', meta)
+                                            'os_version', meta)
         resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key1': 'alt', 'key2': 'value2'}
+        expected = {'os_version': 'alt', 'os_distro': 'value2'}
         self.assertEqual(expected, resp_metadata)
 
     @test.attr(type='gate')
     def test_delete_image_metadata_item(self):
         # The metadata value/key pair should be deleted from the image
         self.client.delete_image_metadata_item(self.image_id,
-                                               'key1')
+                                               'os_version')
         resp_metadata = self.client.list_image_metadata(self.image_id)
-        expected = {'key2': 'value2'}
+        expected = {'os_distro': 'value2'}
         self.assertEqual(expected, resp_metadata)
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index 615b5d0..73412ff 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -36,7 +36,7 @@
     @test.attr(type=['negative', 'gate'])
     def test_update_nonexistent_image_metadata(self):
         # Negative test:An update should not happen for a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
+        meta = {'os_distro': 'alt1', 'os_version': 'alt2'}
         self.assertRaises(exceptions.NotFound,
                           self.client.update_image_metadata,
                           data_utils.rand_uuid(), meta)
@@ -46,12 +46,12 @@
         # Negative test: Get on non-existent image should not happen
         self.assertRaises(exceptions.NotFound,
                           self.client.get_image_metadata_item,
-                          data_utils.rand_uuid(), 'key2')
+                          data_utils.rand_uuid(), 'os_version')
 
     @test.attr(type=['negative', 'gate'])
     def test_set_nonexistent_image_metadata(self):
         # Negative test: Metadata should not be set to a non-existent image
-        meta = {'key1': 'alt1', 'key2': 'alt2'}
+        meta = {'os_distro': 'alt1', 'os_version': 'alt2'}
         self.assertRaises(exceptions.NotFound, self.client.set_image_metadata,
                           data_utils.rand_uuid(), meta)
 
@@ -59,10 +59,10 @@
     def test_set_nonexistent_image_metadata_item(self):
         # Negative test: Metadata item should not be set to a
         # nonexistent image
-        meta = {'key1': 'alt'}
+        meta = {'os_distro': 'alt'}
         self.assertRaises(exceptions.NotFound,
                           self.client.set_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1',
+                          data_utils.rand_uuid(), 'os_distro',
                           meta)
 
     @test.attr(type=['negative', 'gate'])
@@ -71,4 +71,4 @@
         # item from non-existent image
         self.assertRaises(exceptions.NotFound,
                           self.client.delete_image_metadata_item,
-                          data_utils.rand_uuid(), 'key1')
+                          data_utils.rand_uuid(), 'os_distro')
diff --git a/tempest/api/data_processing/test_plugins.py b/tempest/api/data_processing/test_plugins.py
index 9fd7a17..4b4ec48 100644
--- a/tempest/api/data_processing/test_plugins.py
+++ b/tempest/api/data_processing/test_plugins.py
@@ -13,8 +13,11 @@
 #    under the License.
 
 from tempest.api.data_processing import base as dp_base
+from tempest import config
 from tempest import test
 
+CONF = config.CONF
+
 
 class PluginsTest(dp_base.BaseDataProcessingTest):
     def _list_all_plugin_names(self):
@@ -24,8 +27,8 @@
         """
         _, plugins = self.client.list_plugins()
         plugins_names = [plugin['name'] for plugin in plugins]
-        self.assertIn('vanilla', plugins_names)
-        self.assertIn('hdp', plugins_names)
+        for enabled_plugin in CONF.data_processing_feature_enabled.plugins:
+            self.assertIn(enabled_plugin, plugins_names)
 
         return plugins_names
 
diff --git a/tempest/clients.py b/tempest/clients.py
index 63bae6c..e362ac0 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -13,6 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import copy
+
 from tempest import auth
 from tempest.common import negative_rest_client
 from tempest import config
@@ -140,6 +142,14 @@
         'trace_requests': CONF.debug.trace_requests
     }
 
+    # NOTE: Tempest uses timeout values of compute API if project specific
+    # timeout values don't exist.
+    default_params_with_timeout_values = {
+        'build_interval': CONF.compute.build_interval,
+        'build_timeout': CONF.compute.build_timeout
+    }
+    default_params_with_timeout_values.update(default_params)
+
     def __init__(self, credentials=None, interface='json', service=None):
         # Set interface and client type first
         self.interface = interface
@@ -151,11 +161,24 @@
         self._set_volume_clients()
 
         self.baremetal_client = BaremetalClientJSON(self.auth_provider)
-        self.network_client = NetworkClientJSON(self.auth_provider)
+        self.network_client = NetworkClientJSON(
+            self.auth_provider,
+            CONF.network.catalog_type,
+            CONF.network.region or CONF.identity.region,
+            endpoint_type=CONF.network.endpoint_type,
+            build_interval=CONF.network.build_interval,
+            build_timeout=CONF.network.build_timeout,
+            **self.default_params)
         self.database_flavors_client = DatabaseFlavorsClientJSON(
-            self.auth_provider)
+            self.auth_provider,
+            CONF.database.catalog_type,
+            CONF.identity.region,
+            **self.default_params_with_timeout_values)
         self.database_versions_client = DatabaseVersionsClientJSON(
-            self.auth_provider)
+            self.auth_provider,
+            CONF.database.catalog_type,
+            CONF.identity.region,
+            **self.default_params_with_timeout_values)
         self.messaging_client = MessagingClientJSON(self.auth_provider)
         if CONF.service_available.ceilometer:
             self.telemetry_client = TelemetryClientJSON(
@@ -191,36 +214,63 @@
             self.auth_provider)
 
     def _set_compute_clients(self):
-        self.agents_client = AgentsClientJSON(self.auth_provider)
-        self.networks_client = NetworksClientJSON(self.auth_provider)
-        self.migrations_client = MigrationsClientJSON(self.auth_provider)
+        params = {
+            'service': CONF.compute.catalog_type,
+            'region': CONF.compute.region or CONF.identity.region,
+            'endpoint_type': CONF.compute.endpoint_type,
+            'build_interval': CONF.compute.build_interval,
+            'build_timeout': CONF.compute.build_timeout
+        }
+        params.update(self.default_params)
+
+        self.agents_client = AgentsClientJSON(self.auth_provider, **params)
+        self.networks_client = NetworksClientJSON(self.auth_provider, **params)
+        self.migrations_client = MigrationsClientJSON(self.auth_provider,
+                                                      **params)
         self.security_group_default_rules_client = (
-            SecurityGroupDefaultRulesClientJSON(self.auth_provider))
-        self.certificates_client = CertificatesClientJSON(self.auth_provider)
-        self.servers_client = ServersClientJSON(self.auth_provider)
-        self.limits_client = LimitsClientJSON(self.auth_provider)
-        self.images_client = ImagesClientJSON(self.auth_provider)
-        self.keypairs_client = KeyPairsClientJSON(self.auth_provider)
-        self.quotas_client = QuotasClientJSON(self.auth_provider)
-        self.quota_classes_client = QuotaClassesClientJSON(self.auth_provider)
-        self.flavors_client = FlavorsClientJSON(self.auth_provider)
-        self.extensions_client = ExtensionsClientJSON(self.auth_provider)
-        self.volumes_extensions_client = VolumesExtensionsClientJSON(
-            self.auth_provider)
-        self.floating_ips_client = FloatingIPsClientJSON(self.auth_provider)
+            SecurityGroupDefaultRulesClientJSON(self.auth_provider, **params))
+        self.certificates_client = CertificatesClientJSON(self.auth_provider,
+                                                          **params)
+        self.servers_client = ServersClientJSON(self.auth_provider, **params)
+        self.limits_client = LimitsClientJSON(self.auth_provider, **params)
+        self.images_client = ImagesClientJSON(self.auth_provider, **params)
+        self.keypairs_client = KeyPairsClientJSON(self.auth_provider, **params)
+        self.quotas_client = QuotasClientJSON(self.auth_provider, **params)
+        self.quota_classes_client = QuotaClassesClientJSON(self.auth_provider,
+                                                           **params)
+        self.flavors_client = FlavorsClientJSON(self.auth_provider, **params)
+        self.extensions_client = ExtensionsClientJSON(self.auth_provider,
+                                                      **params)
+        self.floating_ips_client = FloatingIPsClientJSON(self.auth_provider,
+                                                         **params)
         self.security_groups_client = SecurityGroupsClientJSON(
-            self.auth_provider)
-        self.interfaces_client = InterfacesClientJSON(self.auth_provider)
-        self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider)
+            self.auth_provider, **params)
+        self.interfaces_client = InterfacesClientJSON(self.auth_provider,
+                                                      **params)
+        self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider,
+                                                   **params)
         self.availability_zone_client = AvailabilityZoneClientJSON(
-            self.auth_provider)
-        self.aggregates_client = AggregatesClientJSON(self.auth_provider)
-        self.services_client = ServicesClientJSON(self.auth_provider)
-        self.tenant_usages_client = TenantUsagesClientJSON(self.auth_provider)
-        self.hosts_client = HostsClientJSON(self.auth_provider)
-        self.hypervisor_client = HypervisorClientJSON(self.auth_provider)
+            self.auth_provider, **params)
+        self.aggregates_client = AggregatesClientJSON(self.auth_provider,
+                                                      **params)
+        self.services_client = ServicesClientJSON(self.auth_provider, **params)
+        self.tenant_usages_client = TenantUsagesClientJSON(self.auth_provider,
+                                                           **params)
+        self.hosts_client = HostsClientJSON(self.auth_provider, **params)
+        self.hypervisor_client = HypervisorClientJSON(self.auth_provider,
+                                                      **params)
         self.instance_usages_audit_log_client = \
-            InstanceUsagesAuditLogClientJSON(self.auth_provider)
+            InstanceUsagesAuditLogClientJSON(self.auth_provider, **params)
+
+        # NOTE: The following client needs special timeout values because
+        # the API is a proxy for the other component.
+        params_volume = copy.deepcopy(params)
+        params_volume.update({
+            'build_interval': CONF.volume.build_interval,
+            'build_timeout': CONF.volume.build_timeout
+        })
+        self.volumes_extensions_client = VolumesExtensionsClientJSON(
+            self.auth_provider, **params_volume)
 
     def _set_identity_clients(self):
         self.identity_client = IdentityClientJSON(self.auth_provider)
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 6e1ca7a..e5ffb1b 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -144,21 +144,46 @@
     servers = None
 
     def __init__(self, user, pw, tenant):
+        default_params = {
+            'disable_ssl_certificate_validation':
+                CONF.identity.disable_ssl_certificate_validation,
+            'ca_certs': CONF.identity.ca_certificates_file,
+            'trace_requests': CONF.debug.trace_requests
+        }
+        compute_params = {
+            'service': CONF.compute.catalog_type,
+            'region': CONF.compute.region or CONF.identity.region,
+            'endpoint_type': CONF.compute.endpoint_type,
+            'build_interval': CONF.compute.build_interval,
+            'build_timeout': CONF.compute.build_timeout
+        }
+        compute_params.update(default_params)
+
         _creds = tempest.auth.KeystoneV2Credentials(
             username=user,
             password=pw,
             tenant_name=tenant)
         _auth = tempest.auth.KeystoneV2AuthProvider(_creds)
         self.identity = identity_client.IdentityClientJSON(_auth)
-        self.servers = servers_client.ServersClientJSON(_auth)
+        self.servers = servers_client.ServersClientJSON(_auth,
+                                                        **compute_params)
+        self.flavors = flavors_client.FlavorsClientJSON(_auth,
+                                                        **compute_params)
+        self.secgroups = security_groups_client.SecurityGroupsClientJSON(
+            _auth, **compute_params)
         self.objects = object_client.ObjectClient(_auth)
         self.containers = container_client.ContainerClient(_auth)
         self.images = image_client.ImageClientV2JSON(_auth)
-        self.flavors = flavors_client.FlavorsClientJSON(_auth)
         self.telemetry = telemetry_client.TelemetryClientJSON(_auth)
-        self.secgroups = security_groups_client.SecurityGroupsClientJSON(_auth)
         self.volumes = volumes_client.VolumesClientJSON(_auth)
-        self.networks = network_client.NetworkClientJSON(_auth)
+        self.networks = network_client.NetworkClientJSON(
+            _auth,
+            CONF.network.catalog_type,
+            CONF.network.region or CONF.identity.region,
+            endpoint_type=CONF.network.endpoint_type,
+            build_interval=CONF.network.build_interval,
+            build_timeout=CONF.network.build_timeout,
+            **default_params)
 
 
 def load_resources(fname):
diff --git a/tempest/common/glance_http.py b/tempest/common/glance_http.py
index 5f35c85..92ed8f1 100644
--- a/tempest/common/glance_http.py
+++ b/tempest/common/glance_http.py
@@ -67,7 +67,7 @@
         _kwargs = {'timeout': float(kwargs.get('timeout', 600))}
 
         if scheme == 'https':
-            _kwargs['cacert'] = kwargs.get('cacert', None)
+            _kwargs['ca_certs'] = kwargs.get('ca_certs', None)
             _kwargs['cert_file'] = kwargs.get('cert_file', None)
             _kwargs['key_file'] = kwargs.get('key_file', None)
             _kwargs['insecure'] = kwargs.get('insecure', False)
@@ -232,7 +232,7 @@
           with native Python 3.3 code.
     """
     def __init__(self, host, port=None, key_file=None, cert_file=None,
-                 cacert=None, timeout=None, insecure=False,
+                 ca_certs=None, timeout=None, insecure=False,
                  ssl_compression=True):
         httplib.HTTPSConnection.__init__(self, host, port,
                                          key_file=key_file,
@@ -242,7 +242,7 @@
         self.timeout = timeout
         self.insecure = insecure
         self.ssl_compression = ssl_compression
-        self.cacert = cacert
+        self.ca_certs = ca_certs
         self.setcontext()
 
     @staticmethod
@@ -326,11 +326,11 @@
                 msg = 'Unable to load key from "%s" %s' % (self.key_file, e)
                 raise exc.SSLConfigurationError(msg)
 
-        if self.cacert:
+        if self.ca_certs:
             try:
-                self.context.load_verify_locations(self.cacert)
+                self.context.load_verify_locations(self.ca_certs)
             except Exception as e:
-                msg = 'Unable to load CA from "%s"' % (self.cacert, e)
+                msg = 'Unable to load CA from "%s"' % (self.ca_certs, e)
                 raise exc.SSLConfigurationError(msg)
         else:
             self.context.set_default_verify_paths()
diff --git a/tempest/config.py b/tempest/config.py
index dd693e5..1b6ec62 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -743,6 +743,17 @@
 ]
 
 
+data_processing_feature_group = cfg.OptGroup(
+    name="data_processing-feature-enabled",
+    title="Enabled Data Processing features")
+
+DataProcessingFeaturesGroup = [
+    cfg.ListOpt('plugins',
+                default=["vanilla", "hdp"],
+                help="List of enabled data processing plugins")
+]
+
+
 boto_group = cfg.OptGroup(name='boto',
                           title='EC2/S3 options')
 BotoGroup = [
@@ -1050,6 +1061,7 @@
     (telemetry_group, TelemetryGroup),
     (dashboard_group, DashboardGroup),
     (data_processing_group, DataProcessingGroup),
+    (data_processing_feature_group, DataProcessingFeaturesGroup),
     (boto_group, BotoGroup),
     (stress_group, StressGroup),
     (scenario_group, ScenarioGroup),
@@ -1120,6 +1132,8 @@
         self.telemetry = cfg.CONF.telemetry
         self.dashboard = cfg.CONF.dashboard
         self.data_processing = cfg.CONF.data_processing
+        self.data_processing_feature_enabled = cfg.CONF[
+            'data_processing-feature-enabled']
         self.boto = cfg.CONF.boto
         self.stress = cfg.CONF.stress
         self.scenario = cfg.CONF.scenario
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 2cfec14..ebc6b15 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -436,6 +436,7 @@
                                  act_serv=servers,
                                  trgt_serv=dns_servers))
 
+    @test.skip_because(bug="1412325")
     @testtools.skipUnless(CONF.scenario.dhcp_client,
                           "DHCP client is not available.")
     @test.attr(type='smoke')
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index c584a6e..910fd79 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -66,7 +66,7 @@
 
     def _create_snapshot_from_volume(self, vol_id):
         snap_name = data_utils.rand_name('snapshot')
-        _, snap = self.snapshots_client.create_snapshot(
+        snap = self.snapshots_client.create_snapshot(
             volume_id=vol_id,
             force=True,
             display_name=snap_name)
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 9359808..9435dbf 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -114,6 +114,19 @@
         """
         return self._show_request('ports', uuid)
 
+    @base.handle_errors
+    def show_port_by_address(self, address):
+        """
+        Gets a specific port by address.
+
+        :param address: MAC address of the port.
+        :return: Serialized port as a dictionary.
+
+        """
+        uri = '/ports/detail?address=%s' % address
+
+        return self._show_request('ports', uuid=None, uri=uri)
+
     def show_driver(self, driver_name):
         """
         Gets a specific driver.
diff --git a/tempest/services/compute/json/agents_client.py b/tempest/services/compute/json/agents_client.py
index 95d7880..e17495f 100644
--- a/tempest/services/compute/json/agents_client.py
+++ b/tempest/services/compute/json/agents_client.py
@@ -18,10 +18,9 @@
 from tempest.api_schema.response.compute import agents as common_schema
 from tempest.api_schema.response.compute.v2 import agents as schema
 from tempest.common import service_client
-from tempest.services.compute.json import base
 
 
-class AgentsClientJSON(base.ComputeClient):
+class AgentsClientJSON(service_client.ServiceClient):
     """
     Tests Agents API
     """
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index 47dd401..94ea713 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -19,10 +19,9 @@
 from tempest.api_schema.response.compute.v2 import aggregates as v2_schema
 from tempest.common import service_client
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 
-class AggregatesClientJSON(base.ComputeClient):
+class AggregatesClientJSON(service_client.ServiceClient):
 
     def list_aggregates(self):
         """Get aggregate list."""
diff --git a/tempest/services/compute/json/availability_zone_client.py b/tempest/services/compute/json/availability_zone_client.py
index b8bda68..e37c9d9 100644
--- a/tempest/services/compute/json/availability_zone_client.py
+++ b/tempest/services/compute/json/availability_zone_client.py
@@ -16,10 +16,10 @@
 import json
 
 from tempest.api_schema.response.compute.v2 import availability_zone as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class AvailabilityZoneClientJSON(base.ComputeClient):
+class AvailabilityZoneClientJSON(service_client.ServiceClient):
 
     def get_availability_zone_list(self):
         resp, body = self.get('os-availability-zone')
diff --git a/tempest/services/compute/json/base.py b/tempest/services/compute/json/base.py
deleted file mode 100644
index ae44ffb..0000000
--- a/tempest/services/compute/json/base.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2014 NEC Corporation.  All rights reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from tempest.common import service_client
-from tempest import config
-
-CONF = config.CONF
-
-
-class ComputeClient(service_client.ServiceClient):
-    """
-    Base compute client class
-    """
-
-    def __init__(self, auth_provider,
-                 build_interval=None, build_timeout=None):
-        if build_interval is None:
-            build_interval = CONF.compute.build_interval
-        if build_timeout is None:
-            build_timeout = CONF.compute.build_timeout
-
-        super(ComputeClient, self).__init__(
-            auth_provider,
-            CONF.compute.catalog_type,
-            CONF.compute.region or CONF.identity.region,
-            endpoint_type=CONF.compute.endpoint_type,
-            build_interval=build_interval,
-            build_timeout=build_timeout)
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index 123f0b9..b705c37 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -17,10 +17,10 @@
 
 from tempest.api_schema.response.compute import certificates as schema
 from tempest.api_schema.response.compute.v2 import certificates as v2schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class CertificatesClientJSON(base.ComputeClient):
+class CertificatesClientJSON(service_client.ServiceClient):
 
     def get_certificate(self, id):
         url = "os-certificates/%s" % (id)
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
index 69ad7c0..d3148b4 100644
--- a/tempest/services/compute/json/extensions_client.py
+++ b/tempest/services/compute/json/extensions_client.py
@@ -16,10 +16,10 @@
 import json
 
 from tempest.api_schema.response.compute.v2 import extensions as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class ExtensionsClientJSON(base.ComputeClient):
+class ExtensionsClientJSON(service_client.ServiceClient):
 
     def list_extensions(self):
         url = 'extensions'
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 8fd24b6..5797c16 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -16,10 +16,10 @@
 import json
 
 from tempest.api_schema.response.compute.v2 import fixed_ips as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class FixedIPsClientJSON(base.ComputeClient):
+class FixedIPsClientJSON(service_client.ServiceClient):
 
     def get_fixed_ip_details(self, fixed_ip):
         url = "os-fixed-ips/%s" % (fixed_ip)
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 6276d3c..b42ea40 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -21,10 +21,10 @@
 from tempest.api_schema.response.compute import flavors_extra_specs \
     as schema_extra_specs
 from tempest.api_schema.response.compute.v2 import flavors as v2schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class FlavorsClientJSON(base.ComputeClient):
+class FlavorsClientJSON(service_client.ServiceClient):
 
     def list_flavors(self, params=None):
         url = 'flavors'
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 788b4d2..9c586e3 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -17,11 +17,11 @@
 import urllib
 
 from tempest.api_schema.response.compute.v2 import floating_ips as schema
+from tempest.common import service_client
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 
-class FloatingIPsClientJSON(base.ComputeClient):
+class FloatingIPsClientJSON(service_client.ServiceClient):
 
     def list_floating_ips(self, params=None):
         """Returns a list of all floating IPs filtered by any parameters."""
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index f4e1f12..b06378b 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -18,10 +18,9 @@
 from tempest.api_schema.response.compute import hosts as schema
 from tempest.api_schema.response.compute.v2 import hosts as v2_schema
 from tempest.common import service_client
-from tempest.services.compute.json import base
 
 
-class HostsClientJSON(base.ComputeClient):
+class HostsClientJSON(service_client.ServiceClient):
 
     def list_hosts(self, params=None):
         """Lists all hosts."""
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index 37be874..380b5ce 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -18,10 +18,9 @@
 from tempest.api_schema.response.compute import hypervisors as common_schema
 from tempest.api_schema.response.compute.v2 import hypervisors as v2schema
 from tempest.common import service_client
-from tempest.services.compute.json import base
 
 
-class HypervisorClientJSON(base.ComputeClient):
+class HypervisorClientJSON(service_client.ServiceClient):
 
     def get_hypervisor_list(self):
         """List hypervisors information."""
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 5b0ebe1..a5755da 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -20,10 +20,9 @@
 from tempest.common import service_client
 from tempest.common import waiters
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 
-class ImagesClientJSON(base.ComputeClient):
+class ImagesClientJSON(service_client.ServiceClient):
 
     def create_image(self, server_id, name, meta=None):
         """Creates an image of the original server."""
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index f79c3de..80d7334 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -17,10 +17,10 @@
 
 from tempest.api_schema.response.compute.v2 import instance_usage_audit_logs \
     as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class InstanceUsagesAuditLogClientJSON(base.ComputeClient):
+class InstanceUsagesAuditLogClientJSON(service_client.ServiceClient):
 
     def list_instance_usage_audit_logs(self):
         url = 'os-instance_usage_audit_log'
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index f1e2660..595b23c 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -19,11 +19,11 @@
 from tempest.api_schema.response.compute import interfaces as common_schema
 from tempest.api_schema.response.compute import servers as servers_schema
 from tempest.api_schema.response.compute.v2 import interfaces as schema
+from tempest.common import service_client
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 
-class InterfacesClientJSON(base.ComputeClient):
+class InterfacesClientJSON(service_client.ServiceClient):
 
     def list_interfaces(self, server):
         resp, body = self.get('servers/%s/os-interface' % server)
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index c4406f5..69dd9ae 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -17,10 +17,10 @@
 
 from tempest.api_schema.response.compute import keypairs as common_schema
 from tempest.api_schema.response.compute.v2 import keypairs as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class KeyPairsClientJSON(base.ComputeClient):
+class KeyPairsClientJSON(service_client.ServiceClient):
 
     def list_keypairs(self):
         resp, body = self.get("os-keypairs")
diff --git a/tempest/services/compute/json/limits_client.py b/tempest/services/compute/json/limits_client.py
index 66a0649..3a725ae 100644
--- a/tempest/services/compute/json/limits_client.py
+++ b/tempest/services/compute/json/limits_client.py
@@ -16,10 +16,10 @@
 import json
 
 from tempest.api_schema.response.compute.v2 import limits as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class LimitsClientJSON(base.ComputeClient):
+class LimitsClientJSON(service_client.ServiceClient):
 
     def get_absolute_limits(self):
         resp, body = self.get("limits")
diff --git a/tempest/services/compute/json/migrations_client.py b/tempest/services/compute/json/migrations_client.py
index de183f1..b41abc8 100644
--- a/tempest/services/compute/json/migrations_client.py
+++ b/tempest/services/compute/json/migrations_client.py
@@ -16,10 +16,10 @@
 import urllib
 
 from tempest.api_schema.response.compute import migrations as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class MigrationsClientJSON(base.ComputeClient):
+class MigrationsClientJSON(service_client.ServiceClient):
 
     def list_migrations(self, params=None):
         """Lists all migrations."""
diff --git a/tempest/services/compute/json/networks_client.py b/tempest/services/compute/json/networks_client.py
index 5a2744d..361258a 100644
--- a/tempest/services/compute/json/networks_client.py
+++ b/tempest/services/compute/json/networks_client.py
@@ -15,10 +15,10 @@
 
 import json
 
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class NetworksClientJSON(base.ComputeClient):
+class NetworksClientJSON(service_client.ServiceClient):
 
     def list_networks(self):
         resp, body = self.get("os-networks")
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 0fee57a..f9f02a5 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -18,10 +18,10 @@
 from tempest.api_schema.response.compute.v2\
     import quota_classes as classes_schema
 from tempest.api_schema.response.compute.v2 import quotas as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class QuotasClientJSON(base.ComputeClient):
+class QuotasClientJSON(service_client.ServiceClient):
 
     def get_quota_set(self, tenant_id, user_id=None):
         """List the quota set for a tenant."""
@@ -115,7 +115,7 @@
         return resp, body
 
 
-class QuotaClassesClientJSON(base.ComputeClient):
+class QuotaClassesClientJSON(service_client.ServiceClient):
 
     def get_quota_class_set(self, quota_class_id):
         """List the quota class set for a quota class."""
diff --git a/tempest/services/compute/json/security_group_default_rules_client.py b/tempest/services/compute/json/security_group_default_rules_client.py
index efaf329..5d0c16f 100644
--- a/tempest/services/compute/json/security_group_default_rules_client.py
+++ b/tempest/services/compute/json/security_group_default_rules_client.py
@@ -17,10 +17,10 @@
 
 from tempest.api_schema.response.compute.v2 import \
     security_group_default_rule as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class SecurityGroupDefaultRulesClientJSON(base.ComputeClient):
+class SecurityGroupDefaultRulesClientJSON(service_client.ServiceClient):
 
     def create_security_default_group_rule(self, ip_protocol, from_port,
                                            to_port, **kwargs):
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index a301a0f..1ac52af 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -17,11 +17,11 @@
 import urllib
 
 from tempest.api_schema.response.compute.v2 import security_groups as schema
+from tempest.common import service_client
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 
-class SecurityGroupsClientJSON(base.ComputeClient):
+class SecurityGroupsClientJSON(service_client.ServiceClient):
 
     def list_security_groups(self, params=None):
         """List all security groups for a user."""
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 400f9a7..cbe1ca8 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -20,15 +20,15 @@
 
 from tempest.api_schema.response.compute import servers as common_schema
 from tempest.api_schema.response.compute.v2 import servers as schema
+from tempest.common import service_client
 from tempest.common import waiters
 from tempest import config
 from tempest import exceptions
-from tempest.services.compute.json import base
 
 CONF = config.CONF
 
 
-class ServersClientJSON(base.ComputeClient):
+class ServersClientJSON(service_client.ServiceClient):
 
     def create_server(self, name, image_ref, flavor_ref, **kwargs):
         """
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 52662fa..fc2274d 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -19,10 +19,9 @@
 
 from tempest.api_schema.response.compute import services as schema
 from tempest.common import service_client
-from tempest.services.compute.json import base
 
 
-class ServicesClientJSON(base.ComputeClient):
+class ServicesClientJSON(service_client.ServiceClient):
 
     def list_services(self, params=None):
         url = 'os-services'
diff --git a/tempest/services/compute/json/tenant_usages_client.py b/tempest/services/compute/json/tenant_usages_client.py
index eac23bb..5dc1d5d 100644
--- a/tempest/services/compute/json/tenant_usages_client.py
+++ b/tempest/services/compute/json/tenant_usages_client.py
@@ -17,10 +17,10 @@
 import urllib
 
 from tempest.api_schema.response.compute.v2 import tenant_usages as schema
-from tempest.services.compute.json import base
+from tempest.common import service_client
 
 
-class TenantUsagesClientJSON(base.ComputeClient):
+class TenantUsagesClientJSON(service_client.ServiceClient):
 
     def list_tenant_usages(self, params=None):
         url = 'os-simple-tenant-usage'
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index 69b9bea..61d0b23 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -18,20 +18,11 @@
 import urllib
 
 from tempest.api_schema.response.compute.v2 import volumes as schema
-from tempest import config
+from tempest.common import service_client
 from tempest import exceptions
-from tempest.services.compute.json import base
-
-CONF = config.CONF
 
 
-class VolumesExtensionsClientJSON(base.ComputeClient):
-
-    def __init__(self, auth_provider):
-        super(VolumesExtensionsClientJSON, self).__init__(
-            auth_provider,
-            build_interval=CONF.volume.build_interval,
-            build_timeout=CONF.volume.build_timeout)
+class VolumesExtensionsClientJSON(service_client.ServiceClient):
 
     def list_volumes(self, params=None):
         """List all the volumes created."""
diff --git a/tempest/services/database/json/flavors_client.py b/tempest/services/database/json/flavors_client.py
index 9a27443..dfb2eb3 100644
--- a/tempest/services/database/json/flavors_client.py
+++ b/tempest/services/database/json/flavors_client.py
@@ -16,19 +16,10 @@
 import urllib
 
 from tempest.common import service_client
-from tempest import config
-
-CONF = config.CONF
 
 
 class DatabaseFlavorsClientJSON(service_client.ServiceClient):
 
-    def __init__(self, auth_provider):
-        super(DatabaseFlavorsClientJSON, self).__init__(
-            auth_provider,
-            CONF.database.catalog_type,
-            CONF.identity.region)
-
     def list_db_flavors(self, params=None):
         url = 'flavors'
         if params:
diff --git a/tempest/services/database/json/versions_client.py b/tempest/services/database/json/versions_client.py
index f5c5217..c3388bb 100644
--- a/tempest/services/database/json/versions_client.py
+++ b/tempest/services/database/json/versions_client.py
@@ -16,18 +16,23 @@
 import urllib
 
 from tempest.common import service_client
-from tempest import config
-
-CONF = config.CONF
 
 
 class DatabaseVersionsClientJSON(service_client.ServiceClient):
 
-    def __init__(self, auth_provider):
+    def __init__(self, auth_provider, service, region,
+                 endpoint_type=None, build_interval=None, build_timeout=None,
+                 disable_ssl_certificate_validation=None, ca_certs=None,
+                 trace_requests=None):
+        dscv = disable_ssl_certificate_validation
         super(DatabaseVersionsClientJSON, self).__init__(
-            auth_provider,
-            CONF.database.catalog_type,
-            CONF.identity.region)
+            auth_provider, service, region,
+            endpoint_type=endpoint_type,
+            build_interval=build_interval,
+            build_timeout=build_timeout,
+            disable_ssl_certificate_validation=dscv,
+            ca_certs=ca_certs,
+            trace_requests=trace_requests)
         self.skip_path()
 
     def list_db_versions(self, params=None):
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 8602513..c7ee5f7 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -16,11 +16,8 @@
 
 from tempest.common import service_client
 from tempest.common.utils import misc
-from tempest import config
 from tempest import exceptions
 
-CONF = config.CONF
-
 
 class NetworkClientJSON(service_client.ServiceClient):
 
@@ -37,16 +34,8 @@
     quotas
     """
 
-    def __init__(self, auth_provider):
-        super(NetworkClientJSON, self).__init__(
-            auth_provider,
-            CONF.network.catalog_type,
-            CONF.network.region or CONF.identity.region,
-            endpoint_type=CONF.network.endpoint_type,
-            build_interval=CONF.network.build_interval,
-            build_timeout=CONF.network.build_timeout)
-        self.version = '2.0'
-        self.uri_prefix = "v%s" % (self.version)
+    version = '2.0'
+    uri_prefix = "v2.0"
 
     def get_uri(self, plural_name):
         # get service prefix from resource name
diff --git a/tempest/tests/test_glance_http.py b/tempest/tests/test_glance_http.py
index 9a6c9de..c92a886 100644
--- a/tempest/tests/test_glance_http.py
+++ b/tempest/tests/test_glance_http.py
@@ -171,7 +171,7 @@
 
     def test_get_connection_kwargs_set_timeout_for_http(self):
         kwargs = self.client.get_connection_kwargs('http', timeout=10,
-                                                   cacert='foo')
+                                                   ca_certs='foo')
         self.assertEqual(10, kwargs['timeout'])
         # nothing more than timeout is evaluated for http connections
         self.assertEqual(1, len(kwargs.keys()))
@@ -179,7 +179,7 @@
     def test_get_connection_kwargs_default_for_https(self):
         kwargs = self.client.get_connection_kwargs('https')
         self.assertEqual(600, kwargs['timeout'])
-        self.assertEqual(None, kwargs['cacert'])
+        self.assertEqual(None, kwargs['ca_certs'])
         self.assertEqual(None, kwargs['cert_file'])
         self.assertEqual(None, kwargs['key_file'])
         self.assertEqual(False, kwargs['insecure'])
@@ -188,13 +188,13 @@
 
     def test_get_connection_kwargs_set_params_for_https(self):
         kwargs = self.client.get_connection_kwargs('https', timeout=10,
-                                                   cacert='foo',
+                                                   ca_certs='foo',
                                                    cert_file='/foo/bar.cert',
                                                    key_file='/foo/key.pem',
                                                    insecure=True,
                                                    ssl_compression=False)
         self.assertEqual(10, kwargs['timeout'])
-        self.assertEqual('foo', kwargs['cacert'])
+        self.assertEqual('foo', kwargs['ca_certs'])
         self.assertEqual('/foo/bar.cert', kwargs['cert_file'])
         self.assertEqual('/foo/key.pem', kwargs['key_file'])
         self.assertEqual(True, kwargs['insecure'])