Fix python-manilaclient functional tests

Fixes share server migration functional tests in the
python-manilaclient. Recently, this change [1] was introduced, and
before such change was merged, Manila used to keep the source share
server even after the complete operation.

As of the merge of [1], Manila is no longer keeping the source
share server, and it is automatically removed after the complete
phase is triggered.

In this change, we stop waiting for the share server task state
to be a migration completed task state, and instead, expect that
the source share server won't be encountered after the migration
complete.

[1] https://review.opendev.org/c/openstack/manila/+/803623

Change-Id: I7d53a65f1a3b1d5112b3e4de7dc60925191920fa
This commit is contained in:
silvacarloss 2021-09-13 14:15:37 -03:00
parent 32fad505c7
commit 1c3334d06b
1 changed files with 14 additions and 4 deletions

View File

@ -317,20 +317,30 @@ class ShareServersMigrationBase(base.BaseTestCase):
task_state = constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE
server = self.admin_client.wait_for_server_migration_task_state(
share_server_id, dest_host, task_state)
migration_progress = (
self.admin_client.share_server_migration_get_progress(
share_server_id))
dest_share_server_id = migration_progress.get(
'destination_share_server_id')
# Call share server migration complete or cancel operations
# according the ddt.
if operation == 'complete':
task_state = constants.TASK_STATE_MIGRATION_SUCCESS
self.admin_client.share_server_migration_complete(
share_server_id)
task_state = constants.TASK_STATE_MIGRATION_SUCCESS
server = self.admin_client.wait_for_server_migration_task_state(
dest_share_server_id, dest_host, task_state)
self.assertRaises(exceptions.NotFound,
self.admin_client.get_share_server,
share_server_id)
else:
self.admin_client.share_server_migration_cancel(server['id'])
task_state = constants.TASK_STATE_MIGRATION_CANCELLED
# Wait for the respectives task state for each operation above.
server = self.admin_client.wait_for_server_migration_task_state(
server['id'], dest_host, task_state)
# Wait for the respectives task state for each operation above.
server = self.admin_client.wait_for_server_migration_task_state(
server['id'], dest_host, task_state)
# Check if the share is available again.
share = self.admin_client.get_share(share['id'])
self.assertEqual('available', share['status'])