Verify the response attributes of 'list_aggregates'
This patch verifies the response attributes of list_aggregates.
The response body of v2 and v3 API has the same format:
"aggregates": [
{
"availability_zone": "nova",
"created_at": "2012-11-16T06:22:23.361359",
"deleted": false,
"deleted_at": null,
"hosts": [],
"id": 1,
"metadata": {
"availability_zone": "nova"
},
"name": "name",
"updated_at": null
}
]
Partially implements blueprint nova-api-attribute-test
Change-Id: If4c09929f3e9d3fd743aad2b727a74834fdbf8fd
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index 700a29b..ccb85c4 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -15,6 +15,7 @@
import json
+from tempest.api_schema.compute import aggregates as schema
from tempest.common import rest_client
from tempest import config
from tempest import exceptions
@@ -32,6 +33,7 @@
"""Get aggregate list."""
resp, body = self.get("os-aggregates")
body = json.loads(body)
+ self.validate_response(schema.list_aggregates, resp, body)
return resp, body['aggregates']
def get_aggregate(self, aggregate_id):