fullstack: skip test_mtu_update when DHCP agent is not in rootns

The test case requires access to devices created by DHCP agent. When the
agent is deployed with linuxbridge agent, we start it in a host-
namespace, and then it creates its own qdhcp- namespaces for dhcp ports
inside the host- namespace.

This could be solved by calling:
ip netns exec host-* ip netns exec qdhcp-* ip link show ...
but ip_lib doesn't support constructing such commands.

Of course, we could extend ip_lib to support this use case, but
currently we have larger dragons to fight. We will revisit the skip once
all agents are moved to namespaces as planned by jlibosva@.

This patch merely disables the test case if DHCP agent is running in a
namespace. We may revisit it when and if we feel comfortable making
significant changes to ip_lib.

Change-Id: Ieea83bf2959654f98b1dc4d7aa17138d0626ec40
Related-Bug: #1671634
This commit is contained in:
Ihar Hrachyshka 2017-08-29 20:10:12 +00:00
parent 5d98e30e5c
commit 1a5b796b06
1 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,13 @@ class TestDhcpAgentNoHA(BaseDhcpAgentTest):
self.vm.block_until_dhcp_config_done()
def test_mtu_update(self):
# The test case needs access to devices in nested namespaces. ip_lib
# doesn't support it, and it's probably unsafe to touch the library for
# testing matters.
# TODO(jlibosva) revisit when ip_lib supports nested namespaces
if self.environment.hosts[0].dhcp_agent.namespace is not None:
self.skip("ip_lib doesn't support nested namespaces")
self.vm.block_until_dhcp_config_done()
namespace = cmd._get_namespace_name(