Image cleanup is missing in test_create_delete_image
In test_create_delete_image, there is no addCleanup after
self.client.create_image, so if anything goes wrong, the
following self.client.delete_image may not be executed and
the image will be left over improperly. This is to fix it.
Change-Id: Ib54758c0d29efd4f49d470a665713878c0576f10
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 7fd23fc..6c417f1 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -19,6 +19,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest.lib.common.utils import test_utils
from tempest import test
CONF = config.CONF
@@ -75,6 +76,8 @@
body = self.client.create_image(self.server_id, name=name,
metadata=meta)
image_id = data_utils.parse_image_id(body.response['location'])
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.client.delete_image, image_id)
waiters.wait_for_image_status(self.client, image_id, 'ACTIVE')
# Verify the image was created correctly