[Debian-ha-commits] [booth] 02/03: d/patches: add fix for unit tests in Ubuntu (Closes: #895179)

Valentin Vidic vvidic-guest at moszumanska.debian.org
Tue Apr 10 09:19:12 UTC 2018


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository booth.

commit 9e0be379976c0031fce9572b310f303fbaff415b
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Mon Apr 9 20:04:40 2018 +0200

    d/patches: add fix for unit tests in Ubuntu (Closes: #895179)
---
 debian/patches/series                              |  1 +
 .../wrong-local-ip-assumption-in-tests.patch       | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 89a810a..16ca1b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 gcc-7-buffer-size.patch
 fix-failing-unit-tests.patch
 spelling.patch
+wrong-local-ip-assumption-in-tests.patch
diff --git a/debian/patches/wrong-local-ip-assumption-in-tests.patch b/debian/patches/wrong-local-ip-assumption-in-tests.patch
new file mode 100644
index 0000000..cb65c77
--- /dev/null
+++ b/debian/patches/wrong-local-ip-assumption-in-tests.patch
@@ -0,0 +1,24 @@
+Description: don't assume `hostname` must map to a configured IP
+ On Ubuntu systems, by default, `hostname -i` will point to 127.0.1.1.  This
+ address works for connections both to and from the loopback interface, but
+ does not show up as a configured address via netlink, which means booth
+ will fail to recognize it as a valid address.
+ .
+ This is only used in the tests, so just patch this out to use 127.0.0.1
+ explicitly instead of by resolving the hostname.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+
+Index: booth-1.0/test/utils.py
+===================================================================
+--- booth-1.0.orig/test/utils.py
++++ booth-1.0/test/utils.py
+@@ -9,8 +9,6 @@
+     return (stdout, stderr, p.returncode)
+ 
+ def get_IP():
+-    (stdout, stderr, returncode) = run_cmd(['hostname', '-i'])
+-    if returncode != 0:
+-        return '127.0.0.1'
++    return '127.0.0.1'
+     # in case multiple IP addresses are returned, use only the first.
+     return re.sub(r'\s.*', '', stdout)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/booth.git



More information about the Debian-HA-Commits mailing list