Merge "DVR: Correctly change MTU in fip namespace"

This commit is contained in:
Zuul 2019-04-12 05:48:09 +00:00 committed by Gerrit Code Review
commit e8b8a8498d
2 changed files with 8 additions and 6 deletions

View File

@ -423,12 +423,13 @@ class FipNamespace(namespaces.Namespace):
rtr_2_fip_dev, fip_2_rtr_dev = ip_wrapper.add_veth(rtr_2_fip_name, rtr_2_fip_dev, fip_2_rtr_dev = ip_wrapper.add_veth(rtr_2_fip_name,
fip_2_rtr_name, fip_2_rtr_name,
fip_ns_name) fip_ns_name)
rtr_2_fip_dev.link.set_up()
fip_2_rtr_dev.link.set_up()
mtu = ri.get_ex_gw_port().get('mtu') mtu = ri.get_ex_gw_port().get('mtu')
if mtu: if mtu:
rtr_2_fip_dev.link.set_mtu(mtu) rtr_2_fip_dev.link.set_mtu(mtu)
fip_2_rtr_dev.link.set_mtu(mtu) fip_2_rtr_dev.link.set_mtu(mtu)
rtr_2_fip_dev.link.set_up()
fip_2_rtr_dev.link.set_up()
self._add_cidr_to_device(rtr_2_fip_dev, str(rtr_2_fip)) self._add_cidr_to_device(rtr_2_fip_dev, str(rtr_2_fip))
self._add_cidr_to_device(fip_2_rtr_dev, str(fip_2_rtr)) self._add_cidr_to_device(fip_2_rtr_dev, str(fip_2_rtr))

View File

@ -297,9 +297,10 @@ class TestDvrFipNs(base.BaseTestCase):
fip_2_rtr_name, fip_2_rtr_name,
fip_ns_name) fip_ns_name)
self.assertEqual(2, device.link.set_up.call_count)
device.link.set_mtu.assert_called_with(2000) device.link.set_mtu.assert_called_with(2000)
self.assertEqual(2, device.link.set_mtu.call_count) self.assertEqual(2, device.link.set_mtu.call_count)
self.assertEqual(2, device.link.set_up.call_count)
if not addr_exists: if not addr_exists:
expected = [mock.call(str(addr_pair[0]), add_broadcast=False), expected = [mock.call(str(addr_pair[0]), add_broadcast=False),