From 9b7beb0e29d1de3e7cc787a3c0e20d24ccb0427c Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 29 Apr 2015 16:15:35 +0100 Subject: [PATCH] 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 --- neutron/tests/unit/agent/l3/test_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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', -- 2.45.2