]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests/packaging: skip systemd tests without systemd
authorJakub Ružička <jakub.ruzicka@nic.cz>
Mon, 23 Sep 2024 14:59:52 +0000 (16:59 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 30 Sep 2024 09:16:07 +0000 (11:16 +0200)
tests/packaging/systemd_service.sh

index 9dec16ab8ad3a50c533ad72287a9385f2fdacf1f..a4425385cf3012342533e4341e2b04944a13777f 100755 (executable)
@@ -9,6 +9,14 @@ if test "$(id -u)" -ne 0; then
        exit 1
 fi
 
+# SKIP test when systemd isn't PID 1
+if [[ -d /run/systemd/system ]] ; then
+       echo "systemd detected -> RUN systemd tests"
+else
+       echo "systemd not detected -> SKIP systemd tests"
+       exit 77
+fi
+
 # We will be starting a systemd service, but another tests might do the same
 # so this makes sure there is nothing left after we exit
 trap "systemctl stop knot-resolver.service" EXIT