Verify quotas attributes through Nova os-quota-sets API
This patch adds checks whether a response of Nova os-quota-sets
get/get defaultAPI
includes the attributes to block the backward incompatibility change
in the future.
The quotas response body of v2 API is the following:
{
"quota_set": {
"id": "231a1e7fd1b344f9874d0334d98b459c",
"instances": 10,
"cores": 20,
"ram": 51200,
"floating_ips": 10,
"fixed_ips": -1,
"metadata_items": 128,
"injected_files": 5,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"key_pairs": 100,
"security_groups": 10
"security_group_rules": 20,
}
}
The one of v3 API is the following:
{
"quota_set": {
"id": "231a1e7fd1b344f9874d0334d98b459c",
"instances": 10,
"cores": 20,
"ram": 51200,
"floating_ips": 10,
"fixed_ips": -1,
"metadata_items": 128,
"key_pairs": 100,
"security_groups": 10
"security_group_rules": 20,
}
}
Partially implements blueprint nova-api-attribute-test
Change-Id: I8a45ba601b92f17808227a4853a42e812a2a082e
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index 2fae927..9346183 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -15,6 +15,7 @@
import json
+from tempest.api_schema.compute.v2 import quotas as schema
from tempest.common import rest_client
from tempest import config
@@ -35,6 +36,7 @@
url += '?user_id=%s' % str(user_id)
resp, body = self.get(url)
body = json.loads(body)
+ self.validate_response(schema.quota_set, resp, body)
return resp, body['quota_set']
def get_default_quota_set(self, tenant_id):
@@ -43,6 +45,7 @@
url = 'os-quota-sets/%s/defaults' % str(tenant_id)
resp, body = self.get(url)
body = json.loads(body)
+ self.validate_response(schema.quota_set, resp, body)
return resp, body['quota_set']
def update_quota_set(self, tenant_id, force=None,