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 0000000000000000000000000000000000000000..3a82df966d7f2f167751c768f99a0b2c61449d0c
--- /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 0000000000000000000000000000000000000000..069cdf9df5c1a3447e56b0e278182a648f1617e3
--- /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 0000000000000000000000000000000000000000..733f673319031c03c91f4a8e78e24f8caf4a6143
--- /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