Add API test to ensure IPs can be added by subnet

A user should be able to request additional fixed IPs
from the same subnet they already have an IP from.
This prevents a regression from that behavior.

Related-Bug: #1623800
Change-Id: I1867963e027f8d240580ada89b540443f74ed684
This commit is contained in:
Kevin Benton 2016-09-14 20:36:44 -07:00
parent 748faa0579
commit 7c6071bbbc
1 changed files with 12 additions and 0 deletions

View File

@ -47,6 +47,18 @@ class PortsTestJSON(base.BaseNetworkTest):
self.client.update_subnet(s['id'], enable_dhcp=True)
self.create_port(self.network)
@test.idempotent_id('1d6d8683-8691-43c6-a7ba-c69723258726')
def test_add_ips_to_port(self):
s = self.create_subnet(self.network)
port = self.create_port(self.network)
# request another IP on the same subnet
port['fixed_ips'].append({'subnet_id': s['id']})
updated = self.client.update_port(port['id'],
fixed_ips=port['fixed_ips'])
subnets = [ip['subnet_id'] for ip in updated['port']['fixed_ips']]
expected = [s['id'], s['id']]
self.assertEqual(expected, subnets)
class PortsSearchCriteriaTest(base.BaseSearchCriteriaTest):