Check for volume status after rebuild of volume-based server
sometimes we observe failures of this test when env is slow enough
so that volume re-image takes longer than default 20sec/GB.
In this case, volume re-image times out inside nova, and server
returns back to ACTIVE, and then depending on when the actual re-image
will complete, this test can fail in many seemingly unrelated ways,
like fail to find image metadata on volume, fail the check that image is
"different", fail to login over SSH etc.
As an indicative measure, add a check after test considers
server rebuild to be complete, that the volume is in "in-use" state.
Related-Issue: PRODX-47359, PRODX-50272, PRODX-56679
Change-Id: I911ce843471786c35ab6a0109ebb1eb3fe77b835
Signed-off-by: Pavlo Shchelokovskyy <shchelokovskyy@gmail.com>
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index fcd4493..261d254 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -848,6 +848,10 @@
rebuilt_server['id'])['server']
volume_id = server['os-extended-volumes:volumes_attached'][0]['id']
volume_after_rebuild = self.volumes_client.show_volume(volume_id)
+ self.assertEqual(
+ 'in-use',
+ volume_after_rebuild['volume']['status'],
+ 'Volume status after server rebuild has completed is wrong')
image_after_rebuild = (
volume_after_rebuild['volume']
['volume_image_metadata']['image_id'])