From 655515bc973bcd9f08470745e5646b28da722044 Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Wed, 11 Oct 2017 13:14:32 +0700 Subject: [PATCH] Replace the usage of some aliases in tempest In tempest, following aliases have been moved in version Pike and will be removed in version Queens:ad * manager > os_primary [1] * admin_manager > os_admin [2] * os_adm > os_admin [3] * os > os_primary [4] * alt_manager > os_alt [5] [1] https://review.openstack.org/#/c/468036/ [2] https://review.openstack.org/#/c/467852/ [3] https://review.openstack.org/#/c/467605/ [4] https://review.openstack.org/#/c/466991/ [5] https://review.openstack.org/#/c/457555/ Closes-Bug: 1720000 Change-Id: I141c36c785bf4e8dcd5b538444afa6d2fc91e8c3 --- almanach/tests/tempest/tests/api/base.py | 4 ++-- almanach/tests/tempest/tests/scenario/base.py | 12 +++++++----- .../tests/scenario/test_server_creation.py | 5 +++-- .../tests/scenario/test_server_rebuild.py | 11 +++++++---- .../tempest/tests/scenario/test_server_resize.py | 16 ++++++++++------ .../tests/scenario/test_volume_attachment.py | 5 +++-- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/almanach/tests/tempest/tests/api/base.py b/almanach/tests/tempest/tests/api/base.py index 02bb77f..6e48bf6 100644 --- a/almanach/tests/tempest/tests/api/base.py +++ b/almanach/tests/tempest/tests/api/base.py @@ -40,8 +40,8 @@ class BaseAlmanachTest(tempest.test.BaseTestCase): super(BaseAlmanachTest, cls).setup_clients() cred_provider = cls._get_credentials_provider() credentials = cred_provider.get_creds_by_roles(['admin']).credentials - cls.os = clients.Manager(credentials=credentials) - cls.almanach_client = cls.os.almanach_client + cls.os_primary = clients.Manager(credentials=credentials) + cls.almanach_client = cls.os_primary.almanach_client @classmethod def create_server_through_api(cls, tenant_id, server): diff --git a/almanach/tests/tempest/tests/scenario/base.py b/almanach/tests/tempest/tests/scenario/base.py index 2433df8..1854aea 100644 --- a/almanach/tests/tempest/tests/scenario/base.py +++ b/almanach/tests/tempest/tests/scenario/base.py @@ -37,8 +37,8 @@ class BaseAlmanachScenarioTest(manager.ScenarioTest): super(BaseAlmanachScenarioTest, cls).setup_clients() cred_provider = cls._get_credentials_provider() credentials = cred_provider.get_creds_by_roles(['admin']).credentials - cls.os = clients.Manager(credentials=credentials) - cls.almanach_client = cls.os.almanach_client + cls.os_primary = clients.Manager(credentials=credentials) + cls.almanach_client = cls.os_primary.almanach_client def get_tenant_entities(self, tenant_id): resp, response_body = self.almanach_client.get_tenant_entities(tenant_id) @@ -88,12 +88,14 @@ class BaseAlmanachScenarioTest(manager.ScenarioTest): flavor=flavors[0]['id'], tenant_network=tenant_network) - server = self.os.servers_client.show_server(body['id'])['server'] + server = self.os_primary.servers_client.show_server(body['id'])[ + 'server'] return server, flavors[0] def delete_test_server(self, server): - self.os.servers_client.delete_server(server['id']) - waiters.wait_for_server_termination(self.os.servers_client, server['id'], True) + self.os_primary.servers_client.delete_server(server['id']) + waiters.wait_for_server_termination(self.os_primary.servers_client, + server['id'], True) def wait_for_notification(self, callback, *args): start_time = int(time.time()) diff --git a/almanach/tests/tempest/tests/scenario/test_server_creation.py b/almanach/tests/tempest/tests/scenario/test_server_creation.py index f78ef0b..e05ff7a 100644 --- a/almanach/tests/tempest/tests/scenario/test_server_creation.py +++ b/almanach/tests/tempest/tests/scenario/test_server_creation.py @@ -24,9 +24,10 @@ class TestServerCreationScenario(base.BaseAlmanachScenarioTest): server, flavor = self.create_test_server(wait_until='ACTIVE') self.addCleanup(waiters.wait_for_server_termination, - self.os.servers_client, server['id']) + self.os_primary.servers_client, server['id']) self.addCleanup(test_utils.call_and_ignore_notfound_exc, - self.os.servers_client.delete_server, server['id']) + self.os_primary.servers_client.delete_server, + server['id']) entities = self.get_tenant_entities(server['tenant_id']) diff --git a/almanach/tests/tempest/tests/scenario/test_server_rebuild.py b/almanach/tests/tempest/tests/scenario/test_server_rebuild.py index ef6fd01..1f15497 100644 --- a/almanach/tests/tempest/tests/scenario/test_server_rebuild.py +++ b/almanach/tests/tempest/tests/scenario/test_server_rebuild.py @@ -58,14 +58,17 @@ class TestServerRebuildScenario(base.BaseAlmanachScenarioTest): server, flavor = self.create_test_server(wait_until='ACTIVE') image = self._prepare_image() - self.os.servers_client.rebuild_server(server['id'], image['id']) - waiters.wait_for_server_status(self.os.servers_client, server['id'], + self.os_primary.servers_client.rebuild_server(server['id'], + image['id']) + waiters.wait_for_server_status(self.os_primary.servers_client, + server['id'], status='ACTIVE') self.addCleanup(waiters.wait_for_server_termination, - self.os.servers_client, server['id']) + self.os_primary.servers_client, server['id']) self.addCleanup(test_utils.call_and_ignore_notfound_exc, - self.os.servers_client.delete_server, server['id']) + self.os_primary.servers_client.delete_server, + server['id']) return server, flavor diff --git a/almanach/tests/tempest/tests/scenario/test_server_resize.py b/almanach/tests/tempest/tests/scenario/test_server_resize.py index 5bb2d31..c008535 100644 --- a/almanach/tests/tempest/tests/scenario/test_server_resize.py +++ b/almanach/tests/tempest/tests/scenario/test_server_resize.py @@ -54,19 +54,23 @@ class TestServerResizeScenario(base.BaseAlmanachScenarioTest): flavors = self.flavors_client.list_flavors()['flavors'] resized_flavor = flavors[1] server, initial_flavor = self.create_test_server(wait_until='ACTIVE') - self.os.servers_client.resize_server(server['id'], resized_flavor['id']) + self.os_primary.servers_client.resize_server(server['id'], + resized_flavor['id']) - waiters.wait_for_server_status(self.os.servers_client, server['id'], + waiters.wait_for_server_status(self.os_primary.servers_client, + server['id'], status='VERIFY_RESIZE') - self.os.servers_client.confirm_resize_server(server['id']) + self.os_primary.servers_client.confirm_resize_server(server['id']) - waiters.wait_for_server_status(self.os.servers_client, server['id'], + waiters.wait_for_server_status(self.os_primary.servers_client, + server['id'], status='ACTIVE') self.addCleanup(waiters.wait_for_server_termination, - self.os.servers_client, server['id']) + self.os_primary.servers_client, server['id']) self.addCleanup(test_utils.call_and_ignore_notfound_exc, - self.os.servers_client.delete_server, server['id']) + self.os_primary.servers_client.delete_server, + server['id']) return server, initial_flavor, resized_flavor diff --git a/almanach/tests/tempest/tests/scenario/test_volume_attachment.py b/almanach/tests/tempest/tests/scenario/test_volume_attachment.py index 7c86387..9a1f188 100644 --- a/almanach/tests/tempest/tests/scenario/test_volume_attachment.py +++ b/almanach/tests/tempest/tests/scenario/test_volume_attachment.py @@ -25,9 +25,10 @@ class TestVolumeAttachmentScenario(base.BaseAlmanachScenarioTest): def tearDown(self): super(TestVolumeAttachmentScenario, self).tearDown() self.addCleanup(waiters.wait_for_server_termination, - self.os.servers_client, self._server['id']) + self.os_primary.servers_client, self._server['id']) self.addCleanup(test_utils.call_and_ignore_notfound_exc, - self.os.servers_client.delete_server, self._server['id']) + self.os_primary.servers_client.delete_server, + self._server['id']) self.addCleanup(self.volumes_client.wait_for_resource_deletion, self._volume['id']) self.addCleanup(test_utils.call_and_ignore_notfound_exc,