Change the order of installing flows for br-int

For ovs-agent, it uses CANARY_TABLE table to check ovs status, when
ovs-agent restarts, it should firstly install flows for CANARY_TABLE
table.

Closes-bug: #1642223
Change-Id: I2aebbe5faca2fd4ec137255f0413cc2c129a4588
This commit is contained in:
shihanzhang 2016-12-30 14:23:12 +08:00
parent d0a2c1650a
commit 0af6e6ded0
4 changed files with 9 additions and 9 deletions

View File

@ -40,8 +40,8 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
"""openvswitch agent br-int specific logic."""
def setup_default_table(self):
self.install_normal()
self.setup_canary_table()
self.install_normal()
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
def setup_canary_table(self):

View File

@ -34,8 +34,8 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
"""openvswitch agent br-int specific logic."""
def setup_default_table(self):
self.install_normal()
self.setup_canary_table()
self.install_normal()
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
def setup_canary_table(self):

View File

@ -33,6 +33,12 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
self.br.setup_default_table()
(dp, ofp, ofpp) = self._get_dp()
expected = [
call._send_msg(ofpp.OFPFlowMod(dp,
cookie=self.stamp,
instructions=[],
match=ofpp.OFPMatch(),
priority=0,
table_id=23)),
call._send_msg(ofpp.OFPFlowMod(dp,
cookie=self.stamp,
instructions=[
@ -44,12 +50,6 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
match=ofpp.OFPMatch(),
priority=0,
table_id=0)),
call._send_msg(ofpp.OFPFlowMod(dp,
cookie=self.stamp,
instructions=[],
match=ofpp.OFPMatch(),
priority=0,
table_id=23)),
call._send_msg(ofpp.OFPFlowMod(dp,
cookie=self.stamp,
instructions=[],

View File

@ -33,8 +33,8 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
def test_setup_default_table(self):
self.br.setup_default_table()
expected = [
call.add_flow(priority=0, table=0, actions='normal'),
call.add_flow(priority=0, table=23, actions='drop'),
call.add_flow(priority=0, table=0, actions='normal'),
call.add_flow(priority=0, table=24, actions='drop'),
]
self.assertEqual(expected, self.mock.mock_calls)