1
0
mirror of https://github.com/lxc/python3-lxc.git synced 2026-02-05 18:48:46 +01:00

api_test: fix interfaces comparison failure

When the host has kernel module sit or ipip inserted, additional network
interfaces sit0 and/or tunl0 would appear inside the container by
default as well, which fails the api_test.

This change append sit0/tunl0 to expected interfaces when applicable.

Closes: #2
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
This commit is contained in:
You-Sheng Yang
2019-09-18 17:23:41 +08:00
parent 0c5bc706b5
commit 69c41ef513

View File

@@ -106,7 +106,12 @@ assert(container.state == "RUNNING")
## Checking IP address
print("Getting the interface names")
assert(set(container.get_interfaces()) == set(('lo', 'eth0')))
expected_ifs = set(('lo', 'eth0'))
if os.path.isdir('/sys/module/sit'):
expected_ifs.add('sit0')
if os.path.isdir('/sys/module/ipip'):
expected_ifs.add('tunl0')
assert(set(container.get_interfaces()) == expected_ifs)
## Checking IP address
print("Getting the IP addresses")