Wait for backup images to be ACTIVE in test_create_backup
The test_create_backup test creates two backup snapshot images of the
instance right away and waits for the instance to be ACTIVE before
continuing each time, and before creating the third and final backup
image.
The problem is the instance is always ACTIVE, it's the task state that
is transitioning on the instance while it's creating backup snapshot
instances and checking for old rotations to delete.
The test needs to not only check that the instance is ACTIVE before
creating each new backup but also that the snapshot image backups
themselves are ACTIVE which is a better indication that the instance's
state transition is complete.
Closes-Bug: #1257561
Change-Id: I5b423b3424e1dfe6cf5f8fef0dc9538961c1f28d
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index f244155..91c386e 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -247,6 +247,7 @@
image1_id = data_utils.parse_image_id(resp['location'])
self.addCleanup(_clean_oldest_backup, image1_id)
self.assertEqual(202, resp.status)
+ self.os.image_client.wait_for_image_status(image1_id, 'active')
backup2 = data_utils.rand_name('backup')
self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
@@ -257,6 +258,7 @@
image2_id = data_utils.parse_image_id(resp['location'])
self.addCleanup(self.os.image_client.delete_image, image2_id)
self.assertEqual(202, resp.status)
+ self.os.image_client.wait_for_image_status(image2_id, 'active')
# verify they have been created
properties = {