]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Enable test_agent_ovs_cleanup to be run alone
authorGary Kotton <gkotton@redhat.com>
Mon, 21 Jan 2013 07:47:28 +0000 (07:47 +0000)
committerGary Kotton <gkotton@redhat.com>
Mon, 21 Jan 2013 07:47:28 +0000 (07:47 +0000)
Fixed bug 1102243

Change-Id: I0d3df32301903a0ce8547fe50fd03222e1548a72

quantum/tests/unit/test_agent_ovs_cleanup.py

index e05054ca2852a177d0121b52c9e58f0bd81d72af..d82f4103d0c71439a275d5bfe73d2f5c2bc1a27d 100644 (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)])