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:
parent
d0a2c1650a
commit
0af6e6ded0
|
@ -40,8 +40,8 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
|
||||||
"""openvswitch agent br-int specific logic."""
|
"""openvswitch agent br-int specific logic."""
|
||||||
|
|
||||||
def setup_default_table(self):
|
def setup_default_table(self):
|
||||||
self.install_normal()
|
|
||||||
self.setup_canary_table()
|
self.setup_canary_table()
|
||||||
|
self.install_normal()
|
||||||
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
|
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
|
||||||
|
|
||||||
def setup_canary_table(self):
|
def setup_canary_table(self):
|
||||||
|
|
|
@ -34,8 +34,8 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
|
||||||
"""openvswitch agent br-int specific logic."""
|
"""openvswitch agent br-int specific logic."""
|
||||||
|
|
||||||
def setup_default_table(self):
|
def setup_default_table(self):
|
||||||
self.install_normal()
|
|
||||||
self.setup_canary_table()
|
self.setup_canary_table()
|
||||||
|
self.install_normal()
|
||||||
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
|
self.install_drop(table_id=constants.ARP_SPOOF_TABLE)
|
||||||
|
|
||||||
def setup_canary_table(self):
|
def setup_canary_table(self):
|
||||||
|
|
|
@ -33,6 +33,12 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
|
||||||
self.br.setup_default_table()
|
self.br.setup_default_table()
|
||||||
(dp, ofp, ofpp) = self._get_dp()
|
(dp, ofp, ofpp) = self._get_dp()
|
||||||
expected = [
|
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,
|
call._send_msg(ofpp.OFPFlowMod(dp,
|
||||||
cookie=self.stamp,
|
cookie=self.stamp,
|
||||||
instructions=[
|
instructions=[
|
||||||
|
@ -44,12 +50,6 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
|
||||||
match=ofpp.OFPMatch(),
|
match=ofpp.OFPMatch(),
|
||||||
priority=0,
|
priority=0,
|
||||||
table_id=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,
|
call._send_msg(ofpp.OFPFlowMod(dp,
|
||||||
cookie=self.stamp,
|
cookie=self.stamp,
|
||||||
instructions=[],
|
instructions=[],
|
||||||
|
|
|
@ -33,8 +33,8 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
|
||||||
def test_setup_default_table(self):
|
def test_setup_default_table(self):
|
||||||
self.br.setup_default_table()
|
self.br.setup_default_table()
|
||||||
expected = [
|
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=23, actions='drop'),
|
||||||
|
call.add_flow(priority=0, table=0, actions='normal'),
|
||||||
call.add_flow(priority=0, table=24, actions='drop'),
|
call.add_flow(priority=0, table=24, actions='drop'),
|
||||||
]
|
]
|
||||||
self.assertEqual(expected, self.mock.mock_calls)
|
self.assertEqual(expected, self.mock.mock_calls)
|
||||||
|
|
Loading…
Reference in New Issue