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
This commit is contained in:
Vu Cong Tuan 2017-10-11 13:14:32 +07:00
parent 047ecdffd7
commit 655515bc97
6 changed files with 32 additions and 21 deletions

View File

@ -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):

View File

@ -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())

View File

@ -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'])

View File

@ -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

View File

@ -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

View File

@ -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,