From bd5c98e25b40ed4be749fd0880027407c4468d1e Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 26 May 2020 10:26:39 +0000 Subject: [PATCH] Mock command execution in "test_iptables.TestHelper" UTs Change-Id: I112e0a1cb45259c5af3bcbf09ae9f515f90723d0 Closes-Bug: #1880676 --- .../unit/agent/linux/openvswitch_firewall/test_iptables.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py b/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py index 28185a028de..a82f3c74041 100644 --- a/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py +++ b/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py @@ -17,6 +17,7 @@ from unittest import mock from neutron.agent.linux import iptables_firewall from neutron.agent.linux.openvswitch_firewall import iptables +from neutron.agent.linux import utils from neutron.tests import base @@ -25,6 +26,8 @@ class TestHelper(base.BaseTestCase): super(TestHelper, self).setUp() self.helper = iptables.Helper(mock.Mock()) mock.patch.object(iptables_firewall, 'cfg').start() + self.mock_execute = mock.patch.object(utils, 'execute', + return_value=False).start() mock.patch('neutron.agent.linux.ip_conntrack.get_conntrack').start() def test_get_hybrid_ports(self):