diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py index 8f875d2c9f..208b0325fc 100644 --- a/tempest/api/compute/admin/test_floating_ips_bulk.py +++ b/tempest/api/compute/admin/test_floating_ips_bulk.py @@ -74,7 +74,7 @@ class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest): self.assertEqual(self.ip_range, body['ip_range']) resp, ips_list = self.client.list_floating_ips_bulk() self.assertEqual(200, resp.status) - self.assertNotEqual(0, len(body)) + self.assertNotEqual(0, len(ips_list)) for ip in netaddr.IPNetwork(self.ip_range).iter_hosts(): self.assertIn(str(ip), map(lambda x: x['address'], ips_list)) resp, body = self.client.delete_floating_ips_bulk(self.ip_range) diff --git a/tempest/api_schema/compute/v2/floating_ips.py b/tempest/api_schema/compute/v2/floating_ips.py index 3ea6320fd0..03e6aefa9e 100644 --- a/tempest/api_schema/compute/v2/floating_ips.py +++ b/tempest/api_schema/compute/v2/floating_ips.py @@ -98,3 +98,22 @@ floating_ip_pools = { add_remove_floating_ip = { 'status_code': [202] } + +create_floating_ips_bulk = { + 'status_code': [200], + 'response_body': { + 'type': 'object', + 'properties': { + 'floating_ips_bulk_create': { + 'type': 'object', + 'properties': { + 'interface': {'type': ['string', 'null']}, + 'ip_range': {'type': 'string'}, + 'pool': {'type': ['string', 'null']}, + }, + 'required': ['interface', 'ip_range', 'pool'] + } + }, + 'required': ['floating_ips_bulk_create'] + } +} diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py index 6fc2bc2a7b..92b4ddf036 100644 --- a/tempest/services/compute/json/floating_ips_client.py +++ b/tempest/services/compute/json/floating_ips_client.py @@ -123,6 +123,7 @@ class FloatingIPsClientJSON(rest_client.RestClient): post_body = json.dumps({'floating_ips_bulk_create': post_body}) resp, body = self.post('os-floating-ips-bulk', post_body) body = json.loads(body) + self.validate_response(schema.create_floating_ips_bulk, resp, body) return resp, body['floating_ips_bulk_create'] def list_floating_ips_bulk(self):