summaryrefslogtreecommitdiffstats
path: root/debian/tests/shellcheck
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/shellcheck36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/tests/shellcheck b/debian/tests/shellcheck
new file mode 100755
index 0000000..e85e422
--- /dev/null
+++ b/debian/tests/shellcheck
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -eu
+
+. "$(dirname "$0")/shared-functions.sh"
+
+testname="$(basename "$0")"
+pkgname="libnss-test-$testname"
+
+nss_lines="
+passwd last mynss
+group before=files mynss
+shadow after=files mynss [!SUCCESS=notfound]
+gshadow first mynss [NOTFOUND=return]
+hosts remove-only mynss
+protocols after=db mynss skip-if-present=files
+"
+
+echo "Set up and build test package..."
+cd "$AUTOPKGTEST_TMP"
+mkdir "$pkgname"
+cd "$pkgname"
+setup_pkg "$pkgname" "$testname"
+build_pkg "$pkgname" "1" "$nss_lines"
+
+echo "Extract maintscripts..."
+cd "$AUTOPKGTEST_TMP"
+dpkg-deb -e "${pkgname}_1_all.deb" control
+
+echo "Check for errors and warnings..."
+cd control/
+test -s postinst
+test -s postrm
+shellcheck postinst
+shellcheck postrm
+echo "OK"