Enable test_agent_ovs_cleanup to be run alone

Fixed bug 1102243

Change-Id: I0d3df32301903a0ce8547fe50fd03222e1548a72
This commit is contained in:
Gary Kotton 2013-01-21 07:47:28 +00:00
parent 823b639513
commit b115445f77
1 changed files with 14 additions and 3 deletions

View File

@ -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)])