From: Jakub Ružička Date: Mon, 23 Sep 2024 14:59:52 +0000 (+0200) Subject: tests/packaging: skip systemd tests without systemd X-Git-Tag: v6.0.9~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f85472c52b6972877116d44e5688a4028f9ec55;p=thirdparty%2Fknot-resolver.git tests/packaging: skip systemd tests without systemd --- diff --git a/tests/packaging/systemd_service.sh b/tests/packaging/systemd_service.sh index 9dec16ab8..a4425385c 100755 --- a/tests/packaging/systemd_service.sh +++ b/tests/packaging/systemd_service.sh @@ -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