From 7c6071bbbc32014f6663c12c70a5ed5358fe870f Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 14 Sep 2016 20:36:44 -0700 Subject: [PATCH] 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 --- neutron/tests/tempest/api/test_ports.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/neutron/tests/tempest/api/test_ports.py b/neutron/tests/tempest/api/test_ports.py index 916f5494a80..093de07796d 100644 --- a/neutron/tests/tempest/api/test_ports.py +++ b/neutron/tests/tempest/api/test_ports.py @@ -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):