diff options
author | Dan Smith <dansmith@redhat.com> | 2023-02-27 06:48:38 -0800 |
---|---|---|
committer | Dan Smith <dansmith@redhat.com> | 2023-02-27 08:30:46 -0800 |
commit | d3155552ec0d176aa03410f6d2725b5c4138c976 (patch) | |
tree | 720fa7ade2c47706b4a9b4077a2d50d4dcf6e783 | |
parent | cd080273d2158d53547bc2bfe9e37c9530e11b2e (diff) | |
download | tempest-d3155552ec0d176aa03410f6d2725b5c4138c976.tar.gz |
Avoid wait for vol detach in live-migrate tests
This extends the recent theme of making sure the tearDown process does
not hang and ultimately fail the test because it cannot detach a
volume from a guest. We see (and have been seeing for a long time)
the live migration tests specifically fail in this way in the gate.
Change-Id: Ib1065c146ab2f927c23fc8a0b73d7040516a19a6
Related-Bug: #199232
-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') |