From 2a1694445315d1a75c58dd8ccf8c9b80abb3b720 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 26 May 2020 16:00:11 +0000 Subject: [PATCH] Mock command execution in "test_hybrid_plug_flag_based_on_firewall" UT Change-Id: Ibafbacb7a1471c06b7456878f530e92419447123 Related-Bug: #1880676 --- .../ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ed852ef02f8..097533b8db3 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 @@ -36,6 +36,7 @@ from neutron.agent.common import ovs_lib from neutron.agent.common import polling from neutron.agent.common import utils from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils as linux_utils from neutron.api.rpc.callbacks import resources from neutron.objects.ports import Port from neutron.objects.ports import PortBinding @@ -1193,7 +1194,8 @@ class TestOvsNeutronAgent(object): def test_process_network_port_with_empty_port(self): self._test_process_network_ports({}) - def test_hybrid_plug_flag_based_on_firewall(self): + @mock.patch.object(linux_utils, 'execute', return_value=False) + def test_hybrid_plug_flag_based_on_firewall(self, *args): cfg.CONF.set_default( 'firewall_driver', 'neutron.agent.firewall.NoopFirewallDriver',