]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Ensure mocks for lla allocator _write in test_agent
authorSam Betts <sam@code-smash.net>
Wed, 29 Apr 2015 15:15:35 +0000 (16:15 +0100)
committerSam Betts <sam@code-smash.net>
Wed, 29 Apr 2015 16:25:46 +0000 (17:25 +0100)
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

index a9b17966ca212a7c3a63dde491932c74a714c8a2..bdf62fbbd9909aa14bcc659161815566ab288678 100644 (file)
@@ -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',