Merge "Check create-Floating-IP-Bulk Nova API attributes"
This commit is contained in:
commit
fe3a91cbee
@ -74,7 +74,7 @@ class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest):
|
|||||||
self.assertEqual(self.ip_range, body['ip_range'])
|
self.assertEqual(self.ip_range, body['ip_range'])
|
||||||
resp, ips_list = self.client.list_floating_ips_bulk()
|
resp, ips_list = self.client.list_floating_ips_bulk()
|
||||||
self.assertEqual(200, resp.status)
|
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():
|
for ip in netaddr.IPNetwork(self.ip_range).iter_hosts():
|
||||||
self.assertIn(str(ip), map(lambda x: x['address'], ips_list))
|
self.assertIn(str(ip), map(lambda x: x['address'], ips_list))
|
||||||
resp, body = self.client.delete_floating_ips_bulk(self.ip_range)
|
resp, body = self.client.delete_floating_ips_bulk(self.ip_range)
|
||||||
|
@ -98,3 +98,22 @@ floating_ip_pools = {
|
|||||||
add_remove_floating_ip = {
|
add_remove_floating_ip = {
|
||||||
'status_code': [202]
|
'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']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -123,6 +123,7 @@ class FloatingIPsClientJSON(rest_client.RestClient):
|
|||||||
post_body = json.dumps({'floating_ips_bulk_create': post_body})
|
post_body = json.dumps({'floating_ips_bulk_create': post_body})
|
||||||
resp, body = self.post('os-floating-ips-bulk', post_body)
|
resp, body = self.post('os-floating-ips-bulk', post_body)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
|
self.validate_response(schema.create_floating_ips_bulk, resp, body)
|
||||||
return resp, body['floating_ips_bulk_create']
|
return resp, body['floating_ips_bulk_create']
|
||||||
|
|
||||||
def list_floating_ips_bulk(self):
|
def list_floating_ips_bulk(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user