[lxc-devel] [lxc/master] tests: Support running on IPv6 networks

stgraber on Github lxc-bot at linuxcontainers.org
Tue Mar 21 20:24:43 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170321/8fd6996d/attachment.bin>
-------------- next part --------------
From f332b5d0a005fe6c1141d5867f619f7aff03d77f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 21 Mar 2017 16:23:27 -0400
Subject: [PATCH] tests: Support running on IPv6 networks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/tests/lxc-test-ubuntu | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/tests/lxc-test-ubuntu b/src/tests/lxc-test-ubuntu
index dc06804..a5e6204 100755
--- a/src/tests/lxc-test-ubuntu
+++ b/src/tests/lxc-test-ubuntu
@@ -61,7 +61,12 @@ for template in ubuntu ubuntu-cloud; do
 	done
 	[ -n "$lxcip" ] || FAIL "to start networking in $template container"
 
-	ping -c 1 $lxcip || FAIL "to ping $template container"
+	if echo "${lxcip}" | grep -q ":"; then
+		ping6 -c 1 $lxcip || FAIL "to ping $template container"
+	else
+		ping -c 1 $lxcip || FAIL "to ping $template container"
+	fi
+
 	# Check apparmor
 	lxcpid=`lxc-info -n $name -p -H`
 	aa=`cat /proc/$lxcpid/attr/current`


More information about the lxc-devel mailing list