chiark / gitweb /
adt-initscript: New autopkgtest
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2023 15:41:28 +0000 (15:41 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2023 17:02:10 +0000 (17:02 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
adt/adt-initscript [new file with mode: 0755]
debian/hippotat-server.hippotatd.init
debian/tests/control

diff --git a/adt/adt-initscript b/adt/adt-initscript
new file mode 100755 (executable)
index 0000000..e4e6b38
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Tests that we can start, stop, and restart.
+
+set -e
+. "${0%/*}"/acommon
+
+test-prep
+
+perl <test/test.cfg >/etc/hippotat/main.cfg -pe '
+       s{^addrs *=.*}{addrs = 127.0.0.1};
+'
+
+cat >>/etc/default/hippotatd <<END
+CHECK_FIREWALL=false
+USER=root
+END
+
+service hippotatd start
+curl http://localhost:8099/ | tee /dev/stderr | grep hippotat
+
+dpid=$(pidof hippotatd)
+
+service hippotatd restart
+
+dpid2=$(pidof hippotatd)
+
+test $dpid != $dpid2
+
+service hippotatd stop
+
+( LC_MESSAGES=C nc -v localhost 8099 2>&1 ||: ) \
+    | tee /dev/stderr | grep 'Connection refused'
+
+echo ok.
index a43ed2952bf734d38dd9c801875f6f151bd91331..04e1ddb5a5acc120e4d584f752f198870c0c6563 100644 (file)
@@ -59,6 +59,7 @@ print_config () {
 }
 
 check_firewall () {
+       $CHECK_FIREWALL || return 0
        vnetwork=$(print_config vnetwork)
        if dump_firewall | fgrep " $vnetwork " >/dev/null; then :; else
                log_failure_msg \
index b4d03fd936165956cf960983235b8d2a8e183f96..7e8eed54399111b1f49878bff9366d6dba6e2a6f 100644 (file)
@@ -6,3 +6,12 @@ Depends:
   rsyslog, authbind, iptables,
   bash, iproute2, util-linux, iputils-ping
 Restrictions: needs-root, allow-stderr
+
+Tests: adt-initscript
+Tests-Directory: adt
+Depends:
+  hippotat-server,
+  net-tools,
+  rsyslog,
+  bash, userv-utils, netcat-openbsd, curl
+Restrictions: needs-root, allow-stderr