From 45ae2e45c41c2418ebc58fbd0f2921ab662fd4c4 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Wed, 23 May 2018 15:13:42 -0700 Subject: [PATCH] Fix UT BridgeLibTest when IPv6 is disabled There was missing mock of ipv6_utils.is_enabled_and_bind_by_default() in BridgeLibTest unit tests and that cause failing some of tests from this module when tests are running on host with disabled IPv6. Now it's mocked and tests are running properly and are testing what they should test. Closes-Bug: #1773818 Change-Id: I9144450ce85e020c0e33c5214a2178acbbbf5f54 (cherry picked from commit 8930d33c71e394c1cfaa1b9ad5493c79d394cb40) --- neutron/tests/unit/agent/linux/test_bridge_lib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neutron/tests/unit/agent/linux/test_bridge_lib.py b/neutron/tests/unit/agent/linux/test_bridge_lib.py index 357abeb1c77..1cbe3e643c6 100644 --- a/neutron/tests/unit/agent/linux/test_bridge_lib.py +++ b/neutron/tests/unit/agent/linux/test_bridge_lib.py @@ -29,6 +29,9 @@ class BridgeLibTest(base.BaseTestCase): def setUp(self): super(BridgeLibTest, self).setUp() + mock.patch( + 'neutron.common.ipv6_utils.is_enabled_and_bind_by_default', + return_value=True).start() ip_wrapper = mock.patch('neutron.agent.linux.ip_lib.IPWrapper').start() self.execute = ip_wrapper.return_value.netns.execute