unbound: add test.sh
authorAlexandru Ardelean <redacted>
Wed, 6 May 2026 06:23:11 +0000 (09:23 +0300)
committerAlexandru Ardelean <redacted>
Wed, 6 May 2026 18:05:36 +0000 (21:05 +0300)
unbound-control-setup is a shell script that generates TLS certificates
for unbound-control; it does not print a version string. The generic CI
test framework cannot verify the version via the binary, causing the
"No executables in the package provided version" failure.

Add a package-specific test.sh that:
 - tests unbound-daemon version via 'unbound -V' and config file presence
 - tests libunbound shared library presence
 - tests unbound-anchor/-checkconf/-control/-host binaries run and
   respond to -h without starting the daemon
 - tests unbound-control-setup as an installed, executable shell script
   containing expected keywords (no version check)

Signed-off-by: Alexandru Ardelean <redacted>
net/unbound/test.sh [new file with mode: 0644]

diff --git a/net/unbound/test.sh b/net/unbound/test.sh
new file mode 100644 (file)
index 0000000..7753456
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+case "$1" in
+unbound-daemon)
+       unbound -V 2>&1 | grep -F "$2"
+       [ -f /etc/unbound/unbound.conf ] || { echo "FAIL: /etc/unbound/unbound.conf not installed"; exit 1; }
+       ;;
+
+libunbound)
+       ls /usr/lib/libunbound.so.* > /dev/null
+       ;;
+
+unbound-anchor)
+       [ -x /usr/sbin/unbound-anchor ] || { echo "FAIL: unbound-anchor not executable"; exit 1; }
+       unbound-anchor -h 2>&1 | grep -qi "unbound\|anchor\|usage\|option"
+       ;;
+
+unbound-checkconf)
+       [ -x /usr/sbin/unbound-checkconf ] || { echo "FAIL: unbound-checkconf not executable"; exit 1; }
+       unbound-checkconf -h 2>&1 | grep -qi "unbound\|usage\|option\|config"
+       ;;
+
+unbound-control)
+       [ -x /usr/sbin/unbound-control ] || { echo "FAIL: unbound-control not executable"; exit 1; }
+       unbound-control -h 2>&1 | grep -qi "unbound\|usage\|option"
+       ;;
+
+unbound-control-setup)
+       # Shell script — no version string; just verify it is installed
+       [ -x /usr/sbin/unbound-control-setup ] || {
+               echo "FAIL: unbound-control-setup not executable"
+               exit 1
+       }
+       grep -q "openssl\|unbound" /usr/sbin/unbound-control-setup
+       ;;
+
+unbound-host)
+       [ -x /usr/sbin/unbound-host ] || { echo "FAIL: unbound-host not executable"; exit 1; }
+       unbound-host -h 2>&1 | grep -qi "unbound\|usage\|option"
+       ;;
+esac
git clone https://git.99rst.org/PROJECT