]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: systemd-update-utmp is optional
authorFranck Bui <fbui@suse.com>
Tue, 6 Feb 2024 13:46:53 +0000 (14:46 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 7 Feb 2024 10:00:20 +0000 (11:00 +0100)
It can be disabled with '-Dutmp=false'

test/units/testsuite-01.sh

index 870b62da9aba05f0f39ca5af0741518aaccb1cf0..bb3ff2f1e9e5ce9919d26ee8e792a0cb836a557a 100755 (executable)
@@ -48,14 +48,16 @@ systemd-analyze blame
 # Test for 'systemd-update-utmp runlevel' vs 'systemctl daemon-reexec'.
 # See issue #27163.
 # shellcheck disable=SC2034
-for _ in {0..10}; do
-    systemctl daemon-reexec &
-    pid_reexec=$!
-    # shellcheck disable=SC2034
+if [[ -x /usr/lib/systemd/systemd-update-utmp ]]; then
     for _ in {0..10}; do
-        SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-update-utmp runlevel
+        systemctl daemon-reexec &
+        pid_reexec=$!
+        # shellcheck disable=SC2034
+        for _ in {0..10}; do
+            SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-update-utmp runlevel
+        done
+        wait "$pid_reexec"
     done
-    wait "$pid_reexec"
-done
+fi
 
 touch /testok