From: Sam Betts Date: Wed, 29 Apr 2015 15:15:35 +0000 (+0100) Subject: Ensure mocks for lla allocator _write in test_agent X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=9b7beb0e29d1de3e7cc787a3c0e20d24ccb0427c;p=openstack-build%2Fneutron-build.git Ensure mocks for lla allocator _write in test_agent The test test_create_dvr_fip_interfaces_for_restart_l3agent_case was causing a file fip-linklocal-networks to be created when the tests are run, this patch ensures that the correct part of the LinkLocalAllocator is patched to prevent this in the test case. Change-Id: Ifd0cae56324364b281a9279047b26a182b77905a Closes-Bug: 1450090 --- diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index a9b17966c..bdf62fbbd 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -1217,7 +1217,9 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): agent_gateway_port[0]) self.assertTrue(ri.rtr_fip_subnet) - def test_create_dvr_fip_interfaces_for_restart_l3agent_case(self): + @mock.patch.object(lla.LinkLocalAllocator, '_write') + def test_create_dvr_fip_interfaces_for_restart_l3agent_case(self, + lla_write): fake_floatingips = {'floatingips': [ {'id': _uuid(), 'floating_ip_address': '20.0.0.3',