From: Gary Kotton Date: Mon, 21 Jan 2013 07:47:28 +0000 (+0000) Subject: Enable test_agent_ovs_cleanup to be run alone X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2daeeba8ab805c11c33e07690eca1204a88f914f;p=openstack-build%2Fneutron-build.git Enable test_agent_ovs_cleanup to be run alone Fixed bug 1102243 Change-Id: I0d3df32301903a0ce8547fe50fd03222e1548a72 --- diff --git a/quantum/tests/unit/test_agent_ovs_cleanup.py b/quantum/tests/unit/test_agent_ovs_cleanup.py index e05054ca2..d82f4103d 100644 --- a/quantum/tests/unit/test_agent_ovs_cleanup.py +++ b/quantum/tests/unit/test_agent_ovs_cleanup.py @@ -36,6 +36,17 @@ class TestOVSCleanup(unittest.TestCase): mock_get_bridges.return_value = ['br-int', 'br-ex'] with mock.patch( 'quantum.agent.linux.ovs_lib.OVSBridge') as ovs: - util.main() - ovs.assert_has_calls([mock.call().delete_ports( - all_ports=False)]) + setup_conf = mock.patch( + 'quantum.agent.ovs_cleanup_util.setup_conf') + with setup_conf as mock_setup_conf: + conf = mock.Mock() + confroot_helper = 'sudo' + conf.ovs_all_ports = False + conf.ovs_integration_bridge = 'br-int' + conf.external_network_bridge = 'br-ex' + + mock_setup_conf.return_value = conf + + util.main() + ovs.assert_has_calls([mock.call().delete_ports( + all_ports=False)])