Blob Blame History Raw
From 4754bd5a62283359caa0867c4e6a463d2c62193c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
Date: Wed, 27 Apr 2016 20:58:33 +0200
Subject: [PATCH] test: booth cannot cope with <address>%<device> IPv6
 addresses

...at least for the time being.  So craft ::1 address in that case
as a substitute.
---
 test/utils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/utils.py b/test/utils.py
index cbbd8d4..ceeef98 100755
--- a/test/utils.py
+++ b/test/utils.py
@@ -12,5 +12,7 @@ def get_IP():
     (stdout, stderr, returncode) = run_cmd(['hostname', '-i'])
     if returncode != 0:
         raise RuntimeError, "Failed to run hostname -i:\n" + stderr
-    # in case multiple IP addresses are returned, use only the first.
-    return re.sub(r'\s.*', '', stdout)
+    # in case multiple IP addresses are returned, use only the first
+    # and also strip '%<device>' part possibly present with IPv6 address
+    ret = re.sub(r'\s.*', '', stdout)
+    return "::1" if '%' in ret else ret
-- 
2.4.11