Don't delete br-int to br-tun patch on startup

When starting up, we don't want to delete the patch port between br-int
and br-tun unless we're also dropping the flows..  In liberty both of
these bridges were switched to not dump flows on startup and to put the
bridges in secure mode so that default flood flows are not installed
when the bridge is created.

Without this patch the patch port is torn down and not reinstalled until
br-tun is setup again.

Partial-Bug: #1514056
Change-Id: Ia518a99a2de5d1bda467fde57892c43970f88bcd
(cherry picked from commit 8dce6a5c87)
This commit is contained in:
Clayton O'Neill 2016-03-24 14:59:41 +00:00 committed by Hynek Mlnarik
parent 6fefdfd65f
commit b392ad1c66
3 changed files with 15 additions and 3 deletions

View File

@ -981,8 +981,11 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
self.int_br.set_secure_mode()
self.int_br.setup_controllers(self.conf)
self.int_br.delete_port(self.conf.OVS.int_peer_patch_port)
if self.conf.AGENT.drop_flows_on_start:
# Delete the patch port between br-int and br-tun if we're deleting
# the flows on br-int, so that traffic doesn't get flooded over
# while flows are missing.
self.int_br.delete_port(self.conf.OVS.int_peer_patch_port)
self.int_br.delete_flows()
self.int_br.setup_default_table()

View File

@ -106,6 +106,17 @@ class TestOVSAgent(base.OVSAgentTestFramework):
self.agent.setup_integration_br()
time.sleep(0.25)
def test_assert_patch_port_ofports_dont_change(self):
# When the integration bridge is setup, it should reuse the existing
# patch ports between br-int and br-tun.
self.setup_agent_and_ports(port_dicts=[], create_tunnels=True)
patch_int_ofport_before = self.agent.patch_int_ofport
patch_tun_ofport_before = self.agent.patch_tun_ofport
self.setup_agent_and_ports(port_dicts=[], create_tunnels=True)
self.assertEqual(patch_int_ofport_before, self.agent.patch_int_ofport)
self.assertEqual(patch_tun_ofport_before, self.agent.patch_tun_ofport)
def test_noresync_after_port_gone(self):
'''This will test the scenario where a port is removed after listing
it but before getting vif info about it.

View File

@ -181,7 +181,6 @@ class TunnelTest(object):
mock.call.create(),
mock.call.set_secure_mode(),
mock.call.setup_controllers(mock.ANY),
mock.call.delete_port('patch-tun'),
mock.call.setup_default_table(),
]
@ -601,7 +600,6 @@ class TunnelTestUseVethInterco(TunnelTest):
mock.call.create(),
mock.call.set_secure_mode(),
mock.call.setup_controllers(mock.ANY),
mock.call.delete_port('patch-tun'),
mock.call.setup_default_table(),
]