Merge "Split out roles client from keystone identity client"
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index fa1c666..2907e26 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -111,7 +111,7 @@
 
         # Verify that GET shows the updated quota set of user
         user_name = data_utils.rand_name('cpu_quota_user')
-        password = data_utils.rand_name('password')
+        password = data_utils.rand_password()
         email = user_name + '@testmail.tm'
         user = self.identity_utils.create_user(username=user_name,
                                                password=password,
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index 77af509..58d26d3 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -17,6 +17,8 @@
 from tempest_lib import exceptions as lib_exc
 
 from tempest.api.compute import base
+from tempest.common.utils.linux import remote_client
+from tempest.common import waiters
 from tempest import config
 from tempest import test
 
@@ -26,6 +28,16 @@
 class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
 
     @classmethod
+    def setup_credentials(cls):
+        cls.prepare_instance_network()
+        super(ServerPersonalityTestJSON, cls).setup_credentials()
+
+    @classmethod
+    def resource_setup(cls):
+        cls.set_validation_resources()
+        super(ServerPersonalityTestJSON, cls).resource_setup()
+
+    @classmethod
     def skip_checks(cls):
         super(ServerPersonalityTestJSON, cls).skip_checks()
         if not CONF.compute_feature_enabled.personality:
@@ -40,18 +52,34 @@
     @test.idempotent_id('3cfe87fd-115b-4a02-b942-7dc36a337fdf')
     def test_create_server_with_personality(self):
         file_contents = 'This is a test file.'
-        personality = [{'path': '/test.txt',
+        file_path = '/test.txt'
+        personality = [{'path': file_path,
                         'contents': base64.b64encode(file_contents)}]
-        self.create_test_server(personality=personality)
+        server = self.create_test_server(personality=personality,
+                                         wait_until='ACTIVE',
+                                         validatable=True)
+        if CONF.validation.run_validation:
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user, server['adminPass'],
+                self.validation_resources['keypair']['private_key'])
+            self.assertEqual(file_contents,
+                             linux_client.exec_command(
+                                 'sudo cat %s' % file_path))
 
     @test.idempotent_id('128966d8-71fc-443c-8cab-08e24114ecc9')
     def test_rebuild_server_with_personality(self):
-        server_id = self.rebuild_server(None)
+        server = self.create_test_server(wait_until='ACTIVE', validatable=True)
+        server_id = server['id']
         file_contents = 'Test server rebuild.'
         personality = [{'path': 'rebuild.txt',
                         'contents': base64.b64encode(file_contents)}]
-        self.client.rebuild_server(server_id, self.image_ref_alt,
-                                   personality=personality)
+        rebuilt_server = self.client.rebuild_server(server_id,
+                                                    self.image_ref_alt,
+                                                    personality=personality)
+        waiters.wait_for_server_status(self.client, server_id, 'ACTIVE')
+        self.assertEqual(self.image_ref_alt,
+                         rebuilt_server['server']['image']['id'])
 
     @test.idempotent_id('176cd8c9-b9e8-48ee-a480-180beab292bf')
     def test_personality_files_exceed_limit(self):
@@ -83,9 +111,20 @@
             raise self.skipException("No limit for personality files")
         person = []
         for i in range(0, int(max_file_limit)):
-            path = 'etc/test' + str(i) + '.txt'
+            path = '/etc/test' + str(i) + '.txt'
             person.append({
                 'path': path,
                 'contents': base64.b64encode(file_contents),
             })
-        self.create_test_server(personality=person)
+        server = self.create_test_server(personality=person,
+                                         wait_until='ACTIVE',
+                                         validatable=True)
+        if CONF.validation.run_validation:
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user, server['adminPass'],
+                self.validation_resources['keypair']['private_key'])
+            for i in person:
+                self.assertEqual(base64.b64decode(i['contents']),
+                                 linux_client.exec_command(
+                                     'sudo cat %s' % i['path']))
diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py
index b6d447a..e752b02 100644
--- a/tempest/api/identity/admin/v2/test_tokens.py
+++ b/tempest/api/identity/admin/v2/test_tokens.py
@@ -24,7 +24,7 @@
     def test_create_get_delete_token(self):
         # get a token by username and password
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         # first:create a tenant
         tenant_name = data_utils.rand_name(name='tenant')
         tenant = self.tenants_client.create_tenant(tenant_name)['tenant']
@@ -59,7 +59,7 @@
 
         # Create a user.
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         tenant_id = None  # No default tenant so will get unscoped token.
         email = ''
         user = self.client.create_user(user_name, user_password,
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 609251f..2e9714e 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -26,7 +26,7 @@
     def resource_setup(cls):
         super(UsersTestJSON, cls).resource_setup()
         cls.alt_user = data_utils.rand_name('test_user')
-        cls.alt_password = data_utils.rand_name('pass')
+        cls.alt_password = data_utils.rand_password()
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
     @test.attr(type='smoke')
@@ -132,15 +132,16 @@
         self.data.setup_test_tenant()
         user_ids = list()
         fetched_user_ids = list()
+        password1 = data_utils.rand_password()
         alt_tenant_user1 = data_utils.rand_name('tenant_user1')
-        user1 = self.client.create_user(alt_tenant_user1, 'password1',
+        user1 = self.client.create_user(alt_tenant_user1, password1,
                                         self.data.tenant['id'],
                                         'user1@123')['user']
         user_ids.append(user1['id'])
         self.data.users.append(user1)
-
+        password2 = data_utils.rand_password()
         alt_tenant_user2 = data_utils.rand_name('tenant_user2')
-        user2 = self.client.create_user(alt_tenant_user2, 'password2',
+        user2 = self.client.create_user(alt_tenant_user2, password2,
                                         self.data.tenant['id'],
                                         'user2@123')['user']
         user_ids.append(user2['id'])
@@ -173,7 +174,8 @@
                                                   role['id'])['role']
 
         alt_user2 = data_utils.rand_name('second_user')
-        second_user = self.client.create_user(alt_user2, 'password1',
+        alt_password2 = data_utils.rand_password()
+        second_user = self.client.create_user(alt_user2, alt_password2,
                                               self.data.tenant['id'],
                                               'user2@123')['user']
         user_ids.append(second_user['id'])
@@ -198,7 +200,7 @@
         # Test case to check if updating of user password is successful.
         self.data.setup_test_user()
         # Updating the user with new password
-        new_pass = data_utils.rand_name('pass')
+        new_pass = data_utils.rand_password()
         update_user = self.client.update_user_password(
             self.data.user['id'], new_pass)['user']
         self.assertEqual(update_user['id'], self.data.user['id'])
diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py
index 0c7afe8..8fa5a36 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -28,7 +28,7 @@
     def resource_setup(cls):
         super(UsersNegativeTestJSON, cls).resource_setup()
         cls.alt_user = data_utils.rand_name('test_user')
-        cls.alt_password = data_utils.rand_name('pass')
+        cls.alt_password = data_utils.rand_password()
         cls.alt_email = cls.alt_user + '@testmail.tm'
 
     @test.attr(type=['negative'])
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 5e1c3cc..b81bff7 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         for i in range(2):
             cls.project = cls.client.create_project(
                 data_utils.rand_name('project'),
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 260ea54..e022023 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -67,7 +67,8 @@
         users = []
         for i in range(3):
             name = data_utils.rand_name('User')
-            user = self.client.create_user(name)['user']
+            password = data_utils.rand_password()
+            user = self.client.create_user(name, password)['user']
             users.append(user)
             self.addCleanup(self.client.delete_user, user['id'])
             self.groups_client.add_group_user(group['id'], user['id'])
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index b7f37d4..ca91ce5 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -34,7 +34,7 @@
     def resource_setup(cls):
         super(UsersV3TestJSON, cls).resource_setup()
         alt_user = data_utils.rand_name('test_user')
-        alt_password = data_utils.rand_name('pass')
+        alt_password = data_utils.rand_password()
         cls.alt_email = alt_user + '@testmail.tm'
         cls.data.setup_test_domain()
         # Create user with Domain
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index d39fd5f..af9497c 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -161,7 +161,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, project_id=project['id'])['user']
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 3be2643..f194d9c 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -31,7 +31,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        cls.u_password = data_utils.rand_name('pass')
+        cls.u_password = data_utils.rand_password()
         cls.domain = cls.client.create_domain(
             data_utils.rand_name('domain'),
             description=data_utils.rand_name('domain-desc'))['domain']
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 7d33d4a..f5b20d5 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = '%s-description' % u_name
         u_email = '%s@testmail.tm' % u_name
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email)['user']
@@ -60,7 +60,7 @@
 
         # Create a user.
         user_name = data_utils.rand_name(name='user')
-        user_password = data_utils.rand_name(name='pass')
+        user_password = data_utils.rand_password()
         user = self.client.create_user(user_name,
                                        password=user_password)['user']
         self.addCleanup(self.client.delete_user, user['id'])
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index cc13918..bf7ad71 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -55,7 +55,7 @@
         self.trustor_username = data_utils.rand_name('user')
         u_desc = self.trustor_username + 'description'
         u_email = self.trustor_username + '@testmail.xx'
-        self.trustor_password = data_utils.rand_name('pass')
+        self.trustor_password = data_utils.rand_password()
         user = self.client.create_user(
             self.trustor_username,
             description=u_desc,
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index e8d4a36..6dbd443 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -29,7 +29,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False)['user']
@@ -69,13 +69,13 @@
     def test_update_user_password(self):
         # Creating User to check password updation
         u_name = data_utils.rand_name('user')
-        original_password = data_utils.rand_name('pass')
+        original_password = data_utils.rand_password()
         user = self.client.create_user(
             u_name, password=original_password)['user']
         # Delete the User at the end all test methods
         self.addCleanup(self.client.delete_user, user['id'])
         # Update user with new password
-        new_password = data_utils.rand_name('pass1')
+        new_password = data_utils.rand_password()
         self.client.update_user_password(user['id'], password=new_password,
                                          original_password=original_password)
         # TODO(lbragstad): Sleeping after the response status has been checked
@@ -109,7 +109,7 @@
         u_name = data_utils.rand_name('user')
         u_desc = u_name + 'description'
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         user_body = self.client.create_user(
             u_name, description=u_desc, password=u_password,
             email=u_email, enabled=False, project_id=u_project['id'])['user']
diff --git a/tempest/api/identity/admin/v3/test_users_negative.py b/tempest/api/identity/admin/v3/test_users_negative.py
index d40a5b9..4c80bda 100644
--- a/tempest/api/identity/admin/v3/test_users_negative.py
+++ b/tempest/api/identity/admin/v3/test_users_negative.py
@@ -28,7 +28,7 @@
         # Attempt to create a user in a non-existent domain should fail
         u_name = data_utils.rand_name('user')
         u_email = u_name + '@testmail.tm'
-        u_password = data_utils.rand_name('pass')
+        u_password = data_utils.rand_password()
         self.assertRaises(lib_exc.NotFound, self.client.create_user,
                           u_name, u_password,
                           email=u_email,
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 2ad0939..1a4c8bb 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -217,7 +217,7 @@
             """Set up a test user."""
             self.setup_test_tenant()
             self.test_user = data_utils.rand_name('test_user')
-            self.test_password = data_utils.rand_name('pass')
+            self.test_password = data_utils.rand_password()
             self.test_email = self.test_user + '@testmail.tm'
             self.user = self.client.create_user(self.test_user,
                                                 self.test_password,
@@ -244,7 +244,7 @@
             """Set up a test v3 user."""
             self.setup_test_project()
             self.test_user = data_utils.rand_name('test_user')
-            self.test_password = data_utils.rand_name('pass')
+            self.test_password = data_utils.rand_password()
             self.test_email = self.test_user + '@testmail.tm'
             self.v3_user = self.client.create_user(
                 self.test_user,
diff --git a/tempest/api/network/admin/test_negative_quotas.py b/tempest/api/network/admin/test_negative_quotas.py
index 5c4c421..47da08c 100644
--- a/tempest/api/network/admin/test_negative_quotas.py
+++ b/tempest/api/network/admin/test_negative_quotas.py
@@ -29,6 +29,7 @@
 
         quota_driver = neutron.db.quota_db.DbQuotaDriver
     """
+    force_tenant_isolation = True
 
     @classmethod
     def skip_checks(cls):
@@ -45,9 +46,9 @@
     @test.idempotent_id('644f4e1b-1bf9-4af0-9fd8-eb56ac0f51cf')
     def test_network_quota_exceeding(self):
         # Set the network quota to two
-        self.admin_client.update_quotas(self.networks_client.tenant_id,
-                                        network=2)
-        self.addCleanup(self.admin_client.reset_quotas,
+        self.admin_quotas_client.update_quotas(self.networks_client.tenant_id,
+                                               network=2)
+        self.addCleanup(self.admin_quotas_client.reset_quotas,
                         self.networks_client.tenant_id)
 
         # Create two networks
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 4a25206..45d35cf 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -57,14 +57,14 @@
         self.addCleanup(self.identity_utils.delete_project, project_id)
 
         # Change quotas for tenant
-        quota_set = self.admin_client.update_quotas(project_id,
-                                                    **new_quotas)['quota']
-        self.addCleanup(self.admin_client.reset_quotas, project_id)
+        quota_set = self.admin_quotas_client.update_quotas(
+            project_id, **new_quotas)['quota']
+        self.addCleanup(self.admin_quotas_client.reset_quotas, project_id)
         for key, value in six.iteritems(new_quotas):
             self.assertEqual(value, quota_set[key])
 
         # Confirm our tenant is listed among tenants with non default quotas
-        non_default_quotas = self.admin_client.list_quotas()
+        non_default_quotas = self.admin_quotas_client.list_quotas()
         found = False
         for qs in non_default_quotas['quotas']:
             if qs['tenant_id'] == project_id:
@@ -72,14 +72,14 @@
         self.assertTrue(found)
 
         # Confirm from API quotas were changed as requested for tenant
-        quota_set = self.admin_client.show_quotas(project_id)
+        quota_set = self.admin_quotas_client.show_quotas(project_id)
         quota_set = quota_set['quota']
         for key, value in six.iteritems(new_quotas):
             self.assertEqual(value, quota_set[key])
 
         # Reset quotas to default and confirm
-        self.admin_client.reset_quotas(project_id)
-        non_default_quotas = self.admin_client.list_quotas()
+        self.admin_quotas_client.reset_quotas(project_id)
+        non_default_quotas = self.admin_quotas_client.list_quotas()
         for q in non_default_quotas['quotas']:
             self.assertNotEqual(project_id, q['tenant_id'])
 
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index c5a3dff..f1fd3e9 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -74,6 +74,7 @@
         cls.networks_client = cls.os.networks_client
         cls.subnets_client = cls.os.subnets_client
         cls.ports_client = cls.os.ports_client
+        cls.quotas_client = cls.os.network_quotas_client
         cls.floating_ips_client = cls.os.floating_ips_client
 
     @classmethod
@@ -274,6 +275,7 @@
         cls.admin_networks_client = cls.os_adm.networks_client
         cls.admin_subnets_client = cls.os_adm.subnets_client
         cls.admin_ports_client = cls.os_adm.ports_client
+        cls.admin_quotas_client = cls.os_adm.network_quotas_client
         cls.admin_floating_ips_client = cls.os_adm.floating_ips_client
         cls.admin_metering_labels_client = cls.os_adm.metering_labels_client
         cls.admin_metering_label_rules_client = (
diff --git a/tempest/clients.py b/tempest/clients.py
index b95192b..a837ce1 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -118,6 +118,8 @@
 from tempest.services.network.json.network_client import NetworkClient
 from tempest.services.network.json.networks_client import NetworksClient
 from tempest.services.network.json.ports_client import PortsClient
+from tempest.services.network.json.quotas_client import QuotasClient \
+    as NetworkQuotasClient
 from tempest.services.network.json.subnets_client import SubnetsClient
 from tempest.services.object_storage.account_client import AccountClient
 from tempest.services.object_storage.container_client import ContainerClient
@@ -233,6 +235,14 @@
             build_interval=CONF.network.build_interval,
             build_timeout=CONF.network.build_timeout,
             **self.default_params)
+        self.network_quotas_client = NetworkQuotasClient(
+            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.floating_ips_client = FloatingIPsClient(
             self.auth_provider,
             CONF.network.catalog_type,
diff --git a/tempest/common/credentials_factory.py b/tempest/common/credentials_factory.py
index 95dcafc..5d290d4 100644
--- a/tempest/common/credentials_factory.py
+++ b/tempest/common/credentials_factory.py
@@ -11,8 +11,6 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 
-import os
-
 from oslo_concurrency import lockutils
 from oslo_log import log as logging
 from tempest_lib import auth
@@ -170,8 +168,7 @@
             admin_creds=admin_creds,
             **_get_dynamic_provider_params())
     else:
-        if (CONF.auth.test_accounts_file and
-                os.path.isfile(CONF.auth.test_accounts_file)):
+        if CONF.auth.test_accounts_file:
             # Most params are not relevant for pre-created accounts
             return preprov_creds.PreProvisionedCredentialProvider(
                 name=name, identity_version=identity_version,
@@ -193,8 +190,7 @@
     if CONF.auth.use_dynamic_credentials:
         return is_admin
     # Check whether test accounts file has the admin specified or not
-    elif (CONF.auth.test_accounts_file and
-            os.path.isfile(CONF.auth.test_accounts_file)):
+    elif CONF.auth.test_accounts_file:
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
             identity_version=identity_version, name='check_admin',
             **_get_preprov_provider_params())
@@ -219,8 +215,7 @@
     if CONF.auth.use_dynamic_credentials:
         return True
     # Check whether test accounts file has the admin specified or not
-    if (CONF.auth.test_accounts_file and
-            os.path.isfile(CONF.auth.test_accounts_file)):
+    if CONF.auth.test_accounts_file:
         check_accounts = preprov_creds.PreProvisionedCredentialProvider(
             identity_version=identity_version, name='check_alt',
             **_get_preprov_provider_params())
diff --git a/tempest/common/preprov_creds.py b/tempest/common/preprov_creds.py
index 74cc3f0..34af31e 100644
--- a/tempest/common/preprov_creds.py
+++ b/tempest/common/preprov_creds.py
@@ -31,8 +31,13 @@
 
 
 def read_accounts_yaml(path):
-    with open(path, 'r') as yaml_file:
-        accounts = yaml.load(yaml_file)
+    try:
+        with open(path, 'r') as yaml_file:
+            accounts = yaml.load(yaml_file)
+    except IOError:
+        raise exceptions.InvalidConfiguration(
+            'The path for the test accounts file: %s '
+            'could not be found' % path)
     return accounts
 
 
@@ -74,7 +79,7 @@
             identity_version=identity_version, name=name,
             admin_role=admin_role, credentials_domain=credentials_domain)
         self.test_accounts_file = test_accounts_file
-        if test_accounts_file and os.path.isfile(test_accounts_file):
+        if test_accounts_file:
             accounts = read_accounts_yaml(self.test_accounts_file)
             self.use_default_creds = False
         else:
diff --git a/tempest/config.py b/tempest/config.py
index a6212fb..1f9a1f3 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1406,6 +1406,7 @@
         _CONF.set_default('alt_domain_name',
                           self.auth.default_credentials_domain_name,
                           group='identity')
+        logging.tempest_set_log_file('tempest.log')
 
     def __init__(self, parse_conf=True, config_path=None):
         """Initialize a configuration from a conf directory and conf file."""
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 3e6a947..fc56ad5 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -812,8 +812,9 @@
     def _get_server_port_id_and_ip4(self, server, ip_addr=None):
         ports = self._list_ports(device_id=server['id'], status='ACTIVE',
                                  fixed_ip=ip_addr)
-        # it might happen here that this port has more then one ip address
-        # as in case of dual stack- when this port is created on 2 subnets
+        # A port can have more then one IP address in some cases.
+        # If the network is dual-stack (IPv4 + IPv6), this port is associated
+        # with 2 subnets
         port_map = [(p["id"], fxip["ip_address"])
                     for p in ports
                     for fxip in p["fixed_ips"]
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 20ccc59..5bbff1c 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -757,7 +757,7 @@
 
         # Create server
         self._setup_network_and_servers()
-        self.check_public_network_connectivity(should_connect=False)
+        self.check_public_network_connectivity(should_connect=True)
         self._create_new_network()
         self._hotplug_server()
         fip, server = self.floating_ip_tuple
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 08316be..459891f 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -157,23 +157,6 @@
             message = '(%s) %s' % (caller, message)
         raise exceptions.TimeoutException(message)
 
-    def update_quotas(self, tenant_id, **kwargs):
-        put_body = {'quota': kwargs}
-        uri = '/quotas/%s' % tenant_id
-        return self.update_resource(uri, put_body)
-
-    def reset_quotas(self, tenant_id):
-        uri = '/quotas/%s' % tenant_id
-        return self.delete_resource(uri)
-
-    def show_quotas(self, tenant_id, **fields):
-        uri = '/quotas/%s' % tenant_id
-        return self.show_resource(uri, **fields)
-
-    def list_quotas(self, **filters):
-        uri = '/quotas'
-        return self.list_resources(uri, **filters)
-
     def create_router(self, name, admin_state_up=True, **kwargs):
         post_body = {'router': kwargs}
         post_body['router']['name'] = name
diff --git a/tempest/services/network/json/quotas_client.py b/tempest/services/network/json/quotas_client.py
new file mode 100644
index 0000000..9b65a54
--- /dev/null
+++ b/tempest/services/network/json/quotas_client.py
@@ -0,0 +1,35 @@
+# 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.
+
+from tempest.services.network.json import base
+
+
+class QuotasClient(base.BaseNetworkClient):
+
+    def update_quotas(self, tenant_id, **kwargs):
+        put_body = {'quota': kwargs}
+        uri = '/quotas/%s' % tenant_id
+        return self.update_resource(uri, put_body)
+
+    def reset_quotas(self, tenant_id):
+        uri = '/quotas/%s' % tenant_id
+        return self.delete_resource(uri)
+
+    def show_quotas(self, tenant_id, **fields):
+        uri = '/quotas/%s' % tenant_id
+        return self.show_resource(uri, **fields)
+
+    def list_quotas(self, **filters):
+        uri = '/quotas'
+        return self.list_resources(uri, **filters)