Define image status enums for compute proxy API schema
The compute images API proxy defines enums for the image
status values so we should enforce those in the response
schema validation.
Note that this is used in refstack/defcore tests.
Change-Id: I8c95c567eb8bb36a219e90ed811c09a7ead07771
diff --git a/tempest/lib/api_schema/response/compute/v2_1/images.py b/tempest/lib/api_schema/response/compute/v2_1/images.py
index b0f1934..f65b9d8 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/images.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/images.py
@@ -19,11 +19,13 @@
image_links = copy.deepcopy(parameter_types.links)
image_links['items']['properties'].update({'type': {'type': 'string'}})
+image_status_enums = ['ACTIVE', 'SAVING', 'DELETED', 'ERROR', 'UNKNOWN']
+
common_image_schema = {
'type': 'object',
'properties': {
'id': {'type': 'string'},
- 'status': {'type': 'string'},
+ 'status': {'enum': image_status_enums},
'updated': {'type': 'string'},
'links': image_links,
'name': {'type': ['string', 'null']},