diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index d8b428f5850..c1ccc0a9ee2 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -2550,6 +2550,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin, def _handle_ovs_restart(self, polling_manager): self.setup_integration_br() + self.install_ingress_direct_goto_flows() self.setup_physical_bridges(self.bridge_mappings) if self.enable_tunneling: self._reset_tunnel_ofports() diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py index 2f45390503a..a7f405e131c 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py @@ -2365,6 +2365,23 @@ class TestOvsNeutronAgent(object): self._test_ovs_status(constants.OVS_NORMAL, constants.OVS_RESTARTED) + def test_ovs_restart_for_ingress_direct_goto_flows(self): + with mock.patch.object(self.agent, + 'check_ovs_status', + return_value=constants.OVS_RESTARTED), \ + mock.patch.object(self.agent, + '_agent_has_updates', + side_effect=TypeError('loop exit')), \ + mock.patch.object(self.agent, 'setup_integration_br'), \ + mock.patch.object(self.agent, + 'install_ingress_direct_goto_flows') as \ + install_ingress_direct_goto_flows: + try: + self.agent.rpc_loop(polling_manager=mock.Mock()) + except TypeError: + pass + install_ingress_direct_goto_flows.assert_called_once_with() + def test_rpc_loop_fail_to_process_network_ports_keep_flows(self): with mock.patch.object(async_process.AsyncProcess, "_spawn"),\ mock.patch.object(async_process.AsyncProcess, "start"),\