]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: wait systemd to finish reexec in TEST-74-AUX-UTILS.varlinkctl.sh
authorIvan Kruglov <mail@ikruglov.com>
Mon, 18 May 2026 07:45:23 +0000 (00:45 -0700)
committerIvan Kruglov <mail@ikruglov.com>
Tue, 19 May 2026 09:05:55 +0000 (11:05 +0200)
test/units/TEST-74-AUX-UTILS.varlinkctl.sh

index 0836883f24cd11092273a419d30a2ac3d9ff1c9f..ec71e2641e0d587f660d6754320f252a857e3d4b 100755 (executable)
@@ -204,6 +204,14 @@ varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}'
 varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Reload '{}'
 # This will disconnect and fail, as the manager reexec and drops connections
 varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Reexecute '{}' ||:
+# Wait for the manager to finish re-exec before proceeding — the user manager
+# tests below use systemd-run which requires a functional PID 1.
+for _ in {1..10}; do
+    if systemctl is-system-running 2>/dev/null | grep -qE 'running|degraded'; then
+        break
+    fi
+    sleep 1
+done
 
 # test io.systemd.Manager in user manager
 testuser_uid=$(id -u testuser)