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 b1af575ddd7..3a72495b296 100644 --- a/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py +++ b/neutron/tests/unit/agent/linux/openvswitch_firewall/test_iptables.py @@ -73,14 +73,18 @@ class TestHelper(base.BaseTestCase): self.helper.int_br.get_port_name_list.return_value = [ 'tap1234', 'qvo-1234', 'tap9876', 'qvo-fghfhfh'] self.helper.int_br.db_get_val.return_value = {'foo': 'bar'} - self.helper.load_driver_if_needed() - self.assertIsNotNone(self.helper.iptables_driver) + with mock.patch.object(iptables_firewall.IptablesFirewallDriver, + '_check_netfilter_for_bridges'): + self.helper.load_driver_if_needed() + self.assertIsNotNone(self.helper.iptables_driver) def test_get_iptables_driver_instance_has_correct_instance(self): - instance = iptables.get_iptables_driver_instance() - self.assertIsInstance( - instance, - iptables_firewall.OVSHybridIptablesFirewallDriver) + with mock.patch.object(iptables_firewall.IptablesFirewallDriver, + '_check_netfilter_for_bridges'): + instance = iptables.get_iptables_driver_instance() + self.assertIsInstance( + instance, + iptables_firewall.OVSHybridIptablesFirewallDriver) def test_cleanup_port_last_port_marks_cleaned(self): self.helper.iptables_driver = mock.Mock() 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 000cac0cfe7..db90390e103 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 @@ -37,6 +37,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 iptables_firewall from neutron.agent.linux import utils as linux_utils from neutron.api.rpc.callbacks import resources from neutron.objects.ports import Port @@ -151,7 +152,9 @@ class TestOvsNeutronAgent(object): 'setup_ancillary_bridges', return_value=[]),\ mock.patch('neutron.agent.linux.ip_lib.get_device_mac', - return_value='00:00:00:00:00:01'),\ + return_value='00:00:00:00:00:01'), \ + mock.patch.object(iptables_firewall.IptablesFirewallDriver, + '_check_netfilter_for_bridges'), \ mock.patch( 'neutron.agent.common.ovs_lib.BaseOVS.get_bridges'),\ mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall', diff --git a/tox.ini b/tox.ini index 0b93928732d..1ceb5552f81 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ setenv = VIRTUAL_ENV={envdir} OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true} OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true} + OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180} PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY TOX_ENV_SRC_MODULES usedevelop = True