Mock check if ipv6 is enabled in L3 agent unit tests

Without this mock UT related configure_ipv6 method were failing
e.g. on systems when IPv6 was disabled or on systems where such
check should be done differently, like MacOS.

Change-Id: I6d13ab1db1d5465b2ff6abf6499e0d17e1ee8bbb
Slawek Kaplonski 2019-04-10 18:44:26 +02:00
parent 0dc638c388
commit c20b5e347d
1 changed files with 5 additions and 1 deletions

View File

@ -271,7 +271,11 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
def _test__configure_ipv6_params_helper(self, state, gw_port_id):
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
with mock.patch(
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
router_info = l3router.RouterInfo(agent, _uuid(), {}, **self.ri_kwargs)
if gw_port_id:
router_info.ex_gw_port = {'id': gw_port_id}