Merge "add 'create domain with name length > 64'"
diff --git a/HACKING.rst b/HACKING.rst
index 3799046..9f7487d 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -17,6 +17,7 @@
- [T108] Check no hyphen at the end of rand_name() argument
- [T109] Cannot use testtools.skip decorator; instead use
decorators.skip_because from tempest-lib
+- [T110] Check that service client names of GET should be consistent
- [N322] Method's default argument shouldn't be mutable
Test Data/Configuration
diff --git a/README.rst b/README.rst
index bf513bd..45cb4c0 100644
--- a/README.rst
+++ b/README.rst
@@ -22,8 +22,8 @@
- Tempest should not touch private or implementation specific
interfaces. This means not directly going to the database, not
directly hitting the hypervisors, not testing extensions not
- included in the OpenStack base. If there is some feature of
- OpenStack that is not verifiable through standard interfaces, this
+ included in the OpenStack base. If there are some features of
+ OpenStack that are not verifiable through standard interfaces, this
should be considered a possible enhancement.
- Tempest strives for complete coverage of the OpenStack API and
common scenarios that demonstrate a working cloud.
@@ -47,10 +47,11 @@
assumptions related to that. For this section we'll only cover the newer method
as it is simpler, and quicker to work with.
-#. You first need to install Tempest this is done with pip, after you check out
- the Tempest repo you simply run something like::
+#. You first need to install Tempest. This is done with pip after you check out
+ the Tempest repo::
- $ pip install tempest
+ $ git clone https://github.com/openstack/tempest/
+ $ pip install tempest/
This can be done within a venv, but the assumption for this guide is that
the Tempest cli entry point will be in your shell's PATH.
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index f228040..02fa0d8 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -363,6 +363,17 @@
the same *catalog_type* as devstack or you want Tempest to talk to a different
endpoint type instead of publicURL for a service that these need to be changed.
+.. note::
+
+ Tempest does not serve all kind of fancy URLs in the service catalog.
+ Service catalog should be in a standard format (which is going to be
+ standardized at keystone level).
+ Tempest expects URLs in the Service catalog in below format:
+ * http://example.com:1234/<version-info>
+ Examples:
+ * Good - http://example.com:1234/v2.0
+ * Wouldn’t work - http://example.com:1234/xyz/v2.0/
+ (adding prefix/suffix around version etc)
Service feature configuration
-----------------------------
diff --git a/doc/source/plugin.rst b/doc/source/plugin.rst
index a41038c..29653a6 100644
--- a/doc/source/plugin.rst
+++ b/doc/source/plugin.rst
@@ -26,7 +26,7 @@
In order to create the basic structure with base classes and test directories
you can use the tempest-plugin-cookiecutter project::
- > cookiecutter https://git.openstack.org/openstack/tempest-plugin-cookiecutter
+ > pip install -U cookiecutter && cookiecutter https://git.openstack.org/openstack/tempest-plugin-cookiecutter
Cloning into 'tempest-plugin-cookiecutter'...
remote: Counting objects: 17, done.
diff --git a/requirements.txt b/requirements.txt
index 59d6856..370bb65 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -15,7 +15,7 @@
oslo.concurrency>=2.3.0 # Apache-2.0
oslo.config>=2.6.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
-oslo.log>=1.8.0 # Apache-2.0
+oslo.log>=1.12.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0
oslo.utils!=2.6.0,>=2.4.0 # Apache-2.0
six>=1.9.0
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 1b36ff2..5b02761 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -17,11 +17,10 @@
from tempest import test
-class AZAdminV2TestJSON(base.BaseComputeAdminTest):
+class AZAdminV2TestJSON(base.BaseV2ComputeAdminTest):
"""
Tests Availability Zone API List
"""
- _api_version = 2
@classmethod
def setup_clients(cls):
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index f186a7d..cfae772 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -28,14 +28,27 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
+ def skip_checks(cls):
+ super(LiveBlockMigrationTestJSON, cls).skip_checks()
+
+ if not CONF.compute_feature_enabled.live_migration:
+ skip_msg = ("%s skipped as live-migration is "
+ "not available" % cls.__name__)
+ raise cls.skipException(skip_msg)
+ if CONF.compute.min_compute_nodes < 2:
+ raise cls.skipTest(
+ "Less than 2 compute nodes, skipping migration test.")
+
+ @classmethod
def setup_clients(cls):
super(LiveBlockMigrationTestJSON, cls).setup_clients()
cls.admin_hosts_client = cls.os_adm.hosts_client
cls.admin_servers_client = cls.os_adm.servers_client
cls.admin_migration_client = cls.os_adm.migrations_client
- def _get_compute_hostnames(self):
- body = self.admin_hosts_client.list_hosts()['hosts']
+ @classmethod
+ def _get_compute_hostnames(cls):
+ body = cls.admin_hosts_client.list_hosts()['hosts']
return [
host_record['host_name']
for host_record in body
@@ -90,9 +103,6 @@
volume_backed, *block* migration is not used.
"""
# Live migrate an instance to another host
- if len(self._get_compute_hostnames()) < 2:
- raise self.skipTest(
- "Less than 2 compute nodes, skipping migration test.")
server_id = self._create_server(volume_backed=volume_backed)
actual_host = self._get_host_for_server(server_id)
target_host = self._get_host_other_than(actual_host)
@@ -117,14 +127,10 @@
msg)
@test.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
- @testtools.skipUnless(CONF.compute_feature_enabled.live_migration,
- 'Live migration not available')
def test_live_block_migration(self):
self._test_live_migration()
@test.idempotent_id('1e107f21-61b2-4988-8f22-b196e938ab88')
- @testtools.skipUnless(CONF.compute_feature_enabled.live_migration,
- 'Live migration not available')
@testtools.skipUnless(CONF.compute_feature_enabled.pause,
'Pause is not available.')
@testtools.skipUnless(CONF.compute_feature_enabled
@@ -135,24 +141,18 @@
self._test_live_migration(state='PAUSED')
@test.idempotent_id('5071cf17-3004-4257-ae61-73a84e28badd')
- @testtools.skipUnless(CONF.compute_feature_enabled.live_migration,
- 'Live migration not available')
@test.services('volume')
def test_volume_backed_live_migration(self):
self._test_live_migration(volume_backed=True)
@test.idempotent_id('e19c0cc6-6720-4ed8-be83-b6603ed5c812')
- @testtools.skipIf(not CONF.compute_feature_enabled.live_migration or not
- CONF.compute_feature_enabled.
+ @testtools.skipIf(not CONF.compute_feature_enabled.
block_migration_for_live_migration,
'Block Live migration not available')
@testtools.skipIf(not CONF.compute_feature_enabled.
block_migrate_cinder_iscsi,
'Block Live migration not configured for iSCSI')
def test_iscsi_volume(self):
- if len(self._get_compute_hostnames()) < 2:
- raise self.skipTest(
- "Less than 2 compute nodes, skipping migration test.")
server_id = self._create_server()
actual_host = self._get_host_for_server(server_id)
target_host = self._get_host_other_than(actual_host)
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 1da3f6e..c4aa81b 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -20,8 +20,7 @@
CONF = config.CONF
-class NetworksTest(base.BaseComputeAdminTest):
- _api_version = 2
+class NetworksTest(base.BaseV2ComputeAdminTest):
"""
Tests Nova Networks API that usually requires admin privileges.
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index ec2192f..b006fc0 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -22,7 +22,6 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
-from tempest import exceptions
import tempest.test
CONF = config.CONF
@@ -30,10 +29,9 @@
LOG = logging.getLogger(__name__)
-class BaseComputeTest(tempest.test.BaseTestCase):
+class BaseV2ComputeTest(tempest.test.BaseTestCase):
"""Base test case class for all Compute API tests."""
- _api_version = 2
force_tenant_isolation = False
# TODO(andreaf) We should care also for the alt_manager here
@@ -42,29 +40,25 @@
@classmethod
def skip_checks(cls):
- super(BaseComputeTest, cls).skip_checks()
+ super(BaseV2ComputeTest, cls).skip_checks()
if not CONF.service_available.nova:
raise cls.skipException("Nova is not available")
- if cls._api_version != 2:
- msg = ("Unexpected API version is specified (%s)" %
- cls._api_version)
- raise exceptions.InvalidConfiguration(message=msg)
@classmethod
def setup_credentials(cls):
cls.set_network_resources()
- super(BaseComputeTest, cls).setup_credentials()
+ super(BaseV2ComputeTest, cls).setup_credentials()
@classmethod
def setup_clients(cls):
- super(BaseComputeTest, cls).setup_clients()
+ super(BaseV2ComputeTest, cls).setup_clients()
cls.servers_client = cls.os.servers_client
cls.server_groups_client = cls.os.server_groups_client
cls.flavors_client = cls.os.flavors_client
cls.images_client = cls.os.images_client
cls.extensions_client = cls.os.extensions_client
cls.floating_ip_pools_client = cls.os.floating_ip_pools_client
- cls.floating_ips_client = cls.os.floating_ips_client
+ cls.floating_ips_client = cls.os.compute_floating_ips_client
cls.keypairs_client = cls.os.keypairs_client
cls.security_group_rules_client = cls.os.security_group_rules_client
cls.security_groups_client = cls.os.security_groups_client
@@ -96,7 +90,7 @@
@classmethod
def resource_setup(cls):
- super(BaseComputeTest, cls).resource_setup()
+ super(BaseV2ComputeTest, cls).resource_setup()
cls.build_interval = CONF.compute.build_interval
cls.build_timeout = CONF.compute.build_timeout
cls.ssh_user = CONF.compute.ssh_user
@@ -117,7 +111,7 @@
cls.clear_servers()
cls.clear_security_groups()
cls.clear_server_groups()
- super(BaseComputeTest, cls).resource_cleanup()
+ super(BaseV2ComputeTest, cls).resource_cleanup()
@classmethod
def clear_servers(cls):
@@ -147,7 +141,7 @@
Method will delete the server when it's dirty.
The setUp method is responsible for creating a new server.
Exceptions raised in tearDown class are fails the test case,
- This method supposed to use only by tierDown methods, when
+ This method supposed to use only by tearDown methods, when
the shared server_id is stored in the server_id of the class.
"""
if getattr(cls, 'server_id', None) is not None:
@@ -356,22 +350,13 @@
return ip_or_server
-class BaseV2ComputeTest(BaseComputeTest):
- _api_version = 2
-
-
-class BaseComputeAdminTest(BaseComputeTest):
+class BaseV2ComputeAdminTest(BaseV2ComputeTest):
"""Base test case class for Compute Admin API tests."""
credentials = ['primary', 'admin']
@classmethod
def setup_clients(cls):
- super(BaseComputeAdminTest, cls).setup_clients()
+ super(BaseV2ComputeAdminTest, cls).setup_clients()
cls.availability_zone_admin_client = (
cls.os_adm.availability_zone_client)
-
-
-class BaseV2ComputeAdminTest(BaseComputeAdminTest):
- """Base test case class for Compute Admin V2 API tests."""
- _api_version = 2
diff --git a/tempest/api/compute/certificates/test_certificates.py b/tempest/api/compute/certificates/test_certificates.py
index 0096fc2..d5c7302 100644
--- a/tempest/api/compute/certificates/test_certificates.py
+++ b/tempest/api/compute/certificates/test_certificates.py
@@ -20,9 +20,7 @@
CONF = config.CONF
-class CertificatesV2TestJSON(base.BaseComputeTest):
-
- _api_version = 2
+class CertificatesV2TestJSON(base.BaseV2ComputeTest):
@classmethod
def skip_checks(cls):
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index e114c80..7e01296 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -17,9 +17,7 @@
from tempest import test
-class FlavorsV2TestJSON(base.BaseComputeTest):
-
- _api_version = 2
+class FlavorsV2TestJSON(base.BaseV2ComputeTest):
_min_disk = 'minDisk'
_min_ram = 'minRam'
diff --git a/tempest/api/compute/keypairs/base.py b/tempest/api/compute/keypairs/base.py
index 76e5573..15f231b 100644
--- a/tempest/api/compute/keypairs/base.py
+++ b/tempest/api/compute/keypairs/base.py
@@ -16,11 +16,9 @@
from tempest.api.compute import base
-class BaseKeypairTest(base.BaseComputeTest):
+class BaseKeypairTest(base.BaseV2ComputeTest):
"""Base test case class for all keypair API tests."""
- _api_version = 2
-
@classmethod
def setup_clients(cls):
super(BaseKeypairTest, cls).setup_clients()
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index 080441a..8f1f360 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -17,11 +17,10 @@
from tempest import test
-class AZV2TestJSON(base.BaseComputeTest):
+class AZV2TestJSON(base.BaseV2ComputeTest):
"""
Tests Availability Zone API List
"""
- _api_version = 2
@classmethod
def setup_clients(cls):
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 902b72c..f51c2db 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -150,7 +150,7 @@
wait_until='ACTIVE')
# Check a server is in the group
- server_group = (self.server_groups_client.get_server_group(group_id)
+ server_group = (self.server_groups_client.show_server_group(group_id)
['server_group'])
self.assertIn(server['id'], server_group['members'])
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index a59cb16..0754d27 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -52,7 +52,7 @@
except Exception:
# Rebuild server if something happened to it during a test
self.__class__.server_id = self.rebuild_server(
- self.server_id, validatable=True)['server']
+ self.server_id, validatable=True)
def tearDown(self):
self.server_check_teardown()
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index 0da7912..9a04556 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -104,9 +104,9 @@
self._delete_server_group(server_groups[i])
@test.idempotent_id('b3545034-dd78-48f0-bdc2-a4adfa6d0ead')
- def test_get_server_group(self):
+ def test_show_server_group(self):
# Get the server-group
- body = self.client.get_server_group(
+ body = self.client.show_server_group(
self.created_server_group['id'])['server_group']
self.assertEqual(self.created_server_group, body)
diff --git a/tempest/api/compute/test_versions.py b/tempest/api/compute/test_versions.py
index f94cee6..8b84a21 100644
--- a/tempest/api/compute/test_versions.py
+++ b/tempest/api/compute/test_versions.py
@@ -16,7 +16,7 @@
from tempest import test
-class TestVersions(base.BaseComputeTest):
+class TestVersions(base.BaseV2ComputeTest):
@test.idempotent_id('6c0a0990-43b6-4529-9b61-5fd8daf7c55c')
def test_list_api_versions(self):
diff --git a/tempest/api/identity/admin/v2/test_roles.py b/tempest/api/identity/admin/v2/test_roles.py
index 78beead..657d72e 100644
--- a/tempest/api/identity/admin/v2/test_roles.py
+++ b/tempest/api/identity/admin/v2/test_roles.py
@@ -76,7 +76,7 @@
self.data.setup_test_role()
role_id = self.data.role['id']
role_name = self.data.role['name']
- body = self.client.get_role(role_id)['role']
+ body = self.client.show_role(role_id)['role']
self.assertEqual(role_id, body['id'])
self.assertEqual(role_name, body['name'])
diff --git a/tempest/api/identity/admin/v2/test_services.py b/tempest/api/identity/admin/v2/test_services.py
index eebeedb..04e15d2 100644
--- a/tempest/api/identity/admin/v2/test_services.py
+++ b/tempest/api/identity/admin/v2/test_services.py
@@ -27,7 +27,7 @@
# Deleting the service created in this method
self.client.delete_service(service_id)
# Checking whether service is deleted successfully
- self.assertRaises(lib_exc.NotFound, self.client.get_service,
+ self.assertRaises(lib_exc.NotFound, self.client.show_service,
service_id)
@test.idempotent_id('84521085-c6e6-491c-9a08-ec9f70f90110')
@@ -50,7 +50,7 @@
self.assertIn('description', service_data)
self.assertEqual(description, service_data['description'])
# Get service
- fetched_service = (self.client.get_service(service_data['id'])
+ fetched_service = (self.client.show_service(service_data['id'])
['OS-KSADM:service'])
# verifying the existence of service created
self.assertIn('id', fetched_service)
diff --git a/tempest/api/identity/admin/v2/test_tenants.py b/tempest/api/identity/admin/v2/test_tenants.py
index 2ec5c4f..4632b1e 100644
--- a/tempest/api/identity/admin/v2/test_tenants.py
+++ b/tempest/api/identity/admin/v2/test_tenants.py
@@ -57,7 +57,7 @@
desc1 = body['description']
self.assertEqual(desc1, tenant_desc, 'Description should have '
'been sent in response for create')
- body = self.client.get_tenant(tenant_id)['tenant']
+ body = self.client.show_tenant(tenant_id)['tenant']
desc2 = body['description']
self.assertEqual(desc2, tenant_desc, 'Description does not appear'
'to be set')
@@ -74,7 +74,7 @@
tenant_id = body['id']
en1 = body['enabled']
self.assertTrue(en1, 'Enable should be True in response')
- body = self.client.get_tenant(tenant_id)['tenant']
+ body = self.client.show_tenant(tenant_id)['tenant']
en2 = body['enabled']
self.assertTrue(en2, 'Enable should be True in lookup')
self.client.delete_tenant(tenant_id)
@@ -91,7 +91,7 @@
en1 = body['enabled']
self.assertEqual('false', str(en1).lower(),
'Enable should be False in response')
- body = self.client.get_tenant(tenant_id)['tenant']
+ body = self.client.show_tenant(tenant_id)['tenant']
en2 = body['enabled']
self.assertEqual('false', str(en2).lower(),
'Enable should be False in lookup')
@@ -114,7 +114,7 @@
resp2_name = body['name']
self.assertNotEqual(resp1_name, resp2_name)
- body = self.client.get_tenant(t_id)['tenant']
+ body = self.client.show_tenant(t_id)['tenant']
resp3_name = body['name']
self.assertNotEqual(resp1_name, resp3_name)
@@ -141,7 +141,7 @@
resp2_desc = body['description']
self.assertNotEqual(resp1_desc, resp2_desc)
- body = self.client.get_tenant(t_id)['tenant']
+ body = self.client.show_tenant(t_id)['tenant']
resp3_desc = body['description']
self.assertNotEqual(resp1_desc, resp3_desc)
@@ -168,7 +168,7 @@
resp2_en = body['enabled']
self.assertNotEqual(resp1_en, resp2_en)
- body = self.client.get_tenant(t_id)['tenant']
+ body = self.client.show_tenant(t_id)['tenant']
resp3_en = body['enabled']
self.assertNotEqual(resp1_en, resp3_en)
diff --git a/tempest/api/identity/admin/v2/test_tokens.py b/tempest/api/identity/admin/v2/test_tokens.py
index 981a9ea..e808990 100644
--- a/tempest/api/identity/admin/v2/test_tokens.py
+++ b/tempest/api/identity/admin/v2/test_tokens.py
@@ -41,7 +41,7 @@
tenant['name'])
# Perform GET Token
token_id = body['token']['id']
- token_details = self.client.get_token(token_id)['access']
+ token_details = self.client.show_token(token_id)['access']
self.assertEqual(token_id, token_details['token']['id'])
self.assertEqual(user['id'], token_details['user']['id'])
self.assertEqual(user_name, token_details['user']['name'])
diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py
index 6ee5218..6341106 100644
--- a/tempest/api/identity/admin/v2/test_users.py
+++ b/tempest/api/identity/admin/v2/test_users.py
@@ -73,7 +73,7 @@
self.assertEqual(u_email2, update_user['email'])
self.assertEqual(False, update_user['enabled'])
# GET by id after updating
- updated_user = self.client.get_user(user['id'])['user']
+ updated_user = self.client.show_user(user['id'])['user']
# Assert response body of GET after updating
self.assertEqual(u_name2, updated_user['name'])
self.assertEqual(u_email2, updated_user['email'])
@@ -121,7 +121,7 @@
def test_get_users(self):
# Get a list of users and find the test user
self.data.setup_test_user()
- users = self.client.get_users()['users']
+ users = self.client.list_users()['users']
self.assertThat([u['name'] for u in users],
matchers.Contains(self.data.test_user),
"Could not find %s" % self.data.test_user)
@@ -146,7 +146,7 @@
user_ids.append(user2['id'])
self.data.users.append(user2)
# List of users for the respective tenant ID
- body = (self.client.list_users_for_tenant(self.data.tenant['id'])
+ body = (self.client.list_tenant_users(self.data.tenant['id'])
['users'])
for i in body:
fetched_user_ids.append(i['id'])
@@ -182,7 +182,7 @@
second_user['id'],
role['id'])['role']
# List of users with roles for the respective tenant ID
- body = (self.client.list_users_for_tenant(self.data.tenant['id'])
+ body = (self.client.list_tenant_users(self.data.tenant['id'])
['users'])
for i in body:
fetched_user_ids.append(i['id'])
diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py
index 85f7411..a88053d 100644
--- a/tempest/api/identity/admin/v2/test_users_negative.py
+++ b/tempest/api/identity/admin/v2/test_users_negative.py
@@ -222,7 +222,7 @@
# Non-administrator user should not be authorized to get user list
self.data.setup_test_user()
self.assertRaises(lib_exc.Forbidden,
- self.non_admin_client.get_users)
+ self.non_admin_client.list_users)
@test.attr(type=['negative'])
@test.idempotent_id('a73591ec-1903-4ffe-be42-282b39fefc9d')
@@ -230,7 +230,7 @@
# Request to get list of users without a valid token should fail
token = self.client.auth_provider.get_token()
self.client.delete_token(token)
- self.assertRaises(lib_exc.Unauthorized, self.client.get_users)
+ self.assertRaises(lib_exc.Unauthorized, self.client.list_users)
self.client.auth_provider.clear_auth()
@test.attr(type=['negative'])
@@ -247,4 +247,4 @@
# List the users with invalid tenant id
for invalid in invalid_id:
self.assertRaises(lib_exc.NotFound,
- self.client.list_users_for_tenant, invalid)
+ self.client.list_tenant_users, invalid)
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index d22b27f..048c53a 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -53,11 +53,11 @@
@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')]
+ blob = '{"access": "%s", "secret": "%s"}' % (
+ 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])['credential']
+ user_id=self.user_body['id'], project_id=self.projects[0],
+ blob=blob, type='ec2')['credential']
self.addCleanup(self._delete_credential, cred['id'])
for value1 in self.creds_list[0]:
self.assertIn(value1, cred)
@@ -66,9 +66,10 @@
new_keys = [data_utils.rand_name('NewAccess'),
data_utils.rand_name('NewSecret')]
+ blob = '{"access": "%s", "secret": "%s"}' % (new_keys[0], new_keys[1])
update_body = self.creds_client.update_credential(
- cred['id'], access_key=new_keys[0], secret_key=new_keys[1],
- project_id=self.projects[1])['credential']
+ cred['id'], blob=blob, project_id=self.projects[1],
+ type='ec2')['credential']
self.assertEqual(cred['id'], update_body['id'])
self.assertEqual(self.projects[1], update_body['project_id'])
self.assertEqual(self.user_body['id'], update_body['user_id'])
@@ -89,10 +90,11 @@
fetched_cred_ids = list()
for i in range(2):
+ blob = '{"access": "%s", "secret": "%s"}' % (
+ data_utils.rand_name('Access'), data_utils.rand_name('Secret'))
cred = self.creds_client.create_credential(
- data_utils.rand_name('Access'),
- data_utils.rand_name('Secret'),
- self.user_body['id'], self.projects[0])['credential']
+ user_id=self.user_body['id'], project_id=self.projects[0],
+ blob=blob, type='ec2')['credential']
created_cred_ids.append(cred['id'])
self.addCleanup(self._delete_credential, cred['id'])
diff --git a/tempest/api/identity/admin/v3/test_default_project_id.py b/tempest/api/identity/admin/v3/test_default_project_id.py
index 4c69758..53861ca 100644
--- a/tempest/api/identity/admin/v3/test_default_project_id.py
+++ b/tempest/api/identity/admin/v3/test_default_project_id.py
@@ -83,6 +83,6 @@
# verify the user's token and see that it is scoped to the project
token, auth_data = admin_client.auth_provider.get_auth()
- result = admin_client.identity_v3_client.get_token(token)['token']
+ result = admin_client.identity_v3_client.show_token(token)['token']
self.assertEqual(result['project']['domain']['id'], dom_id)
self.assertEqual(result['project']['id'], proj_id)
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index e44a96b..429e2e3 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -33,9 +33,9 @@
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)
+ cls.service_data = (
+ cls.service_client.create_service(name=s_name, type=s_type,
+ description=s_description))
cls.service_data = cls.service_data['service']
cls.service_id = cls.service_data['id']
cls.service_ids.append(cls.service_id)
@@ -45,8 +45,10 @@
region = data_utils.rand_name('region')
url = data_utils.rand_url()
interface = 'public'
- endpoint = (cls.client.create_endpoint(cls.service_id, interface,
- url, region=region, enabled=True))['endpoint']
+ endpoint = cls.client.create_endpoint(service_id=cls.service_id,
+ interface=interface,
+ url=url, region=region,
+ enabled=True)['endpoint']
cls.setup_endpoints.append(endpoint)
@classmethod
@@ -73,8 +75,10 @@
region = data_utils.rand_name('region')
url = data_utils.rand_url()
interface = 'public'
- endpoint = (self.client.create_endpoint(self.service_id, interface,
- url, region=region, enabled=True)['endpoint'])
+ endpoint = self.client.create_endpoint(service_id=self.service_id,
+ interface=interface,
+ url=url, region=region,
+ enabled=True)['endpoint']
# Asserting Create Endpoint response body
self.assertIn('id', endpoint)
self.assertEqual(region, endpoint['region'])
@@ -98,30 +102,30 @@
region1 = data_utils.rand_name('region')
url1 = data_utils.rand_url()
interface1 = 'public'
- endpoint_for_update =\
- self.client.create_endpoint(self.service_id, interface1,
- url1, region=region1,
- enabled=True)['endpoint']
+ endpoint_for_update = (
+ self.client.create_endpoint(service_id=self.service_id,
+ interface=interface1,
+ url=url1, region=region1,
+ enabled=True)['endpoint'])
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')
- service2 =\
- self.service_client.create_service(s_name, s_type,
- description=s_description)
+ service2 = (
+ self.service_client.create_service(name=s_name, type=s_type,
+ description=s_description))
service2 = service2['service']
self.service_ids.append(service2['id'])
# Updating endpoint with new values
region2 = data_utils.rand_name('region')
url2 = data_utils.rand_url()
interface2 = 'internal'
- endpoint = \
- self.client.update_endpoint(endpoint_for_update['id'],
- service_id=service2['id'],
- interface=interface2, url=url2,
- region=region2,
- enabled=False)['endpoint']
+ endpoint = self.client.update_endpoint(endpoint_for_update['id'],
+ service_id=service2['id'],
+ interface=interface2,
+ url=url2, region=region2,
+ enabled=False)['endpoint']
# Asserting if the attributes of endpoint are updated
self.assertEqual(service2['id'], endpoint['service_id'])
self.assertEqual(interface2, endpoint['interface'])
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index 8cf853b..8f9bf2a 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -37,7 +37,7 @@
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,
+ cls.service_client.create_service(name=s_name, type=s_type,
description=s_description)
['service'])
cls.service_id = cls.service_data['id']
@@ -57,8 +57,8 @@
url = data_utils.rand_url()
region = data_utils.rand_name('region')
self.assertRaises(lib_exc.BadRequest, self.client.create_endpoint,
- self.service_id, interface, url, region=region,
- force_enabled='False')
+ service_id=self.service_id, interface=interface,
+ url=url, region=region, enabled='False')
@test.attr(type=['negative'])
@test.idempotent_id('9c43181e-0627-484a-8c79-923e8a59598b')
@@ -68,8 +68,8 @@
url = data_utils.rand_url()
region = data_utils.rand_name('region')
self.assertRaises(lib_exc.BadRequest, self.client.create_endpoint,
- self.service_id, interface, url, region=region,
- force_enabled='True')
+ service_id=self.service_id, interface=interface,
+ url=url, region=region, enabled='True')
def _assert_update_raises_bad_request(self, enabled):
@@ -78,13 +78,14 @@
url1 = data_utils.rand_url()
interface1 = 'public'
endpoint_for_update = (
- self.client.create_endpoint(self.service_id, interface1,
- url1, region=region1,
- enabled=True))['endpoint']
+ self.client.create_endpoint(service_id=self.service_id,
+ interface=interface1,
+ url=url1, region=region1,
+ enabled=True)['endpoint'])
self.addCleanup(self.client.delete_endpoint, endpoint_for_update['id'])
self.assertRaises(lib_exc.BadRequest, self.client.update_endpoint,
- endpoint_for_update['id'], force_enabled=enabled)
+ endpoint_for_update['id'], enabled=enabled)
@test.attr(type=['negative'])
@test.idempotent_id('65e41f32-5eb7-498f-a92a-a6ccacf7439a')
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index 320b479..b7f37d4 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -25,7 +25,7 @@
# assert the response based on expected and not_expected
# expected: user expected in the list response
# not_expected: user, which should not be present in list response
- body = self.client.get_users(params)['users']
+ body = self.client.list_users(params)['users']
self.assertIn(expected[key], map(lambda x: x[key], body))
self.assertNotIn(not_expected[key],
map(lambda x: x[key], body))
@@ -77,7 +77,7 @@
@test.idempotent_id('b30d4651-a2ea-4666-8551-0c0e49692635')
def test_list_users(self):
# List users
- body = self.client.get_users()['users']
+ body = self.client.list_users()['users']
fetched_ids = [u['id'] for u in body]
missing_users = [u['id'] for u in self.data.v3_users
if u['id'] not in fetched_ids]
@@ -88,7 +88,7 @@
@test.idempotent_id('b4baa3ae-ac00-4b4e-9e27-80deaad7771f')
def test_get_user(self):
# Get a user detail
- user = self.client.get_user(self.data.v3_users[0]['id'])['user']
+ user = self.client.show_user(self.data.v3_users[0]['id'])['user']
self.assertEqual(self.data.v3_users[0]['id'], user['id'])
self.assertEqual(self.data.v3_users[0]['name'], user['name'])
self.assertEqual(self.alt_email, user['email'])
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index d079fec..44e5c7b 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -31,8 +31,8 @@
for _ in range(3):
blob = data_utils.rand_name('BlobName')
policy_type = data_utils.rand_name('PolicyType')
- policy = self.policy_client.create_policy(blob,
- policy_type)['policy']
+ policy = self.policy_client.create_policy(
+ blob=blob, type=policy_type)['policy']
# Delete the Policy at the end of this method
self.addCleanup(self._delete_policy, policy['id'])
policy_ids.append(policy['id'])
@@ -49,7 +49,8 @@
# Test to update policy
blob = data_utils.rand_name('BlobName')
policy_type = data_utils.rand_name('PolicyType')
- policy = self.policy_client.create_policy(blob, policy_type)['policy']
+ policy = self.policy_client.create_policy(blob=blob,
+ type=policy_type)['policy']
self.addCleanup(self._delete_policy, policy['id'])
self.assertIn('id', policy)
self.assertIn('type', policy)
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index f014307..d39fd5f 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -169,7 +169,7 @@
self.addCleanup(self.client.delete_user, user['id'])
# Get User To validate the user details
- new_user_get = self.client.get_user(user['id'])['user']
+ new_user_get = self.client.show_user(user['id'])['user']
# Assert response body of GET
self.assertEqual(u_name, new_user_get['name'])
self.assertEqual(u_desc, new_user_get['description'])
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index e96e0f5..0dbbae0 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -33,7 +33,8 @@
cls.setup_regions = list()
for i in range(2):
r_description = data_utils.rand_name('description')
- region = cls.client.create_region(r_description)['region']
+ region = cls.client.create_region(
+ description=r_description)['region']
cls.setup_regions.append(region)
@classmethod
@@ -51,7 +52,7 @@
def test_create_update_get_delete_region(self):
r_description = data_utils.rand_name('description')
region = self.client.create_region(
- r_description,
+ description=r_description,
parent_region_id=self.setup_regions[0]['id'])['region']
self.addCleanup(self._delete_region, region['id'])
self.assertEqual(r_description, region['description'])
@@ -79,7 +80,7 @@
r_region_id = data_utils.rand_uuid()
r_description = data_utils.rand_name('description')
region = self.client.create_region(
- r_description, unique_region_id=r_region_id)['region']
+ region_id=r_region_id, description=r_description)['region']
self.addCleanup(self._delete_region, region['id'])
# Asserting Create Region with specific id response body
self.assertEqual(r_region_id, region['id'])
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index ffc991a..8595dde 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -81,7 +81,7 @@
self.assertIn('links', updated_role)
self.assertNotEqual(r_name, updated_role['name'])
- new_role = self.client.get_role(role['id'])['role']
+ new_role = self.client.show_role(role['id'])['role']
self.assertEqual(new_name, new_role['name'])
self.assertEqual(updated_role['id'], new_role['id'])
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index d920f64..d1595dd 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -26,7 +26,7 @@
# Used for deleting the services created in this class
self.service_client.delete_service(service_id)
# Checking whether service is deleted successfully
- self.assertRaises(lib_exc.NotFound, self.service_client.get_service,
+ self.assertRaises(lib_exc.NotFound, self.service_client.show_service,
service_id)
@test.attr(type='smoke')
@@ -37,7 +37,7 @@
serv_type = data_utils.rand_name('type')
desc = data_utils.rand_name('description')
create_service = self.service_client.create_service(
- serv_type, name=name, description=desc)['service']
+ type=serv_type, name=name, description=desc)['service']
self.addCleanup(self._del_service, create_service['id'])
self.assertIsNotNone(create_service['id'])
@@ -56,7 +56,7 @@
self.assertNotEqual(resp1_desc, resp2_desc)
# Get service
- fetched_service = self.service_client.get_service(s_id)['service']
+ fetched_service = self.service_client.show_service(s_id)['service']
resp3_desc = fetched_service['description']
self.assertEqual(resp2_desc, resp3_desc)
@@ -68,7 +68,7 @@
name = data_utils.rand_name('service')
serv_type = data_utils.rand_name('type')
service = self.service_client.create_service(
- serv_type, name=name)['service']
+ type=serv_type, name=name)['service']
self.addCleanup(self.service_client.delete_service, service['id'])
self.assertIn('id', service)
expected_data = {'name': name, 'type': serv_type}
@@ -82,7 +82,7 @@
name = data_utils.rand_name('service')
serv_type = data_utils.rand_name('type')
create_service = self.service_client.create_service(
- serv_type, name=name)['service']
+ type=serv_type, name=name)['service']
self.addCleanup(self.service_client.delete_service,
create_service['id'])
service_ids.append(create_service['id'])
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index b5f86da..7d33d4a 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -39,13 +39,13 @@
password=u_password).response
subject_token = resp['x-subject-token']
# Perform GET Token
- token_details = self.client.get_token(subject_token)['token']
+ token_details = self.client.show_token(subject_token)['token']
self.assertEqual(resp['x-subject-token'], subject_token)
self.assertEqual(token_details['user']['id'], user['id'])
self.assertEqual(token_details['user']['name'], u_name)
# Perform Delete Token
self.client.delete_token(subject_token)
- self.assertRaises(lib_exc.NotFound, self.client.get_token,
+ self.assertRaises(lib_exc.NotFound, self.client.show_token,
subject_token)
@test.idempotent_id('565fa210-1da1-4563-999b-f7b5b67cf112')
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 8fac0b3..b56c9e6 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -54,7 +54,7 @@
self.assertEqual(u_email2, update_user['email'])
self.assertEqual(False, update_user['enabled'])
# GET by id after updation
- new_user_get = self.client.get_user(user['id'])['user']
+ new_user_get = self.client.show_user(user['id'])['user']
# Assert response body of GET after updation
self.assertEqual(u_name2, new_user_get['name'])
self.assertEqual(u_description2, new_user_get['description'])
@@ -80,7 +80,7 @@
password=new_password).response
subject_token = resp['x-subject-token']
# Perform GET Token to verify and confirm password is updated
- token_details = self.client.get_token(subject_token)['token']
+ token_details = self.client.show_token(subject_token)['token']
self.assertEqual(resp['x-subject-token'], subject_token)
self.assertEqual(token_details['user']['id'], user['id'])
self.assertEqual(token_details['user']['name'], u_name)
@@ -111,8 +111,8 @@
# Delete the Role at the end of this method
self.addCleanup(self.client.delete_role, role_body['id'])
- user = self.client.get_user(user_body['id'])['user']
- role = self.client.get_role(role_body['id'])['role']
+ user = self.client.show_user(user_body['id'])['user']
+ role = self.client.show_role(role_body['id'])['role']
for i in range(2):
# Creating project so as to assign role
project_body = self.client.create_project(
@@ -142,5 +142,5 @@
def test_get_user(self):
# Get a user detail
self.data.setup_test_v3_user()
- user = self.client.get_user(self.data.v3_user['id'])['user']
+ user = self.client.show_user(self.data.v3_user['id'])['user']
self.assertEqual(self.data.v3_user['id'], user['id'])
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 95826b0..02ede3a 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -39,7 +39,7 @@
@classmethod
def get_user_by_name(cls, name):
- users = cls.client.get_users()['users']
+ users = cls.client.list_users()['users']
user = [u for u in users if u['name'] == name]
if len(user) > 0:
return user[0]
@@ -154,7 +154,7 @@
@classmethod
def get_user_by_name(cls, name):
- users = cls.client.get_users()['users']
+ users = cls.client.list_users()['users']
user = [u for u in users if u['name'] == name]
if len(user) > 0:
return user[0]
diff --git a/tempest/api/identity/v2/test_api_discovery.py b/tempest/api/identity/v2/test_api_discovery.py
index 57c78ef..ca807a4 100644
--- a/tempest/api/identity/v2/test_api_discovery.py
+++ b/tempest/api/identity/v2/test_api_discovery.py
@@ -23,7 +23,7 @@
@test.attr(type='smoke')
@test.idempotent_id('ea889a68-a15f-4166-bfb1-c12456eae853')
def test_api_version_resources(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
expected_resources = ('id', 'links', 'media-types', 'status',
'updated')
@@ -34,7 +34,7 @@
@test.attr(type='smoke')
@test.idempotent_id('007a0be0-78fe-4fdb-bbee-e9216cc17bb2')
def test_api_media_types(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
# Get MIME type bases and descriptions
media_types = [(media_type['base'], media_type['type']) for
media_type in descr['media-types']]
@@ -49,7 +49,7 @@
@test.attr(type='smoke')
@test.idempotent_id('77fd6be0-8801-48e6-b9bf-38cdd2f253ec')
def test_api_version_statuses(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
status = descr['status'].lower()
supported_statuses = ['current', 'stable', 'experimental',
'supported', 'deprecated']
diff --git a/tempest/api/identity/v3/test_api_discovery.py b/tempest/api/identity/v3/test_api_discovery.py
index e0207a9..74e9ec1 100644
--- a/tempest/api/identity/v3/test_api_discovery.py
+++ b/tempest/api/identity/v3/test_api_discovery.py
@@ -23,7 +23,7 @@
@test.attr(type='smoke')
@test.idempotent_id('b9232f5e-d9e5-4d97-b96c-28d3db4de1bd')
def test_api_version_resources(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
expected_resources = ('id', 'links', 'media-types', 'status',
'updated')
@@ -34,7 +34,7 @@
@test.attr(type='smoke')
@test.idempotent_id('657c1970-4722-4189-8831-7325f3bc4265')
def test_api_media_types(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
# Get MIME type bases and descriptions
media_types = [(media_type['base'], media_type['type']) for
media_type in descr['media-types']]
@@ -49,7 +49,7 @@
@test.attr(type='smoke')
@test.idempotent_id('8879a470-abfb-47bb-bb8d-5a7fd279ad1e')
def test_api_version_statuses(self):
- descr = self.non_admin_client.get_api_description()['version']
+ descr = self.non_admin_client.show_api_description()['version']
status = descr['status'].lower()
supported_statuses = ['current', 'stable', 'experimental',
'supported', 'deprecated']
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index 86b4973..7692b56 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -61,7 +61,7 @@
@test.idempotent_id('a0856713-6549-470c-a656-e97c8df9a14d')
def test_add_remove_network_from_dhcp_agent(self):
# The agent is now bound to the network, we can free the port
- self.client.delete_port(self.port['id'])
+ self.ports_client.delete_port(self.port['id'])
self.ports.remove(self.port)
agent = dict()
agent['agent_type'] = None
diff --git a/tempest/api/network/admin/test_external_networks_negative.py b/tempest/api/network/admin/test_external_networks_negative.py
index c2fa0dd..8dfce24 100644
--- a/tempest/api/network/admin/test_external_networks_negative.py
+++ b/tempest/api/network/admin/test_external_networks_negative.py
@@ -49,6 +49,6 @@
# create a port which will internally create an instance-ip
self.assertRaises(lib_exc.Conflict,
- client.create_port,
+ self.admin_ports_client.create_port,
network_id=CONF.network.public_network_id,
fixed_ips=fixed_ips)
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 17adfa5..5198ae8 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -75,6 +75,7 @@
cls.client = cls.os.network_client
cls.networks_client = cls.os.networks_client
cls.subnets_client = cls.os.subnets_client
+ cls.ports_client = cls.os.ports_client
@classmethod
def resource_setup(cls):
@@ -108,7 +109,7 @@
metering_label['id'])
# Clean up ports
for port in cls.ports:
- cls._try_delete_resource(cls.client.delete_port,
+ cls._try_delete_resource(cls.ports_client.delete_port,
port['id'])
# Clean up routers
for router in cls.routers:
@@ -201,8 +202,8 @@
@classmethod
def create_port(cls, network, **kwargs):
"""Wrapper utility that returns a test port."""
- body = cls.client.create_port(network_id=network['id'],
- **kwargs)
+ body = cls.ports_client.create_port(network_id=network['id'],
+ **kwargs)
port = body['port']
cls.ports.append(port)
return port
@@ -210,8 +211,8 @@
@classmethod
def update_port(cls, port, **kwargs):
"""Wrapper utility that updates a test port."""
- body = cls.client.update_port(port['id'],
- **kwargs)
+ body = cls.ports_client.update_port(port['id'],
+ **kwargs)
return body['port']
@classmethod
@@ -269,6 +270,7 @@
cls.admin_client = cls.os_adm.network_client
cls.admin_networks_client = cls.os_adm.networks_client
cls.admin_subnets_client = cls.os_adm.subnets_client
+ cls.admin_ports_client = cls.os_adm.ports_client
@classmethod
def create_metering_label(cls, name, description):
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index 5d7f00e..41714aa 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -60,14 +60,14 @@
# Create port with allowed address pair attribute
allowed_address_pairs = [{'ip_address': self.ip_address,
'mac_address': self.mac_address}]
- body = self.client.create_port(
+ body = self.ports_client.create_port(
network_id=self.network['id'],
allowed_address_pairs=allowed_address_pairs)
port_id = body['port']['id']
- self.addCleanup(self.client.delete_port, port_id)
+ self.addCleanup(self.ports_client.delete_port, port_id)
# Confirm port was created with allowed address pair attribute
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports = body['ports']
port = [p for p in ports if p['id'] == port_id]
msg = 'Created port not found in list of ports returned by Neutron'
@@ -76,9 +76,9 @@
def _update_port_with_address(self, address, mac_address=None, **kwargs):
# Create a port without allowed address pair
- body = self.client.create_port(network_id=self.network['id'])
+ body = self.ports_client.create_port(network_id=self.network['id'])
port_id = body['port']['id']
- self.addCleanup(self.client.delete_port, port_id)
+ self.addCleanup(self.ports_client.delete_port, port_id)
if mac_address is None:
mac_address = self.mac_address
@@ -87,7 +87,7 @@
'mac_address': mac_address}]
if kwargs:
allowed_address_pairs.append(kwargs['allowed_address_pairs'])
- body = self.client.update_port(
+ body = self.ports_client.update_port(
port_id, allowed_address_pairs=allowed_address_pairs)
allowed_address_pair = body['port']['allowed_address_pairs']
self.assertEqual(allowed_address_pair, allowed_address_pairs)
@@ -106,9 +106,9 @@
@test.idempotent_id('b3f20091-6cd5-472b-8487-3516137df933')
def test_update_port_with_multiple_ip_mac_address_pair(self):
# Create an ip _address and mac_address through port create
- resp = self.client.create_port(network_id=self.network['id'])
+ resp = self.ports_client.create_port(network_id=self.network['id'])
newportid = resp['port']['id']
- self.addCleanup(self.client.delete_port, newportid)
+ self.addCleanup(self.ports_client.delete_port, newportid)
ipaddress = resp['port']['fixed_ips'][0]['ip_address']
macaddress = resp['port']['mac_address']
diff --git a/tempest/api/network/test_dhcp_ipv6.py b/tempest/api/network/test_dhcp_ipv6.py
index 631a38b..27713a2 100644
--- a/tempest/api/network/test_dhcp_ipv6.py
+++ b/tempest/api/network/test_dhcp_ipv6.py
@@ -63,7 +63,7 @@
del things_list[index]
def _clean_network(self):
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports = body['ports']
for port in ports:
if (port['device_owner'].startswith('network:router_interface')
@@ -73,7 +73,7 @@
)
else:
if port['id'] in [p['id'] for p in self.ports]:
- self.client.delete_port(port['id'])
+ self.ports_client.delete_port(port['id'])
self._remove_from_list_by_index(self.ports, port)
body = self.subnets_client.list_subnets()
subnets = body['subnets']
@@ -203,9 +203,9 @@
real_dhcp_ip, real_eui_ip = [real_ips[sub['id']]
for sub in [subnet_dhcp,
subnet_slaac]]
- self.client.delete_port(port['id'])
+ self.ports_client.delete_port(port['id'])
self.ports.pop()
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports_id_list = [i['id'] for i in body['ports']]
self.assertNotIn(port['id'], ports_id_list)
self._clean_network()
@@ -362,7 +362,7 @@
admin_state_up=True)
port = self.create_router_interface(router['id'],
subnet['id'])
- body = self.client.show_port(port['port_id'])
+ body = self.ports_client.show_port(port['port_id'])
return subnet, body['port']
@test.idempotent_id('e98f65db-68f4-4330-9fea-abd8c5192d4d')
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
index 87e3413..7924f38 100644
--- a/tempest/api/network/test_extra_dhcp_options.py
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -59,14 +59,14 @@
@test.idempotent_id('d2c17063-3767-4a24-be4f-a23dbfa133c9')
def test_create_list_port_with_extra_dhcp_options(self):
# Create a port with Extra DHCP Options
- body = self.client.create_port(
+ body = self.ports_client.create_port(
network_id=self.network['id'],
extra_dhcp_opts=self.extra_dhcp_opts)
port_id = body['port']['id']
- self.addCleanup(self.client.delete_port, port_id)
+ self.addCleanup(self.ports_client.delete_port, port_id)
# Confirm port created has Extra DHCP Options
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports = body['ports']
port = [p for p in ports if p['id'] == port_id]
self.assertTrue(port)
@@ -76,12 +76,12 @@
def test_update_show_port_with_extra_dhcp_options(self):
# Update port with extra dhcp options
name = data_utils.rand_name('new-port-name')
- body = self.client.update_port(
+ body = self.ports_client.update_port(
self.port['id'],
name=name,
extra_dhcp_opts=self.extra_dhcp_opts)
# Confirm extra dhcp options were added to the port
- body = self.client.show_port(self.port['id'])
+ body = self.ports_client.show_port(self.port['id'])
self._confirm_extra_dhcp_options(body['port'], self.extra_dhcp_opts)
def _confirm_extra_dhcp_options(self, port, extra_dhcp_opts):
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 4b4a4e2..b796311 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -130,13 +130,13 @@
self.addCleanup(self.client.delete_floatingip,
created_floating_ip['id'])
# Create a port
- port = self.client.create_port(network_id=self.network['id'])
+ port = self.ports_client.create_port(network_id=self.network['id'])
created_port = port['port']
floating_ip = self.client.update_floatingip(
created_floating_ip['id'],
port_id=created_port['id'])
# Delete port
- self.client.delete_port(created_port['id'])
+ self.ports_client.delete_port(created_port['id'])
# Verifies the details of the floating_ip
floating_ip = self.client.show_floatingip(created_floating_ip['id'])
shown_floating_ip = floating_ip['floatingip']
@@ -197,10 +197,10 @@
list_ips = [str(ip) for ip in ips[-3:-1]]
fixed_ips = [{'ip_address': list_ips[0]}, {'ip_address': list_ips[1]}]
# Create port
- body = self.client.create_port(network_id=self.network['id'],
- fixed_ips=fixed_ips)
+ body = self.ports_client.create_port(network_id=self.network['id'],
+ fixed_ips=fixed_ips)
port = body['port']
- self.addCleanup(self.client.delete_port, port['id'])
+ self.addCleanup(self.ports_client.delete_port, port['id'])
# Create floating ip
body = self.client.create_floatingip(
floating_network_id=self.ext_net_id,
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index c5b2080..5039a69 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -444,9 +444,9 @@
def _delete_ports(self, created_ports):
for n in created_ports:
- self.client.delete_port(n['id'])
+ self.ports_client.delete_port(n['id'])
# Asserting that the ports are not found in the list after deletion
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports_list = [port['id'] for port in body['ports']]
for n in created_ports:
self.assertNotIn(n['id'], ports_list)
@@ -522,7 +522,7 @@
created_ports = body['ports']
self.addCleanup(self._delete_ports, created_ports)
# Asserting that the ports are found in the list after creation
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports_list = [port['id'] for port in body['ports']]
for n in created_ports:
self.assertIsNotNone(n['id'])
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index 4fe31cf..0ef96a6 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -41,7 +41,7 @@
@test.idempotent_id('a954861d-cbfd-44e8-b0a9-7fab111f235d')
def test_show_non_existent_port(self):
non_exist_id = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound, self.client.show_port,
+ self.assertRaises(lib_exc.NotFound, self.ports_client.show_port,
non_exist_id)
@test.attr(type=['negative'])
@@ -79,13 +79,14 @@
def test_create_port_on_non_existent_network(self):
non_exist_net_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
- self.client.create_port, network_id=non_exist_net_id)
+ self.ports_client.create_port,
+ network_id=non_exist_net_id)
@test.attr(type=['negative'])
@test.idempotent_id('cf8eef21-4351-4f53-adcd-cc5cb1e76b92')
def test_update_non_existent_port(self):
non_exist_port_id = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound, self.client.update_port,
+ self.assertRaises(lib_exc.NotFound, self.ports_client.update_port,
non_exist_port_id, name='new_name')
@test.attr(type=['negative'])
@@ -93,4 +94,4 @@
def test_delete_non_existent_port(self):
non_exist_port_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
- self.client.delete_port, non_exist_port_id)
+ self.ports_client.delete_port, non_exist_port_id)
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 6f58075..d0ed1f2 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -45,8 +45,8 @@
cls.port = cls.create_port(cls.network)
def _delete_port(self, port_id):
- self.client.delete_port(port_id)
- body = self.client.list_ports()
+ self.ports_client.delete_port(port_id)
+ body = self.ports_client.list_ports()
ports_list = body['ports']
self.assertFalse(port_id in [n['id'] for n in ports_list])
@@ -54,16 +54,16 @@
@test.idempotent_id('c72c1c0c-2193-4aca-aaa4-b1442640f51c')
def test_create_update_delete_port(self):
# Verify port creation
- body = self.client.create_port(network_id=self.network['id'])
+ body = self.ports_client.create_port(network_id=self.network['id'])
port = body['port']
# Schedule port deletion with verification upon test completion
self.addCleanup(self._delete_port, port['id'])
self.assertTrue(port['admin_state_up'])
# Verify port update
new_name = "New_Port"
- body = self.client.update_port(port['id'],
- name=new_name,
- admin_state_up=False)
+ body = self.ports_client.update_port(port['id'],
+ name=new_name,
+ admin_state_up=False)
updated_port = body['port']
self.assertEqual(updated_port['name'], new_name)
self.assertFalse(updated_port['admin_state_up'])
@@ -107,8 +107,8 @@
'end': str(address + 6)}]}
subnet = self.create_subnet(network, **allocation_pools)
self.addCleanup(self.subnets_client.delete_subnet, subnet['id'])
- body = self.client.create_port(network_id=net_id)
- self.addCleanup(self.client.delete_port, body['port']['id'])
+ body = self.ports_client.create_port(network_id=net_id)
+ self.addCleanup(self.ports_client.delete_port, body['port']['id'])
port = body['port']
ip_address = port['fixed_ips'][0]['ip_address']
start_ip_address = allocation_pools['allocation_pools'][0]['start']
@@ -120,7 +120,7 @@
@test.idempotent_id('c9a685bd-e83f-499c-939f-9f7863ca259f')
def test_show_port(self):
# Verify the details of port
- body = self.client.show_port(self.port['id'])
+ body = self.ports_client.show_port(self.port['id'])
port = body['port']
self.assertIn('id', port)
# TODO(Santosh)- This is a temporary workaround to compare create_port
@@ -134,8 +134,8 @@
def test_show_port_fields(self):
# Verify specific fields of a port
fields = ['id', 'mac_address']
- body = self.client.show_port(self.port['id'],
- fields=fields)
+ body = self.ports_client.show_port(self.port['id'],
+ fields=fields)
port = body['port']
self.assertEqual(sorted(port.keys()), sorted(fields))
for field_name in fields:
@@ -145,7 +145,7 @@
@test.idempotent_id('cf95b358-3e92-4a29-a148-52445e1ac50e')
def test_list_ports(self):
# Verify the port exists in the list of all ports
- body = self.client.list_ports()
+ body = self.ports_client.list_ports()
ports = [port['id'] for port in body['ports']
if port['id'] == self.port['id']]
self.assertNotEmpty(ports, "Created port not found in the list")
@@ -157,14 +157,14 @@
subnet = self.create_subnet(network)
self.addCleanup(self.subnets_client.delete_subnet, subnet['id'])
# Create two ports
- port_1 = self.client.create_port(network_id=network['id'])
- self.addCleanup(self.client.delete_port, port_1['port']['id'])
- port_2 = self.client.create_port(network_id=network['id'])
- self.addCleanup(self.client.delete_port, port_2['port']['id'])
+ port_1 = self.ports_client.create_port(network_id=network['id'])
+ self.addCleanup(self.ports_client.delete_port, port_1['port']['id'])
+ port_2 = self.ports_client.create_port(network_id=network['id'])
+ self.addCleanup(self.ports_client.delete_port, port_2['port']['id'])
# List ports filtered by fixed_ips
port_1_fixed_ip = port_1['port']['fixed_ips'][0]['ip_address']
fixed_ips = 'ip_address=' + port_1_fixed_ip
- port_list = self.client.list_ports(fixed_ips=fixed_ips)
+ port_list = self.ports_client.list_ports(fixed_ips=fixed_ips)
# Check that we got the desired port
ports = port_list['ports']
tenant_ids = set([port['tenant_id'] for port in ports])
@@ -190,14 +190,14 @@
self.addCleanup(self.subnets_client.delete_subnet, subnet['id'])
router = self.create_router(data_utils.rand_name('router-'))
self.addCleanup(self.client.delete_router, router['id'])
- port = self.client.create_port(network_id=network['id'])
+ port = self.ports_client.create_port(network_id=network['id'])
# Add router interface to port created above
self.client.add_router_interface_with_port_id(
router['id'], port['port']['id'])
self.addCleanup(self.client.remove_router_interface_with_port_id,
router['id'], port['port']['id'])
# List ports filtered by router_id
- port_list = self.client.list_ports(device_id=router['id'])
+ port_list = self.ports_client.list_ports(device_id=router['id'])
ports = port_list['ports']
self.assertEqual(len(ports), 1)
self.assertEqual(ports[0]['id'], port['port']['id'])
@@ -207,7 +207,7 @@
def test_list_ports_fields(self):
# Verify specific fields of ports
fields = ['id', 'mac_address']
- body = self.client.list_ports(fields=fields)
+ body = self.ports_client.list_ports(fields=fields)
ports = body['ports']
self.assertNotEmpty(ports, "Port list returned is empty")
# Asserting the fields returned are correct
@@ -231,7 +231,7 @@
# Create a port with multiple IP addresses
port = self.create_port(network,
fixed_ips=fixed_ips)
- self.addCleanup(self.client.delete_port, port['id'])
+ self.addCleanup(self.ports_client.delete_port, port['id'])
self.assertEqual(2, len(port['fixed_ips']))
check_fixed_ips = [subnet_1['id'], subnet_2['id']]
for item in port['fixed_ips']:
@@ -269,8 +269,8 @@
"network_id": self.network['id'],
"admin_state_up": True,
"fixed_ips": fixed_ip_1}
- body = self.client.create_port(**post_body)
- self.addCleanup(self.client.delete_port, body['port']['id'])
+ body = self.ports_client.create_port(**post_body)
+ self.addCleanup(self.ports_client.delete_port, body['port']['id'])
port = body['port']
# Update the port with security groups
@@ -280,7 +280,7 @@
"admin_state_up": False,
"fixed_ips": fixed_ip_2,
"security_groups": security_groups_list}
- body = self.client.update_port(port['id'], **update_body)
+ body = self.ports_client.update_port(port['id'], **update_body)
port_show = body['port']
# Verify the security groups and other attributes updated to port
exclude_keys = set(port_show).symmetric_difference(update_body)
@@ -308,16 +308,16 @@
@test.idempotent_id('13e95171-6cbd-489c-9d7c-3f9c58215c18')
def test_create_show_delete_port_user_defined_mac(self):
# Create a port for a legal mac
- body = self.client.create_port(network_id=self.network['id'])
+ body = self.ports_client.create_port(network_id=self.network['id'])
old_port = body['port']
free_mac_address = old_port['mac_address']
- self.client.delete_port(old_port['id'])
+ self.ports_client.delete_port(old_port['id'])
# Create a new port with user defined mac
- body = self.client.create_port(network_id=self.network['id'],
- mac_address=free_mac_address)
- self.addCleanup(self.client.delete_port, body['port']['id'])
+ body = self.ports_client.create_port(network_id=self.network['id'],
+ mac_address=free_mac_address)
+ self.addCleanup(self.ports_client.delete_port, body['port']['id'])
port = body['port']
- body = self.client.show_port(port['id'])
+ body = self.ports_client.show_port(port['id'])
show_port = body['port']
self.assertEqual(free_mac_address,
show_port['mac_address'])
@@ -330,7 +330,7 @@
subnet = self.create_subnet(network)
self.addCleanup(self.subnets_client.delete_subnet, subnet['id'])
port = self.create_port(network, security_groups=[])
- self.addCleanup(self.client.delete_port, port['id'])
+ self.addCleanup(self.ports_client.delete_port, port['id'])
self.assertIsNotNone(port['security_groups'])
self.assertEmpty(port['security_groups'])
@@ -352,9 +352,9 @@
def test_create_port_binding_ext_attr(self):
post_body = {"network_id": self.network['id'],
"binding:host_id": self.host_id}
- body = self.admin_client.create_port(**post_body)
+ body = self.admin_ports_client.create_port(**post_body)
port = body['port']
- self.addCleanup(self.admin_client.delete_port, port['id'])
+ self.addCleanup(self.admin_ports_client.delete_port, port['id'])
host_id = port['binding:host_id']
self.assertIsNotNone(host_id)
self.assertEqual(self.host_id, host_id)
@@ -362,11 +362,11 @@
@test.idempotent_id('6f6c412c-711f-444d-8502-0ac30fbf5dd5')
def test_update_port_binding_ext_attr(self):
post_body = {"network_id": self.network['id']}
- body = self.admin_client.create_port(**post_body)
+ body = self.admin_ports_client.create_port(**post_body)
port = body['port']
- self.addCleanup(self.admin_client.delete_port, port['id'])
+ self.addCleanup(self.admin_ports_client.delete_port, port['id'])
update_body = {"binding:host_id": self.host_id}
- body = self.admin_client.update_port(port['id'], **update_body)
+ body = self.admin_ports_client.update_port(port['id'], **update_body)
updated_port = body['port']
host_id = updated_port['binding:host_id']
self.assertIsNotNone(host_id)
@@ -376,18 +376,18 @@
def test_list_ports_binding_ext_attr(self):
# Create a new port
post_body = {"network_id": self.network['id']}
- body = self.admin_client.create_port(**post_body)
+ body = self.admin_ports_client.create_port(**post_body)
port = body['port']
- self.addCleanup(self.admin_client.delete_port, port['id'])
+ self.addCleanup(self.admin_ports_client.delete_port, port['id'])
# Update the port's binding attributes so that is now 'bound'
# to a host
update_body = {"binding:host_id": self.host_id}
- self.admin_client.update_port(port['id'], **update_body)
+ self.admin_ports_client.update_port(port['id'], **update_body)
# List all ports, ensure new port is part of list and its binding
# attributes are set and accurate
- body = self.admin_client.list_ports()
+ body = self.admin_ports_client.list_ports()
ports_list = body['ports']
pids_list = [p['id'] for p in ports_list]
self.assertIn(port['id'], pids_list)
@@ -399,10 +399,11 @@
@test.idempotent_id('b54ac0ff-35fc-4c79-9ca3-c7dbd4ea4f13')
def test_show_port_binding_ext_attr(self):
- body = self.admin_client.create_port(network_id=self.network['id'])
+ body = self.admin_ports_client.create_port(
+ network_id=self.network['id'])
port = body['port']
- self.addCleanup(self.admin_client.delete_port, port['id'])
- body = self.admin_client.show_port(port['id'])
+ self.addCleanup(self.admin_ports_client.delete_port, port['id'])
+ body = self.admin_ports_client.show_port(port['id'])
show_port = body['port']
self.assertEqual(port['binding:host_id'],
show_port['binding:host_id'])
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 29855e1..ed191b6 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -144,7 +144,7 @@
self.assertIn('subnet_id', interface.keys())
self.assertIn('port_id', interface.keys())
# Verify router id is equal to device id in port details
- show_port_body = self.client.show_port(
+ show_port_body = self.ports_client.show_port(
interface['port_id'])
self.assertEqual(show_port_body['port']['device_id'],
router['id'])
@@ -155,7 +155,7 @@
network = self.create_network()
self.create_subnet(network)
router = self._create_router(data_utils.rand_name('router-'))
- port_body = self.client.create_port(
+ port_body = self.ports_client.create_port(
network_id=network['id'])
# add router interface to port created above
interface = self.client.add_router_interface_with_port_id(
@@ -165,7 +165,7 @@
self.assertIn('subnet_id', interface.keys())
self.assertIn('port_id', interface.keys())
# Verify router id is equal to device id in port details
- show_port_body = self.client.show_port(
+ show_port_body = self.ports_client.show_port(
interface['port_id'])
self.assertEqual(show_port_body['port']['device_id'],
router['id'])
@@ -181,7 +181,7 @@
self.assertEqual(v, actual_ext_gw_info[k])
def _verify_gateway_port(self, router_id):
- list_body = self.admin_client.list_ports(
+ list_body = self.admin_ports_client.list_ports(
network_id=CONF.network.public_network_id,
device_id=router_id)
self.assertEqual(len(list_body['ports']), 1)
@@ -245,7 +245,7 @@
self.client.update_router(router['id'], external_gateway_info={})
self._verify_router_gateway(router['id'])
# No gateway port expected
- list_body = self.admin_client.list_ports(
+ list_body = self.admin_ports_client.list_ports(
network_id=CONF.network.public_network_id,
device_id=router['id'])
self.assertFalse(list_body['ports'])
@@ -357,7 +357,7 @@
interface02['port_id'])
def _verify_router_interface(self, router_id, subnet_id, port_id):
- show_port_body = self.client.show_port(port_id)
+ show_port_body = self.ports_client.show_port(port_id)
interface_port = show_port_body['port']
self.assertEqual(router_id, interface_port['device_id'])
self.assertEqual(subnet_id,
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index d64efee..e8b035b 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -545,7 +545,7 @@
self.assertTrue(resp['etag'].strip('\"').isalnum())
self.assertTrue(re.match("^\d+\.?\d*\Z", resp['x-timestamp']))
self.assertNotEqual(len(resp['content-type']), 0)
- self.assertTrue(re.match("^tx[0-9a-f]*-[0-9a-f]*$",
+ self.assertTrue(re.match("^tx[0-9a-f]{21}-[0-9a-f]{10}.*",
resp['x-trans-id']))
self.assertNotEqual(len(resp['date']), 0)
self.assertEqual(resp['accept-ranges'], 'bytes')
@@ -637,7 +637,7 @@
self.assertTrue(resp['etag'].strip('\"').isalnum())
self.assertTrue(re.match("^\d+\.?\d*\Z", resp['x-timestamp']))
self.assertNotEqual(len(resp['content-type']), 0)
- self.assertTrue(re.match("^tx[0-9a-f]*-[0-9a-f]*$",
+ self.assertTrue(re.match("^tx[0-9a-f]{21}-[0-9a-f]{10}.*",
resp['x-trans-id']))
self.assertNotEqual(len(resp['date']), 0)
self.assertEqual(resp['accept-ranges'], 'bytes')
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 070150d..d22fb25 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -164,7 +164,7 @@
router_id = self.test_resources.get('Router')['physical_resource_id']
network_id = self.test_resources.get('Network')['physical_resource_id']
subnet_id = self.test_resources.get('Subnet')['physical_resource_id']
- body = self.network_client.list_ports()
+ body = self.ports_client.list_ports()
ports = body['ports']
router_ports = filter(lambda port: port['device_id'] ==
router_id, ports)
diff --git a/tempest/api_schema/response/compute/v2_1/servers.py b/tempest/api_schema/response/compute/v2_1/servers.py
index 44ab9e9..9593f3c 100644
--- a/tempest/api_schema/response/compute/v2_1/servers.py
+++ b/tempest/api_schema/response/compute/v2_1/servers.py
@@ -351,7 +351,7 @@
'required': ['id', 'name', 'policies', 'members', 'metadata']
}
-create_get_server_group = {
+create_show_server_group = {
'status_code': [200],
'response_body': {
'type': 'object',
diff --git a/tempest/clients.py b/tempest/clients.py
index 84e8544..6d25369 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -47,7 +47,7 @@
BaremetalClient
from tempest.services import botoclients
from tempest.services.compute.json.floating_ips_client import \
- FloatingIPsClient
+ FloatingIPsClient as ComputeFloatingIPsClient
from tempest.services.compute.json.images_client import ImagesClient
from tempest.services.compute.json.instance_usage_audit_log_client import \
InstanceUsagesAuditLogClient
@@ -107,6 +107,7 @@
MessagingClient
from tempest.services.network.json.network_client import NetworkClient
from tempest.services.network.json.networks_client import NetworksClient
+from tempest.services.network.json.ports_client import PortsClient
from tempest.services.network.json.subnets_client import SubnetsClient
from tempest.services.object_storage.account_client import AccountClient
from tempest.services.object_storage.container_client import ContainerClient
@@ -213,6 +214,14 @@
build_interval=CONF.network.build_interval,
build_timeout=CONF.network.build_timeout,
**self.default_params)
+ self.ports_client = PortsClient(
+ self.auth_provider,
+ CONF.network.catalog_type,
+ CONF.network.region or CONF.identity.region,
+ endpoint_type=CONF.network.endpoint_type,
+ build_interval=CONF.network.build_interval,
+ build_timeout=CONF.network.build_timeout,
+ **self.default_params)
self.messaging_client = MessagingClient(
self.auth_provider,
CONF.messaging.catalog_type,
@@ -307,8 +316,8 @@
self.auth_provider, **params)
self.floating_ips_bulk_client = FloatingIPsBulkClient(
self.auth_provider, **params)
- self.floating_ips_client = FloatingIPsClient(self.auth_provider,
- **params)
+ self.compute_floating_ips_client = ComputeFloatingIPsClient(
+ self.auth_provider, **params)
self.security_group_rules_client = SecurityGroupRulesClient(
self.auth_provider, **params)
self.security_groups_client = SecurityGroupsClient(
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index 4fa4302..8b84bea 100644
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -247,7 +247,7 @@
def _tenant_exists(self, tenant_id):
id_cl = self.admin_mgr.identity_client
try:
- t = id_cl.get_tenant(tenant_id)
+ t = id_cl.show_tenant(tenant_id)
LOG.debug("Tenant is: %s" % str(t))
return True
except Exception as ex:
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 1b5820b..40a079c 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -294,7 +294,7 @@
class FloatingIpService(BaseService):
def __init__(self, manager, **kwargs):
super(FloatingIpService, self).__init__(kwargs)
- self.client = manager.floating_ips_client
+ self.client = manager.compute_floating_ips_client
def list(self):
client = self.client
@@ -384,6 +384,7 @@
self.client = manager.network_client
self.networks_client = manager.networks_client
self.subnets_client = manager.subnets_client
+ self.ports_client = manager.ports_client
def _filter_by_conf_networks(self, item_list):
if not item_list or not all(('network_id' in i for i in item_list)):
@@ -621,7 +622,7 @@
class NetworkPortService(NetworkService):
def list(self):
- client = self.client
+ client = self.ports_client
ports = [port for port in
client.list_ports(**self.tenant_filter)['ports']
if port["device_owner"] == "" or
@@ -634,7 +635,7 @@
return ports
def delete(self):
- client = self.client
+ client = self.ports_client
ports = self.list()
for port in ports:
try:
@@ -813,7 +814,7 @@
def list(self):
client = self.client
- users = client.get_users()['users']
+ users = client.list_users()['users']
if not self.is_save_state:
users = [user for user in users if user['id']
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index f57e757..97d431a 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -432,7 +432,7 @@
LOG.info("checking users")
for name, user in six.iteritems(self.users):
client = keystone_admin()
- found = client.identity.get_user(user['id'])['user']
+ found = client.identity.show_user(user['id'])['user']
self.assertEqual(found['name'], user['name'])
self.assertEqual(found['tenantId'], user['tenant_id'])
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index 41b0529..6fc3843 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -127,7 +127,7 @@
# The name of the method to associate a floating IP to as server is too
# long for PEP8 compliance so:
- assoc = clients.floating_ips_client.associate_floating_ip_to_server
+ assoc = clients.compute_floating_ips_client.associate_floating_ip_to_server
if wait_until:
for server in servers:
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index e2df560..ce69c84 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -43,7 +43,8 @@
identity_version=self.identity_version)
(self.identity_admin_client, self.network_admin_client,
self.networks_admin_client,
- self.subnets_admin_client) = self._get_admin_clients()
+ self.subnets_admin_client,
+ self.ports_admin_client) = self._get_admin_clients()
# Domain where isolated credentials are provisioned (v3 only).
# Use that of the admin account is None is configured.
self.creds_domain_name = None
@@ -64,10 +65,10 @@
os = clients.Manager(self.default_admin_creds)
if self.identity_version == 'v2':
return (os.identity_client, os.network_client, os.networks_client,
- os.subnets_client)
+ os.subnets_client, os.ports_client)
else:
return (os.identity_v3_client, os.network_client,
- os.networks_client, os.subnets_client)
+ os.networks_client, os.subnets_client, os.ports_client)
def _create_creds(self, suffix="", admin=False, roles=None):
"""Create random credentials under the following schema.
diff --git a/tempest/common/validation_resources.py b/tempest/common/validation_resources.py
index debc200..1908b68 100644
--- a/tempest/common/validation_resources.py
+++ b/tempest/common/validation_resources.py
@@ -58,7 +58,7 @@
validation_data['security_group'] = \
create_ssh_security_group(os, add_rule)
if validation_resources['floating_ip']:
- floating_client = os.floating_ips_client
+ floating_client = os.compute_floating_ips_client
validation_data.update(floating_client.create_floating_ip())
return validation_data
@@ -100,7 +100,7 @@
if not has_exception:
has_exception = exc
if 'floating_ip' in validation_data:
- floating_client = os.floating_ips_client
+ floating_client = os.compute_floating_ips_client
fip_id = validation_data['floating_ip']['id']
try:
floating_client.delete_floating_ip(fip_id)
diff --git a/tempest/config.py b/tempest/config.py
index 0cda018..26823de 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -255,6 +255,7 @@
"when sshing to a guest."),
cfg.StrOpt('ssh_auth_method',
default='keypair',
+ choices=('keypair', 'configured', 'adminpass', 'disabled'),
help="Auth method used for authenticate to the instance. "
"Valid choices are: keypair, configured, adminpass "
"and disabled. "
@@ -264,6 +265,7 @@
"Disabled: avoid using ssh when it is an option."),
cfg.StrOpt('ssh_connect_method',
default='floating',
+ choices=('fixed', 'floating'),
help="How to connect to the instance? "
"fixed: using the first ip belongs the fixed network "
"floating: creating and using a floating ip."),
@@ -330,7 +332,13 @@
help='Unallocated floating IP range, which will be used to '
'test the floating IP bulk feature for CRUD operation. '
'This block must not overlap an existing floating IP '
- 'pool.')
+ 'pool.'),
+ cfg.IntOpt('min_compute_nodes',
+ default=1,
+ help=('The minimum number of compute nodes expected. This will '
+ 'be utilized by some multinode specific tests to ensure '
+ 'that requests match the expected size of the cluster '
+ 'you are testing with.'))
]
compute_features_group = cfg.OptGroup(name='compute-feature-enabled',
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index 06ca09b..936fbe8 100644
--- a/tempest/hacking/checks.py
+++ b/tempest/hacking/checks.py
@@ -30,6 +30,9 @@
RAND_NAME_HYPHEN_RE = re.compile(r".*rand_name\(.+[\-\_][\"\']\)")
mutable_default_args = re.compile(r"^\s*def .+\((.+=\{\}|.+=\[\])")
TESTTOOLS_SKIP_DECORATOR = re.compile(r'\s*@testtools\.skip\((.*)\)')
+METHOD = re.compile(r"^ def .+")
+METHOD_GET_RESOURCE = re.compile(r"^\s*def (list|show)\_.+")
+CLASS = re.compile(r"^class .+")
def import_no_clients_in_api_and_scenario_tests(physical_line, filename):
@@ -143,6 +146,45 @@
"decorators.skip_because from tempest-lib")
+def get_resources_on_service_clients(logical_line, physical_line, filename,
+ line_number, lines):
+ """Check that service client names of GET should be consistent
+
+ T110
+ """
+ if 'tempest/services/' not in filename:
+ return
+
+ ignored_list = []
+ with open('tempest/hacking/ignored_list_T110.txt') as f:
+ for line in f:
+ ignored_list.append(line.strip())
+
+ if filename in ignored_list:
+ return
+
+ if not METHOD.match(physical_line):
+ return
+
+ if pep8.noqa(physical_line):
+ return
+
+ for line in lines[line_number:]:
+ if METHOD.match(line) or CLASS.match(line):
+ # the end of a method
+ return
+
+ if 'self.get(' not in line:
+ continue
+
+ if METHOD_GET_RESOURCE.match(logical_line):
+ return
+
+ msg = ("T110: [GET /resources] methods should be list_<resource name>s"
+ " or show_<resource name>")
+ yield (0, msg)
+
+
def factory(register):
register(import_no_clients_in_api_and_scenario_tests)
register(scenario_tests_need_service_tags)
@@ -152,3 +194,4 @@
register(no_hyphen_at_end_of_rand_name)
register(no_mutable_default_args)
register(no_testtools_skip_decorator)
+ register(get_resources_on_service_clients)
diff --git a/tempest/hacking/ignored_list_T110.txt b/tempest/hacking/ignored_list_T110.txt
new file mode 100644
index 0000000..7c3e830
--- /dev/null
+++ b/tempest/hacking/ignored_list_T110.txt
@@ -0,0 +1,13 @@
+./tempest/services/compute/json/servers_client.py
+./tempest/services/database/json/flavors_client.py
+./tempest/services/identity/v3/json/credentials_client.py
+./tempest/services/identity/v3/json/identity_client.py
+./tempest/services/identity/v3/json/policy_client.py
+./tempest/services/identity/v3/json/region_client.py
+./tempest/services/messaging/json/messaging_client.py
+./tempest/services/object_storage/object_client.py
+./tempest/services/telemetry/json/telemetry_client.py
+./tempest/services/volume/json/qos_client.py
+./tempest/services/volume/json/backups_client.py
+./tempest/services/image/v2/json/image_client.py
+./tempest/services/baremetal/base.py
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 7251baf..9f283c5 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -47,7 +47,8 @@
super(ScenarioTest, cls).setup_clients()
# Clients (in alphabetical order)
cls.flavors_client = cls.manager.flavors_client
- cls.floating_ips_client = cls.manager.floating_ips_client
+ cls.compute_floating_ips_client = (
+ cls.manager.compute_floating_ips_client)
# Glance image client v1
cls.image_client = cls.manager.image_client
# Compute image client
@@ -62,6 +63,7 @@
# Neutron network client
cls.network_client = cls.manager.network_client
cls.networks_client = cls.manager.networks_client
+ cls.ports_client = cls.manager.ports_client
cls.subnets_client = cls.manager.subnets_client
# Heat client
cls.orchestration_client = cls.manager.orchestration_client
@@ -129,14 +131,13 @@
self.cleanup_waits.append(wait_dict)
def _wait_for_cleanups(self):
- """To handle async delete actions, a list of waits is added
- which will be iterated over as the last step of clearing the
- cleanup queue. That way all the delete calls are made up front
- and the tests won't succeed unless the deletes are eventually
- successful. This is the same basic approach used in the api tests to
- limit cleanup execution time except here it is multi-resource,
- because of the nature of the scenario tests.
- """
+ # To handle async delete actions, a list of waits is added
+ # which will be iterated over as the last step of clearing the
+ # cleanup queue. That way all the delete calls are made up front
+ # and the tests won't succeed unless the deletes are eventually
+ # successful. This is the same basic approach used in the api tests to
+ # limit cleanup execution time except here it is multi-resource,
+ # because of the nature of the scenario tests.
for wait in self.cleanup_waits:
waiter_callable = wait.pop('waiter_callable')
waiter_callable(**wait)
@@ -517,7 +518,8 @@
username=None,
private_key=None,
should_connect=True):
- """
+ """Check server connectivity
+
:param ip_address: server to test against
:param username: server's ssh username
:param private_key: server's ssh private key to be used
@@ -560,16 +562,14 @@
raise
def create_floating_ip(self, thing, pool_name=None):
- """Creates a floating IP and associates to a server using
- Nova clients
- """
+ """Create a floating IP and associates to a server on Nova"""
- floating_ip = (self.floating_ips_client.create_floating_ip(pool_name)
- ['floating_ip'])
+ floating_ip = (self.compute_floating_ips_client.
+ create_floating_ip(pool_name)['floating_ip'])
self.addCleanup(self.delete_wrapper,
- self.floating_ips_client.delete_floating_ip,
+ self.compute_floating_ips_client.delete_floating_ip,
floating_ip['id'])
- self.floating_ips_client.associate_floating_ip_to_server(
+ self.compute_floating_ips_client.associate_floating_ip_to_server(
floating_ip['ip'], thing['id'])
return floating_ip
@@ -600,9 +600,17 @@
ssh_client.umount(mount_path)
return timestamp
+ def get_server_or_ip(self, server):
+ if CONF.validation.connect_method == 'floating':
+ ip = self.create_floating_ip(server)['ip']
+ else:
+ ip = server
+ return ip
+
class NetworkScenarioTest(ScenarioTest):
"""Base class for network scenario tests.
+
This class provide helpers for network scenario tests, using the neutron
API. Helpers from ancestor which use the nova network API are overridden
with the neutron API.
@@ -661,7 +669,7 @@
def _list_ports(self, *args, **kwargs):
"""List ports using admin creds """
- ports_list = self.admin_manager.network_client.list_ports(
+ ports_list = self.admin_manager.ports_client.list_ports(
*args, **kwargs)
return ports_list['ports']
@@ -673,9 +681,9 @@
def _create_subnet(self, network, client=None, subnets_client=None,
namestart='subnet-smoke', **kwargs):
- """
- Create a subnet for the given network within the cidr block
- configured for tenant networks.
+ """Create a subnet for the given network
+
+ within the cidr block configured for tenant networks.
"""
if not client:
client = self.network_client
@@ -683,7 +691,8 @@
subnets_client = self.subnets_client
def cidr_in_use(cidr, tenant_id):
- """
+ """Check cidr existence
+
:return True if subnet with cidr already exist in tenant
False else
"""
@@ -735,14 +744,14 @@
def _create_port(self, network_id, client=None, namestart='port-quotatest',
**kwargs):
if not client:
- client = self.network_client
+ client = self.ports_client
name = data_utils.rand_name(namestart)
result = client.create_port(
name=name,
network_id=network_id,
**kwargs)
self.assertIsNotNone(result, 'Unable to allocate port')
- port = net_resources.DeletablePort(client=client,
+ port = net_resources.DeletablePort(ports_client=client,
**result['port'])
self.addCleanup(self.delete_wrapper, port.delete)
return port
@@ -773,9 +782,7 @@
def create_floating_ip(self, thing, external_network_id=None,
port_id=None, client=None):
- """Creates a floating IP and associates to a resource/port using
- Neutron client
- """
+ """Create a floating IP and associates to a resource/port on Neutron"""
if not external_network_id:
external_network_id = CONF.network.public_network_id
if not client:
@@ -803,9 +810,7 @@
return floating_ip
def _disassociate_floating_ip(self, floating_ip):
- """
- :param floating_ip: type DeletableFloatingIp
- """
+ """:param floating_ip: type DeletableFloatingIp"""
floating_ip.update(port_id=None)
self.assertIsNone(floating_ip.port_id)
return floating_ip
@@ -858,8 +863,7 @@
raise
def _check_remote_connectivity(self, source, dest, should_succeed=True):
- """
- check ping server via source ssh connection
+ """check ping server via source ssh connection
:param source: RemoteClient: an ssh connection from which to ping
:param dest: and IP to ping against
@@ -990,7 +994,9 @@
return sg_rule
def _create_loginable_secgroup_rule(self, client=None, secgroup=None):
- """These rules are intended to permit inbound ssh and icmp
+ """Create loginable security group rule
+
+ These rules are intended to permit inbound ssh and icmp
traffic from all sources, so no group_id is provided.
Setting a group_id would only permit traffic from ports
belonging to the same security group.
@@ -1129,11 +1135,13 @@
def create_server(self, name=None, image=None, flavor=None,
wait_on_boot=True, wait_on_delete=True,
network_client=None, networks_client=None,
- create_kwargs=None):
+ ports_client=None, create_kwargs=None):
if network_client is None:
network_client = self.network_client
if networks_client is None:
networks_client = self.networks_client
+ if ports_client is None:
+ ports_client = self.ports_client
vnic_type = CONF.network.port_vnic_type
@@ -1177,7 +1185,7 @@
for net in networks:
net_id = net['uuid']
port = self._create_port(network_id=net_id,
- client=network_client,
+ client=ports_client,
**create_port_body)
ports.append({'port': port.id})
if ports:
@@ -1349,9 +1357,7 @@
class EncryptionScenarioTest(ScenarioTest):
- """
- Base class for encryption scenario tests
- """
+ """Base class for encryption scenario tests"""
credentials = ['primary', 'admin']
@@ -1401,8 +1407,7 @@
class ObjectStorageScenarioTest(ScenarioTest):
- """
- Provide harness to do Object Storage scenario tests.
+ """Provide harness to do Object Storage scenario tests.
Subclasses implement the tests that use the methods provided by this
class.
@@ -1470,10 +1475,8 @@
def list_and_check_container_objects(self, container_name,
present_obj=None,
not_present_obj=None):
- """
- List objects for a given container and assert which are present and
- which are not.
- """
+ # List objects for a given container and assert which are present and
+ # which are not.
if present_obj is None:
present_obj = []
if not_present_obj is None:
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 22d2603..62c0262 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -25,8 +25,8 @@
class TestAggregatesBasicOps(manager.ScenarioTest):
- """
- Creates an aggregate within an availability zone
+ """Creates an aggregate within an availability zone
+
Adds a host to the aggregate
Checks aggregate details
Updates aggregate's name
diff --git a/tempest/scenario/test_baremetal_basic_ops.py b/tempest/scenario/test_baremetal_basic_ops.py
index c0b5a44..fa05577 100644
--- a/tempest/scenario/test_baremetal_basic_ops.py
+++ b/tempest/scenario/test_baremetal_basic_ops.py
@@ -26,9 +26,9 @@
class BaremetalBasicOps(manager.BaremetalScenarioTest):
- """
- This smoke test tests the pxe_ssh Ironic driver. It follows this basic
- set of operations:
+ """This smoke test tests the pxe_ssh Ironic driver.
+
+ It follows this basic set of operations:
* Creates a keypair
* Boots an instance using the keypair
* Monitors the associated Ironic node for power and
@@ -107,17 +107,10 @@
return None
return int(ephemeral)
- def add_floating_ip(self):
- floating_ip = (self.floating_ips_client.create_floating_ip()
- ['floating_ip'])
- self.floating_ips_client.associate_floating_ip_to_server(
- floating_ip['ip'], self.instance['id'])
- return floating_ip['ip']
-
def validate_ports(self):
for port in self.get_ports(self.node['uuid']):
n_port_id = port['extra']['vif_port_id']
- body = self.network_client.show_port(n_port_id)
+ body = self.ports_client.show_port(n_port_id)
n_port = body['port']
self.assertEqual(n_port['device_id'], self.instance['id'])
self.assertEqual(n_port['mac_address'], port['address'])
@@ -131,7 +124,7 @@
self.validate_ports()
self.verify_connectivity()
if CONF.compute.ssh_connect_method == 'floating':
- floating_ip = self.add_floating_ip()
+ floating_ip = self.create_floating_ip(self.instance)['ip']
self.verify_connectivity(ip=floating_ip)
vm_client = self.get_remote_client(self.instance)
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index f6d9f88..cb6b968 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -58,7 +58,8 @@
class TestDashboardBasicOps(manager.ScenarioTest):
- """
+ """The test suite for dashboard basic operations
+
This is a basic scenario test:
* checks that the login page is available
* logs in as a regular user
diff --git a/tempest/scenario/test_encrypted_cinder_volumes.py b/tempest/scenario/test_encrypted_cinder_volumes.py
index 3f0123d..99837eb 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -22,7 +22,8 @@
class TestEncryptedCinderVolumes(manager.EncryptionScenarioTest):
- """
+ """The test suite for encrypted cinder volumes
+
This test is for verifying the functionality of encrypted cinder volumes.
For both LUKS and cryptsetup encryption types, this test performs
diff --git a/tempest/scenario/test_large_ops.py b/tempest/scenario/test_large_ops.py
index 63dd4f0..6497f7a 100644
--- a/tempest/scenario/test_large_ops.py
+++ b/tempest/scenario/test_large_ops.py
@@ -31,8 +31,7 @@
class TestLargeOpsScenario(manager.ScenarioTest):
- """
- Test large operations.
+ """Test large operations.
This test below:
* Spin up multiple instances in one nova call, and repeat three times
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 22aa06c..c3f3c78 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -29,8 +29,7 @@
class TestMinimumBasicScenario(manager.ScenarioTest):
- """
- This is a basic minimum scenario test.
+ """This is a basic minimum scenario test.
This test below:
* across the multiple components
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 31ccd5b..dc5ca08 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -250,7 +250,7 @@
net_id=self.new_net.id)['interfaceAttachment']
self.addCleanup(self.network_client.wait_for_resource_deletion,
'port',
- interface['port_id'])
+ interface['port_id'], client=self.ports_client)
self.addCleanup(self.delete_wrapper,
self.interface_client.delete_interface,
server['id'], interface['port_id'])
@@ -268,7 +268,7 @@
"Old port: %s. Number of new ports: %d" % (
CONF.network.build_timeout, old_port,
len(self.new_port_list)))
- new_port = net_resources.DeletablePort(client=self.network_client,
+ new_port = net_resources.DeletablePort(ports_client=self.ports_client,
**self.new_port_list[0])
def check_new_nic():
@@ -609,12 +609,12 @@
self.check_public_network_connectivity(
should_connect=True, msg="before updating "
"admin_state_up of instance port to False")
- self.network_client.update_port(port_id, admin_state_up=False)
+ self.ports_client.update_port(port_id, admin_state_up=False)
self.check_public_network_connectivity(
should_connect=False, msg="after updating "
"admin_state_up of instance port to False",
should_check_floating_ip_status=False)
- self.network_client.update_port(port_id, admin_state_up=True)
+ self.ports_client.update_port(port_id, admin_state_up=True)
self.check_public_network_connectivity(
should_connect=True, msg="after updating "
"admin_state_up of instance port to True")
@@ -653,7 +653,7 @@
waiters.wait_for_server_termination(self.servers_client, server['id'])
# Assert the port still exists on the network but is unbound from
# the deleted server.
- port = self.network_client.show_port(port_id)['port']
+ port = self.ports_client.show_port(port_id)['port']
self.assertEqual(self.network['id'], port['network_id'])
self.assertEqual('', port['device_id'])
self.assertEqual('', port['device_owner'])
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index f82e7e4..151eef8 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -70,12 +70,13 @@
'security_groups': [{'name': self.sec_grp['name']}]}
def prepare_network(self, address6_mode, n_subnets6=1, dualnet=False):
- """Creates network with
- given number of IPv6 subnets in the given mode and
- one IPv4 subnet
- Creates router with ports on all subnets
- if dualnet - create IPv6 subnets on a different network
- :return: list of created networks
+ """Prepare network
+
+ Creates network with given number of IPv6 subnets in the given mode and
+ one IPv4 subnet.
+ Creates router with ports on all subnets.
+ if dualnet - create IPv6 subnets on a different network
+ :return: list of created networks
"""
self.network = self._create_network(tenant_id=self.tenant_id)
if dualnet:
diff --git a/tempest/scenario/test_object_storage_basic_ops.py b/tempest/scenario/test_object_storage_basic_ops.py
index 49768c5..98dd705 100644
--- a/tempest/scenario/test_object_storage_basic_ops.py
+++ b/tempest/scenario/test_object_storage_basic_ops.py
@@ -25,8 +25,8 @@
class TestObjectStorageBasicOps(manager.ObjectStorageScenarioTest):
- """
- Test swift basic ops.
+ """Test swift basic ops.
+
* get swift stat.
* create container.
* upload a file to the created container.
@@ -57,6 +57,7 @@
@test.services('object_storage')
def test_swift_acl_anonymous_download(self):
"""This test will cover below steps:
+
1. Create container
2. Upload object to the new container
3. Change the ACL of the container
diff --git a/tempest/scenario/test_object_storage_telemetry_middleware.py b/tempest/scenario/test_object_storage_telemetry_middleware.py
index 3376a7c..eee4d3d 100644
--- a/tempest/scenario/test_object_storage_telemetry_middleware.py
+++ b/tempest/scenario/test_object_storage_telemetry_middleware.py
@@ -35,8 +35,8 @@
class TestObjectStorageTelemetry(manager.ObjectStorageScenarioTest):
- """
- Test that swift uses the ceilometer middleware.
+ """Test that swift uses the ceilometer middleware.
+
* create container.
* upload a file to the created container.
* retrieve the file from the created container.
@@ -57,19 +57,15 @@
cls.telemetry_client = cls.os_operator.telemetry_client
def _confirm_notifications(self, container_name, obj_name):
- """
- Loop seeking for appropriate notifications about the containers
- and objects sent to swift.
- """
+ # NOTE: Loop seeking for appropriate notifications about the containers
+ # and objects sent to swift.
def _check_samples():
- """
- Return True only if we have notifications about some
- containers and some objects and the notifications are about
- the expected containers and objects.
- Otherwise returning False will case _check_samples to be
- called again.
- """
+ # NOTE: Return True only if we have notifications about some
+ # containers and some objects and the notifications are about
+ # the expected containers and objects.
+ # Otherwise returning False will case _check_samples to be
+ # called again.
results = self.telemetry_client.list_samples(
'storage.objects.incoming.bytes')
LOG.debug('got samples %s', results)
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 3c11c22..29e393f 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -28,7 +28,8 @@
class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
- """
+ """The test suite for security groups
+
This test suite assumes that Nova has been configured to
boot VM's with Neutron-managed networking, and attempts to
verify cross tenant connectivity as follows
@@ -95,8 +96,7 @@
credentials = ['primary', 'alt', 'admin']
class TenantProperties(object):
- """
- helper class to save tenant details
+ """helper class to save tenant details
id
credentials
network
@@ -232,9 +232,7 @@
return port['device_owner'].startswith('network:router_interface')
def _create_server(self, name, tenant, security_groups=None):
- """
- creates a server and assigns to security group
- """
+ """creates a server and assigns to security group"""
self._set_compute_context(tenant)
if security_groups is None:
security_groups = [tenant.security_groups['default']]
@@ -250,6 +248,7 @@
name=name,
network_client=tenant.manager.network_client,
networks_client=tenant.manager.networks_client,
+ ports_client=tenant.manager.ports_client,
create_kwargs=create_kwargs)
self.assertEqual(
sorted([s['name'] for s in security_groups]),
@@ -267,11 +266,9 @@
tenant.servers.append(server)
def _set_access_point(self, tenant):
- """
- creates a server in a secgroup with rule allowing external ssh
- in order to access tenant internal network
- workaround ip namespace
- """
+ # creates a server in a secgroup with rule allowing external ssh
+ # in order to access tenant internal network
+ # workaround ip namespace
secgroups = tenant.security_groups.values()
name = 'server-{tenant}-access_point'.format(
tenant=tenant.creds.tenant_name)
@@ -300,8 +297,7 @@
return self.servers_client
def _deploy_tenant(self, tenant_or_id):
- """
- creates:
+ """creates:
network
subnet
router (if public not defined)
@@ -319,9 +315,7 @@
self._set_access_point(tenant)
def _get_server_ip(self, server, floating=False):
- """
- returns the ip (floating/internal) of a server
- """
+ """returns the ip (floating/internal) of a server"""
if floating:
server_ip = self.floating_ips[server['id']].floating_ip_address
else:
@@ -332,9 +326,7 @@
return server_ip
def _connect_to_access_point(self, tenant):
- """
- create ssh connection to tenant access point
- """
+ """create ssh connection to tenant access point"""
access_point_ssh = \
self.floating_ips[tenant.access_point['id']].floating_ip_address
private_key = tenant.keypair['private_key']
@@ -373,10 +365,8 @@
ip=self._get_server_ip(server))
def _test_cross_tenant_block(self, source_tenant, dest_tenant):
- """
- if public router isn't defined, then dest_tenant access is via
- floating-ip
- """
+ # if public router isn't defined, then dest_tenant access is via
+ # floating-ip
access_point_ssh = self._connect_to_access_point(source_tenant)
ip = self._get_server_ip(dest_tenant.access_point,
floating=self.floating_ip_access)
@@ -514,7 +504,7 @@
port_id = self._list_ports(device_id=server_id)[0]['id']
# update port with new security group and check connectivity
- self.network_client.update_port(port_id, security_groups=[
+ self.ports_client.update_port(port_id, security_groups=[
new_tenant.security_groups['new_sg'].id])
self._check_connectivity(
access_point=access_point_ssh,
@@ -581,16 +571,16 @@
# Flip the port's port security and check connectivity
try:
- self.network_client.update_port(port_id,
- port_security_enabled=True,
- security_groups=[])
+ self.ports_client.update_port(port_id,
+ port_security_enabled=True,
+ security_groups=[])
self._check_connectivity(access_point=access_point_ssh,
ip=self._get_server_ip(server),
should_succeed=False)
- self.network_client.update_port(port_id,
- port_security_enabled=False,
- security_groups=[])
+ self.ports_client.update_port(port_id,
+ port_security_enabled=False,
+ security_groups=[])
self._check_connectivity(
access_point=access_point_ssh,
ip=self._get_server_ip(server))
diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py
index c83dbb1..9387dc7 100644
--- a/tempest/scenario/test_server_advanced_ops.py
+++ b/tempest/scenario/test_server_advanced_ops.py
@@ -28,9 +28,9 @@
class TestServerAdvancedOps(manager.ScenarioTest):
- """
- This test case stresses some advanced server instance operations:
+ """The test suite for server advanced operations
+ This test case stresses some advanced server instance operations:
* Resizing an instance
* Sequence suspend resume
"""
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index e2f8adb..8a19254 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -32,9 +32,9 @@
class TestServerBasicOps(manager.ScenarioTest):
- """
- This smoke test case follows this basic set of operations:
+ """The test suite for server basic operations
+ This smoke test case follows this basic set of operations:
* Create a keypair for use in launching an instance
* Create a security group to control network access in instance
* Add simple permissive rules to the security group
@@ -89,17 +89,10 @@
def verify_ssh(self):
if self.run_ssh:
# Obtain a floating IP
- self.floating_ip = (self.floating_ips_client.create_floating_ip()
- ['floating_ip'])
- self.addCleanup(self.delete_wrapper,
- self.floating_ips_client.delete_floating_ip,
- self.floating_ip['id'])
- # Attach a floating IP
- self.floating_ips_client.associate_floating_ip_to_server(
- self.floating_ip['ip'], self.instance['id'])
+ self.fip = self.create_floating_ip(self.instance)['ip']
# Check ssh
self.ssh_client = self.get_remote_client(
- server_or_ip=self.floating_ip['ip'],
+ server_or_ip=self.fip,
username=self.image_utils.ssh_user(self.image_ref),
private_key=self.keypair['private_key'])
@@ -110,12 +103,11 @@
def exec_cmd_and_verify_output():
cmd = 'curl ' + md_url
- floating_ip = self.floating_ip['ip']
result = self.ssh_client.exec_command(cmd)
if result:
msg = ('Failed while verifying metadata on server. Result '
- 'of command "%s" is NOT "%s".' % (cmd, floating_ip))
- self.assertEqual(floating_ip, result, msg)
+ 'of command "%s" is NOT "%s".' % (cmd, self.fip))
+ self.assertEqual(self.fip, result, msg)
return 'Verification is successful!'
if not test.call_until_true(exec_cmd_and_verify_output,
diff --git a/tempest/scenario/test_server_multinode.py b/tempest/scenario/test_server_multinode.py
new file mode 100644
index 0000000..403804d
--- /dev/null
+++ b/tempest/scenario/test_server_multinode.py
@@ -0,0 +1,84 @@
+# 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 oslo_log import log as logging
+
+from tempest import config
+from tempest import exceptions
+from tempest.scenario import manager
+from tempest import test
+
+CONF = config.CONF
+
+LOG = logging.getLogger(__name__)
+
+
+class TestServerMultinode(manager.ScenarioTest):
+ """This is a set of tests specific to multinode testing."""
+ credentials = ['primary', 'admin']
+
+ @classmethod
+ def setup_clients(cls):
+ super(TestServerMultinode, cls).setup_clients()
+ # Use admin client by default
+ cls.manager = cls.admin_manager
+ # this is needed so that we can use the availability_zone:host
+ # scheduler hint, which is admin_only by default
+ cls.servers_client = cls.admin_manager.servers_client
+ super(TestServerMultinode, cls).resource_setup()
+
+ @test.idempotent_id('9cecbe35-b9d4-48da-a37e-7ce70aa43d30')
+ @test.attr(type='smoke')
+ @test.services('compute', 'network')
+ def test_schedule_to_all_nodes(self):
+ host_client = self.manager.hosts_client
+ hosts = host_client.list_hosts()['hosts']
+ hosts = [x for x in hosts if x['service'] == 'compute']
+
+ # ensure we have at least as many compute hosts as we expect
+ if len(hosts) < CONF.compute.min_compute_nodes:
+ raise exceptions.InvalidConfiguration(
+ "Host list %s is shorter than min_compute_nodes. "
+ "Did a compute worker not boot correctly?" % hosts)
+
+ # create 1 compute for each node, up to the min_compute_nodes
+ # threshold (so that things don't get crazy if you have 1000
+ # compute nodes but set min to 3).
+ servers = []
+
+ for host in hosts[:CONF.compute.min_compute_nodes]:
+ create_kwargs = {
+ 'availability_zone': '%(zone)s:%(host_name)s' % host
+ }
+
+ # by getting to active state here, this means this has
+ # landed on the host in question.
+ inst = self.create_server(image=CONF.compute.image_ref,
+ flavor=CONF.compute.flavor_ref,
+ create_kwargs=create_kwargs)
+ server = self.servers_client.show_server(inst['id'])['server']
+ servers.append(server)
+
+ # make sure we really have the number of servers we think we should
+ self.assertEqual(
+ len(servers), CONF.compute.min_compute_nodes,
+ "Incorrect number of servers built %s" % servers)
+
+ # ensure that every server ended up on a different host
+ host_ids = [x['hostId'] for x in servers]
+ self.assertEqual(
+ len(set(host_ids)), len(servers),
+ "Incorrect number of distinct host_ids scheduled to %s" % servers)
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
index bc80412..5778107 100644
--- a/tempest/scenario/test_shelve_instance.py
+++ b/tempest/scenario/test_shelve_instance.py
@@ -27,8 +27,8 @@
class TestShelveInstance(manager.ScenarioTest):
- """
- This test shelves then unshelves a Nova instance
+ """This test shelves then unshelves a Nova instance
+
The following is the scenario outline:
* boot an instance and create a timestamp file in it
* shelve the instance
@@ -78,30 +78,17 @@
server = self.create_server(image=CONF.compute.image_ref,
create_kwargs=create_kwargs)
- if CONF.compute.use_floatingip_for_ssh:
- floating_ip = (self.floating_ips_client.create_floating_ip()
- ['floating_ip'])
- self.addCleanup(self.delete_wrapper,
- self.floating_ips_client.delete_floating_ip,
- floating_ip['id'])
- self.floating_ips_client.associate_floating_ip_to_server(
- floating_ip['ip'], server['id'])
- timestamp = self.create_timestamp(
- floating_ip['ip'], private_key=keypair['private_key'])
- else:
- timestamp = self.create_timestamp(
- server, private_key=keypair['private_key'])
+ instance_ip = self.get_server_or_ip(server)
+ timestamp = self.create_timestamp(instance_ip,
+ private_key=keypair['private_key'])
# Prevent bug #1257594 from coming back
# Unshelve used to boot the instance with the original image, not
# with the instance snapshot
self._shelve_then_unshelve_server(server)
- if CONF.compute.use_floatingip_for_ssh:
- timestamp2 = self.get_timestamp(floating_ip['ip'],
- private_key=keypair['private_key'])
- else:
- timestamp2 = self.get_timestamp(server,
- private_key=keypair['private_key'])
+
+ timestamp2 = self.get_timestamp(instance_ip,
+ private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp2)
@test.idempotent_id('1164e700-0af0-4a4c-8792-35909a88743c')
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 5ac3a7e..cd59334 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -26,8 +26,8 @@
class TestSnapshotPattern(manager.ScenarioTest):
- """
- This test is for snapshotting an instance and booting with it.
+ """This test is for snapshotting an instance and booting with it.
+
The following is the scenario outline:
* boot an instance and create a timestamp file in it
* snapshot the instance
@@ -56,13 +56,9 @@
# boot an instance and create a timestamp file in it
server = self._boot_image(CONF.compute.image_ref, keypair,
security_group)
- if CONF.compute.use_floatingip_for_ssh:
- fip_for_server = self.create_floating_ip(server)
- timestamp = self.create_timestamp(
- fip_for_server['ip'], private_key=keypair['private_key'])
- else:
- timestamp = self.create_timestamp(
- server, private_key=keypair['private_key'])
+ instance_ip = self.get_server_or_ip(server)
+ timestamp = self.create_timestamp(instance_ip,
+ private_key=keypair['private_key'])
# snapshot the instance
snapshot_image = self.create_server_snapshot(server=server)
@@ -72,11 +68,7 @@
keypair, security_group)
# check the existence of the timestamp file in the second instance
- if CONF.compute.use_floatingip_for_ssh:
- fip_for_snapshot = self.create_floating_ip(server_from_snapshot)
- timestamp2 = self.get_timestamp(fip_for_snapshot['ip'],
- private_key=keypair['private_key'])
- else:
- timestamp2 = self.get_timestamp(server_from_snapshot,
- private_key=keypair['private_key'])
+ server_from_snapshot_ip = self.get_server_or_ip(server_from_snapshot)
+ timestamp2 = self.get_timestamp(server_from_snapshot_ip,
+ private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp2)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 6eceeb2..05ae33e 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -33,7 +33,8 @@
class TestStampPattern(manager.ScenarioTest):
- """
+ """The test suite for both snapshoting and attaching of volume
+
This test is for snapshotting an instance/volume and attaching the volume
created from snapshot to the instance booted from snapshot.
The following is the scenario outline:
@@ -138,11 +139,7 @@
security_group)
# create and add floating IP to server1
- if CONF.compute.use_floatingip_for_ssh:
- floating_ip_for_server = self.create_floating_ip(server)
- ip_for_server = floating_ip_for_server['ip']
- else:
- ip_for_server = server
+ ip_for_server = self.get_server_or_ip(server)
self._attach_volume(server, volume)
self._wait_for_volume_available_on_the_system(ip_for_server,
@@ -167,12 +164,7 @@
keypair, security_group)
# create and add floating IP to server_from_snapshot
- if CONF.compute.use_floatingip_for_ssh:
- floating_ip_for_snapshot = self.create_floating_ip(
- server_from_snapshot)
- ip_for_snapshot = floating_ip_for_snapshot['ip']
- else:
- ip_for_snapshot = server_from_snapshot
+ ip_for_snapshot = self.get_server_or_ip(server_from_snapshot)
# attach volume2 to instance2
self._attach_volume(server_from_snapshot, volume_from_snapshot)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 414305d..96e79e6 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -25,8 +25,7 @@
class TestVolumeBootPattern(manager.ScenarioTest):
- """
- This test case attempts to reproduce the following steps:
+ """This test case attempts to reproduce the following steps:
* Create in Cinder some bootable volume importing a Glance image
* Boot an instance from the bootable volume
@@ -95,13 +94,6 @@
vol_name = data_utils.rand_name('volume')
return self.create_volume(name=vol_name, snapshot_id=snap_id)
- def _get_server_ip(self, server):
- if CONF.compute.use_floatingip_for_ssh:
- ip = self.create_floating_ip(server)['ip']
- else:
- ip = server
- return ip
-
def _delete_server(self, server):
self.servers_client.delete_server(server['id'])
waiters.wait_for_server_termination(self.servers_client, server['id'])
@@ -119,7 +111,7 @@
keypair, security_group)
# write content to volume on instance
- ip_instance_1st = self._get_server_ip(instance_1st)
+ ip_instance_1st = self.get_server_or_ip(instance_1st)
timestamp = self.create_timestamp(ip_instance_1st,
private_key=keypair['private_key'])
@@ -131,7 +123,7 @@
keypair, security_group)
# check the content of written file
- ip_instance_2nd = self._get_server_ip(instance_2nd)
+ ip_instance_2nd = self.get_server_or_ip(instance_2nd)
timestamp2 = self.get_timestamp(ip_instance_2nd,
private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp2)
@@ -141,13 +133,13 @@
# create a 3rd instance from snapshot
volume = self._create_volume_from_snapshot(snapshot['id'])
- instance_from_snapshot = (
+ server_from_snapshot = (
self._boot_instance_from_volume(volume['id'],
keypair, security_group))
# check the content of written file
- ip_instance_from_snapshot = self._get_server_ip(instance_from_snapshot)
- timestamp3 = self.get_timestamp(ip_instance_from_snapshot,
+ server_from_snapshot_ip = self.get_server_or_ip(server_from_snapshot)
+ timestamp3 = self.get_timestamp(server_from_snapshot_ip,
private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp3)
diff --git a/tempest/scenario/utils.py b/tempest/scenario/utils.py
index 12509f7..ad9deea 100644
--- a/tempest/scenario/utils.py
+++ b/tempest/scenario/utils.py
@@ -72,8 +72,7 @@
@misc.singleton
class InputScenarioUtils(object):
- """
- Example usage:
+ """Example usage:
import testscenarios
(...)
@@ -124,9 +123,7 @@
@property
def scenario_images(self):
- """
- :return: a scenario with name and uuid of images
- """
+ """:return: a scenario with name and uuid of images"""
if not CONF.service_available.glance:
return []
if not hasattr(self, '_scenario_images'):
@@ -143,9 +140,7 @@
@property
def scenario_flavors(self):
- """
- :return: a scenario with name and uuid of flavors
- """
+ """:return: a scenario with name and uuid of flavors"""
if not hasattr(self, '_scenario_flavors'):
try:
flavors = self.flavors_client.list_flavors()['flavors']
@@ -160,10 +155,11 @@
def load_tests_input_scenario_utils(*args):
+ """Wrapper for testscenarios to set the scenarios
+
+ The purpose is to avoid running a getattr on the CONF object at import.
"""
- Wrapper for testscenarios to set the scenarios to avoid running a getattr
- on the CONF object at import.
- """
+
if getattr(args[0], 'suiteClass', None) is not None:
loader, standard_tests, pattern = args
else:
diff --git a/tempest/services/compute/json/server_groups_client.py b/tempest/services/compute/json/server_groups_client.py
index 62258d3..7284e02 100644
--- a/tempest/services/compute/json/server_groups_client.py
+++ b/tempest/services/compute/json/server_groups_client.py
@@ -32,7 +32,7 @@
resp, body = self.post('os-server-groups', post_body)
body = json.loads(body)
- self.validate_response(schema.create_get_server_group, resp, body)
+ self.validate_response(schema.create_show_server_group, resp, body)
return service_client.ResponseBody(resp, body)
def delete_server_group(self, server_group_id):
@@ -48,9 +48,9 @@
self.validate_response(schema.list_server_groups, resp, body)
return service_client.ResponseBody(resp, body)
- def get_server_group(self, server_group_id):
+ def show_server_group(self, server_group_id):
"""Get the details of given server_group."""
resp, body = self.get("os-server-groups/%s" % server_group_id)
body = json.loads(body)
- self.validate_response(schema.create_get_server_group, resp, body)
+ self.validate_response(schema.create_show_server_group, resp, body)
return service_client.ResponseBody(resp, body)
diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py
index 2d71359..1c1bfaa 100644
--- a/tempest/services/identity/v2/json/identity_client.py
+++ b/tempest/services/identity/v2/json/identity_client.py
@@ -19,7 +19,7 @@
class IdentityClient(service_client.ServiceClient):
api_version = "v2.0"
- def get_api_description(self):
+ def show_api_description(self):
"""Retrieves info about the v2.0 Identity API"""
url = ''
resp, body = self.get(url)
@@ -38,7 +38,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_role(self, role_id):
+ def show_role(self, role_id):
"""Get a role by its id."""
resp, body = self.get('OS-KSADM/roles/%s' % role_id)
self.expected_success(200, resp.status)
@@ -98,7 +98,7 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def get_tenant(self, tenant_id):
+ def show_tenant(self, tenant_id):
"""Get tenant details."""
resp, body = self.get('tenants/%s' % str(tenant_id))
self.expected_success(200, resp.status)
@@ -128,7 +128,7 @@
def update_tenant(self, tenant_id, **kwargs):
"""Updates a tenant."""
- body = self.get_tenant(tenant_id)['tenant']
+ body = self.show_tenant(tenant_id)['tenant']
name = kwargs.get('name', body['name'])
desc = kwargs.get('description', body['description'])
en = kwargs.get('enabled', body['enabled'])
@@ -169,7 +169,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_user(self, user_id):
+ def show_user(self, user_id):
"""GET a user."""
resp, body = self.get("users/%s" % user_id)
self.expected_success(200, resp.status)
@@ -182,7 +182,7 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def get_users(self):
+ def list_users(self):
"""Get the list of users."""
resp, body = self.get("users")
self.expected_success(200, resp.status)
@@ -200,7 +200,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_token(self, token_id):
+ def show_token(self, token_id):
"""Get token details."""
resp, body = self.get("tokens/%s" % token_id)
self.expected_success(200, resp.status)
@@ -213,7 +213,7 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def list_users_for_tenant(self, tenant_id):
+ def list_tenant_users(self, tenant_id):
"""List users for a Tenant."""
resp, body = self.get('/tenants/%s/users' % tenant_id)
self.expected_success(200, resp.status)
@@ -221,7 +221,7 @@
return service_client.ResponseBody(resp, body)
def get_user_by_username(self, tenant_id, username):
- users = self.list_users_for_tenant(tenant_id)['users']
+ users = self.list_tenant_users(tenant_id)['users']
for user in users:
if user['name'] == username:
return user
@@ -240,7 +240,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_service(self, service_id):
+ def show_service(self, service_id):
"""Get Service."""
url = '/OS-KSADM/services/%s' % service_id
resp, body = self.get(url)
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index decf3a8..7d4cf9a 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -13,6 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
+"""
+http://developer.openstack.org/api-ref-identity-v3.html#credentials-v3
+"""
+
from oslo_serialization import jsonutils as json
from tempest.common import service_client
@@ -21,17 +25,13 @@
class CredentialsClient(service_client.ServiceClient):
api_version = "v3"
- def create_credential(self, access_key, secret_key, user_id, project_id):
- """Creates a credential."""
- blob = "{\"access\": \"%s\", \"secret\": \"%s\"}" % (
- access_key, secret_key)
- post_body = {
- "blob": blob,
- "project_id": project_id,
- "type": "ec2",
- "user_id": user_id
- }
- post_body = json.dumps({'credential': post_body})
+ def create_credential(self, **kwargs):
+ """Creates a credential.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#createCredential
+ """
+ post_body = json.dumps({'credential': kwargs})
resp, body = self.post('credentials', post_body)
self.expected_success(201, resp.status)
body = json.loads(body)
@@ -39,22 +39,12 @@
return service_client.ResponseBody(resp, body)
def update_credential(self, credential_id, **kwargs):
- """Updates a credential."""
- body = self.get_credential(credential_id)['credential']
- cred_type = kwargs.get('type', body['type'])
- access_key = kwargs.get('access_key', body['blob']['access'])
- secret_key = kwargs.get('secret_key', body['blob']['secret'])
- project_id = kwargs.get('project_id', body['project_id'])
- user_id = kwargs.get('user_id', body['user_id'])
- blob = "{\"access\": \"%s\", \"secret\": \"%s\"}" % (
- access_key, secret_key)
- post_body = {
- "blob": blob,
- "project_id": project_id,
- "type": cred_type,
- "user_id": user_id
- }
- post_body = json.dumps({'credential': post_body})
+ """Updates a credential.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#updateCredential
+ """
+ post_body = json.dumps({'credential': kwargs})
resp, body = self.patch('credentials/%s' % credential_id, post_body)
self.expected_success(200, resp.status)
body = json.loads(body)
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index 6bdf8b3..ede5edb 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -13,6 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
+"""
+http://developer.openstack.org/api-ref-identity-v3.html#endpoints-v3
+"""
+
from oslo_serialization import jsonutils as json
from tempest.common import service_client
@@ -28,53 +32,25 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def create_endpoint(self, service_id, interface, url, **kwargs):
+ def create_endpoint(self, **kwargs):
"""Create endpoint.
- Normally this function wouldn't allow setting values that are not
- allowed for 'enabled'. Use `force_enabled` to set a non-boolean.
-
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#createEndpoint
"""
- region = kwargs.get('region', None)
- if 'force_enabled' in kwargs:
- enabled = kwargs.get('force_enabled', None)
- else:
- enabled = kwargs.get('enabled', None)
- post_body = {
- 'service_id': service_id,
- 'interface': interface,
- 'url': url,
- 'region': region,
- 'enabled': enabled
- }
- post_body = json.dumps({'endpoint': post_body})
+ post_body = json.dumps({'endpoint': kwargs})
resp, body = self.post('endpoints', post_body)
self.expected_success(201, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def update_endpoint(self, endpoint_id, service_id=None, interface=None,
- url=None, region=None, enabled=None, **kwargs):
+ def update_endpoint(self, endpoint_id, **kwargs):
"""Updates an endpoint with given parameters.
- Normally this function wouldn't allow setting values that are not
- allowed for 'enabled'. Use `force_enabled` to set a non-boolean.
-
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#updateEndpoint
"""
- post_body = {}
- if service_id is not None:
- post_body['service_id'] = service_id
- if interface is not None:
- post_body['interface'] = interface
- if url is not None:
- post_body['url'] = url
- if region is not None:
- post_body['region'] = region
- if 'force_enabled' in kwargs:
- post_body['enabled'] = kwargs['force_enabled']
- elif enabled is not None:
- post_body['enabled'] = enabled
- post_body = json.dumps({'endpoint': post_body})
+ post_body = json.dumps({'endpoint': kwargs})
resp, body = self.patch('endpoints/%s' % endpoint_id, post_body)
self.expected_success(200, resp.status)
body = json.loads(body)
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index 3f27624..f7913d0 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -22,7 +22,7 @@
class IdentityV3Client(service_client.ServiceClient):
api_version = "v3"
- def get_api_description(self):
+ def show_api_description(self):
"""Retrieves info about the v3 Identity API"""
url = ''
resp, body = self.get(url)
@@ -54,7 +54,7 @@
def update_user(self, user_id, name, **kwargs):
"""Updates a user."""
- body = self.get_user(user_id)['user']
+ body = self.show_user(user_id)['user']
email = kwargs.get('email', body['email'])
en = kwargs.get('enabled', body['enabled'])
project_id = kwargs.get('project_id', body['project_id'])
@@ -99,7 +99,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_users(self, params=None):
+ def list_users(self, params=None):
"""Get the list of users."""
url = 'users'
if params:
@@ -109,7 +109,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_user(self, user_id):
+ def show_user(self, user_id):
"""GET a user."""
resp, body = self.get("users/%s" % user_id)
self.expected_success(200, resp.status)
@@ -191,7 +191,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_role(self, role_id):
+ def show_role(self, role_id):
"""GET a Role."""
resp, body = self.get('roles/%s' % str(role_id))
self.expected_success(200, resp.status)
@@ -284,7 +284,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_token(self, resp_token):
+ def show_token(self, resp_token):
"""Get token details."""
headers = {'X-Subject-Token': resp_token}
resp, body = self.get("auth/tokens", headers=headers)
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index 3231bb0..ecc9df7 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -13,6 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
+"""
+http://developer.openstack.org/api-ref-identity-v3.html#policies-v3
+"""
+
from oslo_serialization import jsonutils as json
from tempest.common import service_client
@@ -21,13 +25,13 @@
class PolicyClient(service_client.ServiceClient):
api_version = "v3"
- def create_policy(self, blob, type):
- """Creates a Policy."""
- post_body = {
- "blob": blob,
- "type": type
- }
- post_body = json.dumps({'policy': post_body})
+ def create_policy(self, **kwargs):
+ """Creates a Policy.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#createPolicy
+ """
+ post_body = json.dumps({'policy': kwargs})
resp, body = self.post('policies', post_body)
self.expected_success(201, resp.status)
body = json.loads(body)
@@ -49,12 +53,12 @@
return service_client.ResponseBody(resp, body)
def update_policy(self, policy_id, **kwargs):
- """Updates a policy."""
- type = kwargs.get('type')
- post_body = {
- 'type': type
- }
- post_body = json.dumps({'policy': post_body})
+ """Updates a policy.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#updatePolicy
+ """
+ post_body = json.dumps({'policy': kwargs})
url = 'policies/%s' % policy_id
resp, body = self.patch(url, post_body)
self.expected_success(200, resp.status)
diff --git a/tempest/services/identity/v3/json/region_client.py b/tempest/services/identity/v3/json/region_client.py
index 24c6f33..6ccdc31 100644
--- a/tempest/services/identity/v3/json/region_client.py
+++ b/tempest/services/identity/v3/json/region_client.py
@@ -13,6 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
+"""
+http://developer.openstack.org/api-ref-identity-v3.html#regions-v3
+"""
+
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
@@ -22,31 +26,34 @@
class RegionClient(service_client.ServiceClient):
api_version = "v3"
- def create_region(self, description, **kwargs):
- """Create region."""
- req_body = {
- 'description': description,
- }
- if kwargs.get('parent_region_id'):
- req_body['parent_region_id'] = kwargs.get('parent_region_id')
- req_body = json.dumps({'region': req_body})
- if kwargs.get('unique_region_id'):
- resp, body = self.put(
- 'regions/%s' % kwargs.get('unique_region_id'), req_body)
+ def create_region(self, region_id=None, **kwargs):
+ """Create region.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#createRegion
+
+ see http://developer.openstack.org/
+ api-ref-identity-v3.html#createRegionWithID
+ """
+ if region_id is not None:
+ method = self.put
+ url = 'regions/%s' % region_id
else:
- resp, body = self.post('regions', req_body)
+ method = self.post
+ url = 'regions'
+ req_body = json.dumps({'region': kwargs})
+ resp, body = method(url, req_body)
self.expected_success(201, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
def update_region(self, region_id, **kwargs):
- """Updates a region."""
- post_body = {}
- if 'description' in kwargs:
- post_body['description'] = kwargs.get('description')
- if 'parent_region_id' in kwargs:
- post_body['parent_region_id'] = kwargs.get('parent_region_id')
- post_body = json.dumps({'region': post_body})
+ """Updates a region.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#updateRegion
+ """
+ post_body = json.dumps({'region': kwargs})
resp, body = self.patch('regions/%s' % region_id, post_body)
self.expected_success(200, resp.status)
body = json.loads(body)
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index 2acc3a8..3dbfe5e 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -13,6 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
+"""
+http://developer.openstack.org/api-ref-identity-v3.html#service-catalog-v3
+"""
+
from oslo_serialization import jsonutils as json
from tempest.common import service_client
@@ -22,23 +26,18 @@
api_version = "v3"
def update_service(self, service_id, **kwargs):
- """Updates a service."""
- body = self.get_service(service_id)['service']
- name = kwargs.get('name', body['name'])
- type = kwargs.get('type', body['type'])
- desc = kwargs.get('description', body['description'])
- patch_body = {
- 'description': desc,
- 'type': type,
- 'name': name
- }
- patch_body = json.dumps({'service': patch_body})
+ """Updates a service.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#updateService
+ """
+ patch_body = json.dumps({'service': kwargs})
resp, body = self.patch('services/%s' % service_id, patch_body)
self.expected_success(200, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_service(self, service_id):
+ def show_service(self, service_id):
"""Get Service."""
url = 'services/%s' % service_id
resp, body = self.get(url)
@@ -46,15 +45,13 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def create_service(self, serv_type, name=None, description=None,
- enabled=True):
- body_dict = {
- 'name': name,
- 'type': serv_type,
- 'enabled': enabled,
- 'description': description,
- }
- body = json.dumps({'service': body_dict})
+ def create_service(self, **kwargs):
+ """Creates a service.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#createService
+ """
+ body = json.dumps({'service': kwargs})
resp, body = self.post("services", body)
self.expected_success(201, resp.status)
body = json.loads(body)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 7821f37..d811c51 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -34,28 +34,6 @@
quotas
"""
- def create_port(self, **kwargs):
- uri = '/ports'
- post_data = {'port': kwargs}
- return self.create_resource(uri, post_data)
-
- def update_port(self, port_id, **kwargs):
- uri = '/ports/%s' % port_id
- post_data = {'port': kwargs}
- return self.update_resource(uri, post_data)
-
- def show_port(self, port_id, **fields):
- uri = '/ports/%s' % port_id
- return self.show_resource(uri, **fields)
-
- def delete_port(self, port_id):
- uri = '/ports/%s' % port_id
- return self.delete_resource(uri)
-
- def list_ports(self, **filters):
- uri = '/ports'
- return self.list_resources(uri, **filters)
-
def create_floatingip(self, **kwargs):
uri = '/floatingips'
post_data = {'floatingip': kwargs}
@@ -175,20 +153,22 @@
uri = '/ports'
return self.create_resource(uri, post_data)
- def wait_for_resource_deletion(self, resource_type, id):
+ def wait_for_resource_deletion(self, resource_type, id, client=None):
"""Waits for a resource to be deleted."""
start_time = int(time.time())
while True:
- if self.is_resource_deleted(resource_type, id):
+ if self.is_resource_deleted(resource_type, id, client=client):
return
if int(time.time()) - start_time >= self.build_timeout:
raise exceptions.TimeoutException
time.sleep(self.build_interval)
- def is_resource_deleted(self, resource_type, id):
+ def is_resource_deleted(self, resource_type, id, client=None):
+ if client is None:
+ client = self
method = 'show_' + resource_type
try:
- getattr(self, method)(id)
+ getattr(client, method)(id)
except AttributeError:
raise Exception("Unknown resource type %s " % resource_type)
except lib_exc.NotFound:
diff --git a/tempest/services/network/json/ports_client.py b/tempest/services/network/json/ports_client.py
new file mode 100644
index 0000000..d52d65e
--- /dev/null
+++ b/tempest/services/network/json/ports_client.py
@@ -0,0 +1,38 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.services.network.json import base
+
+
+class PortsClient(base.BaseNetworkClient):
+
+ def create_port(self, **kwargs):
+ uri = '/ports'
+ post_data = {'port': kwargs}
+ return self.create_resource(uri, post_data)
+
+ def update_port(self, port_id, **kwargs):
+ uri = '/ports/%s' % port_id
+ post_data = {'port': kwargs}
+ return self.update_resource(uri, post_data)
+
+ def show_port(self, port_id, **fields):
+ uri = '/ports/%s' % port_id
+ return self.show_resource(uri, **fields)
+
+ def delete_port(self, port_id):
+ uri = '/ports/%s' % port_id
+ return self.delete_resource(uri)
+
+ def list_ports(self, **filters):
+ uri = '/ports'
+ return self.list_resources(uri, **filters)
diff --git a/tempest/services/network/resources.py b/tempest/services/network/resources.py
index 16d9823..ae30312 100644
--- a/tempest/services/network/resources.py
+++ b/tempest/services/network/resources.py
@@ -44,6 +44,7 @@
self.network_client = kwargs.pop('network_client', None)
self.networks_client = kwargs.pop('networks_client', None)
self.subnets_client = kwargs.pop('subnets_client', None)
+ self.ports_client = kwargs.pop('ports_client', None)
super(DeletableResource, self).__init__(*args, **kwargs)
def __str__(self):
@@ -152,7 +153,7 @@
class DeletablePort(DeletableResource):
def delete(self):
- self.client.delete_port(self.id)
+ self.ports_client.delete_port(self.id)
class DeletableSecurityGroup(DeletableResource):
diff --git a/tempest/stress/actions/ssh_floating.py b/tempest/stress/actions/ssh_floating.py
index d912b25..6bac570 100644
--- a/tempest/stress/actions/ssh_floating.py
+++ b/tempest/stress/actions/ssh_floating.py
@@ -107,12 +107,12 @@
sec_grp_cli.delete_security_group(self.sec_grp['id'])
def _create_floating_ip(self):
- floating_cli = self.manager.floating_ips_client
+ floating_cli = self.manager.compute_floating_ips_client
self.floating = (floating_cli.create_floating_ip(self.floating_pool)
['floating_ip'])
def _destroy_floating_ip(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
cli.delete_floating_ip(self.floating['id'])
cli.wait_for_resource_deletion(self.floating['id'])
self.logger.info("Deleted Floating IP %s", str(self.floating['ip']))
@@ -146,7 +146,7 @@
self._create_vm()
def wait_disassociate(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
def func():
floating = (cli.show_floating_ip(self.floating['id'])
@@ -158,7 +158,7 @@
raise RuntimeError("IP disassociate timeout!")
def run_core(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
cli.associate_floating_ip_to_server(self.floating['ip'],
self.server_id)
for method in self.verify:
diff --git a/tempest/stress/actions/volume_attach_verify.py b/tempest/stress/actions/volume_attach_verify.py
index 95841a9..4840383 100644
--- a/tempest/stress/actions/volume_attach_verify.py
+++ b/tempest/stress/actions/volume_attach_verify.py
@@ -70,12 +70,12 @@
sec_grp_cli.delete_security_group(self.sec_grp['id'])
def _create_floating_ip(self):
- floating_cli = self.manager.floating_ips_client
+ floating_cli = self.manager.compute_floating_ips_client
self.floating = (floating_cli.create_floating_ip(self.floating_pool)
['floating_ip'])
def _destroy_floating_ip(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
cli.delete_floating_ip(self.floating['id'])
cli.wait_for_resource_deletion(self.floating['id'])
self.logger.info("Deleted Floating IP %s", str(self.floating['ip']))
@@ -98,7 +98,7 @@
self.logger.info("deleted volume: %s" % self.volume['id'])
def _wait_disassociate(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
def func():
floating = (cli.show_floating_ip(self.floating['id'])
@@ -111,7 +111,7 @@
def new_server_ops(self):
self._create_vm()
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
cli.associate_floating_ip_to_server(self.floating['ip'],
self.server_id)
if self.ssh_test_before_attach and self.enable_ssh_verify:
@@ -218,7 +218,7 @@
self._destroy_vm()
def tearDown(self):
- cli = self.manager.floating_ips_client
+ cli = self.manager.compute_floating_ips_client
cli.disassociate_floating_ip_from_server(self.floating['ip'],
self.server_id)
self._wait_disassociate()
diff --git a/tempest/stress/cleanup.py b/tempest/stress/cleanup.py
index 1350d95..66d2b36 100644
--- a/tempest/stress/cleanup.py
+++ b/tempest/stress/cleanup.py
@@ -59,16 +59,17 @@
except Exception:
pass
- floating_ips = (admin_manager.floating_ips_client.list_floating_ips()
+ admin_floating_ips_client = admin_manager.compute_floating_ips_client
+ floating_ips = (admin_floating_ips_client.list_floating_ips()
['floating_ips'])
LOG.info("Cleanup::remove %s floating ips" % len(floating_ips))
for f in floating_ips:
try:
- admin_manager.floating_ips_client.delete_floating_ip(f['id'])
+ admin_floating_ips_client.delete_floating_ip(f['id'])
except Exception:
pass
- users = admin_manager.identity_client.get_users()['users']
+ users = admin_manager.identity_client.list_users()['users']
LOG.info("Cleanup::remove %s users" % len(users))
for user in users:
if user['name'].startswith("stress_user"):
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index 59a5523..73e180e 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -376,7 +376,7 @@
'tempest.services.network.json.network_client.NetworkClient.'
'remove_router_interface_with_subnet_id')
return_values = ({'status': 200}, {'ports': []})
- port_list_mock = mock.patch.object(creds.network_admin_client,
+ port_list_mock = mock.patch.object(creds.ports_admin_client,
'list_ports',
return_value=return_values)
diff --git a/tempest/tests/services/compute/test_server_groups_client.py b/tempest/tests/services/compute/test_server_groups_client.py
index 5e058d6..e531e2f 100644
--- a/tempest/tests/services/compute/test_server_groups_client.py
+++ b/tempest/tests/services/compute/test_server_groups_client.py
@@ -69,16 +69,16 @@
def test_list_server_groups_byte_body(self):
self._test_list_server_groups(bytes_body=True)
- def _test_get_server_group(self, bytes_body=False):
+ def _test_show_server_group(self, bytes_body=False):
expected = {"server_group": TestServerGroupsClient.server_group}
self.check_service_client_function(
- self.client.get_server_group,
+ self.client.show_server_group,
'tempest.common.service_client.ServiceClient.get',
expected, bytes_body,
server_group_id='5bbcc3c4-1da2-4437-a48a-66f15b1b13f9')
- def test_get_server_group_str_body(self):
- self._test_get_server_group(bytes_body=False)
+ def test_show_server_group_str_body(self):
+ self._test_show_server_group(bytes_body=False)
- def test_get_server_group_byte_body(self):
- self._test_get_server_group(bytes_body=True)
+ def test_show_server_group_byte_body(self):
+ self._test_show_server_group(bytes_body=True)