The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/python3-lxc/pull/13

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
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 <vic...@gmail.com>
From 69c41ef51363539226fa362be6f459d39ff1e2cc Mon Sep 17 00:00:00 2001
From: You-Sheng Yang <vic...@gmail.com>
Date: Wed, 18 Sep 2019 17:23:41 +0800
Subject: [PATCH] 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 <vic...@gmail.com>
---
 examples/api_test.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/api_test.py b/examples/api_test.py
index 1934a23..4aeff01 100755
--- a/examples/api_test.py
+++ b/examples/api_test.py
@@ -106,7 +106,12 @@
 
 ## 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")
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to