Verify server list_addresses V2/V3 APIs attributes
This patch adds the JSON schema for Nova V2 & V3 server list_addresses
APIs response and validate the response with added
JSON schema to block the backward incompatibility change in the future.
The response body of server list_addresses V2 API is below:
{
"addresses": {
"private": [
{
"version": 4,
"addr": "192.168.0.3"
}
]
}
}
The response body of server list_addresses V3 API is below:
{
"addresses": {
"private": [
{
"version": 4,
"addr": "192.168.0.3",
"type": "fixed",
"mac_addr": "aa:bb:cc:dd:ee:ff"
}
]
}
}
Partially implements blueprint nova-api-attribute-test
Change-Id: I21392dfb8141d0cf98bf2dcbcb3fd49e75f9cbd8
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 9c7eec6..c266d15 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -193,6 +193,7 @@
"""Lists all addresses for a server."""
resp, body = self.get("servers/%s/ips" % str(server_id))
body = json.loads(body)
+ self.validate_response(schema.list_addresses, resp, body)
return resp, body['addresses']
def list_addresses_by_network(self, server_id, network_id):