Merge "Verify the response status of create delete Image"
diff --git a/tempest/api_schema/compute/v2/images.py b/tempest/api_schema/compute/v2/images.py
index 41593c6..dae31a6 100644
--- a/tempest/api_schema/compute/v2/images.py
+++ b/tempest/api_schema/compute/v2/images.py
@@ -90,3 +90,11 @@
'required': ['images']
}
}
+
+create_image = {
+ 'status_code': [202]
+}
+
+delete = {
+ 'status_code': [204]
+}
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index 2f128f2..bfa65df 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -48,6 +48,7 @@
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/action' % str(server_id),
post_body)
+ self.validate_response(schema.create_image, resp, body)
return resp, body
def list_images(self, params=None):
@@ -81,7 +82,9 @@
def delete_image(self, image_id):
"""Deletes the provided image."""
- return self.delete("images/%s" % str(image_id))
+ resp, body = self.delete("images/%s" % str(image_id))
+ self.validate_response(schema.delete, resp, body)
+ return resp, body
def wait_for_image_status(self, image_id, status):
"""Waits for an image to reach a given status."""
@@ -125,6 +128,7 @@
"""Deletes a single image metadata key/value pair."""
resp, body = self.delete("images/%s/metadata/%s" %
(str(image_id), key))
+ self.validate_response(schema.delete, resp, body)
return resp, body
def is_resource_deleted(self, id):