From: Yu Watanabe Date: Wed, 26 Nov 2025 13:44:14 +0000 (+0900) Subject: TEST-35-LOGIN: fix bus path when the session does not have corresponding audit session X-Git-Tag: v259-rc3~29^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae2ccf9d6e8555600c78e3038d79fc3a6021e5ce;p=thirdparty%2Fsystemd.git TEST-35-LOGIN: fix bus path when the session does not have corresponding audit session If there is no corresponding audit session, then the session ID is prefixed with 'c', and in that case the session ID should be used as is in bus path. --- diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index 4c5e9a51bb7..c3dd11afa6c 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -25,6 +25,17 @@ setup_test_user() { trap cleanup_test_user EXIT } +session_bus_path() { + local session + + session=$(loginctl list-sessions --no-legend | grep -v manager | awk '$3 == "logind-test-user" { print $1 }') + if ! [[ "${session?}" =~ c[0-9]* ]]; then + # When numeric, bus path is prefixed with '_3' + session="_3${session}" + fi + echo "/org/freedesktop/login1/session/${session}" +} + test_write_dropin() { systemctl edit --runtime --stdin systemd-logind.service --drop-in=debug.conf <