Merge "Early die if on image gets killed"
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 8d05fd8..67406b0 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -81,6 +81,10 @@
message = "Server %(server_id)s failed to build and is in ERROR status"
+class ImageKilledException(TempestException):
+ message = "Image %(image_id)s 'killed' while waiting for %(status)s"
+
+
class AddImageException(TempestException):
message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index 1921d78..41b9e81 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -265,9 +265,12 @@
LOG.info('Value transition from "%s" to "%s"'
'in %d second(s).', old_value,
value, dtime)
- if (value == status):
+ if value == status:
return value
+ if value == 'killed':
+ raise exceptions.ImageKilledException(image_id=image_id,
+ status=value)
if dtime > self.build_timeout:
message = ('Time Limit Exceeded! (%ds)'
'while waiting for %s, '