From b58b13f1c691f396acb32e20063c0411c1fe0bf2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 25 Oct 2024 11:31:38 +0200 Subject: [PATCH] test: add brief testcase for systemd-run disconnect handling --- test/units/TEST-74-AUX-UTILS.run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/units/TEST-74-AUX-UTILS.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh index 903ddde70ef..83ae352943f 100755 --- a/test/units/TEST-74-AUX-UTILS.run.sh +++ b/test/units/TEST-74-AUX-UTILS.run.sh @@ -272,3 +272,6 @@ if [[ -e /usr/lib/pam.d/systemd-run0 ]] || [[ -e /etc/pam.d/systemd-run0 ]]; the assert_neq "$(run0 --pty tty < /dev/null)" "not a tty" assert_eq "$(run0 --pipe tty < /dev/null)" "not a tty" fi + +# Tests whether intermediate disconnects corrupt us (modified testcase from https://github.com/systemd/systemd/issues/27204) +assert_rc "37" systemd-run --unit=disconnecttest --wait --pipe --user -M testuser@.host bash -ec 'systemctl --user daemon-reexec; sleep 3; exit 37'