Merge "assertEquals is deprecated, use assertEqual"
diff --git a/README.rst b/README.rst
index f18628a..4161cc6 100644
--- a/README.rst
+++ b/README.rst
@@ -32,16 +32,18 @@
will have a configuration file already set up to work with your
devstack installation.
-Tempest is not tied to any single test runner, but Nose been the most commonly
+Tempest is not tied to any single test runner, but testr is the most commonly
used tool. After setting up your configuration file, you can execute
-the set of Tempest tests by using ``nosetests`` ::
+the set of Tempest tests by using ``testr`` ::
- $> nosetests tempest
+ $> testr run --parallel tempest
To run one single test ::
- $> nosetests -sv tempest.api.compute.servers.test_server_actions.py:
- ServerActionsTestJSON.test_rebuild_nonexistent_server
+ $> testr run --parallel tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_rebuild_nonexistent_server
+
+Alternatively, you can use the run_tests.sh script which will create a venv
+and run the tests or use tox to do the same.
Configuration
-------------
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index c03cd5a..b693227 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -230,6 +230,26 @@
self.assertFalse(flag)
@attr(type='gate')
+ def test_create_server_with_non_public_flavor(self):
+ # Create a flavor with os-flavor-access:is_public false
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
+ # Create the flavor
+ resp, flavor = self.client.create_flavor(flavor_name,
+ self.ram, self.vcpus,
+ self.disk,
+ new_flavor_id,
+ is_public="False")
+ self.addCleanup(self.flavor_clean_up, flavor['id'])
+ self.assertEqual(200, resp.status)
+
+ # Verify flavor is not used by other user
+ self.assertRaises(exceptions.BadRequest,
+ self.os.servers_client.create_server,
+ 'test', self.image_ref, flavor['id'])
+
+ @attr(type='gate')
def test_list_public_flavor_with_other_user(self):
# Create a Flavor with public access.
# Try to List/Get flavor with another user
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index efd2f83..cda5863 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -112,8 +112,7 @@
if c not in fetched_cred_ids]
self.assertEqual(0, len(missing_creds),
"Failed to find cred %s in fetched list" %
- ', '.join(m_cred for m_cred
- in missing_creds))
+ ', '.join(m_cred for m_cred in missing_creds))
class CredentialsTestXML(CredentialsTestJSON):
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index bf7a554..50e9702 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -116,7 +116,7 @@
self.assertEqual(0, len(missing_projects),
"Failed to find project %s in fetched list" %
', '.join(m_project for m_project
- in missing_projects))
+ in missing_projects))
class UsersV3TestXML(UsersV3TestJSON):
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index cbb8d08..b082b1e 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -95,9 +95,11 @@
"""Executes given command with auth attributes appended."""
# TODO(jogo) make admin=False work
creds = ('--os-username %s --os-tenant-name %s --os-password %s '
- '--os-auth-url %s ' % (self.identity.admin_username,
- self.identity.admin_tenant_name, self.identity.admin_password,
- self.identity.uri))
+ '--os-auth-url %s ' %
+ (self.identity.admin_username,
+ self.identity.admin_tenant_name,
+ self.identity.admin_password,
+ self.identity.uri))
flags = creds + ' ' + flags
return self.cmd(cmd, action, flags, params, fail_ok)
diff --git a/tempest/thirdparty/boto/utils/wait.py b/tempest/thirdparty/boto/utils/wait.py
index 1507deb..a44e283 100644
--- a/tempest/thirdparty/boto/utils/wait.py
+++ b/tempest/thirdparty/boto/utils/wait.py
@@ -54,8 +54,7 @@
raise TestCase.failureException("State change timeout exceeded!"
'(%ds) While waiting'
'for %s at "%s"' %
- (dtime,
- final_set, status))
+ (dtime, final_set, status))
time.sleep(default_check_interval)
old_status = status
status = lfunction()
@@ -78,8 +77,7 @@
raise TestCase.failureException('Pattern find timeout exceeded!'
'(%ds) While waiting for'
'"%s" pattern in "%s"' %
- (dtime,
- regexp, text))
+ (dtime, regexp, text))
time.sleep(default_check_interval)