From d18d1ef7c04a485aaee542e7e4adeed0268c27f0 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Thu, 30 Aug 2018 09:25:59 -0400
Subject: [PATCH] make the test suite a little more robust and verbose

---
 ...s-wrong-with-the-daemons-at-the-end-.patch | 21 +++++++++++++
 ...-a-random-loopback-IP-address-to-wor.patch | 30 +++++++++++++++++++
 debian/patches/series                         |  2 ++
 3 files changed, 53 insertions(+)
 create mode 100644 debian/patches/0001-display-what-goes-wrong-with-the-daemons-at-the-end-.patch
 create mode 100644 debian/patches/0002-testsuite-choose-a-random-loopback-IP-address-to-wor.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/0001-display-what-goes-wrong-with-the-daemons-at-the-end-.patch b/debian/patches/0001-display-what-goes-wrong-with-the-daemons-at-the-end-.patch
new file mode 100644
index 0000000..3a82df9
--- /dev/null
+++ b/debian/patches/0001-display-what-goes-wrong-with-the-daemons-at-the-end-.patch
@@ -0,0 +1,21 @@
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+Date: Thu, 30 Aug 2018 09:24:25 -0400
+Subject: display what goes wrong with the daemons at the end of the test
+ suite
+
+---
+ testsuite | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testsuite b/testsuite
+index b654557..fb7bded 100755
+--- a/testsuite
++++ b/testsuite
+@@ -49,6 +49,7 @@ section() {
+ 
+ cleanup () {
+     section "cleaning up"
++    tail "$d/"*.err
+     /usr/sbin/nginx -c "$d/nginx.conf" -p "$d" -s stop 2> "$d/nginx-stop.err" || true
+     kill %2 || true
+     kill %1 || true
diff --git a/debian/patches/0002-testsuite-choose-a-random-loopback-IP-address-to-wor.patch b/debian/patches/0002-testsuite-choose-a-random-loopback-IP-address-to-wor.patch
new file mode 100644
index 0000000..069cdf9
--- /dev/null
+++ b/debian/patches/0002-testsuite-choose-a-random-loopback-IP-address-to-wor.patch
@@ -0,0 +1,30 @@
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+Date: Thu, 30 Aug 2018 09:25:13 -0400
+Subject: testsuite: choose a random loopback IP address to work on
+
+---
+ testsuite | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testsuite b/testsuite
+index fb7bded..69fa0d6 100755
+--- a/testsuite
++++ b/testsuite
+@@ -17,7 +17,7 @@
+ #             if it already exists, it will not be cleaned up.
+ #  -  TESTIP: the IP address to use for testing.
+ #             the user needs to be able to open listening sockets, and to connect to them
+-#             by default, 127.7.8.9
++#             by default, choose a random IP in 127.0.0.0/8
+ 
+ # Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+ # 2018-08-29
+@@ -38,7 +38,7 @@ if [ -z "$WORKDIR" ]; then
+ else
+     d="$WORKDIR"
+ fi
+-ip="${TESTIP:-127.7.8.9}"
++ip="${TESTIP:-127.$(( $RANDOM % 256 )).$(( $RANDOM % 256 )).$(( $RANDOM % 256 ))}"
+ 
+ printf "hddemux test\n------------\n  binary: %s\n workdir: %s\n IP addr: %s\n" "$hddemux" "$d" "$ip"
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..733f673
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-display-what-goes-wrong-with-the-daemons-at-the-end-.patch
+0002-testsuite-choose-a-random-loopback-IP-address-to-wor.patch
-- 
GitLab