Merge "Verify "get version" API response attributes"
diff --git a/tempest/api_schema/compute/version.py b/tempest/api_schema/compute/version.py
new file mode 100644
index 0000000..32c6d96
--- /dev/null
+++ b/tempest/api_schema/compute/version.py
@@ -0,0 +1,55 @@
+# Copyright 2014 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+version = {
+    'status_code': [200],
+    'response_body': {
+        'type': 'object',
+        'properties': {
+            'version': {
+                'type': 'object',
+                'properties': {
+                    'id': {'type': 'string'},
+                    'links': {
+                        'type': 'array',
+                        'items': {
+                            'type': 'object',
+                            'properties': {
+                                'href': {'type': 'string', 'format': 'uri'},
+                                'rel': {'type': 'string'},
+                                'type': {'type': 'string'}
+                            },
+                            'required': ['href', 'rel']
+                        }
+                    },
+                    'media-types': {
+                        'type': 'array',
+                        'items': {
+                            'type': 'object',
+                            'properties': {
+                                'base': {'type': 'string'},
+                                'type': {'type': 'string'}
+                            },
+                            'required': ['base', 'type']
+                        }
+                    },
+                    'status': {'type': 'string'},
+                    'updated': {'type': 'string', 'format': 'date-time'}
+                },
+                'required': ['id', 'links', 'media-types', 'status', 'updated']
+            }
+        },
+        'required': ['version']
+    }
+}
diff --git a/tempest/services/compute/v3/json/version_client.py b/tempest/services/compute/v3/json/version_client.py
index b560c58..568678d 100644
--- a/tempest/services/compute/v3/json/version_client.py
+++ b/tempest/services/compute/v3/json/version_client.py
@@ -15,6 +15,7 @@
 
 import json
 
+from tempest.api_schema.compute import version as schema
 from tempest.common import rest_client
 from tempest import config
 
@@ -30,4 +31,5 @@
     def get_version(self):
         resp, body = self.get('')
         body = json.loads(body)
+        self.validate_response(schema.version, resp, body)
         return resp, body['version']