Add floating IP test to ensure backwards compat
This adds an API test to ensure that we maintain the behavior
of disassociating a floating IP if it receives an update with
an empty body.
Change-Id: I9efd941b621e15691af95cd88f391aa564e4b9bd
Related-Bug: #1607746
diff --git a/neutron/tests/tempest/api/test_floating_ips.py b/neutron/tests/tempest/api/test_floating_ips.py
index 570ca54..8ccdd44 100644
--- a/neutron/tests/tempest/api/test_floating_ips.py
+++ b/neutron/tests/tempest/api/test_floating_ips.py
@@ -41,6 +41,20 @@
for i in range(2):
cls.create_port(cls.network)
+ @test.idempotent_id('f6a0fb6c-cb64-4b81-b0d5-f41d8f69d22d')
+ def test_blank_update_clears_association(self):
+ # originally the floating IP had no attributes other than its
+ # association, so an update with an empty body was a signal to
+ # clear the association. This test ensures we maintain that behavior.
+ body = self.client.create_floatingip(
+ floating_network_id=self.ext_net_id,
+ port_id=self.ports[0]['id'],
+ description='d1'
+ )['floatingip']
+ self.assertEqual(self.ports[0]['id'], body['port_id'])
+ body = self.client.update_floatingip(body['id'])['floatingip']
+ self.assertFalse(body['port_id'])
+
@test.idempotent_id('c72c1c0c-2193-4aca-eeee-b1442641ffff')
@test.requires_ext(extension="standard-attr-description",
service="network")