diff options
-rw-r--r-- | tempest/api/compute/admin/test_live_migration.py | 3 | ||||
-rw-r--r-- | tempest/api/compute/base.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py index 1cb8004f5..f7c0dd9e3 100644 --- a/tempest/api/compute/admin/test_live_migration.py +++ b/tempest/api/compute/admin/test_live_migration.py @@ -202,7 +202,8 @@ class LiveMigrationTest(LiveMigrationTestBase): volume = self.create_volume() # Attach the volume to the server - self.attach_volume(server, volume, device='/dev/xvdb') + self.attach_volume(server, volume, device='/dev/xvdb', + wait_for_detach=False) server = self.admin_servers_client.show_server(server_id)['server'] volume_id1 = server["os-extended-volumes:volumes_attached"][0]["id"] self._live_migrate(server_id, target_host, 'ACTIVE') diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py index ea1cddc5f..260d4e05f 100644 --- a/tempest/api/compute/base.py +++ b/tempest/api/compute/base.py @@ -568,7 +568,8 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest, # is already detached. pass - def attach_volume(self, server, volume, device=None, tag=None): + def attach_volume(self, server, volume, device=None, tag=None, + wait_for_detach=True): """Attaches volume to server and waits for 'in-use' volume status. The volume will be detached when the test tears down. @@ -605,7 +606,7 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest, # the contents of the console log. The final check of the volume state # should be a no-op by this point and is just added for completeness # when detaching non-multiattach volumes. - if not volume['multiattach']: + if not volume['multiattach'] and wait_for_detach: self.addCleanup( waiters.wait_for_volume_resource_status, self.volumes_client, volume['id'], 'available') |