Merge "Fix external connectivity check for dualstack"
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 15369de..4fe2e9f 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -84,13 +84,11 @@
To enable and use locking test accounts you need do a few things:
- #. Enable the locking test account provider with the
- locking_credentials_provider option in the auth section
#. Create a accounts.yaml file which contains the set of pre-existing
credentials to use for testing. To make sure you don't have a credentials
starvation issue when running in parallel make sure you have at least 2
- times the number of parallel workers you are using to execute tempest
- available in the file.
+ times the number of worker processes you are using to execute tempest
+ available in the file. (if running serially the worker count is 1)
You can check the sample file packaged in tempest for the yaml format
#. Provide tempest with the location of you accounts.yaml file with the
@@ -125,15 +123,3 @@
is that if a test requires specific roles on accounts these tests can not be
run. This is because the config options do not give sufficient flexibility to
describe the roles assigned to a user for running the tests.
-
-You also can use the accounts.yaml file to specify the credentials used for
-testing. This will just allocate them serially so you only need to provide
-a pair of credentials. Do note that all the restrictions associated with
-locking test accounts applies to using the accounts.yaml file this way too,
-except since you can't run in parallel only 2 of each type of credential is
-required to run. However, the limitation on tests which require specific roles
-does not apply here.
-
-The procedure for doing this is very similar to with the locking accounts
-provider just don't set the locking_credentials_provider to true and you
-only should need a single pair of credentials.
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 2e57007..175f0d9 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -94,8 +94,12 @@
#
# Path to the yaml file that contains the list of credentials to use
-# for running tests (string value)
-#test_accounts_file = etc/accounts.yaml
+# for running tests. If used when running in parallel you have to make
+# sure sufficient credentials are provided in the accounts file. For
+# example if no tests with roles are being run it requires at least `2
+# * CONC` distinct accounts configured in the `test_accounts_file`,
+# with CONC == the number of concurrent test processes. (string value)
+#test_accounts_file = <None>
# Allows test cases to create/destroy tenants and users. This option
# requires that OpenStack Identity API admin credentials are known. If
@@ -105,14 +109,6 @@
# Deprecated group/name - [orchestration]/allow_tenant_isolation
#allow_tenant_isolation = true
-# If set to True it enables the Accounts provider, which locks
-# credentials to allow for parallel execution with pre-provisioned
-# accounts. It can only be used to run tests that ensure credentials
-# cleanup happens. It requires at least `2 * CONC` distinct accounts
-# configured in `test_accounts_file`, with CONC == the number of
-# concurrent test processes. (boolean value)
-#locking_credentials_provider = false
-
# Roles to assign to all users created by tempest (list value)
#tempest_roles =
@@ -302,9 +298,11 @@
# value)
#ssh_channel_timeout = 60
-# Name of the fixed network that is visible to all test tenants.
-# (string value)
-#fixed_network_name = private
+# Name of the fixed network that is visible to all test tenants. If
+# multiple networks are available for a tenant this is the network
+# which will be used for creating servers if tempest does not create a
+# network or a network is not specified elsewhere (string value)
+#fixed_network_name = <None>
# Network used for SSH connections. Ignored if
# use_floatingip_for_ssh=true or run_ssh=false. (string value)
@@ -393,7 +391,8 @@
#block_migration_for_live_migration = false
# Does the test environment block migration support cinder iSCSI
-# volumes (boolean value)
+# volumes. Note, libvirt doesn't support this, see
+# https://bugs.launchpad.net/nova/+bug/1398999 (boolean value)
#block_migrate_cinder_iscsi = false
# Enable VNC console. This configuration value should be same as
@@ -668,7 +667,7 @@
#non_ssh_image_regex = ^.*[Ww]in.*$
# List of user mapped to regex to matching image names. (string value)
-#ssh_user_regex = [["^.*[Cc]irros.*$", "root"]]
+#ssh_user_regex = [["^.*[Cc]irros.*$", "cirros"]]
[messaging]
diff --git a/requirements.txt b/requirements.txt
index 35b5144..bf7471e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,7 +12,6 @@
python-glanceclient>=0.15.0
python-cinderclient>=1.1.0
python-heatclient>=0.3.0
-python-saharaclient>=0.8.0
python-swiftclient>=2.2.0
testrepository>=0.0.18
oslo.concurrency>=1.8.0,<1.9.0 # Apache-2.0
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/admin/test_live_migration.py
similarity index 100%
rename from tempest/api/compute/test_live_block_migration.py
rename to tempest/api/compute/admin/test_live_migration.py
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index c20d483..477dc61 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -37,12 +37,15 @@
@test.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
def test_get_network(self):
networks = self.client.list_networks()
- configured_network = [x for x in networks if x['label'] ==
- CONF.compute.fixed_network_name]
- self.assertEqual(1, len(configured_network),
- "{0} networks with label {1}".format(
- len(configured_network),
- CONF.compute.fixed_network_name))
+ if CONF.compute.fixed_network_name:
+ configured_network = [x for x in networks if x['label'] ==
+ CONF.compute.fixed_network_name]
+ self.assertEqual(1, len(configured_network),
+ "{0} networks with label {1}".format(
+ len(configured_network),
+ CONF.compute.fixed_network_name))
+ else:
+ configured_network = networks
configured_network = configured_network[0]
network = self.client.get_network(configured_network['id'])
self.assertEqual(configured_network['label'], network['label'])
@@ -51,5 +54,9 @@
def test_list_all_networks(self):
networks = self.client.list_networks()
# Check the configured network is in the list
- configured_network = CONF.compute.fixed_network_name
- self.assertIn(configured_network, [x['label'] for x in networks])
+ if CONF.compute.fixed_network_name:
+ configured_network = CONF.compute.fixed_network_name
+ self.assertIn(configured_network, [x['label'] for x in networks])
+ else:
+ network_name = map(lambda x: x['label'], networks)
+ self.assertGreaterEqual(len(network_name), 1)
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 4995209..9f1a548 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -352,10 +352,10 @@
@classmethod
def skip_checks(cls):
+ super(BaseComputeAdminTest, cls).skip_checks()
if not credentials.is_admin_available():
msg = ("Missing Identity Admin API credentials in configuration.")
raise cls.skipException(msg)
- super(BaseComputeAdminTest, cls).skip_checks()
@classmethod
def setup_credentials(cls):
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 70e4dff..f33204d 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -68,7 +68,10 @@
cls.image_ref_alt)
network = cls.get_tenant_network()
- cls.fixed_network_name = network['name']
+ if network:
+ cls.fixed_network_name = network['name']
+ else:
+ cls.fixed_network_name = None
network_kwargs = fixed_network.set_networks_kwarg(network)
cls.s1_name = data_utils.rand_name(cls.__name__ + '-instance')
cls.s1 = cls.create_test_server(name=cls.s1_name,
@@ -283,6 +286,9 @@
def test_list_servers_filtered_by_ip(self):
# Filter servers by ip
# Here should be listed 1 server
+ if not self.fixed_network_name:
+ msg = 'fixed_network_name needs to be configured to run this test'
+ raise self.skipException(msg)
self.s1 = self.client.get_server(self.s1['id'])
ip = self.s1['addresses'][self.fixed_network_name][0]['addr']
params = {'ip': ip}
@@ -301,6 +307,9 @@
# Filter servers by regex ip
# List all servers filtered by part of ip address.
# Here should be listed all servers
+ if not self.fixed_network_name:
+ msg = 'fixed_network_name needs to be configured to run this test'
+ raise self.skipException(msg)
self.s1 = self.client.get_server(self.s1['id'])
ip = self.s1['addresses'][self.fixed_network_name][0]['addr'][0:-3]
params = {'ip': ip}
diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py
index dd5164d..b3746f2 100644
--- a/tempest/api/identity/admin/v2/test_roles.py
+++ b/tempest/api/identity/admin/v2/test_roles.py
@@ -26,7 +26,7 @@
def resource_setup(cls):
super(RolesTestJSON, cls).resource_setup()
for _ in moves.xrange(5):
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
role = cls.client.create_role(role_name)
cls.data.roles.append(role)
@@ -58,7 +58,7 @@
@test.idempotent_id('c62d909d-6c21-48c0-ae40-0a0760e6db5e')
def test_role_create_delete(self):
"""Role should be created, verified, and deleted."""
- role_name = data_utils.rand_name(name='role-test-')
+ role_name = data_utils.rand_name(name='role-test')
body = self.client.create_role(role_name)
self.assertEqual(role_name, body['name'])
diff --git a/tempest/api/identity/admin/v2/test_roles_negative.py b/tempest/api/identity/admin/v2/test_roles_negative.py
index 662d1ea..5e197ec 100644
--- a/tempest/api/identity/admin/v2/test_roles_negative.py
+++ b/tempest/api/identity/admin/v2/test_roles_negative.py
@@ -58,7 +58,7 @@
@test.idempotent_id('585c8998-a8a4-4641-a5dd-abef7a8ced00')
def test_create_role_by_unauthorized_user(self):
# Non-administrator user should not be able to create role
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.create_role, role_name)
@@ -68,7 +68,7 @@
# Request to create role without a valid token should fail
token = self.client.auth_provider.get_token()
self.client.delete_token(token)
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
self.assertRaises(lib_exc.Unauthorized,
self.client.create_role, role_name)
self.client.auth_provider.clear_auth()
@@ -77,7 +77,7 @@
@test.idempotent_id('c0cde2c8-81c1-4bb0-8fe2-cf615a3547a8')
def test_role_create_duplicate(self):
# Role names should be unique
- role_name = data_utils.rand_name(name='role-dup-')
+ role_name = data_utils.rand_name(name='role-dup')
body = self.client.create_role(role_name)
role1_id = body.get('id')
self.addCleanup(self.client.delete_role, role1_id)
@@ -88,7 +88,7 @@
@test.idempotent_id('15347635-b5b1-4a87-a280-deb2bd6d865e')
def test_delete_role_by_unauthorized_user(self):
# Non-administrator user should not be able to delete role
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
body = self.client.create_role(role_name)
self.data.roles.append(body)
role_id = body.get('id')
@@ -99,7 +99,7 @@
@test.idempotent_id('44b60b20-70de-4dac-beaf-a3fc2650a16b')
def test_delete_role_request_without_token(self):
# Request to delete role without a valid token should fail
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
body = self.client.create_role(role_name)
self.data.roles.append(body)
role_id = body.get('id')
diff --git a/tempest/api/identity/admin/v2/test_services.py b/tempest/api/identity/admin/v2/test_services.py
index 0759ec5..326c78b 100644
--- a/tempest/api/identity/admin/v2/test_services.py
+++ b/tempest/api/identity/admin/v2/test_services.py
@@ -35,9 +35,9 @@
def test_create_get_delete_service(self):
# GET Service
# Creating a Service
- name = data_utils.rand_name('service-')
- type = data_utils.rand_name('type--')
- description = data_utils.rand_name('description-')
+ name = data_utils.rand_name('service')
+ type = data_utils.rand_name('type')
+ description = data_utils.rand_name('description')
service_data = self.client.create_service(
name, type, description=description)
self.assertFalse(service_data['id'] is None)
@@ -67,8 +67,8 @@
@test.idempotent_id('5d3252c8-e555-494b-a6c8-e11d7335da42')
def test_create_service_without_description(self):
# Create a service only with name and type
- name = data_utils.rand_name('service-')
- type = data_utils.rand_name('type--')
+ name = data_utils.rand_name('service')
+ type = data_utils.rand_name('type')
service = self.client.create_service(name, type)
self.assertIn('id', service)
self.addCleanup(self._del_service, service['id'])
@@ -83,9 +83,9 @@
# Create, List, Verify and Delete Services
services = []
for _ in moves.xrange(3):
- name = data_utils.rand_name('service-')
- type = data_utils.rand_name('type--')
- description = data_utils.rand_name('description-')
+ name = data_utils.rand_name('service')
+ type = data_utils.rand_name('type')
+ description = data_utils.rand_name('description')
service = self.client.create_service(
name, type, description=description)
services.append(service)
diff --git a/tempest/api/identity/admin/v2/test_tenant_negative.py b/tempest/api/identity/admin/v2/test_tenant_negative.py
index 8fd1f5a..3ee412b 100644
--- a/tempest/api/identity/admin/v2/test_tenant_negative.py
+++ b/tempest/api/identity/admin/v2/test_tenant_negative.py
@@ -44,7 +44,7 @@
@test.idempotent_id('162ba316-f18b-4987-8c0c-fd9140cd63ed')
def test_tenant_delete_by_unauthorized_user(self):
# Non-administrator user should not be able to delete a tenant
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
tenant = self.client.create_tenant(tenant_name)
self.data.tenants.append(tenant)
self.assertRaises(lib_exc.Forbidden,
@@ -54,7 +54,7 @@
@test.idempotent_id('e450db62-2e9d-418f-893a-54772d6386b1')
def test_tenant_delete_request_without_token(self):
# Request to delete a tenant without a valid token should fail
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
tenant = self.client.create_tenant(tenant_name)
self.data.tenants.append(tenant)
token = self.client.auth_provider.get_token()
@@ -74,7 +74,7 @@
@test.idempotent_id('af16f44b-a849-46cb-9f13-a751c388f739')
def test_tenant_create_duplicate(self):
# Tenant names should be unique
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
body = self.client.create_tenant(tenant_name)
tenant = body
self.data.tenants.append(tenant)
@@ -89,7 +89,7 @@
@test.idempotent_id('d26b278a-6389-4702-8d6e-5980d80137e0')
def test_create_tenant_by_unauthorized_user(self):
# Non-administrator user should not be authorized to create a tenant
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.create_tenant, tenant_name)
@@ -97,7 +97,7 @@
@test.idempotent_id('a3ee9d7e-6920-4dd5-9321-d4b2b7f0a638')
def test_create_tenant_request_without_token(self):
# Create tenant request without a token should not be authorized
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
token = self.client.auth_provider.get_token()
self.client.delete_token(token)
self.assertRaises(lib_exc.Unauthorized, self.client.create_tenant,
@@ -130,7 +130,7 @@
@test.idempotent_id('41704dc5-c5f7-4f79-abfa-76e6fedc570b')
def test_tenant_update_by_unauthorized_user(self):
# Non-administrator user should not be able to update a tenant
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
tenant = self.client.create_tenant(tenant_name)
self.data.tenants.append(tenant)
self.assertRaises(lib_exc.Forbidden,
@@ -140,7 +140,7 @@
@test.idempotent_id('7a421573-72c7-4c22-a98e-ce539219c657')
def test_tenant_update_request_without_token(self):
# Request to update a tenant without a valid token should fail
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
tenant = self.client.create_tenant(tenant_name)
self.data.tenants.append(tenant)
token = self.client.auth_provider.get_token()
diff --git a/tempest/api/identity/admin/v2/test_tenants.py b/tempest/api/identity/admin/v2/test_tenants.py
index 0be25a9..5dba65a 100644
--- a/tempest/api/identity/admin/v2/test_tenants.py
+++ b/tempest/api/identity/admin/v2/test_tenants.py
@@ -49,8 +49,8 @@
@test.idempotent_id('d25e9f24-1310-4d29-b61b-d91299c21d6d')
def test_tenant_create_with_description(self):
# Create tenant with a description
- tenant_name = data_utils.rand_name(name='tenant-')
- tenant_desc = data_utils.rand_name(name='desc-')
+ tenant_name = data_utils.rand_name(name='tenant')
+ tenant_desc = data_utils.rand_name(name='desc')
body = self.client.create_tenant(tenant_name,
description=tenant_desc)
tenant = body
@@ -70,7 +70,7 @@
@test.idempotent_id('670bdddc-1cd7-41c7-b8e2-751cfb67df50')
def test_tenant_create_enabled(self):
# Create a tenant that is enabled
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
body = self.client.create_tenant(tenant_name, enabled=True)
tenant = body
self.data.tenants.append(tenant)
@@ -87,7 +87,7 @@
@test.idempotent_id('3be22093-b30f-499d-b772-38340e5e16fb')
def test_tenant_create_not_enabled(self):
# Create a tenant that is not enabled
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
body = self.client.create_tenant(tenant_name, enabled=False)
tenant = body
self.data.tenants.append(tenant)
@@ -106,7 +106,7 @@
@test.idempotent_id('781f2266-d128-47f3-8bdb-f70970add238')
def test_tenant_update_name(self):
# Update name attribute of a tenant
- t_name1 = data_utils.rand_name(name='tenant-')
+ t_name1 = data_utils.rand_name(name='tenant')
body = self.client.create_tenant(t_name1)
tenant = body
self.data.tenants.append(tenant)
@@ -114,7 +114,7 @@
t_id = body['id']
resp1_name = body['name']
- t_name2 = data_utils.rand_name(name='tenant2-')
+ t_name2 = data_utils.rand_name(name='tenant2')
body = self.client.update_tenant(t_id, name=t_name2)
resp2_name = body['name']
self.assertNotEqual(resp1_name, resp2_name)
@@ -133,8 +133,8 @@
@test.idempotent_id('859fcfe1-3a03-41ef-86f9-b19a47d1cd87')
def test_tenant_update_desc(self):
# Update description attribute of a tenant
- t_name = data_utils.rand_name(name='tenant-')
- t_desc = data_utils.rand_name(name='desc-')
+ t_name = data_utils.rand_name(name='tenant')
+ t_desc = data_utils.rand_name(name='desc')
body = self.client.create_tenant(t_name, description=t_desc)
tenant = body
self.data.tenants.append(tenant)
@@ -142,7 +142,7 @@
t_id = body['id']
resp1_desc = body['description']
- t_desc2 = data_utils.rand_name(name='desc2-')
+ t_desc2 = data_utils.rand_name(name='desc2')
body = self.client.update_tenant(t_id, description=t_desc2)
resp2_desc = body['description']
self.assertNotEqual(resp1_desc, resp2_desc)
@@ -161,7 +161,7 @@
@test.idempotent_id('8fc8981f-f12d-4c66-9972-2bdcf2bc2e1a')
def test_tenant_update_enable(self):
# Update the enabled attribute of a tenant
- t_name = data_utils.rand_name(name='tenant-')
+ t_name = data_utils.rand_name(name='tenant')
t_en = False
body = self.client.create_tenant(t_name, enabled=t_en)
tenant = body
diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py
index 29ba1de..860e5af 100644
--- a/tempest/api/identity/admin/v2/test_tokens.py
+++ b/tempest/api/identity/admin/v2/test_tokens.py
@@ -25,10 +25,10 @@
@test.idempotent_id('453ad4d5-e486-4b2f-be72-cffc8149e586')
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_name = data_utils.rand_name(name='user')
+ user_password = data_utils.rand_name(name='pass')
# first:create a tenant
- tenant_name = data_utils.rand_name(name='tenant-')
+ tenant_name = data_utils.rand_name(name='tenant')
tenant = self.client.create_tenant(tenant_name)
self.data.tenants.append(tenant)
# second:create a user
@@ -60,8 +60,8 @@
"""
# Create a user.
- user_name = data_utils.rand_name(name='user-')
- user_password = data_utils.rand_name(name='pass-')
+ user_name = data_utils.rand_name(name='user')
+ user_password = data_utils.rand_name(name='pass')
tenant_id = None # No default tenant so will get unscoped token.
email = ''
user = self.client.create_user(user_name, user_password,
@@ -69,16 +69,16 @@
self.data.users.append(user)
# Create a couple tenants.
- tenant1_name = data_utils.rand_name(name='tenant-')
+ tenant1_name = data_utils.rand_name(name='tenant')
tenant1 = self.client.create_tenant(tenant1_name)
self.data.tenants.append(tenant1)
- tenant2_name = data_utils.rand_name(name='tenant-')
+ tenant2_name = data_utils.rand_name(name='tenant')
tenant2 = self.client.create_tenant(tenant2_name)
self.data.tenants.append(tenant2)
# Create a role
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
role = self.client.create_role(role_name)
self.data.roles.append(role)
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 2ca5595..f47f985 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -25,8 +25,8 @@
@classmethod
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_user = data_utils.rand_name('test_user')
+ cls.alt_password = data_utils.rand_name('pass')
cls.alt_email = cls.alt_user + '@testmail.tm'
@test.attr(type='smoke')
@@ -45,7 +45,7 @@
def test_create_user_with_enabled(self):
# Create a user with enabled : False
self.data.setup_test_tenant()
- name = data_utils.rand_name('test_user_')
+ name = data_utils.rand_name('test_user')
user = self.client.create_user(name, self.alt_password,
self.data.tenant['id'],
self.alt_email, enabled=False)
@@ -58,7 +58,7 @@
@test.idempotent_id('39d05857-e8a5-4ed4-ba83-0b52d3ab97ee')
def test_update_user(self):
# Test case to check if updating of user attributes is successful.
- test_user = data_utils.rand_name('test_user_')
+ test_user = data_utils.rand_name('test_user')
self.data.setup_test_tenant()
user = self.client.create_user(test_user, self.alt_password,
self.data.tenant['id'],
@@ -66,7 +66,7 @@
# Delete the User at the end of this method
self.addCleanup(self.client.delete_user, user['id'])
# Updating user details with new values
- u_name2 = data_utils.rand_name('user2-')
+ u_name2 = data_utils.rand_name('user2')
u_email2 = u_name2 + '@testmail.tm'
update_user = self.client.update_user(user['id'], name=u_name2,
email=u_email2,
@@ -85,7 +85,7 @@
@test.idempotent_id('29ed26f4-a74e-4425-9a85-fdb49fa269d2')
def test_delete_user(self):
# Delete a user
- test_user = data_utils.rand_name('test_user_')
+ test_user = data_utils.rand_name('test_user')
self.data.setup_test_tenant()
user = self.client.create_user(test_user, self.alt_password,
self.data.tenant['id'],
@@ -139,14 +139,14 @@
self.data.setup_test_tenant()
user_ids = list()
fetched_user_ids = list()
- alt_tenant_user1 = data_utils.rand_name('tenant_user1_')
+ alt_tenant_user1 = data_utils.rand_name('tenant_user1')
user1 = self.client.create_user(alt_tenant_user1, 'password1',
self.data.tenant['id'],
'user1@123')
user_ids.append(user1['id'])
self.data.users.append(user1)
- alt_tenant_user2 = data_utils.rand_name('tenant_user2_')
+ alt_tenant_user2 = data_utils.rand_name('tenant_user2')
user2 = self.client.create_user(alt_tenant_user2, 'password2',
self.data.tenant['id'],
'user2@123')
@@ -179,7 +179,7 @@
role = self.client.assign_user_role(tenant['id'], user['id'],
role['id'])
- alt_user2 = data_utils.rand_name('second_user_')
+ alt_user2 = data_utils.rand_name('second_user')
second_user = self.client.create_user(alt_user2, 'password1',
self.data.tenant['id'],
'user2@123')
@@ -205,7 +205,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_name('pass')
update_user = self.client.update_user_password(
self.data.user['id'], new_pass)
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 387b714..dcf5565 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -27,8 +27,8 @@
@classmethod
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_user = data_utils.rand_name('test_user')
+ cls.alt_password = data_utils.rand_name('pass')
cls.alt_email = cls.alt_user + '@testmail.tm'
@test.attr(type=['negative', 'gate'])
@@ -97,7 +97,7 @@
def test_create_user_with_enabled_non_bool(self):
# Attempt to create a user with valid enabled para should fail
self.data.setup_test_tenant()
- name = data_utils.rand_name('test_user_')
+ name = data_utils.rand_name('test_user')
self.assertRaises(lib_exc.BadRequest, self.client.create_user,
name, self.alt_password,
self.data.tenant['id'],
@@ -107,7 +107,7 @@
@test.idempotent_id('3d07e294-27a0-4144-b780-a2a1bf6fee19')
def test_update_user_for_non_existent_user(self):
# Attempt to update a user non-existent user should fail
- user_name = data_utils.rand_name('user-')
+ user_name = data_utils.rand_name('user')
non_existent_id = str(uuid.uuid4())
self.assertRaises(lib_exc.NotFound, self.client.update_user,
non_existent_id, name=user_name)
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index c427615..9bad8e0 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -27,14 +27,14 @@
cls.projects = list()
cls.creds_list = [['project_id', 'user_id', 'id'],
['access', 'secret']]
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
for i in range(2):
cls.project = cls.client.create_project(
- data_utils.rand_name('project-'),
- description=data_utils.rand_name('project-desc-'))
+ data_utils.rand_name('project'),
+ description=data_utils.rand_name('project-desc'))
cls.projects.append(cls.project['id'])
cls.user_body = cls.client.create_user(
@@ -54,8 +54,8 @@
@test.attr(type='smoke')
@test.idempotent_id('7cd59bf9-bda4-4c72-9467-d21cab278355')
def test_credentials_create_get_update_delete(self):
- keys = [data_utils.rand_name('Access-'),
- data_utils.rand_name('Secret-')]
+ keys = [data_utils.rand_name('Access'),
+ data_utils.rand_name('Secret')]
cred = self.creds_client.create_credential(
keys[0], keys[1], self.user_body['id'],
self.projects[0])
@@ -65,8 +65,8 @@
for value2 in self.creds_list[1]:
self.assertIn(value2, cred['blob'])
- new_keys = [data_utils.rand_name('NewAccess-'),
- data_utils.rand_name('NewSecret-')]
+ new_keys = [data_utils.rand_name('NewAccess'),
+ data_utils.rand_name('NewSecret')]
update_body = self.creds_client.update_credential(
cred['id'], access_key=new_keys[0], secret_key=new_keys[1],
project_id=self.projects[1])
@@ -92,8 +92,8 @@
for i in range(2):
cred = self.creds_client.create_credential(
- data_utils.rand_name('Access-'),
- data_utils.rand_name('Secret-'),
+ data_utils.rand_name('Access'),
+ data_utils.rand_name('Secret'),
self.user_body['id'], self.projects[0])
created_cred_ids.append(cred['id'])
self.addCleanup(self._delete_credential, cred['id'])
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 1f6e651..5af9187 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -35,8 +35,8 @@
fetched_ids = list()
for _ in range(3):
domain = self.client.create_domain(
- data_utils.rand_name('domain-'),
- description=data_utils.rand_name('domain-desc-'))
+ data_utils.rand_name('domain'),
+ description=data_utils.rand_name('domain-desc'))
# Delete the domain at the end of this method
self.addCleanup(self._delete_domain, domain['id'])
domain_ids.append(domain['id'])
@@ -50,8 +50,8 @@
@test.attr(type='smoke')
@test.idempotent_id('f2f5b44a-82e8-4dad-8084-0661ea3b18cf')
def test_create_update_delete_domain(self):
- d_name = data_utils.rand_name('domain-')
- d_desc = data_utils.rand_name('domain-desc-')
+ d_name = data_utils.rand_name('domain')
+ d_desc = data_utils.rand_name('domain-desc')
domain = self.client.create_domain(
d_name, description=d_desc)
self.addCleanup(self._delete_domain, domain['id'])
@@ -64,8 +64,8 @@
self.assertEqual(d_name, domain['name'])
self.assertEqual(d_desc, domain['description'])
self.assertEqual(True, domain['enabled'])
- new_desc = data_utils.rand_name('new-desc-')
- new_name = data_utils.rand_name('new-name-')
+ new_desc = data_utils.rand_name('new-desc')
+ new_name = data_utils.rand_name('new-name')
updated_domain = self.client.update_domain(
domain['id'], name=new_name, description=new_desc)
@@ -88,11 +88,23 @@
@test.idempotent_id('036df86e-bb5d-42c0-a7c2-66b9db3a6046')
def test_create_domain_with_disabled_status(self):
# Create domain with enabled status as false
- d_name = data_utils.rand_name('domain-')
- d_desc = data_utils.rand_name('domain-desc-')
+ d_name = data_utils.rand_name('domain')
+ d_desc = data_utils.rand_name('domain-desc')
domain = self.client.create_domain(
d_name, description=d_desc, enabled=False)
self.addCleanup(self.client.delete_domain, domain['id'])
self.assertEqual(d_name, domain['name'])
self.assertFalse(domain['enabled'])
self.assertEqual(d_desc, domain['description'])
+
+ @test.attr(type='smoke')
+ @test.idempotent_id('2abf8764-309a-4fa9-bc58-201b799817ad')
+ def test_create_domain_without_description(self):
+ # Create domain only with name
+ d_name = data_utils.rand_name('domain-')
+ domain = self.client.create_domain(d_name)
+ self.addCleanup(self._delete_domain, domain['id'])
+ self.assertIn('id', domain)
+ expected_data = {'name': d_name, 'enabled': True}
+ self.assertIsNone(domain['description'])
+ self.assertDictContainsSubset(expected_data, domain)
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index c683f59..2d8c04f 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -31,9 +31,9 @@
def resource_setup(cls):
super(EndPointsTestJSON, cls).resource_setup()
cls.service_ids = list()
- s_name = data_utils.rand_name('service-')
- s_type = data_utils.rand_name('type--')
- s_description = data_utils.rand_name('description-')
+ s_name = data_utils.rand_name('service')
+ s_type = data_utils.rand_name('type')
+ s_description = data_utils.rand_name('description')
cls.service_data =\
cls.service_client.create_service(s_name, s_type,
description=s_description)
@@ -107,9 +107,9 @@
enabled=True)
self.addCleanup(self.client.delete_endpoint, endpoint_for_update['id'])
# Creating service so as update endpoint with new service ID
- s_name = data_utils.rand_name('service-')
- s_type = data_utils.rand_name('type--')
- s_description = data_utils.rand_name('description-')
+ s_name = data_utils.rand_name('service')
+ s_type = data_utils.rand_name('type')
+ s_description = data_utils.rand_name('description')
service2 =\
self.service_client.create_service(s_name, s_type,
description=s_description)
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index e2b7edc..8b85566 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -33,9 +33,9 @@
def resource_setup(cls):
super(EndpointsNegativeTestJSON, cls).resource_setup()
cls.service_ids = list()
- s_name = data_utils.rand_name('service-')
- s_type = data_utils.rand_name('type--')
- s_description = data_utils.rand_name('description-')
+ s_name = data_utils.rand_name('service')
+ s_type = data_utils.rand_name('type')
+ s_description = data_utils.rand_name('description')
cls.service_data = (
cls.service_client.create_service(s_name, s_type,
description=s_description))
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 98d1846..b366d1e 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -75,13 +75,13 @@
def test_list_user_groups(self):
# create a user
user = self.client.create_user(
- data_utils.rand_name('User-'),
- password=data_utils.rand_name('Pass-'))
+ data_utils.rand_name('User'),
+ password=data_utils.rand_name('Pass'))
self.addCleanup(self.client.delete_user, user['id'])
# create two groups, and add user into them
groups = []
for i in range(2):
- name = data_utils.rand_name('Group-')
+ name = data_utils.rand_name('Group')
group = self.client.create_group(name)
groups.append(group)
self.addCleanup(self.client.delete_group, group['id'])
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 63d2b0d..bad56f4 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -31,8 +31,8 @@
policy_ids = list()
fetched_ids = list()
for _ in range(3):
- blob = data_utils.rand_name('BlobName-')
- policy_type = data_utils.rand_name('PolicyType-')
+ blob = data_utils.rand_name('BlobName')
+ policy_type = data_utils.rand_name('PolicyType')
policy = self.policy_client.create_policy(blob,
policy_type)
# Delete the Policy at the end of this method
@@ -49,8 +49,8 @@
@test.idempotent_id('e544703a-2f03-4cf2-9b0f-350782fdb0d3')
def test_create_update_delete_policy(self):
# Test to update policy
- blob = data_utils.rand_name('BlobName-')
- policy_type = data_utils.rand_name('PolicyType-')
+ blob = data_utils.rand_name('BlobName')
+ policy_type = data_utils.rand_name('PolicyType')
policy = self.policy_client.create_policy(blob, policy_type)
self.addCleanup(self._delete_policy, policy['id'])
self.assertIn('id', policy)
@@ -60,7 +60,7 @@
self.assertEqual(blob, policy['blob'])
self.assertEqual(policy_type, policy['type'])
# Update policy
- update_type = data_utils.rand_name('UpdatedPolicyType-')
+ update_type = data_utils.rand_name('UpdatedPolicyType')
data = self.policy_client.update_policy(
policy['id'], type=update_type)
self.assertIn('type', data)
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 69b1fb4..5f8b3d1 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -25,8 +25,8 @@
@test.idempotent_id('0ecf465c-0dc4-4532-ab53-91ffeb74d12d')
def test_project_create_with_description(self):
# Create project with a description
- project_name = data_utils.rand_name('project-')
- project_desc = data_utils.rand_name('desc-')
+ project_name = data_utils.rand_name('project')
+ project_desc = data_utils.rand_name('desc')
project = self.client.create_project(
project_name, description=project_desc)
self.data.projects.append(project)
@@ -59,7 +59,7 @@
@test.idempotent_id('1f66dc76-50cc-4741-a200-af984509e480')
def test_project_create_enabled(self):
# Create a project that is enabled
- project_name = data_utils.rand_name('project-')
+ project_name = data_utils.rand_name('project')
project = self.client.create_project(
project_name, enabled=True)
self.data.projects.append(project)
@@ -74,7 +74,7 @@
@test.idempotent_id('78f96a9c-e0e0-4ee6-a3ba-fbf6dfd03207')
def test_project_create_not_enabled(self):
# Create a project that is not enabled
- project_name = data_utils.rand_name('project-')
+ project_name = data_utils.rand_name('project')
project = self.client.create_project(
project_name, enabled=False)
self.data.projects.append(project)
@@ -90,13 +90,13 @@
@test.idempotent_id('f608f368-048c-496b-ad63-d286c26dab6b')
def test_project_update_name(self):
# Update name attribute of a project
- p_name1 = data_utils.rand_name('project-')
+ p_name1 = data_utils.rand_name('project')
project = self.client.create_project(p_name1)
self.data.projects.append(project)
resp1_name = project['name']
- p_name2 = data_utils.rand_name('project2-')
+ p_name2 = data_utils.rand_name('project2')
body = self.client.update_project(project['id'], name=p_name2)
resp2_name = body['name']
self.assertNotEqual(resp1_name, resp2_name)
@@ -112,14 +112,14 @@
@test.idempotent_id('f138b715-255e-4a7d-871d-351e1ef2e153')
def test_project_update_desc(self):
# Update description attribute of a project
- p_name = data_utils.rand_name('project-')
- p_desc = data_utils.rand_name('desc-')
+ p_name = data_utils.rand_name('project')
+ p_desc = data_utils.rand_name('desc')
project = self.client.create_project(
p_name, description=p_desc)
self.data.projects.append(project)
resp1_desc = project['description']
- p_desc2 = data_utils.rand_name('desc2-')
+ p_desc2 = data_utils.rand_name('desc2')
body = self.client.update_project(
project['id'], description=p_desc2)
resp2_desc = body['description']
@@ -136,7 +136,7 @@
@test.idempotent_id('b6b25683-c97f-474d-a595-55d410b68100')
def test_project_update_enable(self):
# Update the enabled attribute of a project
- p_name = data_utils.rand_name('project-')
+ p_name = data_utils.rand_name('project')
p_en = False
project = self.client.create_project(p_name, enabled=p_en)
self.data.projects.append(project)
@@ -161,15 +161,15 @@
def test_associate_user_to_project(self):
# Associate a user to a project
# Create a Project
- p_name = data_utils.rand_name('project-')
+ p_name = data_utils.rand_name('project')
project = self.client.create_project(p_name)
self.data.projects.append(project)
# Create a User
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
user = self.client.create_user(
u_name, description=u_desc, password=u_password,
email=u_email, project_id=project['id'])
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
index 739bb35..2dda585 100644
--- a/tempest/api/identity/admin/v3/test_projects_negative.py
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -33,7 +33,7 @@
@test.idempotent_id('874c3e84-d174-4348-a16b-8c01f599561b')
def test_project_create_duplicate(self):
# Project names should be unique
- project_name = data_utils.rand_name('project-dup-')
+ project_name = data_utils.rand_name('project-dup')
project = self.client.create_project(project_name)
self.data.projects.append(project)
@@ -44,7 +44,7 @@
@test.idempotent_id('8fba9de2-3e1f-4e77-812a-60cb68f8df13')
def test_create_project_by_unauthorized_user(self):
# Non-admin user should not be authorized to create a project
- project_name = data_utils.rand_name('project-')
+ project_name = data_utils.rand_name('project')
self.assertRaises(
lib_exc.Forbidden, self.non_admin_client.create_project,
project_name)
@@ -68,7 +68,7 @@
@test.idempotent_id('8d68c012-89e0-4394-8d6b-ccd7196def97')
def test_project_delete_by_unauthorized_user(self):
# Non-admin user should not be able to delete a project
- project_name = data_utils.rand_name('project-')
+ project_name = data_utils.rand_name('project')
project = self.client.create_project(project_name)
self.data.projects.append(project)
self.assertRaises(
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index b5c337d..146cc65 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -32,7 +32,7 @@
super(RegionsTestJSON, cls).resource_setup()
cls.setup_regions = list()
for i in range(2):
- r_description = data_utils.rand_name('description-')
+ r_description = data_utils.rand_name('description')
region = cls.client.create_region(r_description)
cls.setup_regions.append(region)
@@ -50,7 +50,7 @@
@test.attr(type='gate')
@test.idempotent_id('56186092-82e4-43f2-b954-91013218ba42')
def test_create_update_get_delete_region(self):
- r_description = data_utils.rand_name('description-')
+ r_description = data_utils.rand_name('description')
region = self.client.create_region(
r_description, parent_region_id=self.setup_regions[0]['id'])
self.addCleanup(self._delete_region, region['id'])
@@ -58,7 +58,7 @@
self.assertEqual(self.setup_regions[0]['id'],
region['parent_region_id'])
# Update region with new description and parent ID
- r_alt_description = data_utils.rand_name('description-')
+ r_alt_description = data_utils.rand_name('description')
region = self.client.update_region(
region['id'],
description=r_alt_description,
@@ -77,7 +77,7 @@
def test_create_region_with_specific_id(self):
# Create a region with a specific id
r_region_id = data_utils.rand_uuid()
- r_description = data_utils.rand_name('description-')
+ r_description = data_utils.rand_name('description')
region = self.client.create_region(
r_description, unique_region_id=r_region_id)
self.addCleanup(self._delete_region, region['id'])
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index b5b1d7b..8334c18 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -25,30 +25,30 @@
def resource_setup(cls):
super(RolesV3TestJSON, cls).resource_setup()
for _ in range(3):
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
role = cls.client.create_role(role_name)
cls.data.v3_roles.append(role)
cls.fetched_role_ids = list()
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
cls.domain = cls.client.create_domain(
- data_utils.rand_name('domain-'),
- description=data_utils.rand_name('domain-desc-'))
+ data_utils.rand_name('domain'),
+ description=data_utils.rand_name('domain-desc'))
cls.project = cls.client.create_project(
- data_utils.rand_name('project-'),
- description=data_utils.rand_name('project-desc-'),
+ data_utils.rand_name('project'),
+ description=data_utils.rand_name('project-desc'),
domain_id=cls.domain['id'])
cls.group_body = cls.client.create_group(
- data_utils.rand_name('Group-'), project_id=cls.project['id'],
+ data_utils.rand_name('Group'), project_id=cls.project['id'],
domain_id=cls.domain['id'])
cls.user_body = cls.client.create_user(
u_name, description=u_desc, password=cls.u_password,
email=u_email, project_id=cls.project['id'],
domain_id=cls.domain['id'])
cls.role = cls.client.create_role(
- data_utils.rand_name('Role-'))
+ data_utils.rand_name('Role'))
@classmethod
def resource_cleanup(cls):
@@ -69,13 +69,13 @@
@test.attr(type='smoke')
@test.idempotent_id('18afc6c0-46cf-4911-824e-9989cc056c3a')
def test_role_create_update_get_list(self):
- r_name = data_utils.rand_name('Role-')
+ r_name = data_utils.rand_name('Role')
role = self.client.create_role(r_name)
self.addCleanup(self.client.delete_role, role['id'])
self.assertIn('name', role)
self.assertEqual(role['name'], r_name)
- new_name = data_utils.rand_name('NewRole-')
+ new_name = data_utils.rand_name('NewRole')
updated_role = self.client.update_role(new_name, role['id'])
self.assertIn('name', updated_role)
self.assertIn('id', updated_role)
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 7358ce9..702e936 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -27,10 +27,10 @@
def test_tokens(self):
# Valid user's token is authenticated
# Create a User
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
user = self.client.create_user(
u_name, description=u_desc, password=u_password,
email=u_email)
@@ -61,22 +61,22 @@
"""
# Create a user.
- user_name = data_utils.rand_name(name='user-')
- user_password = data_utils.rand_name(name='pass-')
+ user_name = data_utils.rand_name(name='user')
+ user_password = data_utils.rand_name(name='pass')
user = self.client.create_user(user_name, password=user_password)
self.addCleanup(self.client.delete_user, user['id'])
# Create a couple projects
- project1_name = data_utils.rand_name(name='project-')
+ project1_name = data_utils.rand_name(name='project')
project1 = self.client.create_project(project1_name)
self.addCleanup(self.client.delete_project, project1['id'])
- project2_name = data_utils.rand_name(name='project-')
+ project2_name = data_utils.rand_name(name='project')
project2 = self.client.create_project(project2_name)
self.addCleanup(self.client.delete_project, project2['id'])
# Create a role
- role_name = data_utils.rand_name(name='role-')
+ role_name = data_utils.rand_name(name='role')
role = self.client.create_role(role_name)
self.addCleanup(self.client.delete_role, role['id'])
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 9d3d0bc..cafd615 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -52,10 +52,10 @@
self.assertIsNotNone(self.trustor_project_id)
# Create a trustor User
- self.trustor_username = data_utils.rand_name('user-')
+ 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_name('pass')
user = self.client.create_user(
self.trustor_username,
description=u_desc,
@@ -65,8 +65,8 @@
self.trustor_user_id = user['id']
# And two roles, one we'll delegate and one we won't
- self.delegated_role = data_utils.rand_name('DelegatedRole-')
- self.not_delegated_role = data_utils.rand_name('NotDelegatedRole-')
+ self.delegated_role = data_utils.rand_name('DelegatedRole')
+ self.not_delegated_role = data_utils.rand_name('NotDelegatedRole')
role = self.client.create_role(self.delegated_role)
self.delegated_role_id = role['id']
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 9d9f61c..e4bfd6a 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -26,10 +26,10 @@
def test_user_update(self):
# Test case to check if updating of user attributes is successful.
# Creating first user
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
user = self.client.create_user(
u_name, description=u_desc, password=u_password,
email=u_email, enabled=False)
@@ -37,12 +37,12 @@
self.addCleanup(self.client.delete_user, user['id'])
# Creating second project for updation
project = self.client.create_project(
- data_utils.rand_name('project-'),
- description=data_utils.rand_name('project-desc-'))
+ data_utils.rand_name('project'),
+ description=data_utils.rand_name('project-desc'))
# Delete the Project at the end of this method
self.addCleanup(self.client.delete_project, project['id'])
# Updating user details with new values
- u_name2 = data_utils.rand_name('user2-')
+ u_name2 = data_utils.rand_name('user2')
u_email2 = u_name2 + '@testmail.tm'
u_description2 = u_name2 + ' description'
update_user = self.client.update_user(
@@ -95,15 +95,15 @@
assigned_project_ids = list()
fetched_project_ids = list()
u_project = self.client.create_project(
- data_utils.rand_name('project-'),
- description=data_utils.rand_name('project-desc-'))
+ data_utils.rand_name('project'),
+ description=data_utils.rand_name('project-desc'))
# Delete the Project at the end of this method
self.addCleanup(self.client.delete_project, u_project['id'])
# Create a user.
- u_name = data_utils.rand_name('user-')
+ 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_name('pass')
user_body = self.client.create_user(
u_name, description=u_desc, password=u_password,
email=u_email, enabled=False, project_id=u_project['id'])
@@ -111,7 +111,7 @@
self.addCleanup(self.client.delete_user, user_body['id'])
# Creating Role
role_body = self.client.create_role(
- data_utils.rand_name('role-'))
+ data_utils.rand_name('role'))
# Delete the Role at the end of this method
self.addCleanup(self.client.delete_role, role_body['id'])
@@ -120,8 +120,8 @@
for i in range(2):
# Creating project so as to assign role
project_body = self.client.create_project(
- data_utils.rand_name('project-'),
- description=data_utils.rand_name('project-desc-'))
+ data_utils.rand_name('project'),
+ description=data_utils.rand_name('project-desc'))
project = self.client.get_project(project_body['id'])
# Delete the Project at the end of this method
self.addCleanup(self.client.delete_project, project_body['id'])
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index db6bdba..b83da3e 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -229,8 +229,8 @@
def setup_test_user(self):
"""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_user = data_utils.rand_name('test_user')
+ self.test_password = data_utils.rand_name('pass')
self.test_email = self.test_user + '@testmail.tm'
self.user = self.client.create_user(self.test_user,
self.test_password,
@@ -240,8 +240,8 @@
def setup_test_tenant(self):
"""Set up a test tenant."""
- self.test_tenant = data_utils.rand_name('test_tenant_')
- self.test_description = data_utils.rand_name('desc_')
+ self.test_tenant = data_utils.rand_name('test_tenant')
+ self.test_description = data_utils.rand_name('desc')
self.tenant = self.client.create_tenant(
name=self.test_tenant,
description=self.test_description)
@@ -256,8 +256,8 @@
def setup_test_v3_user(self):
"""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_user = data_utils.rand_name('test_user')
+ self.test_password = data_utils.rand_name('pass')
self.test_email = self.test_user + '@testmail.tm'
self.v3_user = self.client.create_user(
self.test_user,
@@ -268,8 +268,8 @@
def setup_test_project(self):
"""Set up a test project."""
- self.test_project = data_utils.rand_name('test_project_')
- self.test_description = data_utils.rand_name('desc_')
+ self.test_project = data_utils.rand_name('test_project')
+ self.test_description = data_utils.rand_name('desc')
self.project = self.client.create_project(
name=self.test_project,
description=self.test_description)
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index ad121b0..fca57c6 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -18,8 +18,16 @@
from tempest import exceptions
from tempest import test
+AGENT_TYPE = 'L3 agent'
+AGENT_MODES = (
+ 'legacy',
+ 'dvr_snat'
+)
+
class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest):
+ _agent_mode = 'legacy'
+
"""
Tests the following operations in the Neutron API using the REST client for
Neutron:
@@ -46,12 +54,32 @@
body = cls.admin_client.list_agents()
agents = body['agents']
for agent in agents:
- if agent['agent_type'] == 'L3 agent':
+ # TODO(armax): falling back on default _agent_mode can be
+ # dropped as soon as Icehouse is dropped.
+ agent_mode = (
+ agent['configurations'].get('agent_mode', cls._agent_mode))
+ if agent['agent_type'] == AGENT_TYPE and agent_mode in AGENT_MODES:
cls.agent = agent
break
else:
msg = "L3 Agent Scheduler enabled in conf, but L3 Agent not found"
raise exceptions.InvalidConfiguration(msg)
+ cls.router = cls.create_router(data_utils.rand_name('router'))
+ # NOTE(armax): If DVR is an available extension, and the created router
+ # is indeed a distributed one, more resources need to be provisioned
+ # in order to bind the router to the L3 agent.
+ # That said, let's preserve the existing test logic, where the extra
+ # query and setup steps are only required if the extension is available
+ # and only if the router's default type is distributed.
+ if test.is_extension_enabled('dvr', 'network'):
+ is_dvr_router = cls.admin_client.show_router(
+ cls.router['id'])['router'].get('distributed', False)
+ if is_dvr_router:
+ cls.network = cls.create_network()
+ cls.create_subnet(cls.network)
+ cls.port = cls.create_port(cls.network)
+ cls.client.add_router_interface_with_port_id(
+ cls.router['id'], cls.port['id'])
@test.attr(type='smoke')
@test.idempotent_id('b7ce6e89-e837-4ded-9b78-9ed3c9c6a45a')
@@ -62,22 +90,18 @@
@test.idempotent_id('9464e5e7-8625-49c3-8fd1-89c52be59d66')
def test_add_list_remove_router_on_l3_agent(self):
l3_agent_ids = list()
- name = data_utils.rand_name('router1-')
- router = self.client.create_router(name)
- self.addCleanup(self.client.delete_router, router['router']['id'])
self.admin_client.add_router_to_l3_agent(
self.agent['id'],
- router['router']['id'])
- body = self.admin_client.list_l3_agents_hosting_router(
- router['router']['id'])
+ self.router['id'])
+ body = (
+ self.admin_client.list_l3_agents_hosting_router(self.router['id']))
for agent in body['agents']:
l3_agent_ids.append(agent['id'])
self.assertIn('agent_type', agent)
self.assertEqual('L3 agent', agent['agent_type'])
self.assertIn(self.agent['id'], l3_agent_ids)
- del l3_agent_ids[:]
body = self.admin_client.remove_router_from_l3_agent(
self.agent['id'],
- router['router']['id'])
+ self.router['id'])
# NOTE(afazekas): The deletion not asserted, because neutron
# is not forbidden to reschedule the router to the same agent
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 09a5555..26a31cb 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -263,7 +263,8 @@
@classmethod
def create_router(cls, router_name=None, admin_state_up=False,
- external_network_id=None, enable_snat=None):
+ external_network_id=None, enable_snat=None,
+ **kwargs):
ext_gw_info = {}
if external_network_id:
ext_gw_info['network_id'] = external_network_id
@@ -271,7 +272,7 @@
ext_gw_info['enable_snat'] = enable_snat
body = cls.client.create_router(
router_name, external_gateway_info=ext_gw_info,
- admin_state_up=admin_state_up)
+ admin_state_up=admin_state_up, **kwargs)
router = body['router']
cls.routers.append(router)
return router
diff --git a/tempest/api/network/base_routers.py b/tempest/api/network/base_routers.py
index aa4e200..739e6f9 100644
--- a/tempest/api/network/base_routers.py
+++ b/tempest/api/network/base_routers.py
@@ -21,8 +21,21 @@
# as some router operations, such as enabling or disabling SNAT
# require admin credentials by default
- def _delete_router(self, router_id):
- self.client.delete_router(router_id)
+ def _cleanup_router(self, router):
+ self.delete_router(router)
+ self.routers.remove(router)
+
+ def _create_router(self, name, admin_state_up=False,
+ external_network_id=None, enable_snat=None):
+ # associate a cleanup with created routers to avoid quota limits
+ router = self.create_router(name, admin_state_up,
+ external_network_id, enable_snat)
+ self.addCleanup(self._cleanup_router, router)
+ return router
+
+ def _delete_router(self, router_id, network_client=None):
+ client = network_client or self.client
+ client.delete_router(router_id)
# Asserting that the router is not found in the list
# after deletion
list_body = self.client.list_routers()
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index c6f3849..7c0ab7f 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -44,18 +44,6 @@
if cls._ip_version == 4 else
CONF.network.tenant_network_v6_cidr)
- def _cleanup_router(self, router):
- self.delete_router(router)
- self.routers.remove(router)
-
- def _create_router(self, name, admin_state_up=False,
- external_network_id=None, enable_snat=None):
- # associate a cleanup with created routers to avoid quota limits
- router = self.create_router(name, admin_state_up,
- external_network_id, enable_snat)
- self.addCleanup(self._cleanup_router, router)
- return router
-
@test.attr(type='smoke')
@test.idempotent_id('f64403e2-8483-4b34-8ccd-b09a87bcc68c')
def test_create_show_list_update_delete_router(self):
@@ -363,3 +351,37 @@
class RoutersIpV6Test(RoutersTest):
_ip_version = 6
+
+
+class DvrRoutersTest(base.BaseRouterTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(DvrRoutersTest, cls).skip_checks()
+ if not test.is_extension_enabled('dvr', 'network'):
+ msg = "DVR extension not enabled."
+ raise cls.skipException(msg)
+
+ @test.attr(type='smoke')
+ @test.idempotent_id('141297aa-3424-455d-aa8d-f2d95731e00a')
+ def test_create_distributed_router(self):
+ name = data_utils.rand_name('router')
+ create_body = self.admin_client.create_router(
+ name, distributed=True)
+ self.addCleanup(self._delete_router,
+ create_body['router']['id'],
+ self.admin_client)
+ self.assertTrue(create_body['router']['distributed'])
+
+ @test.attr(type='smoke')
+ @test.idempotent_id('644d7a4a-01a1-4b68-bb8d-0c0042cb1729')
+ def test_convert_centralized_router(self):
+ router = self._create_router(data_utils.rand_name('router'))
+ self.assertNotIn('distributed', router)
+ update_body = self.admin_client.update_router(router['id'],
+ distributed=True)
+ self.assertTrue(update_body['router']['distributed'])
+ show_body = self.admin_client.show_router(router['id'])
+ self.assertTrue(show_body['router']['distributed'])
+ show_body = self.client.show_router(router['id'])
+ self.assertNotIn('distributed', show_body['router'])
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index ae17222..4149be3 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -114,3 +114,28 @@
class RoutersNegativeIpV6Test(RoutersNegativeTest):
_ip_version = 6
+
+
+class DvrRoutersNegativeTest(base.BaseRouterTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(DvrRoutersNegativeTest, cls).skip_checks()
+ if not test.is_extension_enabled('dvr', 'network'):
+ msg = "DVR extension not enabled."
+ raise cls.skipException(msg)
+
+ @classmethod
+ def resource_setup(cls):
+ super(DvrRoutersNegativeTest, cls).resource_setup()
+ cls.router = cls.create_router(data_utils.rand_name('router'))
+ cls.network = cls.create_network()
+ cls.subnet = cls.create_subnet(cls.network)
+
+ @test.attr(type=['negative', 'smoke'])
+ @test.idempotent_id('4990b055-8fc7-48ab-bba7-aa28beaad0b9')
+ def test_router_create_tenant_distributed_returns_forbidden(self):
+ self.assertRaises(lib_exc.Forbidden,
+ self.create_router,
+ data_utils.rand_name('router'),
+ distributed=True)
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 59fdec0..d4b107e 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -199,5 +199,5 @@
for r in resources)
def get_stack_output(self, stack_identifier, output_key):
- body = self.client.get_stack(stack_identifier)
+ body = self.client.show_stack(stack_identifier)
return self.stack_output(body, output_key)
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index bcf091a..81e6e82 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -81,8 +81,8 @@
# attempt to log the server console to help with debugging
# the cause of the server not signalling the waitcondition
# to heat.
- body = cls.client.get_resource(cls.stack_identifier,
- 'Server')
+ body = cls.client.show_resource(cls.stack_identifier,
+ 'Server')
server_id = body['physical_resource_id']
LOG.debug('Console output for %s', server_id)
output = cls.servers_client.get_console_output(
diff --git a/tempest/api/orchestration/stacks/test_non_empty_stack.py b/tempest/api/orchestration/stacks/test_non_empty_stack.py
index 9c5a6d5..5f96de3 100644
--- a/tempest/api/orchestration/stacks/test_non_empty_stack.py
+++ b/tempest/api/orchestration/stacks/test_non_empty_stack.py
@@ -66,7 +66,7 @@
@test.idempotent_id('992f96e3-41ee-4ff6-91c7-bcfb670c0919')
def test_stack_show(self):
"""Getting details about created stack should be possible."""
- stack = self.client.get_stack(self.stack_name)
+ stack = self.client.show_stack(self.stack_name)
self.assertIsInstance(stack, dict)
self.assert_fields_in_dict(stack, 'stack_name', 'id', 'links',
'parameters', 'outputs', 'disable_rollback',
@@ -105,8 +105,8 @@
@test.idempotent_id('2aba03b3-392f-4237-900b-1f5a5e9bd962')
def test_show_resource(self):
"""Getting details about created resource should be possible."""
- resource = self.client.get_resource(self.stack_identifier,
- self.resource_name)
+ resource = self.client.show_resource(self.stack_identifier,
+ self.resource_name)
self.assertIsInstance(resource, dict)
self.assert_fields_in_dict(resource, 'resource_name', 'description',
'links', 'logical_resource_id',
diff --git a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
index 28ef5a5..acdd4c7 100644
--- a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
+++ b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
@@ -73,7 +73,7 @@
@test.attr(type='gate')
@test.idempotent_id('8d77dec7-91fd-45a6-943d-5abd45e338a4')
def test_stack_keypairs_output(self):
- stack = self.client.get_stack(self.stack_name)
+ stack = self.client.show_stack(self.stack_name)
self.assertIsInstance(stack, dict)
output_map = {}
diff --git a/tempest/api/orchestration/stacks/test_resource_types.py b/tempest/api/orchestration/stacks/test_resource_types.py
index 32b0b8e..8f15f9c 100644
--- a/tempest/api/orchestration/stacks/test_resource_types.py
+++ b/tempest/api/orchestration/stacks/test_resource_types.py
@@ -32,7 +32,7 @@
self.assertNotEmpty(resource_types)
for resource_type in resource_types:
- type_schema = self.client.get_resource_type(resource_type)
+ type_schema = self.client.show_resource_type(resource_type)
self.assert_fields_in_dict(type_schema, 'properties',
'attributes', 'resource_type')
self.assertEqual(resource_type, type_schema['resource_type'])
@@ -41,7 +41,7 @@
@test.idempotent_id('8401821d-65fe-4d43-9fa3-57d5ce3a35c7')
def test_resource_type_template(self):
"""Verify it is possible to get template about resource types."""
- type_template = self.client.get_resource_type_template(
+ type_template = self.client.show_resource_type_template(
'OS::Nova::Server')
self.assert_fields_in_dict(
type_template,
diff --git a/tempest/api/orchestration/stacks/test_soft_conf.py b/tempest/api/orchestration/stacks/test_soft_conf.py
index 649bf47..13f0a6c 100644
--- a/tempest/api/orchestration/stacks/test_soft_conf.py
+++ b/tempest/api/orchestration/stacks/test_soft_conf.py
@@ -71,28 +71,28 @@
self.client.delete_software_deploy(deploy_id)
# Testing that it is really gone
self.assertRaises(
- lib_exc.NotFound, self.client.get_software_deploy,
+ lib_exc.NotFound, self.client.show_software_deployment,
self.deployment_id)
def _config_delete(self, config_id):
self.client.delete_software_config(config_id)
# Testing that it is really gone
self.assertRaises(
- lib_exc.NotFound, self.client.get_software_config, config_id)
+ lib_exc.NotFound, self.client.show_software_config, config_id)
@test.attr(type='smoke')
@test.idempotent_id('136162ed-9445-4b9c-b7fc-306af8b5da99')
def test_get_software_config(self):
"""Testing software config get."""
for conf in self.configs:
- api_config = self.client.get_software_config(conf['id'])
+ api_config = self.client.show_software_config(conf['id'])
self._validate_config(conf, api_config)
@test.attr(type='smoke')
@test.idempotent_id('1275c835-c967-4a2c-8d5d-ad533447ed91')
def test_get_deployment_list(self):
"""Getting a list of all deployments"""
- deploy_list = self.client.get_software_deploy_list()
+ deploy_list = self.client.list_software_deployments()
deploy_ids = [deploy['id'] for deploy in
deploy_list['software_deployments']]
self.assertIn(self.deployment_id, deploy_ids)
@@ -101,12 +101,13 @@
@test.idempotent_id('fe7cd9f9-54b1-429c-a3b7-7df8451db913')
def test_get_deployment_metadata(self):
"""Testing deployment metadata get"""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
conf_ids = [conf['id'] for conf in metadata['metadata']]
self.assertIn(self.configs[0]['id'], conf_ids)
def _validate_deployment(self, action, status, reason, config_id):
- deployment = self.client.get_software_deploy(self.deployment_id)
+ deployment = self.client.show_software_deployment(self.deployment_id)
self.assertEqual(action, deployment['software_deployment']['action'])
self.assertEqual(status, deployment['software_deployment']['status'])
self.assertEqual(reason,
@@ -131,7 +132,8 @@
@test.idempotent_id('2ac43ab3-34f2-415d-be2e-eabb4d14ee32')
def test_software_deployment_update_no_metadata_change(self):
"""Testing software deployment update without metadata change."""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
# Updating values without changing the configuration ID
new_action = 'ACTION_1'
new_status = 'STATUS_1'
@@ -145,7 +147,8 @@
new_reason, self.configs[0]['id'])
# Metadata should not be changed at this point
- test_metadata = self.client.get_software_deploy_meta(self.server_id)
+ test_metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
for key in metadata['metadata'][0]:
self.assertEqual(
metadata['metadata'][0][key],
@@ -155,7 +158,8 @@
@test.idempotent_id('92c48944-d79d-4595-a840-8e1a581c1a72')
def test_software_deployment_update_with_metadata_change(self):
"""Testing software deployment update with metadata change."""
- metadata = self.client.get_software_deploy_meta(self.server_id)
+ metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
self.client.update_software_deploy(
self.deployment_id, self.server_id, self.configs[1]['id'],
self.action, self.status, self.input_values,
@@ -163,7 +167,8 @@
self._validate_deployment(self.action, self.status,
self.status_reason, self.configs[1]['id'])
# Metadata should now be changed
- new_metadata = self.client.get_software_deploy_meta(self.server_id)
+ new_metadata = self.client.show_software_deployment_metadata(
+ self.server_id)
# Its enough to test the ID in this case
meta_id = metadata['metadata'][0]['id']
test_id = new_metadata['metadata'][0]['id']
diff --git a/tempest/api/orchestration/stacks/test_stacks.py b/tempest/api/orchestration/stacks/test_stacks.py
index 147f456..9ce8ebeb 100644
--- a/tempest/api/orchestration/stacks/test_stacks.py
+++ b/tempest/api/orchestration/stacks/test_stacks.py
@@ -52,15 +52,15 @@
self.assertIn(stack_id, list_ids)
# fetch the stack
- stack = self.client.get_stack(stack_identifier)
+ stack = self.client.show_stack(stack_identifier)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# fetch the stack by name
- stack = self.client.get_stack(stack_name)
+ stack = self.client.show_stack(stack_name)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# fetch the stack by id
- stack = self.client.get_stack(stack_id)
+ stack = self.client.show_stack(stack_id)
self.assertEqual('CREATE_COMPLETE', stack['stack_status'])
# delete the stack
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index 5f03e16..2b1ec12 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -34,7 +34,7 @@
def _cinder_verify(self, volume_id, template):
self.assertIsNotNone(volume_id)
- volume = self.volumes_client.get_volume(volume_id)
+ volume = self.volumes_client.show_volume(volume_id)
self.assertEqual('available', volume.get('status'))
self.assertEqual(template['resources']['volume']['properties'][
'size'], volume.get('size'))
@@ -76,7 +76,7 @@
self.client.delete_stack(stack_identifier)
self.client.wait_for_stack_status(stack_identifier, 'DELETE_COMPLETE')
self.assertRaises(lib_exc.NotFound,
- self.volumes_client.get_volume,
+ self.volumes_client.show_volume,
volume_id)
def _cleanup_volume(self, volume_id):
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index ad5eb7d..db2d143 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -139,7 +139,7 @@
# the multi backend feature has been enabled
# if multi-backend is enabled: os-vol-attr:host should be like:
# host@backend_name
- volume = self.admin_volume_client.get_volume(volume_id)
+ volume = self.admin_volume_client.show_volume(volume_id)
volume1_host = volume['os-vol-host-attr:host']
msg = ("multi-backend reporting incorrect values for volume %s" %
@@ -150,10 +150,10 @@
# this test checks that the two volumes created at setUp don't
# belong to the same backend (if they are, than the
# volume backend distinction is not working properly)
- volume = self.admin_volume_client.get_volume(volume1_id)
+ volume = self.admin_volume_client.show_volume(volume1_id)
volume1_host = volume['os-vol-host-attr:host']
- volume = self.admin_volume_client.get_volume(volume2_id)
+ volume = self.admin_volume_client.show_volume(volume2_id)
volume2_host = volume['os-vol-host-attr:host']
msg = ("volumes %s and %s were created in the same backend" %
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index db026c1..d6e3f3e 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -89,7 +89,7 @@
self.admin_snapshots_client.\
reset_snapshot_status(self.snapshot['id'], status)
snapshot_get \
- = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])
+ = self.admin_snapshots_client.show_snapshot(self.snapshot['id'])
self.assertEqual(status, snapshot_get['status'])
@test.attr(type='gate')
@@ -107,7 +107,7 @@
self.client.update_snapshot_status(self.snapshot['id'],
status, progress)
snapshot_get \
- = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])
+ = self.admin_snapshots_client.show_snapshot(self.snapshot['id'])
self.assertEqual(status, snapshot_get['status'])
self.assertEqual(progress, snapshot_get[progress_alias])
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 86d90f6..3ec3219 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -32,14 +32,14 @@
@test.attr(type='gate')
@test.idempotent_id('59eada70-403c-4cef-a2a3-a8ce2f1b07a0')
def test_list_quotas(self):
- quotas = self.quotas_client.get_quota_set(self.demo_tenant_id)
+ quotas = self.quotas_client.show_quota_set(self.demo_tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quotas)
@test.attr(type='gate')
@test.idempotent_id('2be020a2-5fdd-423d-8d35-a7ffbc36e9f7')
def test_list_default_quotas(self):
- quotas = self.quotas_client.get_default_quota_set(
+ quotas = self.quotas_client.show_default_quota_set(
self.demo_tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quotas)
@@ -48,7 +48,7 @@
@test.idempotent_id('3d45c99e-cc42-4424-a56e-5cbd212b63a6')
def test_update_all_quota_resources_for_tenant(self):
# Admin can update all the resource quota limits for a tenant
- default_quota_set = self.quotas_client.get_default_quota_set(
+ default_quota_set = self.quotas_client.show_default_quota_set(
self.demo_tenant_id)
new_quota_set = {'gigabytes': 1009,
'volumes': 11,
@@ -72,7 +72,7 @@
@test.attr(type='gate')
@test.idempotent_id('18c51ae9-cb03-48fc-b234-14a19374dbed')
def test_show_quota_usage(self):
- quota_usage = self.quotas_client.get_quota_usage(
+ quota_usage = self.quotas_client.show_quota_usage(
self.os_adm.credentials.tenant_id)
for key in QUOTA_KEYS:
self.assertIn(key, quota_usage)
@@ -82,14 +82,14 @@
@test.attr(type='gate')
@test.idempotent_id('ae8b6091-48ad-4bfa-a188-bbf5cc02115f')
def test_quota_usage(self):
- quota_usage = self.quotas_client.get_quota_usage(
+ quota_usage = self.quotas_client.show_quota_usage(
self.demo_tenant_id)
volume = self.create_volume()
self.addCleanup(self.admin_volume_client.delete_volume,
volume['id'])
- new_quota_usage = self.quotas_client.get_quota_usage(
+ new_quota_usage = self.quotas_client.show_quota_usage(
self.demo_tenant_id)
self.assertEqual(quota_usage['volumes']['in_use'] + 1,
@@ -108,7 +108,7 @@
tenant = identity_client.create_tenant(tenant_name)
tenant_id = tenant['id']
self.addCleanup(identity_client.delete_tenant, tenant_id)
- quota_set_default = self.quotas_client.get_default_quota_set(
+ quota_set_default = self.quotas_client.show_default_quota_set(
tenant_id)
volume_default = quota_set_default['volumes']
@@ -116,7 +116,7 @@
volumes=(int(volume_default) + 5))
self.quotas_client.delete_quota_set(tenant_id)
- quota_set_new = self.quotas_client.get_quota_set(tenant_id)
+ quota_set_new = self.quotas_client.show_quota_set(tenant_id)
self.assertEqual(volume_default, quota_set_new['volumes'])
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 681a48a..048b02c 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -77,7 +77,7 @@
self.volumes_client.wait_for_volume_status(volume['id'], 'available')
# Get volume details and Verify
- fetched_volume = self.volumes_client.get_volume(volume['id'])
+ fetched_volume = self.volumes_client.show_volume(volume['id'])
self.assertEqual(volume_types[1]['name'],
fetched_volume['volume_type'],
'The fetched Volume type is different '
@@ -110,7 +110,7 @@
"to the requested name")
self.assertTrue(body['id'] is not None,
"Field volume_type id is empty or not found.")
- fetched_volume_type = self.volume_types_client.get_volume_type(
+ fetched_volume_type = self.volume_types_client.show_volume_type(
body['id'])
self.assertEqual(name, fetched_volume_type['name'],
'The fetched Volume_type is different '
@@ -146,7 +146,7 @@
# Get encryption type
fetched_encryption_type = (
- self.volume_types_client.get_encryption_type(
+ self.volume_types_client.show_encryption_type(
encryption_type['volume_type_id']))
self.assertEqual(provider,
fetched_encryption_type['provider'],
@@ -164,7 +164,7 @@
"type": "encryption-type"}
self.volume_types_client.wait_for_resource_deletion(resource)
deleted_encryption_type = (
- self.volume_types_client.get_encryption_type(
+ self.volume_types_client.show_encryption_type(
encryption_type['volume_type_id']))
self.assertEmpty(deleted_encryption_type)
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs.py b/tempest/api/volume/admin/test_volume_types_extra_specs.py
index f382a67..0f4dbe5 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs.py
@@ -77,7 +77,7 @@
self.assertEqual(extra_specs, body,
"Volume type extra spec incorrectly created")
- self.volume_types_client.get_volume_type_extra_specs(
+ self.volume_types_client.show_volume_type_extra_specs(
self.volume_type['id'],
extra_specs.keys()[0])
self.assertEqual(extra_specs, body,
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index 7775025..e861c5f 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -137,7 +137,7 @@
extra_specs = {"spec1": "val1"}
self.assertRaises(
lib_exc.NotFound,
- self.volume_types_client.get_volume_type_extra_specs,
+ self.volume_types_client.show_volume_type_extra_specs,
str(uuid.uuid4()), extra_specs.keys()[0])
@test.attr(type='gate')
@@ -147,7 +147,7 @@
# id.
self.assertRaises(
lib_exc.NotFound,
- self.volume_types_client.get_volume_type_extra_specs,
+ self.volume_types_client.show_volume_type_extra_specs,
self.volume_type['id'], str(uuid.uuid4()))
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index d2bf777..d9be337 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -45,7 +45,7 @@
def test_get_nonexistent_type_id(self):
# Should not be able to get volume type with nonexistent type id.
self.assertRaises(lib_exc.NotFound,
- self.volume_types_client.get_volume_type,
+ self.volume_types_client.show_volume_type,
str(uuid.uuid4()))
@test.attr(type='gate')
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
index 1b69549..feb46a3 100644
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -79,7 +79,7 @@
def test_volume_reset_status(self):
# test volume reset status : available->error->available
self._reset_volume_status(self.volume['id'], 'error')
- volume_get = self.admin_volume_client.get_volume(
+ volume_get = self.admin_volume_client.show_volume(
self.volume['id'])
self.assertEqual('error', volume_get['status'])
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 6fd2a5e..2d830c8 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -55,11 +55,11 @@
'available')
# Get a given backup
- backup = self.backups_adm_client.get_backup(backup['id'])
+ backup = self.backups_adm_client.show_backup(backup['id'])
self.assertEqual(backup_name, backup['name'])
# Get all backups with detail
- backups = self.backups_adm_client.list_backups_with_detail()
+ backups = self.backups_adm_client.list_backups(detail=True)
self.assertIn((backup['name'], backup['id']),
[(m['name'], m['id']) for m in backups])
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 1f76b1c..28676b0 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -18,6 +18,7 @@
from tempest_lib import exceptions as lib_exc
from tempest import clients
+from tempest.common import credentials
from tempest.common import fixed_network
from tempest import config
from tempest import exceptions
@@ -175,14 +176,17 @@
"""Base test case class for all Volume Admin API tests."""
@classmethod
+ def skip_checks(cls):
+ super(BaseVolumeAdminTest, cls).skip_checks()
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in configuration.")
+ raise cls.skipException(msg)
+
+ @classmethod
def setup_credentials(cls):
super(BaseVolumeAdminTest, cls).setup_credentials()
- try:
- cls.adm_creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(credentials=cls.adm_creds)
- except NotImplementedError:
- msg = "Missing Volume Admin API credentials in configuration."
- raise cls.skipException(msg)
+ cls.adm_creds = cls.isolated_creds.get_admin_creds()
+ cls.os_adm = clients.Manager(credentials=cls.adm_creds)
@classmethod
def setup_clients(cls):
diff --git a/tempest/api/volume/test_availability_zone.py b/tempest/api/volume/test_availability_zone.py
index e63cfcd..d544821 100644
--- a/tempest/api/volume/test_availability_zone.py
+++ b/tempest/api/volume/test_availability_zone.py
@@ -32,7 +32,7 @@
@test.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
def test_get_availability_zone_list(self):
# List of availability zone
- availability_zone = self.client.get_availability_zone_list()
+ availability_zone = self.client.list_availability_zones()
self.assertTrue(len(availability_zone) > 0)
diff --git a/tempest/api/volume/test_qos.py b/tempest/api/volume/test_qos.py
index f806790..edece79 100644
--- a/tempest/api/volume/test_qos.py
+++ b/tempest/api/volume/test_qos.py
@@ -64,7 +64,7 @@
self.created_qos['id'], vol_type_id)
def _test_get_association_qos(self):
- body = self.volume_qos_client.get_association_qos(
+ body = self.volume_qos_client.show_association_qos(
self.created_qos['id'])
associations = []
@@ -102,7 +102,7 @@
@test.idempotent_id('7aa214cc-ac1a-4397-931f-3bb2e83bb0fd')
def test_get_qos(self):
"""Tests the detail of a given qos-specs"""
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertEqual(self.qos_name, body['name'])
self.assertEqual(self.qos_consumer, body['consumer'])
@@ -121,7 +121,7 @@
body = self.volume_qos_client.set_qos_key(self.created_qos['id'],
iops_bytes='500')
self.assertEqual(args, body)
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertEqual(args['iops_bytes'], body['specs']['iops_bytes'])
# test the deletion of a specs key from qos-specs
@@ -130,7 +130,7 @@
operation = 'qos-key-unset'
self.volume_qos_client.wait_for_qos_operations(self.created_qos['id'],
operation, keys)
- body = self.volume_qos_client.get_qos(self.created_qos['id'])
+ body = self.volume_qos_client.show_qos(self.created_qos['id'])
self.assertNotIn(keys[0], body['specs'])
@test.attr(type='smoke')
diff --git a/tempest/api/volume/test_snapshot_metadata.py b/tempest/api/volume/test_snapshot_metadata.py
index d4efc2a..536648d 100644
--- a/tempest/api/volume/test_snapshot_metadata.py
+++ b/tempest/api/volume/test_snapshot_metadata.py
@@ -50,12 +50,12 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Delete one item metadata of the snapshot
self.client.delete_snapshot_metadata_item(
self.snapshot_id, "key1")
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(expected, body)
@test.attr(type='gate')
@@ -71,13 +71,13 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Update metadata item
body = self.client.update_snapshot_metadata(
self.snapshot_id, update)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(update, body)
@test.attr(type='gate')
@@ -95,13 +95,13 @@
body = self.client.create_snapshot_metadata(self.snapshot_id,
metadata)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(metadata, body)
# Update metadata item
body = self.client.update_snapshot_metadata_item(
self.snapshot_id, "key3", update_item)
# Get the metadata of the snapshot
- body = self.client.get_snapshot_metadata(self.snapshot_id)
+ body = self.client.show_snapshot_metadata(self.snapshot_id)
self.assertEqual(expect, body)
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index e601349..a0e1161 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -45,12 +45,12 @@
body = self.volumes_client.create_volume_metadata(self.volume_id,
metadata)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
# Delete one item metadata of the volume
self.volumes_client.delete_volume_metadata_item(
self.volume_id, "key1")
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertNotIn("key1", body)
del metadata["key1"]
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
@@ -70,13 +70,13 @@
body = self.volumes_client.create_volume_metadata(
self.volume_id, metadata)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(metadata.items()))
# Update metadata
body = self.volumes_client.update_volume_metadata(
self.volume_id, update)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(update.items()))
@test.attr(type='gate')
@@ -98,7 +98,7 @@
body = self.volumes_client.update_volume_metadata_item(
self.volume_id, "key3", update_item)
# Get the metadata of the volume
- body = self.volumes_client.get_volume_metadata(self.volume_id)
+ body = self.volumes_client.show_volume_metadata(self.volume_id)
self.assertThat(body.items(), matchers.ContainsAll(expect.items()))
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 40947df..4acab39 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -71,7 +71,7 @@
'awaiting-transfer')
# Get a volume transfer
- body = self.client.get_volume_transfer(transfer_id)
+ body = self.client.show_volume_transfer(transfer_id)
self.assertEqual(volume['id'], body['volume_id'])
# List volume transfers, the result should be greater than
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 1872ec7..fecb98b 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -86,7 +86,7 @@
self.volume['id'],
'available')
self.addCleanup(self.client.detach_volume, self.volume['id'])
- volume = self.client.get_volume(self.volume['id'])
+ volume = self.client.show_volume(self.volume['id'])
self.assertIn('attachments', volume)
attachment = self.client.get_attachment_from_volume(volume)
self.assertEqual(mountpoint, attachment['device'])
@@ -117,12 +117,12 @@
# Mark volume as reserved.
body = self.client.reserve_volume(self.volume['id'])
# To get the volume info
- body = self.client.get_volume(self.volume['id'])
+ body = self.client.show_volume(self.volume['id'])
self.assertIn('attaching', body['status'])
# Unmark volume as reserved.
body = self.client.unreserve_volume(self.volume['id'])
# To get the volume info
- body = self.client.get_volume(self.volume['id'])
+ body = self.client.show_volume(self.volume['id'])
self.assertIn('available', body['status'])
def _is_true(self, val):
@@ -136,7 +136,7 @@
self.client.update_volume_readonly(self.volume['id'],
readonly)
# Get Volume information
- fetched_volume = self.client.get_volume(self.volume['id'])
+ fetched_volume = self.client.show_volume(self.volume['id'])
bool_flag = self._is_true(fetched_volume['metadata']['readonly'])
self.assertEqual(True, bool_flag)
@@ -145,7 +145,7 @@
self.client.update_volume_readonly(self.volume['id'], readonly)
# Get Volume information
- fetched_volume = self.client.get_volume(self.volume['id'])
+ fetched_volume = self.client.show_volume(self.volume['id'])
bool_flag = self._is_true(fetched_volume['metadata']['readonly'])
self.assertEqual(False, bool_flag)
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index 35c12bc..38bb748 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -35,7 +35,7 @@
extend_size = int(self.volume['size']) + 1
self.client.extend_volume(self.volume['id'], extend_size)
self.client.wait_for_volume_status(self.volume['id'], 'available')
- volume = self.client.get_volume(self.volume['id'])
+ volume = self.client.show_volume(self.volume['id'])
self.assertEqual(int(volume['size']), extend_size)
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 1fa1d5f..1027f48 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -60,7 +60,7 @@
self.assertTrue(volume['id'] is not None,
"Field volume id is empty or not found.")
# Get Volume information
- fetched_volume = self.client.get_volume(volume['id'])
+ fetched_volume = self.client.show_volume(volume['id'])
self.assertEqual(v_name,
fetched_volume[self.name_field],
'The fetched Volume name is different '
@@ -92,8 +92,8 @@
# Assert response body for update_volume method
self.assertEqual(new_v_name, update_volume[self.name_field])
self.assertEqual(new_desc, update_volume[self.descrip_field])
- # Assert response body for get_volume method
- updated_volume = self.client.get_volume(volume['id'])
+ # Assert response body for show_volume method
+ updated_volume = self.client.show_volume(volume['id'])
self.assertEqual(volume['id'], updated_volume['id'])
self.assertEqual(new_v_name, updated_volume[self.name_field])
self.assertEqual(new_desc, updated_volume[self.descrip_field])
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 29e3324..1c7b1c8 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -70,7 +70,7 @@
cls.metadata = {'Type': 'work'}
for i in range(3):
volume = cls.create_volume(metadata=cls.metadata)
- volume = cls.client.get_volume(volume['id'])
+ volume = cls.client.show_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
@@ -89,7 +89,7 @@
"""
if with_detail:
fetched_vol_list = \
- self.client.list_volumes_with_detail(params=params)
+ self.client.list_volumes(detail=True, params=params)
else:
fetched_vol_list = self.client.list_volumes(params=params)
@@ -125,7 +125,7 @@
def test_volume_list_with_details(self):
# Get a list of Volumes with details
# Fetch all Volumes
- fetched_list = self.client.list_volumes_with_detail()
+ fetched_list = self.client.list_volumes(detail=True)
self.assertVolumesIn(fetched_list, self.volume_list)
@test.attr(type='gate')
@@ -133,7 +133,7 @@
def test_volume_list_by_name(self):
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
params = {self.name: volume[self.name]}
- fetched_vol = self.client.list_volumes(params)
+ fetched_vol = self.client.list_volumes(params=params)
self.assertEqual(1, len(fetched_vol), str(fetched_vol))
self.assertEqual(fetched_vol[0][self.name],
volume[self.name])
@@ -143,7 +143,7 @@
def test_volume_list_details_by_name(self):
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
params = {self.name: volume[self.name]}
- fetched_vol = self.client.list_volumes_with_detail(params)
+ fetched_vol = self.client.list_volumes(detail=True, params=params)
self.assertEqual(1, len(fetched_vol), str(fetched_vol))
self.assertEqual(fetched_vol[0][self.name],
volume[self.name])
@@ -152,7 +152,7 @@
@test.idempotent_id('39654e13-734c-4dab-95ce-7613bf8407ce')
def test_volumes_list_by_status(self):
params = {'status': 'available'}
- fetched_list = self.client.list_volumes(params)
+ fetched_list = self.client.list_volumes(params=params)
self._list_by_param_value_and_assert(params)
self.assertVolumesIn(fetched_list, self.volume_list,
fields=self.VOLUME_FIELDS)
@@ -161,7 +161,7 @@
@test.idempotent_id('2943f712-71ec-482a-bf49-d5ca06216b9f')
def test_volumes_list_details_by_status(self):
params = {'status': 'available'}
- fetched_list = self.client.list_volumes_with_detail(params)
+ fetched_list = self.client.list_volumes(detail=True, params=params)
for volume in fetched_list:
self.assertEqual('available', volume['status'])
self.assertVolumesIn(fetched_list, self.volume_list)
@@ -172,7 +172,7 @@
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
zone = volume['availability_zone']
params = {'availability_zone': zone}
- fetched_list = self.client.list_volumes(params)
+ fetched_list = self.client.list_volumes(params=params)
self._list_by_param_value_and_assert(params)
self.assertVolumesIn(fetched_list, self.volume_list,
fields=self.VOLUME_FIELDS)
@@ -183,7 +183,7 @@
volume = self.volume_list[data_utils.rand_int_id(0, 2)]
zone = volume['availability_zone']
params = {'availability_zone': zone}
- fetched_list = self.client.list_volumes_with_detail(params)
+ fetched_list = self.client.list_volumes(detail=True, params=params)
for volume in fetched_list:
self.assertEqual(zone, volume['availability_zone'])
self.assertVolumesIn(fetched_list, self.volume_list)
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index a47e964..aba245a 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -43,7 +43,7 @@
@test.idempotent_id('f131c586-9448-44a4-a8b0-54ca838aa43e')
def test_volume_get_nonexistent_volume_id(self):
# Should not be able to get a non-existent volume
- self.assertRaises(lib_exc.NotFound, self.client.get_volume,
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume,
str(uuid.uuid4()))
@test.attr(type=['negative', 'gate'])
@@ -152,14 +152,14 @@
@test.idempotent_id('30799cfd-7ee4-446c-b66c-45b383ed211b')
def test_get_invalid_volume_id(self):
# Should not be able to get volume with invalid id
- self.assertRaises(lib_exc.NotFound, self.client.get_volume,
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume,
'#$%%&^&^')
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('c6c3db06-29ad-4e91-beb0-2ab195fe49e3')
def test_get_volume_without_passing_volume_id(self):
# Should not be able to get volume when empty ID is passed
- self.assertRaises(lib_exc.NotFound, self.client.get_volume, '')
+ self.assertRaises(lib_exc.NotFound, self.client.show_volume, '')
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('1f035827-7c32-4019-9240-b4ec2dbd9dfd')
@@ -266,7 +266,7 @@
def test_list_volumes_with_nonexistent_name(self):
v_name = data_utils.rand_name('Volume')
params = {self.name_field: v_name}
- fetched_volume = self.client.list_volumes(params)
+ fetched_volume = self.client.list_volumes(params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@@ -275,14 +275,14 @@
v_name = data_utils.rand_name('Volume')
params = {self.name_field: v_name}
fetched_volume = \
- self.client.list_volumes_with_detail(params)
+ self.client.list_volumes(detail=True, params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@test.idempotent_id('143b279b-7522-466b-81be-34a87d564a7c')
def test_list_volumes_with_invalid_status(self):
params = {'status': 'null'}
- fetched_volume = self.client.list_volumes(params)
+ fetched_volume = self.client.list_volumes(params=params)
self.assertEqual(0, len(fetched_volume))
@test.attr(type=['negative', 'gate'])
@@ -290,7 +290,7 @@
def test_list_volumes_detail_with_invalid_status(self):
params = {'status': 'null'}
fetched_volume = \
- self.client.list_volumes_with_detail(params)
+ self.client.list_volumes(detail=True, params=params)
self.assertEqual(0, len(fetched_volume))
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index b277390..2c15f92 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -50,7 +50,7 @@
if with_detail:
fetched_snap_list = \
self.snapshots_client.\
- list_snapshots_with_detail(params=params)
+ list_snapshots(detail=True, params=params)
else:
fetched_snap_list = \
self.snapshots_client.list_snapshots(params=params)
@@ -98,7 +98,7 @@
snapshot = self.create_snapshot(self.volume_origin['id'], **params)
# Get the snap and check for some of its details
- snap_get = self.snapshots_client.get_snapshot(snapshot['id'])
+ snap_get = self.snapshots_client.show_snapshot(snapshot['id'])
self.assertEqual(self.volume_origin['id'],
snap_get['volume_id'],
"Referred volume origin mismatch")
@@ -119,9 +119,9 @@
# Assert response body for update_snapshot method
self.assertEqual(new_s_name, update_snapshot[self.name_field])
self.assertEqual(new_desc, update_snapshot[self.descrip_field])
- # Assert response body for get_snapshot method
+ # Assert response body for show_snapshot method
updated_snapshot = \
- self.snapshots_client.get_snapshot(snapshot['id'])
+ self.snapshots_client.show_snapshot(snapshot['id'])
self.assertEqual(new_s_name, updated_snapshot[self.name_field])
self.assertEqual(new_desc, updated_snapshot[self.descrip_field])
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index f6b52a9..04ea361 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -45,7 +45,7 @@
cls.metadata = {'Type': 'work'}
for i in range(3):
volume = cls.create_volume(metadata=cls.metadata)
- volume = cls.client.get_volume(volume['id'])
+ volume = cls.client.show_volume(volume['id'])
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
@@ -70,7 +70,8 @@
'sort_dir': sort_dir,
'sort_key': sort_key
}
- fetched_volume = self.client.list_volumes_with_detail(params)
+ fetched_volume = self.client.list_volumes(detail=True,
+ params=params)
self.assertEqual(limit, len(fetched_volume),
"The count of volumes is %s, expected:%s " %
(len(fetched_volume), limit))
diff --git a/tempest/api_schema/response/compute/availability_zone.py b/tempest/api_schema/response/compute/availability_zone.py
deleted file mode 100644
index ab3e2ea..0000000
--- a/tempest/api_schema/response/compute/availability_zone.py
+++ /dev/null
@@ -1,37 +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.
-
-# NOTE: This is the detail information for "get az detail" API.
-# The information is the same between v2 and v3 APIs.
-detail = {
- 'type': 'object',
- 'patternProperties': {
- # NOTE: Here is for a hostname
- '^[a-zA-Z0-9-_.]+$': {
- 'type': 'object',
- 'patternProperties': {
- # NOTE: Here is for a service name
- '^.*$': {
- 'type': 'object',
- 'properties': {
- 'available': {'type': 'boolean'},
- 'active': {'type': 'boolean'},
- 'updated_at': {'type': ['string', 'null']}
- },
- 'required': ['available', 'active', 'updated_at']
- }
- }
- }
- }
-}
diff --git a/tempest/api_schema/response/compute/hypervisors.py b/tempest/api_schema/response/compute/hypervisors.py
deleted file mode 100644
index d6f2bd1..0000000
--- a/tempest/api_schema/response/compute/hypervisors.py
+++ /dev/null
@@ -1,225 +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.
-
-import copy
-
-hypervisor_statistics = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor_statistics': {
- 'type': 'object',
- 'properties': {
- 'count': {'type': 'integer'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- 'required': ['count', 'current_workload',
- 'disk_available_least', 'free_disk_gb',
- 'free_ram_mb', 'local_gb', 'local_gb_used',
- 'memory_mb', 'memory_mb_used', 'running_vms',
- 'vcpus', 'vcpus_used']
- }
- },
- 'required': ['hypervisor_statistics']
- }
-}
-
-common_list_hypervisors_detail = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisors': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'cpu_info': {'type': 'string'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'host_ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'hypervisor_hostname': {'type': 'string'},
- 'hypervisor_type': {'type': 'string'},
- 'hypervisor_version': {'type': 'integer'},
- 'id': {'type': ['integer', 'string']},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'service': {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'disabled_reason': {'type': ['string', 'null']}
- },
- # NOTE(gmann): 'disabled_reason' is updated in
- # 'service' dict if 'os-hypervisor-status'
- # extension is loaded. So this is not required.
- 'required': ['host', 'id']
- },
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['cpu_info', 'current_workload',
- 'disk_available_least', 'host_ip',
- 'free_disk_gb', 'free_ram_mb',
- 'hypervisor_hostname', 'hypervisor_type',
- 'hypervisor_version', 'id', 'local_gb',
- 'local_gb_used', 'memory_mb',
- 'memory_mb_used', 'running_vms', 'service',
- 'vcpus', 'vcpus_used']
- }
- }
- },
- 'required': ['hypervisors']
- }
-}
-
-common_show_hypervisor = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'cpu_info': {'type': 'string'},
- 'current_workload': {'type': 'integer'},
- 'disk_available_least': {'type': ['integer', 'null']},
- 'host_ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'free_disk_gb': {'type': 'integer'},
- 'free_ram_mb': {'type': 'integer'},
- 'hypervisor_hostname': {'type': 'string'},
- 'hypervisor_type': {'type': 'string'},
- 'hypervisor_version': {'type': 'integer'},
- 'id': {'type': ['integer', 'string']},
- 'local_gb': {'type': 'integer'},
- 'local_gb_used': {'type': 'integer'},
- 'memory_mb': {'type': 'integer'},
- 'memory_mb_used': {'type': 'integer'},
- 'running_vms': {'type': 'integer'},
- 'service': {
- 'type': 'object',
- 'properties': {
- 'host': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'disabled_reason': {'type': ['string', 'null']}
- },
- # NOTE: 'disabled_reason' is updated in 'service'
- # dict if os-hypervisor-status' extension is loaded.
- # So this is not required.
- 'required': ['host', 'id']
- },
- 'vcpus': {'type': 'integer'},
- 'vcpus_used': {'type': 'integer'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['cpu_info', 'current_workload',
- 'disk_available_least', 'host_ip',
- 'free_disk_gb', 'free_ram_mb',
- 'hypervisor_hostname', 'hypervisor_type',
- 'hypervisor_version', 'id', 'local_gb',
- 'local_gb_used', 'memory_mb', 'memory_mb_used',
- 'running_vms', 'service', 'vcpus', 'vcpus_used']
- }
- },
- 'required': ['hypervisor']
- }
-}
-
-common_hypervisors_detail = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisors': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'hypervisor_hostname': {'type': 'string'}
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['id', 'hypervisor_hostname']
- }
- }
- },
- 'required': ['hypervisors']
- }
-}
-
-common_hypervisors_info = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'hypervisor': {
- 'type': 'object',
- 'properties': {
- 'status': {'type': 'string'},
- 'state': {'type': 'string'},
- 'id': {'type': ['integer', 'string']},
- 'hypervisor_hostname': {'type': 'string'},
- },
- # NOTE: When loading os-hypervisor-status extension,
- # a response contains status and state. So these params
- # should not be required.
- 'required': ['id', 'hypervisor_hostname']
- }
- },
- 'required': ['hypervisor']
- }
-}
-
-
-hypervisor_uptime = copy.deepcopy(common_hypervisors_info)
-hypervisor_uptime['response_body']['properties']['hypervisor'][
- 'properties']['uptime'] = {'type': 'string'}
-hypervisor_uptime['response_body']['properties']['hypervisor'][
- 'required'] = ['id', 'hypervisor_hostname', 'uptime']
diff --git a/tempest/api_schema/response/compute/v2_1/availability_zone.py b/tempest/api_schema/response/compute/v2_1/availability_zone.py
index e261d3d..5c1224e 100644
--- a/tempest/api_schema/response/compute/v2_1/availability_zone.py
+++ b/tempest/api_schema/response/compute/v2_1/availability_zone.py
@@ -14,8 +14,6 @@
import copy
-from tempest.api_schema.response.compute import availability_zone as common
-
base = {
'status_code': [200],
@@ -47,8 +45,30 @@
}
}
-get_availability_zone_list = copy.deepcopy(base)
+detail = {
+ 'type': 'object',
+ 'patternProperties': {
+ # NOTE: Here is for a hostname
+ '^[a-zA-Z0-9-_.]+$': {
+ 'type': 'object',
+ 'patternProperties': {
+ # NOTE: Here is for a service name
+ '^.*$': {
+ 'type': 'object',
+ 'properties': {
+ 'available': {'type': 'boolean'},
+ 'active': {'type': 'boolean'},
+ 'updated_at': {'type': ['string', 'null']}
+ },
+ 'required': ['available', 'active', 'updated_at']
+ }
+ }
+ }
+ }
+}
-get_availability_zone_list_detail = copy.deepcopy(base)
-get_availability_zone_list_detail['response_body']['properties'][
- 'availabilityZoneInfo']['items']['properties']['hosts'] = common.detail
+list_availability_zone_list = copy.deepcopy(base)
+
+list_availability_zone_list_detail = copy.deepcopy(base)
+list_availability_zone_list_detail['response_body']['properties'][
+ 'availabilityZoneInfo']['items']['properties']['hosts'] = detail
diff --git a/tempest/api_schema/response/compute/v2_1/hypervisors.py b/tempest/api_schema/response/compute/v2_1/hypervisors.py
index cbb7698..3efa46b 100644
--- a/tempest/api_schema/response/compute/v2_1/hypervisors.py
+++ b/tempest/api_schema/response/compute/v2_1/hypervisors.py
@@ -14,13 +14,163 @@
import copy
-from tempest.api_schema.response.compute import hypervisors
+get_hypervisor_statistics = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor_statistics': {
+ 'type': 'object',
+ 'properties': {
+ 'count': {'type': 'integer'},
+ 'current_workload': {'type': 'integer'},
+ 'disk_available_least': {'type': ['integer', 'null']},
+ 'free_disk_gb': {'type': 'integer'},
+ 'free_ram_mb': {'type': 'integer'},
+ 'local_gb': {'type': 'integer'},
+ 'local_gb_used': {'type': 'integer'},
+ 'memory_mb': {'type': 'integer'},
+ 'memory_mb_used': {'type': 'integer'},
+ 'running_vms': {'type': 'integer'},
+ 'vcpus': {'type': 'integer'},
+ 'vcpus_used': {'type': 'integer'}
+ },
+ 'required': ['count', 'current_workload',
+ 'disk_available_least', 'free_disk_gb',
+ 'free_ram_mb', 'local_gb', 'local_gb_used',
+ 'memory_mb', 'memory_mb_used', 'running_vms',
+ 'vcpus', 'vcpus_used']
+ }
+ },
+ 'required': ['hypervisor_statistics']
+ }
+}
-hypervisors_servers = copy.deepcopy(hypervisors.common_hypervisors_detail)
+hypervisor_detail = {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'cpu_info': {'type': 'string'},
+ 'current_workload': {'type': 'integer'},
+ 'disk_available_least': {'type': ['integer', 'null']},
+ 'host_ip': {
+ 'type': 'string',
+ 'format': 'ip-address'
+ },
+ 'free_disk_gb': {'type': 'integer'},
+ 'free_ram_mb': {'type': 'integer'},
+ 'hypervisor_hostname': {'type': 'string'},
+ 'hypervisor_type': {'type': 'string'},
+ 'hypervisor_version': {'type': 'integer'},
+ 'id': {'type': ['integer', 'string']},
+ 'local_gb': {'type': 'integer'},
+ 'local_gb_used': {'type': 'integer'},
+ 'memory_mb': {'type': 'integer'},
+ 'memory_mb_used': {'type': 'integer'},
+ 'running_vms': {'type': 'integer'},
+ 'service': {
+ 'type': 'object',
+ 'properties': {
+ 'host': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'disabled_reason': {'type': ['string', 'null']}
+ },
+ 'required': ['host', 'id']
+ },
+ 'vcpus': {'type': 'integer'},
+ 'vcpus_used': {'type': 'integer'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['cpu_info', 'current_workload',
+ 'disk_available_least', 'host_ip',
+ 'free_disk_gb', 'free_ram_mb',
+ 'hypervisor_hostname', 'hypervisor_type',
+ 'hypervisor_version', 'id', 'local_gb',
+ 'local_gb_used', 'memory_mb', 'memory_mb_used',
+ 'running_vms', 'service', 'vcpus', 'vcpus_used']
+}
-# Defining extra attributes for V3 show hypervisor schema
-hypervisors_servers['response_body']['properties']['hypervisors']['items'][
+list_hypervisors_detail = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisors': {
+ 'type': 'array',
+ 'items': hypervisor_detail
+ }
+ },
+ 'required': ['hypervisors']
+ }
+}
+
+get_hypervisor = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor': hypervisor_detail
+ },
+ 'required': ['hypervisor']
+ }
+}
+
+list_search_hypervisors = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisors': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'hypervisor_hostname': {'type': 'string'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['id', 'hypervisor_hostname']
+ }
+ }
+ },
+ 'required': ['hypervisors']
+ }
+}
+
+get_hypervisor_uptime = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'hypervisor': {
+ 'type': 'object',
+ 'properties': {
+ 'status': {'type': 'string'},
+ 'state': {'type': 'string'},
+ 'id': {'type': ['integer', 'string']},
+ 'hypervisor_hostname': {'type': 'string'},
+ 'uptime': {'type': 'string'}
+ },
+ # NOTE: When loading os-hypervisor-status extension,
+ # a response contains status and state. So these params
+ # should not be required.
+ 'required': ['id', 'hypervisor_hostname', 'uptime']
+ }
+ },
+ 'required': ['hypervisor']
+ }
+}
+
+get_hypervisors_servers = copy.deepcopy(list_search_hypervisors)
+get_hypervisors_servers['response_body']['properties']['hypervisors']['items'][
'properties']['servers'] = {
'type': 'array',
'items': {
diff --git a/tempest/cli/simple_read_only/data_processing/__init__.py b/tempest/cli/simple_read_only/data_processing/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/cli/simple_read_only/data_processing/__init__.py
+++ /dev/null
diff --git a/tempest/cli/simple_read_only/data_processing/test_sahara.py b/tempest/cli/simple_read_only/data_processing/test_sahara.py
deleted file mode 100644
index 153dbd2..0000000
--- a/tempest/cli/simple_read_only/data_processing/test_sahara.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright (c) 2013 Mirantis Inc.
-#
-# 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 logging
-import re
-
-from tempest_lib import exceptions
-import testtools
-
-from tempest import cli
-from tempest import config
-from tempest import test
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class SimpleReadOnlySaharaClientTest(cli.ClientTestBase):
- """Basic, read-only tests for Sahara CLI client.
-
- Checks return values and output of read-only commands.
- These tests do not presume any content, nor do they create
- their own. They only verify the structure of output if present.
- """
-
- @classmethod
- def resource_setup(cls):
- if not CONF.service_available.sahara:
- msg = "Skipping all Sahara cli tests because it is not available"
- raise cls.skipException(msg)
- super(SimpleReadOnlySaharaClientTest, cls).resource_setup()
-
- def sahara(self, *args, **kwargs):
- return self.clients.sahara(
- *args, endpoint_type=CONF.data_processing.endpoint_type, **kwargs)
-
- @test.attr(type='negative')
- @test.idempotent_id('c8809259-710f-43f9-b452-54b2be3115a9')
- def test_sahara_fake_action(self):
- self.assertRaises(exceptions.CommandFailed,
- self.sahara,
- 'this-does-not-exist')
-
- @test.idempotent_id('39afe90c-0fd8-456e-89e2-da6de9680fff')
- def test_sahara_plugins_list(self):
- plugins = self.parser.listing(self.sahara('plugin-list'))
- self.assertTableStruct(plugins, [
- 'name',
- 'versions',
- 'title'
- ])
-
- @test.idempotent_id('3eb36fd8-bb06-4004-9e90-84ddf4dbcf5b')
- @testtools.skipUnless(CONF.data_processing_feature_enabled.plugins,
- 'No plugins defined')
- def test_sahara_plugins_show(self):
- 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',
- 'Value'
- ])
-
- @test.idempotent_id('502b684b-3d41-4619-aa6c-4db3465ae79d')
- def test_sahara_node_group_template_list(self):
- result = self.sahara('node-group-template-list')
- node_group_templates = self.parser.listing(result)
- self.assertTableStruct(node_group_templates, [
- 'name',
- 'id',
- 'plugin_name',
- 'node_processes',
- 'description'
- ])
-
- @test.idempotent_id('6c36fe4d-3b88-4b0d-b702-2a051db7dae7')
- def test_sahara_cluster_template_list(self):
- result = self.sahara('cluster-template-list')
- cluster_templates = self.parser.listing(result)
- self.assertTableStruct(cluster_templates, [
- 'name',
- 'id',
- 'plugin_name',
- 'node_groups',
- 'description'
- ])
-
- @test.idempotent_id('b951949d-b9a6-49db-add5-8a18ac533810')
- def test_sahara_cluster_list(self):
- result = self.sahara('cluster-list')
- clusters = self.parser.listing(result)
- self.assertTableStruct(clusters, [
- 'name',
- 'id',
- 'status',
- 'node_count'
- ])
-
- @test.idempotent_id('dbc83a8c-15b6-4aa8-b274-5896577397e1')
- def test_sahara_data_source_list(self):
- result = self.sahara('data-source-list')
- data_sources = self.parser.listing(result)
- self.assertTableStruct(data_sources, [
- 'name',
- 'id',
- 'type',
- 'description'
- ])
-
- @test.idempotent_id('a8f77e05-d4bf-45c3-8245-57835d0de37b')
- def test_sahara_job_binary_data_list(self):
- result = self.sahara('job-binary-data-list')
- job_binary_data_list = self.parser.listing(result)
- self.assertTableStruct(job_binary_data_list, [
- 'id',
- 'name'
- ])
-
- @test.idempotent_id('a8f4d0f3-fa1c-49ce-b73f-d624d89dc381')
- def test_sahara_job_binary_list(self):
- result = self.sahara('job-binary-list')
- job_binaries = self.parser.listing(result)
- self.assertTableStruct(job_binaries, [
- 'id',
- 'name',
- 'description'
- ])
-
- @test.idempotent_id('91164ca4-d049-49e0-a52a-686b408196ff')
- def test_sahara_job_template_list(self):
- result = self.sahara('job-template-list')
- job_templates = self.parser.listing(result)
- self.assertTableStruct(job_templates, [
- 'id',
- 'name',
- 'description'
- ])
-
- @test.idempotent_id('6829c251-a8b6-449d-af86-7dd98b69a7ce')
- def test_sahara_job_list(self):
- result = self.sahara('job-list')
- jobs = self.parser.listing(result)
- self.assertTableStruct(jobs, [
- 'id',
- 'cluster_id',
- 'status'
- ])
-
- @test.idempotent_id('e4bd5d3b-474b-4b7a-82ab-f6bb0bc89faf')
- def test_sahara_bash_completion(self):
- self.sahara('bash-completion')
-
- # Optional arguments
- @test.idempotent_id('699c14e5-632e-46b8-91e5-6bff8c8307e5')
- def test_sahara_help(self):
- help_text = self.sahara('help')
- lines = help_text.split('\n')
- self.assertFirstLineStartsWith(lines, 'usage: sahara')
-
- commands = []
- cmds_start = lines.index('Positional arguments:')
- cmds_end = lines.index('Optional arguments:')
- command_pattern = re.compile('^ {4}([a-z0-9\-\_]+)')
- for line in lines[cmds_start:cmds_end]:
- match = command_pattern.match(line)
- if match:
- commands.append(match.group(1))
- commands = set(commands)
- wanted_commands = set(('cluster-create', 'data-source-create',
- 'image-unregister', 'job-binary-create',
- 'plugin-list', 'job-binary-create', 'help'))
- self.assertFalse(wanted_commands - commands)
-
- @test.idempotent_id('84a18ea6-6379-4024-af6b-0e938f60dfc2')
- def test_sahara_version(self):
- version = self.sahara('', flags='--version')
- self.assertTrue(re.search('[0-9.]+', version))
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index e970249..fec3bd4 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -86,6 +86,7 @@
owner: javelin
flavor: m1.small
image: javelin_cirros
+ floating_ip_pool: public
- name: hoplite
owner: javelin
flavor: m1.medium
@@ -306,10 +307,10 @@
return tenants
-def _assign_swift_role(user):
+def _assign_swift_role(user, swift_role):
admin = keystone_admin()
roles = admin.identity.list_roles()
- role = next(r for r in roles if r['name'] == 'Member')
+ role = next(r for r in roles if r['name'] == swift_role)
LOG.debug(USERS[user])
try:
admin.identity.assign_user_role(
@@ -583,7 +584,8 @@
LOG.info("Creating objects")
for obj in objects:
LOG.debug("Object %s" % obj)
- _assign_swift_role(obj['owner'])
+ swift_role = obj.get('swift_role', 'Member')
+ _assign_swift_role(obj['owner'], swift_role)
client = client_for_user(obj['owner'])
client.containers.create_container(obj['container'])
client.objects.create_object(
@@ -858,7 +860,9 @@
for secgroup in server['secgroups']:
client.servers.add_security_group(server_id, secgroup)
if CONF.compute.use_floatingip_for_ssh:
- floating_ip = client.floating_ips.create_floating_ip()
+ floating_ip_pool = server.get('floating_ip_pool')
+ floating_ip = client.floating_ips.create_floating_ip(
+ pool_name=floating_ip_pool)
client.floating_ips.associate_floating_ip_to_server(
floating_ip['ip'], server_id)
@@ -992,9 +996,13 @@
add_router_interface(RES['routers'])
create_secgroups(RES['secgroups'])
- create_servers(RES['servers'])
create_volumes(RES['volumes'])
- attach_volumes(RES['volumes'])
+
+ # Only attempt attaching the volumes if servers are defined in the
+ # resourcefile
+ if 'servers' in RES:
+ create_servers(RES['servers'])
+ attach_volumes(RES['volumes'])
def destroy_resources():
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index 909de96..3c71e07 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -253,10 +253,9 @@
'database': 'trove'
}
# Get catalog list for endpoints to use for validation
- endpoints = os.endpoints_client.list_endpoints()
- for endpoint in endpoints:
- service = os.service_client.get_service(endpoint['service_id'])
- services.append(service['type'])
+ _token, auth_data = os.auth_provider.get_auth()
+ for entry in auth_data['serviceCatalog']:
+ services.append(entry['type'])
# Pull all catalog types from config file and compare against endpoint list
for cfgname in dir(CONF._config):
cfg = getattr(CONF, cfgname)
@@ -330,7 +329,7 @@
CONF_PARSER = moves.configparser.SafeConfigParser()
CONF_PARSER.optionxform = str
CONF_PARSER.readfp(conf_file)
- os = clients.AdminManager()
+ os = clients.Manager()
services = check_service_availability(os, update)
results = {}
for service in ['nova', 'cinder', 'neutron', 'swift']:
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py
index 8e9a018..6d376d6 100644
--- a/tempest/common/accounts.py
+++ b/tempest/common/accounts.py
@@ -38,7 +38,8 @@
def __init__(self, identity_version=None, name=None):
super(Accounts, self).__init__(identity_version=identity_version,
name=name)
- if os.path.isfile(CONF.auth.test_accounts_file):
+ if (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
accounts = read_accounts_yaml(CONF.auth.test_accounts_file)
self.use_default_creds = False
else:
@@ -261,18 +262,14 @@
def _unique_creds(self, cred_arg=None):
"""Verify that the configured credentials are valid and distinct """
- if self.use_default_creds:
- try:
- user = self.get_primary_creds()
- alt_user = self.get_alt_creds()
- return getattr(user, cred_arg) != getattr(alt_user, cred_arg)
- except exceptions.InvalidCredentials as ic:
- msg = "At least one of the configured credentials is " \
- "not valid: %s" % ic.message
- raise exceptions.InvalidConfiguration(msg)
- else:
- # TODO(andreaf) Add a uniqueness check here
- return len(self.hash_dict['creds']) > 1
+ try:
+ user = self.get_primary_creds()
+ alt_user = self.get_alt_creds()
+ return getattr(user, cred_arg) != getattr(alt_user, cred_arg)
+ except exceptions.InvalidCredentials as ic:
+ msg = "At least one of the configured credentials is " \
+ "not valid: %s" % ic.message
+ raise exceptions.InvalidConfiguration(msg)
def is_multi_user(self):
return self._unique_creds('username')
@@ -280,42 +277,20 @@
def is_multi_tenant(self):
return self._unique_creds('tenant_id')
- def get_creds(self, id, roles=None):
- try:
- hashes = self._get_match_hash_list(roles)
- # No need to sort the dict as within the same python process
- # the HASH seed won't change, so subsequent calls to keys()
- # will return the same result
- _hash = hashes[id]
- except IndexError:
- msg = 'Insufficient number of users provided'
- raise exceptions.InvalidConfiguration(msg)
- return self.hash_dict['creds'][_hash]
-
def get_primary_creds(self):
if self.isolated_creds.get('primary'):
return self.isolated_creds.get('primary')
- if not self.use_default_creds:
- creds = self.get_creds(0)
- primary_credential = cred_provider.get_credentials(
- identity_version=self.identity_version, **creds)
- else:
- primary_credential = cred_provider.get_configured_credentials(
- credential_type='user', identity_version=self.identity_version)
+ primary_credential = cred_provider.get_configured_credentials(
+ credential_type='user', identity_version=self.identity_version)
self.isolated_creds['primary'] = primary_credential
return primary_credential
def get_alt_creds(self):
if self.isolated_creds.get('alt'):
return self.isolated_creds.get('alt')
- if not self.use_default_creds:
- creds = self.get_creds(1)
- alt_credential = cred_provider.get_credentials(
- identity_version=self.identity_version, **creds)
- else:
- alt_credential = cred_provider.get_configured_credentials(
- credential_type='alt_user',
- identity_version=self.identity_version)
+ alt_credential = cred_provider.get_configured_credentials(
+ credential_type='alt_user',
+ identity_version=self.identity_version)
self.isolated_creds['alt'] = alt_credential
return alt_credential
@@ -323,35 +298,14 @@
self.isolated_creds = {}
def get_admin_creds(self):
- if not self.use_default_creds:
- return self.get_creds_by_roles([CONF.identity.admin_role])
- else:
- creds = cred_provider.get_configured_credentials(
- "identity_admin", fill_in=False)
- self.isolated_creds['admin'] = creds
- return creds
+ creds = cred_provider.get_configured_credentials(
+ "identity_admin", fill_in=False)
+ self.isolated_creds['admin'] = creds
+ return creds
def get_creds_by_roles(self, roles, force_new=False):
- roles = list(set(roles))
- exist_creds = self.isolated_creds.get(str(roles), None)
- index = 0
- if exist_creds and not force_new:
- return exist_creds
- elif exist_creds and force_new:
- new_index = str(roles) + '-' + str(len(self.isolated_creds))
- self.isolated_creds[new_index] = exist_creds
- # Figure out how many existing creds for this roles set are present
- # use this as the index the returning hash list to ensure separate
- # creds are returned with force_new being True
- for creds_names in self.isolated_creds:
- if str(roles) in creds_names:
- index = index + 1
- if not self.use_default_creds:
- creds = self.get_creds(index, roles=roles)
- role_credential = cred_provider.get_credentials(**creds)
- self.isolated_creds[str(roles)] = role_credential
- else:
- msg = "Default credentials can not be used with specifying "\
- "credentials by roles"
- raise exceptions.InvalidConfiguration(msg)
- return role_credential
+ msg = "Credentials being specified through the config file can not be"\
+ " used with tests that specify using credentials by roles. "\
+ "Either exclude/skip the tests doing this or use either an "\
+ "test_accounts_file or tenant isolation."
+ raise exceptions.InvalidConfiguration(msg)
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index 9630d1c..2c6763d 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -147,3 +147,25 @@
@abc.abstractmethod
def is_role_available(self, role):
return
+
+
+class TestResources(object):
+ """Readonly Credentials, with network resources added."""
+
+ def __init__(self, credentials):
+ self._credentials = credentials
+ self.network = None
+ self.subnet = None
+ self.router = None
+
+ def __getattr__(self, item):
+ return getattr(self._credentials, item)
+
+ def set_resources(self, **kwargs):
+ for key in kwargs.keys():
+ if hasattr(self, key):
+ setattr(self, key, kwargs[key])
+
+ @property
+ def credentials(self):
+ return self._credentials
diff --git a/tempest/common/credentials.py b/tempest/common/credentials.py
index 1ca0128..c34df48 100644
--- a/tempest/common/credentials.py
+++ b/tempest/common/credentials.py
@@ -38,7 +38,8 @@
network_resources=network_resources,
identity_version=identity_version)
else:
- if CONF.auth.locking_credentials_provider:
+ if (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
# Most params are not relevant for pre-created accounts
return accounts.Accounts(name=name,
identity_version=identity_version)
@@ -56,7 +57,8 @@
if CONF.auth.allow_tenant_isolation:
return is_admin
# Check whether test accounts file has the admin specified or not
- elif os.path.isfile(CONF.auth.test_accounts_file):
+ elif (CONF.auth.test_accounts_file and
+ os.path.isfile(CONF.auth.test_accounts_file)):
check_accounts = accounts.Accounts(name='check_admin')
if not check_accounts.admin_available():
is_admin = False
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index 83822c2..67fbab1 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -15,7 +15,9 @@
from tempest_lib import exceptions as lib_exc
+from tempest.common import isolated_creds
from tempest import config
+from tempest import exceptions
CONF = config.CONF
@@ -34,12 +36,14 @@
:return a dict with 'id' and 'name' of the network
"""
fixed_network_name = CONF.compute.fixed_network_name
+ network = None
# NOTE(andreaf) get_primary_network will always be available once
# bp test-accounts-continued is implemented
- if (CONF.auth.allow_tenant_isolation and
+ if (isinstance(creds_provider, isolated_creds.IsolatedCreds) and
(CONF.service_available.neutron and
not CONF.service_available.ironic)):
- network = creds_provider.get_primary_network()
+ # tenant_allow_isolation == True, so network is defined
+ network = creds_provider.get_primary_creds().network
else:
if fixed_network_name:
try:
@@ -51,7 +55,11 @@
networks = resp['networks']
else:
raise lib_exc.NotFound()
- network = networks[0]
+ if len(networks) > 0:
+ network = networks[0]
+ else:
+ msg = "Configured fixed_network_name not found"
+ raise exceptions.InvalidConfiguration(msg)
# To be consistent with network isolation, add name is only
# label is available
network['name'] = network.get('name', network.get('label'))
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 22fc9c3..1f85872 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -142,7 +142,6 @@
network_resources)
self.network_resources = network_resources
self.isolated_creds = {}
- self.isolated_net_resources = {}
self.ports = []
self.password = password
self.default_admin_creds = cred_provider.get_configured_credentials(
@@ -207,7 +206,8 @@
if roles:
for role in roles:
self.creds_client.assign_user_role(user, project, role)
- return self.creds_client.get_credentials(user, project, self.password)
+ creds = self.creds_client.get_credentials(user, project, self.password)
+ return cred_provider.TestResources(creds)
def _create_network_resources(self, tenant_id):
network = None
@@ -297,33 +297,6 @@
self.network_admin_client.add_router_interface_with_subnet_id(
router_id, subnet_id)
- def get_primary_network(self):
- return self.isolated_net_resources.get('primary')[0]
-
- def get_primary_subnet(self):
- return self.isolated_net_resources.get('primary')[1]
-
- def get_primary_router(self):
- return self.isolated_net_resources.get('primary')[2]
-
- def get_admin_network(self):
- return self.isolated_net_resources.get('admin')[0]
-
- def get_admin_subnet(self):
- return self.isolated_net_resources.get('admin')[1]
-
- def get_admin_router(self):
- return self.isolated_net_resources.get('admin')[2]
-
- def get_alt_network(self):
- return self.isolated_net_resources.get('alt')[0]
-
- def get_alt_subnet(self):
- return self.isolated_net_resources.get('alt')[1]
-
- def get_alt_router(self):
- return self.isolated_net_resources.get('alt')[2]
-
def get_credentials(self, credential_type):
if self.isolated_creds.get(str(credential_type)):
credentials = self.isolated_creds[str(credential_type)]
@@ -341,8 +314,8 @@
not CONF.baremetal.driver_enabled):
network, subnet, router = self._create_network_resources(
credentials.tenant_id)
- self.isolated_net_resources[str(credential_type)] = (
- network, subnet, router,)
+ credentials.set_resources(network=network, subnet=subnet,
+ router=router)
LOG.info("Created isolated network resources for : \n"
+ " credentials: %s" % credentials)
return credentials
@@ -368,12 +341,6 @@
new_index = str(roles) + '-' + str(len(self.isolated_creds))
self.isolated_creds[new_index] = exist_creds
del self.isolated_creds[str(roles)]
- # Handle isolated neutron resouces if they exist too
- if CONF.service_available.neutron:
- exist_net = self.isolated_net_resources.get(str(roles))
- if exist_net:
- self.isolated_net_resources[new_index] = exist_net
- del self.isolated_net_resources[str(roles)]
return self.get_credentials(roles)
def _clear_isolated_router(self, router_id, router_name):
@@ -414,27 +381,33 @@
def _clear_isolated_net_resources(self):
net_client = self.network_admin_client
- for cred in self.isolated_net_resources:
- network, subnet, router = self.isolated_net_resources.get(cred)
+ for cred in self.isolated_creds:
+ creds = self.isolated_creds.get(cred)
+ if (not creds or not any([creds.router, creds.network,
+ creds.subnet])):
+ continue
LOG.debug("Clearing network: %(network)s, "
"subnet: %(subnet)s, router: %(router)s",
- {'network': network, 'subnet': subnet, 'router': router})
+ {'network': creds.network, 'subnet': creds.subnet,
+ 'router': creds.router})
if (not self.network_resources or
- self.network_resources.get('router')):
+ (self.network_resources.get('router') and creds.subnet)):
try:
net_client.remove_router_interface_with_subnet_id(
- router['id'], subnet['id'])
+ creds.router['id'], creds.subnet['id'])
except lib_exc.NotFound:
LOG.warn('router with name: %s not found for delete' %
- router['name'])
- self._clear_isolated_router(router['id'], router['name'])
+ creds.router['name'])
+ self._clear_isolated_router(creds.router['id'],
+ creds.router['name'])
if (not self.network_resources or
self.network_resources.get('subnet')):
- self._clear_isolated_subnet(subnet['id'], subnet['name'])
+ self._clear_isolated_subnet(creds.subnet['id'],
+ creds.subnet['name'])
if (not self.network_resources or
self.network_resources.get('network')):
- self._clear_isolated_network(network['id'], network['name'])
- self.isolated_net_resources = {}
+ self._clear_isolated_network(creds.network['id'],
+ creds.network['name'])
def clear_isolated_creds(self):
if not self.isolated_creds:
diff --git a/tempest/config.py b/tempest/config.py
index 4ee4669..3725f58 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -23,6 +23,13 @@
from oslo_log import log as logging
+# TODO(marun) Replace use of oslo_config's global ConfigOpts
+# (cfg.CONF) instance with a local instance (cfg.ConfigOpts()) once
+# the cli tests move to the clients. The cli tests rely on oslo
+# incubator modules that use the global cfg.CONF.
+_CONF = cfg.CONF
+
+
def register_opt_group(conf, opt_group, options):
conf.register_group(opt_group)
for opt in options:
@@ -35,9 +42,14 @@
AuthGroup = [
cfg.StrOpt('test_accounts_file',
- default='etc/accounts.yaml',
help="Path to the yaml file that contains the list of "
- "credentials to use for running tests"),
+ "credentials to use for running tests. If used when "
+ "running in parallel you have to make sure sufficient "
+ "credentials are provided in the accounts file. For "
+ "example if no tests with roles are being run it requires "
+ "at least `2 * CONC` distinct accounts configured in "
+ " the `test_accounts_file`, with CONC == the "
+ "number of concurrent test processes."),
cfg.BoolOpt('allow_tenant_isolation',
default=True,
help="Allows test cases to create/destroy tenants and "
@@ -49,15 +61,6 @@
group='compute'),
cfg.DeprecatedOpt('allow_tenant_isolation',
group='orchestration')]),
- cfg.BoolOpt('locking_credentials_provider',
- default=False,
- help="If set to True it enables the Accounts provider, "
- "which locks credentials to allow for parallel execution "
- "with pre-provisioned accounts. It can only be used to "
- "run tests that ensure credentials cleanup happens. "
- "It requires at least `2 * CONC` distinct accounts "
- "configured in `test_accounts_file`, with CONC == the "
- "number of concurrent test processes."),
cfg.ListOpt('tempest_roles',
help="Roles to assign to all users created by tempest",
default=[]),
@@ -232,9 +235,11 @@
help="Timeout in seconds to wait for output from ssh "
"channel."),
cfg.StrOpt('fixed_network_name',
- default='private',
help="Name of the fixed network that is visible to all test "
- "tenants."),
+ "tenants. If multiple networks are available for a tenant"
+ " this is the network which will be used for creating "
+ "servers if tempest does not create a network or a "
+ "network is not specified elsewhere"),
cfg.StrOpt('network_for_ssh',
default='public',
help="Network used for SSH connections. Ignored if "
@@ -325,7 +330,8 @@
cfg.BoolOpt('block_migrate_cinder_iscsi',
default=False,
help="Does the test environment block migration support "
- "cinder iSCSI volumes"),
+ "cinder iSCSI volumes. Note, libvirt doesn't support this, "
+ "see https://bugs.launchpad.net/nova/+bug/1398999"),
cfg.BoolOpt('vnc_console',
default=False,
help='Enable VNC console. This configuration value should '
@@ -996,7 +1002,7 @@
help="SSH verification in tests is skipped"
"for matching images"),
cfg.StrOpt('ssh_user_regex',
- default="[[\"^.*[Cc]irros.*$\", \"root\"]]",
+ default="[[\"^.*[Cc]irros.*$\", \"cirros\"]]",
help="List of user mapped to regex "
"to matching image names."),
]
@@ -1106,7 +1112,7 @@
def register_opts():
for g, o in _opts:
- register_opt_group(cfg.CONF, g, o)
+ register_opt_group(_CONF, g, o)
def list_opts():
@@ -1130,45 +1136,44 @@
def __getattr__(self, attr):
# Handles config options from the default group
- return getattr(cfg.CONF, attr)
+ return getattr(_CONF, attr)
def _set_attrs(self):
- self.auth = cfg.CONF.auth
- self.compute = cfg.CONF.compute
- self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
- self.identity = cfg.CONF.identity
- self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
- self.image = cfg.CONF.image
- self.image_feature_enabled = cfg.CONF['image-feature-enabled']
- self.network = cfg.CONF.network
- self.network_feature_enabled = cfg.CONF['network-feature-enabled']
- self.volume = cfg.CONF.volume
- self.volume_feature_enabled = cfg.CONF['volume-feature-enabled']
- self.object_storage = cfg.CONF['object-storage']
- self.object_storage_feature_enabled = cfg.CONF[
+ self.auth = _CONF.auth
+ self.compute = _CONF.compute
+ self.compute_feature_enabled = _CONF['compute-feature-enabled']
+ self.identity = _CONF.identity
+ self.identity_feature_enabled = _CONF['identity-feature-enabled']
+ self.image = _CONF.image
+ self.image_feature_enabled = _CONF['image-feature-enabled']
+ self.network = _CONF.network
+ self.network_feature_enabled = _CONF['network-feature-enabled']
+ self.volume = _CONF.volume
+ self.volume_feature_enabled = _CONF['volume-feature-enabled']
+ self.object_storage = _CONF['object-storage']
+ self.object_storage_feature_enabled = _CONF[
'object-storage-feature-enabled']
- self.database = cfg.CONF.database
- self.orchestration = cfg.CONF.orchestration
- self.messaging = cfg.CONF.messaging
- self.telemetry = cfg.CONF.telemetry
- self.dashboard = cfg.CONF.dashboard
- self.data_processing = cfg.CONF.data_processing
- self.data_processing_feature_enabled = cfg.CONF[
+ self.database = _CONF.database
+ self.orchestration = _CONF.orchestration
+ self.messaging = _CONF.messaging
+ self.telemetry = _CONF.telemetry
+ self.dashboard = _CONF.dashboard
+ self.data_processing = _CONF.data_processing
+ self.data_processing_feature_enabled = _CONF[
'data_processing-feature-enabled']
- self.boto = cfg.CONF.boto
- self.stress = cfg.CONF.stress
- self.scenario = cfg.CONF.scenario
- self.service_available = cfg.CONF.service_available
- self.debug = cfg.CONF.debug
- self.baremetal = cfg.CONF.baremetal
- self.input_scenario = cfg.CONF['input-scenario']
- self.cli = cfg.CONF.cli
- self.negative = cfg.CONF.negative
- cfg.CONF.set_default('domain_name', self.identity.admin_domain_name,
- group='identity')
- cfg.CONF.set_default('alt_domain_name',
- self.identity.admin_domain_name,
- group='identity')
+ self.boto = _CONF.boto
+ self.stress = _CONF.stress
+ self.scenario = _CONF.scenario
+ self.service_available = _CONF.service_available
+ self.debug = _CONF.debug
+ self.baremetal = _CONF.baremetal
+ self.input_scenario = _CONF['input-scenario']
+ self.cli = _CONF.cli
+ self.negative = _CONF.negative
+ _CONF.set_default('domain_name', self.identity.admin_domain_name,
+ group='identity')
+ _CONF.set_default('alt_domain_name', self.identity.admin_domain_name,
+ group='identity')
def __init__(self, parse_conf=True, config_path=None):
"""Initialize a configuration from a conf directory and conf file."""
@@ -1194,18 +1199,18 @@
# to remove an issue with the config file up to date checker.
if parse_conf:
config_files.append(path)
- logging.register_options(cfg.CONF)
+ logging.register_options(_CONF)
if os.path.isfile(path):
- cfg.CONF([], project='tempest', default_config_files=config_files)
+ _CONF([], project='tempest', default_config_files=config_files)
else:
- cfg.CONF([], project='tempest')
- logging.setup(cfg.CONF, 'tempest')
+ _CONF([], project='tempest')
+ logging.setup(_CONF, 'tempest')
LOG = logging.getLogger('tempest')
LOG.info("Using tempest config file %s" % path)
register_opts()
self._set_attrs()
if parse_conf:
- cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
+ _CONF.log_opt_values(LOG, std_logging.DEBUG)
class TempestConfigProxy(object):
diff --git a/tempest/manager.py b/tempest/manager.py
index a256f25..025ce65 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -46,8 +46,14 @@
# Check if passed or default credentials are valid
if not self.credentials.is_valid():
raise exceptions.InvalidCredentials()
+ # Tenant isolation creates TestResources, but Accounts and some tests
+ # creates Credentials
+ if isinstance(credentials, cred_provider.TestResources):
+ creds = self.credentials.credentials
+ else:
+ creds = self.credentials
# Creates an auth provider for the credentials
- self.auth_provider = get_auth_provider(self.credentials)
+ self.auth_provider = get_auth_provider(creds)
# FIXME(andreaf) unused
self.client_attr_names = []
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 321a5a2..d2c41f0 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -186,7 +186,8 @@
if create_kwargs is None:
create_kwargs = {}
network = self.get_tenant_network()
- fixed_network.set_networks_kwarg(network, create_kwargs)
+ create_kwargs = fixed_network.set_networks_kwarg(network,
+ create_kwargs)
LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
name, image, flavor)
@@ -234,7 +235,7 @@
self.volumes_client.wait_for_volume_status(volume['id'], 'available')
# The volume retrieved on creation has a non-up-to-date status.
# Retrieval after it becomes active ensures correct details.
- volume = self.volumes_client.get_volume(volume['id'])
+ volume = self.volumes_client.show_volume(volume['id'])
return volume
def _create_loginable_secgroup_rule(self, secgroup_id=None):
@@ -406,7 +407,7 @@
# Compute client
_images_client = self.images_client
if name is None:
- name = data_utils.rand_name('scenario-snapshot-')
+ name = data_utils.rand_name('scenario-snapshot')
LOG.debug("Creating a snapshot image for server: %s", server['name'])
image = _images_client.create_image(server['id'], name)
image_id = image.response['location'].split('images/')[1]
@@ -430,14 +431,14 @@
self.assertEqual(self.volume['id'], volume['id'])
self.volumes_client.wait_for_volume_status(volume['id'], 'in-use')
# Refresh the volume after the attachment
- self.volume = self.volumes_client.get_volume(volume['id'])
+ self.volume = self.volumes_client.show_volume(volume['id'])
def nova_volume_detach(self):
self.servers_client.detach_volume(self.server['id'], self.volume['id'])
self.volumes_client.wait_for_volume_status(self.volume['id'],
'available')
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual('available', volume['status'])
def rebuild_server(self, server_id, image=None,
@@ -685,6 +686,8 @@
def _get_network_by_name(self, network_name):
net = self._list_networks(name=network_name)
+ self.assertNotEqual(len(net), 0,
+ "Unable to get network by name: %s" % network_name)
return net_resources.AttributeDict(net[0])
def create_floating_ip(self, thing, external_network_id=None,
@@ -1054,6 +1057,9 @@
# not (the current baremetal case). Likely can be removed when
# test account mgmt is reworked:
# https://blueprints.launchpad.net/tempest/+spec/test-accounts
+ if not CONF.compute.fixed_network_name:
+ m = 'fixed_network_name must be specified in config'
+ raise exceptions.InvalidConfiguration(m)
network = self._get_network_by_name(
CONF.compute.fixed_network_name)
router = None
@@ -1322,7 +1328,7 @@
client = self.admin_volume_types_client
if not name:
name = 'generic'
- randomized_name = data_utils.rand_name('scenario-type-' + name + '-')
+ randomized_name = data_utils.rand_name('scenario-type-' + name)
LOG.debug("Creating a volume type: %s", randomized_name)
body = client.create_volume_type(
randomized_name)
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 92e6c74..c5e8012 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -16,6 +16,7 @@
from oslo_log import log as logging
from tempest_lib.common.utils import data_utils
+from tempest.common import credentials
from tempest.common import tempest_fixtures as fixtures
from tempest.scenario import manager
from tempest import test
@@ -34,6 +35,13 @@
Deletes aggregate
"""
@classmethod
+ def skip_checks(cls):
+ super(TestAggregatesBasicOps, cls).skip_checks()
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in configuration.")
+ raise cls.skipException(msg)
+
+ @classmethod
def setup_clients(cls):
super(TestAggregatesBasicOps, cls).setup_clients()
cls.aggregates_client = cls.manager.aggregates_client
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 145efe7..0789c21 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -78,7 +78,7 @@
self.servers_client.wait_for_server_status(server['id'], status)
def nova_boot(self):
- name = data_utils.rand_name('scenario-server-')
+ name = data_utils.rand_name('scenario-server')
flavor_id = CONF.compute.flavor_ref
# Explicitly create secgroup to avoid cleanup at the end of testcases.
# Since no traffic is tested, we don't need to actually add rules to
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index c780464..45923ce 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -73,7 +73,7 @@
self.assertIn(self.volume['id'], [x['id'] for x in volumes])
def cinder_show(self):
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual(self.volume, volume)
def nova_volume_attach(self):
@@ -83,7 +83,7 @@
self.assertEqual(self.volume['id'], volume['id'])
self.volumes_client.wait_for_volume_status(volume['id'], 'in-use')
# Refresh the volume after the attachment
- self.volume = self.volumes_client.get_volume(volume['id'])
+ self.volume = self.volumes_client.show_volume(volume['id'])
def nova_reboot(self):
self.servers_client.reboot(self.server['id'], 'SOFT')
@@ -99,7 +99,7 @@
self.volumes_client.wait_for_volume_status(self.volume['id'],
'available')
- volume = self.volumes_client.get_volume(self.volume['id'])
+ volume = self.volumes_client.show_volume(self.volume['id'])
self.assertEqual('available', volume['status'])
def create_and_add_security_group(self):
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index f1dcb86..2c4522d 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -214,7 +214,7 @@
def _reassociate_floating_ips(self):
floating_ip, server = self.floating_ip_tuple
- name = data_utils.rand_name('new_server-smoke-')
+ name = data_utils.rand_name('new_server-smoke')
# create a new server for the floating ip
server = self._create_server(name, self.network)
self._associate_floating_ip(floating_ip, server)
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index cffb2fe..1ecc212 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -125,6 +125,10 @@
if CONF.baremetal.driver_enabled:
msg = ('Not currently supported by baremetal.')
raise cls.skipException(msg)
+ if CONF.network.port_vnic_type in ['direct', 'macvtap']:
+ msg = ('Not currently supported when using vnic_type'
+ ' direct or macvtap')
+ raise cls.skipException(msg)
if not (CONF.network.tenant_networks_reachable or
CONF.network.public_network_id):
msg = ('Either tenant_networks_reachable must be "true", or '
@@ -256,7 +260,7 @@
def _create_tenant_servers(self, tenant, num=1):
for i in range(num):
- name = 'server-{tenant}-gen-{num}-'.format(
+ name = 'server-{tenant}-gen-{num}'.format(
tenant=tenant.creds.tenant_name,
num=i
)
@@ -271,7 +275,7 @@
workaround ip namespace
"""
secgroups = tenant.security_groups.values()
- name = 'server-{tenant}-access_point-'.format(
+ name = 'server-{tenant}-access_point'.format(
tenant=tenant.creds.tenant_name)
name = data_utils.rand_name(name)
server = self._create_server(name, tenant,
@@ -497,7 +501,7 @@
new_tenant.security_groups.update(new_sg=new_sg)
# Create server with default security group
- name = 'server-{tenant}-gen-1-'.format(
+ name = 'server-{tenant}-gen-1'.format(
tenant=new_tenant.creds.tenant_name
)
name = data_utils.rand_name(name)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index f7653e7..53b471a 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -78,14 +78,14 @@
return self.get_remote_client(server_or_ip)
def _create_volume_snapshot(self, volume):
- snapshot_name = data_utils.rand_name('scenario-snapshot-')
+ snapshot_name = data_utils.rand_name('scenario-snapshot')
_, snapshot = self.snapshots_client.create_snapshot(
volume['id'], display_name=snapshot_name)
def cleaner():
self.snapshots_client.delete_snapshot(snapshot['id'])
try:
- while self.snapshots_client.get_snapshot(snapshot['id']):
+ while self.snapshots_client.show_snapshot(snapshot['id']):
time.sleep(1)
except lib_exc.NotFound:
pass
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 3e259b0..5bc24ea 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -12,7 +12,6 @@
from oslo_log import log
from tempest_lib.common.utils import data_utils
-from tempest_lib import decorators
from tempest import config
from tempest.scenario import manager
@@ -42,6 +41,8 @@
super(TestVolumeBootPattern, cls).skip_checks()
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
+ if CONF.volume.storage_protocol == 'ceph':
+ raise cls.skipException('Skip until bug 1439371 is fixed.')
def _create_volume_from_image(self):
img_uuid = CONF.compute.image_ref
@@ -132,7 +133,6 @@
actual = self._get_content(ssh_client)
self.assertEqual(expected, actual)
- @decorators.skip_because(bug='1373513')
@test.idempotent_id('557cd2c2-4eb8-4dce-98be-f86765ff311b')
@test.services('compute', 'volume', 'image')
def test_volume_boot_pattern(self):
@@ -176,7 +176,6 @@
# NOTE(gfidente): ensure resources are in clean state for
# deletion operations to succeed
self._stop_instances([instance_2nd, instance_from_snapshot])
- self._detach_volumes([volume_origin, volume])
class TestVolumeBootPatternV2(TestVolumeBootPattern):
diff --git a/tempest/services/compute/json/availability_zone_client.py b/tempest/services/compute/json/availability_zone_client.py
index b541a2c..6c50398 100644
--- a/tempest/services/compute/json/availability_zone_client.py
+++ b/tempest/services/compute/json/availability_zone_client.py
@@ -25,14 +25,14 @@
def get_availability_zone_list(self):
resp, body = self.get('os-availability-zone')
body = json.loads(body)
- self.validate_response(schema.get_availability_zone_list, resp, body)
+ self.validate_response(schema.list_availability_zone_list, resp, body)
return service_client.ResponseBodyList(resp,
body['availabilityZoneInfo'])
def get_availability_zone_list_detail(self):
resp, body = self.get('os-availability-zone/detail')
body = json.loads(body)
- self.validate_response(schema.get_availability_zone_list_detail, resp,
+ self.validate_response(schema.list_availability_zone_list_detail, resp,
body)
return service_client.ResponseBodyList(resp,
body['availabilityZoneInfo'])
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index bf4bc7f..49ac266 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -15,8 +15,7 @@
import json
-from tempest.api_schema.response.compute import hypervisors as common_schema
-from tempest.api_schema.response.compute.v2_1 import hypervisors as v2schema
+from tempest.api_schema.response.compute.v2_1 import hypervisors as schema
from tempest.common import service_client
@@ -26,51 +25,47 @@
"""List hypervisors information."""
resp, body = self.get('os-hypervisors')
body = json.loads(body)
- self.validate_response(common_schema.common_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_search_hypervisors, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_list_details(self):
"""Show detailed hypervisors information."""
resp, body = self.get('os-hypervisors/detail')
body = json.loads(body)
- self.validate_response(common_schema.common_list_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_hypervisors_detail, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_show_details(self, hyper_id):
"""Display the details of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s' % hyper_id)
body = json.loads(body)
- self.validate_response(common_schema.common_show_hypervisor,
- resp, body)
+ self.validate_response(schema.get_hypervisor, resp, body)
return service_client.ResponseBody(resp, body['hypervisor'])
def get_hypervisor_servers(self, hyper_name):
"""List instances belonging to the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/servers' % hyper_name)
body = json.loads(body)
- self.validate_response(v2schema.hypervisors_servers, resp, body)
+ self.validate_response(schema.get_hypervisors_servers, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
def get_hypervisor_stats(self):
"""Get hypervisor statistics over all compute nodes."""
resp, body = self.get('os-hypervisors/statistics')
body = json.loads(body)
- self.validate_response(common_schema.hypervisor_statistics, resp, body)
+ self.validate_response(schema.get_hypervisor_statistics, resp, body)
return service_client.ResponseBody(resp, body['hypervisor_statistics'])
def get_hypervisor_uptime(self, hyper_id):
"""Display the uptime of the specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
body = json.loads(body)
- self.validate_response(common_schema.hypervisor_uptime, resp, body)
+ self.validate_response(schema.get_hypervisor_uptime, resp, body)
return service_client.ResponseBody(resp, body['hypervisor'])
def search_hypervisor(self, hyper_name):
"""Search specified hypervisor."""
resp, body = self.get('os-hypervisors/%s/search' % hyper_name)
body = json.loads(body)
- self.validate_response(common_schema.common_hypervisors_detail,
- resp, body)
+ self.validate_response(schema.list_search_hypervisors, resp, body)
return service_client.ResponseBodyList(resp, body['hypervisors'])
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index 1a4c5d9..debf39b 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -105,7 +105,7 @@
headers['X-Auth-User'] = self.user
return headers, body
- def get_stack(self, stack_identifier):
+ def show_stack(self, stack_identifier):
"""Returns the details of a single stack."""
url = "stacks/%s" % stack_identifier
resp, body = self.get(url)
@@ -137,7 +137,7 @@
body = json.loads(body)
return service_client.ResponseBodyList(resp, body['resources'])
- def get_resource(self, stack_identifier, resource_name):
+ def show_resource(self, stack_identifier, resource_name):
"""Returns the details of a single resource."""
url = "stacks/%s/resources/%s" % (stack_identifier, resource_name)
resp, body = self.get(url)
@@ -159,7 +159,7 @@
while True:
try:
- body = self.get_resource(
+ body = self.show_resource(
stack_identifier, resource_name)
except lib_exc.NotFound:
# ignore this, as the resource may not have
@@ -195,7 +195,7 @@
while True:
try:
- body = self.get_stack(stack_identifier)
+ body = self.show_stack(stack_identifier)
except lib_exc.NotFound:
if status == 'DELETE_COMPLETE':
return
@@ -295,14 +295,14 @@
body = json.loads(body)
return service_client.ResponseBodyList(resp, body['resource_types'])
- def get_resource_type(self, resource_type_name):
+ def show_resource_type(self, resource_type_name):
"""Return the schema of a resource type."""
url = 'resource_types/%s' % resource_type_name
resp, body = self.get(url)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, json.loads(body))
- def get_resource_type_template(self, resource_type_name):
+ def show_resource_type_template(self, resource_type_name):
"""Return the template of a resource type."""
url = 'resource_types/%s/template' % resource_type_name
resp, body = self.get(url)
@@ -320,7 +320,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_config(self, conf_id):
+ def show_software_config(self, conf_id):
"""Returns a software configuration resource."""
url = 'software_configs/%s' % str(conf_id)
resp, body = self.get(url)
@@ -365,7 +365,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy_list(self):
+ def list_software_deployments(self):
"""Returns a list of all deployments."""
url = 'software_deployments'
resp, body = self.get(url)
@@ -373,7 +373,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy(self, deploy_id):
+ def show_software_deployment(self, deploy_id):
"""Returns a specific software deployment."""
url = 'software_deployments/%s' % str(deploy_id)
resp, body = self.get(url)
@@ -381,7 +381,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_software_deploy_meta(self, server_id):
+ def show_software_deployment_metadata(self, server_id):
"""Return a config metadata for a specific server."""
url = 'software_deployments/metadata/%s' % server_id
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/admin/volume_quotas_client.py b/tempest/services/volume/json/admin/volume_quotas_client.py
index abd36c1..5092afc 100644
--- a/tempest/services/volume/json/admin/volume_quotas_client.py
+++ b/tempest/services/volume/json/admin/volume_quotas_client.py
@@ -26,7 +26,7 @@
TYPE = "json"
- def get_default_quota_set(self, tenant_id):
+ def show_default_quota_set(self, tenant_id):
"""List the default volume quota set for a tenant."""
url = 'os-quota-sets/%s/defaults' % tenant_id
@@ -34,7 +34,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, self._parse_resp(body))
- def get_quota_set(self, tenant_id, params=None):
+ def show_quota_set(self, tenant_id, params=None):
"""List the quota set for a tenant."""
url = 'os-quota-sets/%s' % tenant_id
@@ -45,10 +45,10 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, self._parse_resp(body))
- def get_quota_usage(self, tenant_id):
+ def show_quota_usage(self, tenant_id):
"""List the quota set for a tenant."""
- body = self.get_quota_set(tenant_id, params={'usage': True})
+ body = self.show_quota_set(tenant_id, params={'usage': True})
return body
def update_quota_set(self, tenant_id, gigabytes=None, volumes=None,
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index c905155..9366984 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -33,9 +33,9 @@
# "type": resource_type}
try:
if resource['type'] == "volume-type":
- self.get_volume_type(resource['id'])
+ self.show_volume_type(resource['id'])
elif resource['type'] == "encryption-type":
- body = self.get_encryption_type(resource['id'])
+ body = self.show_encryption_type(resource['id'])
if not body:
return True
else:
@@ -61,7 +61,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['volume_types'])
- def get_volume_type(self, volume_id):
+ def show_volume_type(self, volume_id):
"""Returns the details of a single volume_type."""
url = "types/%s" % str(volume_id)
resp, body = self.get(url)
@@ -104,7 +104,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['extra_specs'])
- def get_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
+ def show_volume_type_extra_specs(self, vol_type_id, extra_spec_name):
"""Returns the details of a single volume_type extra spec."""
url = "types/%s/extra_specs/%s" % (str(vol_type_id),
str(extra_spec_name))
@@ -150,7 +150,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
- def get_encryption_type(self, vol_type_id):
+ def show_encryption_type(self, vol_type_id):
"""
Get the volume encryption type for the specified volume type.
vol_type_id: Id of volume_type.
diff --git a/tempest/services/volume/json/availability_zone_client.py b/tempest/services/volume/json/availability_zone_client.py
index bb5e39b..dc0388f 100644
--- a/tempest/services/volume/json/availability_zone_client.py
+++ b/tempest/services/volume/json/availability_zone_client.py
@@ -20,7 +20,7 @@
class BaseVolumeAvailabilityZoneClientJSON(service_client.ServiceClient):
- def get_availability_zone_list(self):
+ def list_availability_zones(self):
resp, body = self.get('os-availability-zone')
body = json.loads(body)
self.expected_success(200, resp.status)
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index dad5aff..83ec182 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -56,7 +56,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
- def get_backup(self, backup_id):
+ def show_backup(self, backup_id):
"""Returns the details of a single backup."""
url = "backups/%s" % str(backup_id)
resp, body = self.get(url)
@@ -64,9 +64,11 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['backup'])
- def list_backups_with_detail(self):
+ def list_backups(self, detail=False):
"""Information for all the tenant's backups."""
- url = "backups/detail"
+ url = "backups"
+ if detail:
+ url += "/detail"
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
@@ -74,13 +76,13 @@
def wait_for_backup_status(self, backup_id, status):
"""Waits for a Backup to reach a given status."""
- body = self.get_backup(backup_id)
+ body = self.show_backup(backup_id)
backup_status = body['status']
start = int(time.time())
while backup_status != status:
time.sleep(self.build_interval)
- body = self.get_backup(backup_id)
+ body = self.show_backup(backup_id)
backup_status = body['status']
if backup_status == 'error':
raise exceptions.VolumeBackupException(backup_id=backup_id)
diff --git a/tempest/services/volume/json/qos_client.py b/tempest/services/volume/json/qos_client.py
index 14ff506..e9d3777 100644
--- a/tempest/services/volume/json/qos_client.py
+++ b/tempest/services/volume/json/qos_client.py
@@ -26,7 +26,7 @@
def is_resource_deleted(self, qos_id):
try:
- self.get_qos(qos_id)
+ self.show_qos(qos_id)
except lib_exc.NotFound:
return True
return False
@@ -48,15 +48,15 @@
start_time = int(time.time())
while True:
if operation == 'qos-key-unset':
- body = self.get_qos(qos_id)
+ body = self.show_qos(qos_id)
if not any(key in body['specs'] for key in args):
return
elif operation == 'disassociate':
- body = self.get_association_qos(qos_id)
+ body = self.show_association_qos(qos_id)
if not any(args in body[i]['id'] for i in range(0, len(body))):
return
elif operation == 'disassociate-all':
- body = self.get_association_qos(qos_id)
+ body = self.show_association_qos(qos_id)
if not body:
return
else:
@@ -96,7 +96,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['qos_specs'])
- def get_qos(self, qos_id):
+ def show_qos(self, qos_id):
"""Get the specified QoS specification."""
url = "qos-specs/%s" % str(qos_id)
resp, body = self.get(url)
@@ -133,7 +133,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
- def get_association_qos(self, qos_id):
+ def show_association_qos(self, qos_id):
"""Get the association of the specified QoS specification."""
url = "qos-specs/%s/associations" % str(qos_id)
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index 9f88085..2140c62 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -29,29 +29,20 @@
create_resp = 200
- def list_snapshots(self, params=None):
+ def list_snapshots(self, detail=False, params=None):
"""List all the snapshot."""
url = 'snapshots'
+ if detail:
+ url += '/detail'
if params:
- url += '?%s' % urllib.urlencode(params)
+ url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['snapshots'])
- def list_snapshots_with_detail(self, params=None):
- """List the details of all snapshots."""
- url = 'snapshots/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['snapshots'])
-
- def get_snapshot(self, snapshot_id):
+ def show_snapshot(self, snapshot_id):
"""Returns the details of a single snapshot."""
url = "snapshots/%s" % str(snapshot_id)
resp, body = self.get(url)
@@ -85,7 +76,7 @@
# NOTE(afazekas): just for the wait function
def _get_snapshot_status(self, snapshot_id):
- body = self.get_snapshot(snapshot_id)
+ body = self.show_snapshot(snapshot_id)
status = body['status']
# NOTE(afazekas): snapshot can reach an "error"
# state in a "normal" lifecycle
@@ -128,7 +119,7 @@
def is_resource_deleted(self, id):
try:
- self.get_snapshot(id)
+ self.show_snapshot(id)
except lib_exc.NotFound:
return True
return False
@@ -166,7 +157,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['metadata'])
- def get_snapshot_metadata(self, snapshot_id):
+ def show_snapshot_metadata(self, snapshot_id):
"""Get metadata of the snapshot."""
url = "snapshots/%s/metadata" % str(snapshot_id)
resp, body = self.get(url)
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 059664c..a82291a 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -40,29 +40,20 @@
"""Return the element 'attachment' from input volumes."""
return volume['attachments'][0]
- def list_volumes(self, params=None):
+ def list_volumes(self, detail=False, params=None):
"""List all the volumes created."""
url = 'volumes'
+ if detail:
+ url += '/detail'
if params:
- url += '?%s' % urllib.urlencode(params)
+ url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBodyList(resp, body['volumes'])
- def list_volumes_with_detail(self, params=None):
- """List the details of all volumes."""
- url = 'volumes/detail'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['volumes'])
-
- def get_volume(self, volume_id):
+ def show_volume(self, volume_id):
"""Returns the details of a single volume."""
url = "volumes/%s" % str(volume_id)
resp, body = self.get(url)
@@ -161,13 +152,13 @@
def wait_for_volume_status(self, volume_id, status):
"""Waits for a Volume to reach a given status."""
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
start = int(time.time())
while volume_status != status:
time.sleep(self.build_interval)
- body = self.get_volume(volume_id)
+ body = self.show_volume(volume_id)
volume_status = body['status']
if volume_status == 'error':
raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
@@ -183,7 +174,7 @@
def is_resource_deleted(self, id):
try:
- self.get_volume(id)
+ self.show_volume(id)
except lib_exc.NotFound:
return True
return False
@@ -240,7 +231,7 @@
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body['transfer'])
- def get_volume_transfer(self, transfer_id):
+ def show_volume_transfer(self, transfer_id):
"""Returns the details of a volume transfer."""
url = "os-volume-transfer/%s" % str(transfer_id)
resp, body = self.get(url)
@@ -303,7 +294,7 @@
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body['metadata'])
- def get_volume_metadata(self, volume_id):
+ def show_volume_metadata(self, volume_id):
"""Get metadata of the volume."""
url = "volumes/%s/metadata" % str(volume_id)
resp, body = self.get(url)
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index d0b1be1..29c4401 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -80,7 +80,7 @@
# volume deletion may block
_, snaps = admin_manager.snapshots_client.\
- list_snapshots({"all_tenants": True})
+ list_snapshots(params={"all_tenants": True})
LOG.info("Cleanup::remove %s snapshots" % len(snaps))
for v in snaps:
try:
@@ -96,7 +96,8 @@
except Exception:
pass
- vols = admin_manager.volumes_client.list_volumes({"all_tenants": True})
+ vols = admin_manager.volumes_client.list_volumes(
+ params={"all_tenants": True})
LOG.info("Cleanup::remove %s volumes" % len(vols))
for v in vols:
try:
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index e84d627..62e60d6 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -23,7 +23,7 @@
from tempest_lib.common.utils import data_utils
from tempest import clients
-from tempest.common import cred_provider
+from tempest.common import isolated_creds
from tempest.common import ssh
from tempest import config
from tempest import exceptions
@@ -149,15 +149,22 @@
username = data_utils.rand_name("stress_user")
tenant_name = data_utils.rand_name("stress_tenant")
password = "pass"
- identity_client = admin_manager.identity_client
- tenant = identity_client.create_tenant(name=tenant_name)
- identity_client.create_user(username,
- password,
- tenant['id'],
- "email")
- creds = cred_provider.get_credentials(username=username,
- password=password,
- tenant_name=tenant_name)
+ if CONF.identity.auth_version == 'v2':
+ identity_client = admin_manager.identity_client
+ else:
+ identity_client = admin_manager.identity_v3_client
+ credentials_client = isolated_creds.get_creds_client(
+ identity_client)
+ project = credentials_client.create_project(
+ name=tenant_name, description=tenant_name)
+ user = credentials_client.create_user(username, password,
+ project['id'], "email")
+ # Add roles specified in config file
+ for conf_role in CONF.auth.tempest_roles:
+ credentials_client.assign_user_role(user, project,
+ conf_role)
+ creds = credentials_client.get_credentials(user, project,
+ password)
manager = clients.Manager(credentials=creds)
test_obj = importutils.import_class(test['action'])
diff --git a/tempest/test.py b/tempest/test.py
index da936b4..d57b1d8 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -445,7 +445,12 @@
# Make sure isolated_creds exists and get a network client
networks_client = cls.get_client_manager().networks_client
isolated_creds = getattr(cls, 'isolated_creds', None)
- if credentials.is_admin_available():
+ # In case of nova network, isolated tenants are not able to list the
+ # network configured in fixed_network_name, even if the can use it
+ # for their servers, so using an admin network client to validate
+ # the network name
+ if (not CONF.service_available.neutron and
+ credentials.is_admin_available()):
admin_creds = isolated_creds.get_admin_creds()
networks_client = clients.Manager(admin_creds).networks_client
return fixed_network.get_tenant_network(isolated_creds,
@@ -467,8 +472,6 @@
super(NegativeAutoTest, cls).setUpClass()
os = cls.get_client_manager()
cls.client = os.negative_client
- os_admin = clients.AdminManager(service=cls._service)
- cls.admin_client = os_admin.negative_client
@staticmethod
def load_tests(*args):
@@ -596,7 +599,13 @@
"mechanism")
if "admin_client" in description and description["admin_client"]:
- client = self.admin_client
+ if not credentials.is_admin_available():
+ msg = ("Missing Identity Admin API credentials in"
+ "configuration.")
+ raise self.skipException(msg)
+ creds = self.isolated_creds.get_admin_creds()
+ os_adm = clients.Manager(credentials=creds)
+ client = os_adm.negative_client
else:
client = self.client
resp, resp_body = client.send_request(method, new_url,
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index 2a98a06..6371e49 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -67,7 +67,7 @@
self.useFixture(mockpatch.Patch(
'tempest.common.accounts.read_accounts_yaml',
return_value=self.test_accounts))
- cfg.CONF.set_default('test_accounts_file', '', group='auth')
+ cfg.CONF.set_default('test_accounts_file', 'fake_path', group='auth')
self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def _get_hash_list(self, accounts_list):
@@ -297,12 +297,8 @@
cfg.CONF.set_default('test_accounts_file', '', group='auth')
self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
- def test_get_creds(self):
+ def test_get_creds_roles_nonlocking_invalid(self):
test_accounts_class = accounts.NotLockingAccounts('v2', 'test_name')
- for i in xrange(len(self.test_accounts)):
- creds = test_accounts_class.get_creds(i)
- msg = "Empty credentials returned for ID %s" % str(i)
- self.assertIsNotNone(creds, msg)
self.assertRaises(exceptions.InvalidConfiguration,
- test_accounts_class.get_creds,
- id=len(self.test_accounts))
+ test_accounts_class.get_creds_by_roles,
+ ['fake_role'])
diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py
new file mode 100644
index 0000000..4e3aa4c
--- /dev/null
+++ b/tempest/tests/common/test_admin_available.py
@@ -0,0 +1,104 @@
+# Copyright 2015 Red Hat, Inc.
+#
+# 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 oslo.config import cfg
+from oslotest import mockpatch
+
+from tempest.common import credentials
+from tempest import config
+from tempest.tests import base
+from tempest.tests import fake_config
+
+
+class TestAdminAvailable(base.TestCase):
+
+ def setUp(self):
+ super(TestAdminAvailable, self).setUp()
+ self.useFixture(fake_config.ConfigFixture())
+ self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
+
+ def run_test(self, tenant_isolation, use_accounts_file, admin_creds):
+
+ cfg.CONF.set_default('allow_tenant_isolation',
+ tenant_isolation, group='auth')
+ if use_accounts_file:
+ accounts = [{'username': 'u1',
+ 'tenant_name': 't1',
+ 'password': 'p'},
+ {'username': 'u2',
+ 'tenant_name': 't2',
+ 'password': 'p'}]
+ if admin_creds == 'role':
+ accounts.append({'username': 'admin',
+ 'tenant_name': 'admin',
+ 'password': 'p',
+ 'roles': ['admin']})
+ elif admin_creds == 'type':
+ accounts.append({'username': 'admin',
+ 'tenant_name': 'admin',
+ 'password': 'p',
+ 'types': ['admin']})
+ self.useFixture(mockpatch.Patch(
+ 'tempest.common.accounts.read_accounts_yaml',
+ return_value=accounts))
+ cfg.CONF.set_default('test_accounts_file',
+ use_accounts_file, group='auth')
+ self.useFixture(mockpatch.Patch('os.path.isfile',
+ return_value=True))
+ else:
+ self.useFixture(mockpatch.Patch('os.path.isfile',
+ return_value=False))
+ if admin_creds:
+ (u, t, p) = ('u', 't', 'p')
+ else:
+ (u, t, p) = (None, None, None)
+
+ cfg.CONF.set_default('admin_username', u, group='identity')
+ cfg.CONF.set_default('admin_tenant_name', t, group='identity')
+ cfg.CONF.set_default('admin_password', p, group='identity')
+
+ expected = admin_creds is not None or tenant_isolation
+ observed = credentials.is_admin_available()
+ self.assertEqual(expected, observed)
+
+ # Tenant isolation implies admin so only one test case for True
+ def test__tenant_isolation__accounts_file__no_admin(self):
+ self.run_test(tenant_isolation=True,
+ use_accounts_file=True,
+ admin_creds=None)
+
+ def test__no_tenant_isolation__accounts_file__no_admin(self):
+ self.run_test(tenant_isolation=False,
+ use_accounts_file=True,
+ admin_creds=None)
+
+ def test__no_tenant_isolation__accounts_file__admin_role(self):
+ self.run_test(tenant_isolation=False,
+ use_accounts_file=True,
+ admin_creds='role')
+
+ def test__no_tenant_isolation__accounts_file__admin_type(self):
+ self.run_test(tenant_isolation=False,
+ use_accounts_file=True,
+ admin_creds='type')
+
+ def test__no_tenant_isolation__no_accounts_file__no_admin(self):
+ self.run_test(tenant_isolation=False,
+ use_accounts_file=False,
+ admin_creds=None)
+
+ def test__no_tenant_isolation__no_accounts_file__admin(self):
+ self.run_test(tenant_isolation=False,
+ use_accounts_file=False,
+ admin_creds='role')
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 82cbde9..fd8718f 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -278,11 +278,11 @@
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
- iso_creds.get_primary_creds()
+ primary_creds = iso_creds.get_primary_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_primary_network()
- subnet = iso_creds.get_primary_subnet()
- router = iso_creds.get_primary_router()
+ network = primary_creds.network
+ subnet = primary_creds.subnet
+ router = primary_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_net')
self.assertEqual(subnet['id'], '1234')
@@ -427,11 +427,11 @@
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
- iso_creds.get_alt_creds()
+ alt_creds = iso_creds.get_alt_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_alt_network()
- subnet = iso_creds.get_alt_subnet()
- router = iso_creds.get_alt_router()
+ network = alt_creds.network
+ subnet = alt_creds.subnet
+ router = alt_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_alt_net')
self.assertEqual(subnet['id'], '1234')
@@ -453,11 +453,11 @@
'tempest.services.network.json.network_client.NetworkClientJSON.'
'add_router_interface_with_subnet_id')
self._mock_list_roles('123456', 'admin')
- iso_creds.get_admin_creds()
+ admin_creds = iso_creds.get_admin_creds()
router_interface_mock.called_once_with('1234', '1234')
- network = iso_creds.get_admin_network()
- subnet = iso_creds.get_admin_subnet()
- router = iso_creds.get_admin_router()
+ network = admin_creds.network
+ subnet = admin_creds.subnet
+ router = admin_creds.router
self.assertEqual(network['id'], '1234')
self.assertEqual(network['name'], 'fake_admin_net')
self.assertEqual(subnet['id'], '1234')
@@ -490,13 +490,13 @@
'delete_router')
router_mock = router.start()
- iso_creds.get_primary_creds()
+ primary_creds = iso_creds.get_primary_creds()
self.assertEqual(net_mock.mock_calls, [])
self.assertEqual(subnet_mock.mock_calls, [])
self.assertEqual(router_mock.mock_calls, [])
- network = iso_creds.get_primary_network()
- subnet = iso_creds.get_primary_subnet()
- router = iso_creds.get_primary_router()
+ network = primary_creds.network
+ subnet = primary_creds.subnet
+ router = primary_creds.router
self.assertIsNone(network)
self.assertIsNone(subnet)
self.assertIsNone(router)
diff --git a/tempest/thirdparty/boto/test_ec2_network.py b/tempest/thirdparty/boto/test_ec2_network.py
deleted file mode 100644
index ce20156..0000000
--- a/tempest/thirdparty/boto/test_ec2_network.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# 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 import test
-from tempest.thirdparty.boto import test as boto_test
-
-
-class EC2NetworkTest(boto_test.BotoTestCase):
-
- @classmethod
- def setup_clients(cls):
- super(EC2NetworkTest, cls).setup_clients()
- cls.ec2_client = cls.os.ec2api_client
-
- # Note(afazekas): these tests for things duable without an instance
- @test.idempotent_id('48b912af-9403-4b4f-aa69-fa76d690a81f')
- def test_disassociate_not_associated_floating_ip(self):
- # EC2 disassociate not associated floating ip
- ec2_codes = self.ec2_error_code
- address = self.ec2_client.allocate_address()
- public_ip = address.public_ip
- rcuk = self.addResourceCleanUp(self.ec2_client.release_address,
- public_ip)
- addresses_get = self.ec2_client.get_all_addresses(
- addresses=(public_ip,))
- self.assertEqual(len(addresses_get), 1)
- self.assertEqual(addresses_get[0].public_ip, public_ip)
- self.assertBotoError(ec2_codes.client.InvalidAssociationID.NotFound,
- address.disassociate)
- self.ec2_client.release_address(public_ip)
- self.assertAddressReleasedWait(address)
- self.cancelResourceCleanUp(rcuk)
diff --git a/tools/check_uuid.py b/tools/check_uuid.py
index 34effe4..e21c3d8 100755
--- a/tools/check_uuid.py
+++ b/tools/check_uuid.py
@@ -275,7 +275,7 @@
if not test_uuid:
return
if test_uuid in uuids:
- error_str = "%s:%s\n uuid %s collision: %s<->%s\n%s:%s\n" % (
+ error_str = "%s:%s\n uuid %s collision: %s<->%s\n%s:%s" % (
tests[module_name]['source_path'],
tests[module_name]['tests'][test_name].lineno,
test_uuid,
@@ -285,6 +285,8 @@
uuids[test_uuid]['test_node'].lineno,
)
print(error_str)
+ print("cannot automatically resolve the collision, please "
+ "manually remove the duplicate value on the new test.")
return True
else:
uuids[test_uuid] = {