[scenario] Wait for image deletion
This operation requires some time to delete image completely
from cinder backend on lvm storage.
Related-Bug: PRODX-26356
Change-Id: Iaf7582444b9d123de0a41ee383a1ddbf7515a748
(cherry picked from commit 7b90981e3eb46fba3fdd34581761104f7995fbff)
diff --git a/barbican_tempest_plugin/tests/scenario/manager.py b/barbican_tempest_plugin/tests/scenario/manager.py
index fae7518..f852fa7 100644
--- a/barbican_tempest_plugin/tests/scenario/manager.py
+++ b/barbican_tempest_plugin/tests/scenario/manager.py
@@ -290,7 +290,10 @@
params.update(properties)
body = self.image_client.create_image(**params)
image = body['image'] if 'image' in body else body
- self.addCleanup(self.image_client.delete_image, image['id'])
+ self.addCleanup(self.image_client.wait_for_resource_deletion,
+ image['id'])
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.image_client.delete_image, image['id'])
self.assertEqual("queued", image['status'])
with open(path, 'rb') as image_file:
if CONF.image_feature_enabled.api_v1: