diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index 4c5e9a51bb..c3dd11afa6 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 <