Validate image metadata attributes of Nova APIs

This patch adds the JSON Schema for Nova V2 Image metadata APIs
(list, set, update) and validate the response with added JSON
Schema to block the backward incompatibility change in the future.

Response body of above APIs is below-

{
    "metadata":
    {

    }
}

Partially implements blueprint nova-api-attribute-test

Change-Id: I923dc1f8e5df96339b14221a68086039c36e22dc
diff --git a/tempest/api_schema/compute/v2/images.py b/tempest/api_schema/compute/v2/images.py
index dae31a6..7fd6b84 100644
--- a/tempest/api_schema/compute/v2/images.py
+++ b/tempest/api_schema/compute/v2/images.py
@@ -98,3 +98,14 @@
 delete = {
     'status_code': [204]
 }
+
+image_metadata = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'metadata': {'type': 'object'}
+        },
+        'required': ['metadata']
+    }
+}
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index bfa65df..abf6049 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -94,6 +94,7 @@
         """Lists all metadata items for an image."""
         resp, body = self.get("images/%s/metadata" % str(image_id))
         body = json.loads(body)
+        self.validate_response(schema.image_metadata, resp, body)
         return resp, body['metadata']
 
     def set_image_metadata(self, image_id, meta):
@@ -101,6 +102,7 @@
         post_body = json.dumps({'metadata': meta})
         resp, body = self.put('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
+        self.validate_response(schema.image_metadata, resp, body)
         return resp, body['metadata']
 
     def update_image_metadata(self, image_id, meta):
@@ -108,6 +110,7 @@
         post_body = json.dumps({'metadata': meta})
         resp, body = self.post('images/%s/metadata' % str(image_id), post_body)
         body = json.loads(body)
+        self.validate_response(schema.image_metadata, resp, body)
         return resp, body['metadata']
 
     def get_image_metadata_item(self, image_id, key):