Merge "boto: Remove skip for bug 1072318"
diff --git a/tempest/cli/simple_read_only/data_processing/test_sahara.py b/tempest/cli/simple_read_only/data_processing/test_sahara.py
index 1f2403c..c06c2c9 100644
--- a/tempest/cli/simple_read_only/data_processing/test_sahara.py
+++ b/tempest/cli/simple_read_only/data_processing/test_sahara.py
@@ -16,6 +16,7 @@
 import re
 
 from tempest_lib import exceptions
+import testtools
 
 from tempest import cli
 from tempest import config
@@ -59,8 +60,12 @@
             'title'
         ])
 
+    @testtools.skipUnless(CONF.data_processing_feature_enabled.plugins,
+                          'No plugins defined')
     def test_sahara_plugins_show(self):
-        result = self.sahara('plugin-show', params='--name vanilla')
+        name_param = '--name %s' % \
+            (CONF.data_processing_feature_enabled.plugins[0])
+        result = self.sahara('plugin-show', params=name_param)
         plugin = self.parser.listing(result)
         self.assertTableStruct(plugin, [
             'Property',
diff --git a/tempest/clients.py b/tempest/clients.py
index e362ac0..32c6410 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -159,6 +159,7 @@
         self._set_compute_clients()
         self._set_identity_clients()
         self._set_volume_clients()
+        self._set_object_storage_clients()
 
         self.baremetal_client = BaremetalClientJSON(self.auth_provider)
         self.network_client = NetworkClientJSON(
@@ -193,12 +194,9 @@
                            self.credentials.tenant_name)
 
         # common clients
-        self.account_client = AccountClient(self.auth_provider)
         if CONF.service_available.glance:
             self.image_client = ImageClientJSON(self.auth_provider)
             self.image_client_v2 = ImageClientV2JSON(self.auth_provider)
-        self.container_client = ContainerClient(self.auth_provider)
-        self.object_client = ObjectClient(self.auth_provider)
         self.orchestration_client = OrchestrationClient(
             self.auth_provider,
             CONF.orchestration.catalog_type,
@@ -315,6 +313,11 @@
         self.volume_types_v2_client = VolumeTypesV2ClientJSON(
             self.auth_provider)
 
+    def _set_object_storage_clients(self):
+        self.account_client = AccountClient(self.auth_provider)
+        self.container_client = ContainerClient(self.auth_provider)
+        self.object_client = ObjectClient(self.auth_provider)
+
 
 class AdminManager(Manager):
 
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index e5ffb1b..8aa5f28 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -187,7 +187,7 @@
 
 
 def load_resources(fname):
-    """Load the expected resources from a yaml flie."""
+    """Load the expected resources from a yaml file."""
     return yaml.load(open(fname, 'r'))
 
 
@@ -423,7 +423,7 @@
                 self._ping_ip(addr, 60)
 
     def check_secgroups(self):
-        """Check that the security groups are still existing."""
+        """Check that the security groups still exist."""
         LOG.info("Checking security groups")
         for secgroup in self.res['secgroups']:
             client = client_for_user(secgroup['owner'])
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index a7e0ee3..65a3a95 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -335,7 +335,7 @@
             continue
         results = verify_extensions(os, service, results)
 
-    # Verify API verisons of all services in the keystone catalog and keystone
+    # Verify API versions of all services in the keystone catalog and keystone
     # itself.
     services.append('keystone')
     for service in services:
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index de6b0f9..83739fd 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -70,7 +70,7 @@
             * test that cross-tenant traffic is enabled once an appropriate
             rule has been created on destination tenant.
             * test that reverse traffic is still blocked
-            * test than revesre traffic is enabled once an appropriate rule has
+            * test than reverse traffic is enabled once an appropriate rule has
             been created on source tenant
         7._test_port_update_new_security_group:
            * test that traffic is blocked with default security group
@@ -85,7 +85,7 @@
             to it, and cross tenant check will be done on the private IP of the
             destination tenant
             or
-            * not defined (empty string), in which case each tanant will have
+            * not defined (empty string), in which case each tenant will have
             its own router connected to the public network
     """
 
@@ -466,7 +466,7 @@
     def test_port_update_new_security_group(self):
         """
         This test verifies the traffic after updating the vm port with new
-        security group having appropiate rule.
+        security group having appropriate rule.
         """
         new_tenant = self.primary_tenant
 
diff --git a/tempest/tests/common/test_service_clients.py b/tempest/tests/common/test_service_clients.py
new file mode 100644
index 0000000..fc73c18
--- /dev/null
+++ b/tempest/tests/common/test_service_clients.py
@@ -0,0 +1,102 @@
+# Copyright 2015 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.
+
+import mock
+import random
+import six
+
+from tempest.services.compute.json import agents_client
+from tempest.services.compute.json import aggregates_client
+from tempest.services.compute.json import availability_zone_client
+from tempest.services.compute.json import certificates_client
+from tempest.services.compute.json import extensions_client
+from tempest.services.compute.json import fixed_ips_client
+from tempest.services.compute.json import flavors_client
+from tempest.services.compute.json import floating_ips_client
+from tempest.services.compute.json import hosts_client
+from tempest.services.compute.json import hypervisor_client
+from tempest.services.compute.json import images_client
+from tempest.services.compute.json import instance_usage_audit_log_client
+from tempest.services.compute.json import interfaces_client
+from tempest.services.compute.json import keypairs_client
+from tempest.services.compute.json import limits_client
+from tempest.services.compute.json import migrations_client
+from tempest.services.compute.json import networks_client as nova_net_client
+from tempest.services.compute.json import quotas_client
+from tempest.services.compute.json import security_group_default_rules_client \
+    as nova_secgrop_default_client
+from tempest.services.compute.json import security_groups_client
+from tempest.services.compute.json import servers_client
+from tempest.services.compute.json import services_client
+from tempest.services.compute.json import tenant_usages_client
+from tempest.services.compute.json import volumes_extensions_client
+from tempest.services.database.json import flavors_client as db_flavor_client
+from tempest.services.database.json import versions_client as db_version_client
+from tempest.services.network.json import network_client
+from tempest.services.orchestration.json import orchestration_client
+from tempest.tests import base
+
+
+class TestServiceClient(base.TestCase):
+
+    @mock.patch('tempest_lib.common.rest_client.RestClient.__init__')
+    def test_service_client_creations_with_specified_args(self, mock_init):
+        test_clients = [
+            agents_client.AgentsClientJSON,
+            aggregates_client.AggregatesClientJSON,
+            availability_zone_client.AvailabilityZoneClientJSON,
+            certificates_client.CertificatesClientJSON,
+            extensions_client.ExtensionsClientJSON,
+            fixed_ips_client.FixedIPsClientJSON,
+            flavors_client.FlavorsClientJSON,
+            floating_ips_client.FloatingIPsClientJSON,
+            hosts_client.HostsClientJSON,
+            hypervisor_client.HypervisorClientJSON,
+            images_client.ImagesClientJSON,
+            instance_usage_audit_log_client.InstanceUsagesAuditLogClientJSON,
+            interfaces_client.InterfacesClientJSON,
+            keypairs_client.KeyPairsClientJSON,
+            limits_client.LimitsClientJSON,
+            migrations_client.MigrationsClientJSON,
+            nova_net_client.NetworksClientJSON,
+            quotas_client.QuotasClientJSON,
+            quotas_client.QuotaClassesClientJSON,
+            nova_secgrop_default_client.SecurityGroupDefaultRulesClientJSON,
+            security_groups_client.SecurityGroupsClientJSON,
+            servers_client.ServersClientJSON,
+            services_client.ServicesClientJSON,
+            tenant_usages_client.TenantUsagesClientJSON,
+            volumes_extensions_client.VolumesExtensionsClientJSON,
+            db_flavor_client.DatabaseFlavorsClientJSON,
+            db_version_client.DatabaseVersionsClientJSON,
+            network_client.NetworkClientJSON,
+            orchestration_client.OrchestrationClient]
+
+        for client in test_clients:
+            fake_string = six.text_type(random.randint(1, 0x7fffffff))
+            auth = 'auth' + fake_string
+            service = 'service' + fake_string
+            region = 'region' + fake_string
+            params = {
+                'endpoint_type': 'URL' + fake_string,
+                'build_interval': random.randint(1, 100),
+                'build_timeout': random.randint(1, 100),
+                'disable_ssl_certificate_validation':
+                    True if random.randint(0, 1) else False,
+                'ca_certs': None,
+                'trace_requests': 'foo' + fake_string
+            }
+            client(auth, service, region, **params)
+            mock_init.assert_called_once_with(auth, service, region, **params)
+            mock_init.reset_mock()
diff --git a/tox.ini b/tox.ini
index fe2f79e..2e8b509 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@
 skipsdist = True
 
 [tempestenv]
-sitepackages = True
+sitepackages = False
 setenv = VIRTUAL_ENV={envdir}
          OS_TEST_PATH=./tempest/test_discover
 deps = setuptools