Add support for specifying fixed IP address in floating IP association
This patch enhances the floating IP association process by allowing the fixed IP address to be explicitly passed. This provides greater control and ensures the correct port is targeted when associating a floating IP, resolving ambiguity when multiple ports are present. Change-Id: I829703a63397a1116360a768dbccdb1f237be87c Related-Bug: #2089798
This commit is contained in:
parent
7f788b96a9
commit
e1145a333d
@ -1199,14 +1199,15 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||
except (KeyError, IndexError):
|
||||
return None
|
||||
|
||||
def associate_floating_ip(self, floating_ip, server):
|
||||
def associate_floating_ip(self, floating_ip, server, ip_addr=None,
|
||||
**kwargs):
|
||||
"""Associate floating ip to server
|
||||
|
||||
This wrapper utility attaches the floating_ip for
|
||||
the respective port_id of server
|
||||
"""
|
||||
port_id, _ = self.get_server_port_id_and_ip4(server)
|
||||
kwargs = dict(port_id=port_id)
|
||||
port_id, _ = self.get_server_port_id_and_ip4(server, ip_addr=ip_addr)
|
||||
kwargs.update({"port_id": port_id})
|
||||
floating_ip = self.floating_ips_client.update_floatingip(
|
||||
floating_ip['id'], **kwargs)['floatingip']
|
||||
self.assertEqual(port_id, floating_ip['port_id'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user