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
This commit is contained in:
Slawek Kaplonski 2018-05-23 15:13:42 -07:00
parent fab6bcbdcd
commit 8930d33c71
1 changed files with 3 additions and 0 deletions

View File

@ -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