From: Matteo Croce Date: Thu, 3 Apr 2025 10:57:37 +0000 (+0200) Subject: test logind restart with different classes X-Git-Tag: v258-rc1~918 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e39062b0ba913244da1fa8ac582afb6ff44652af;p=thirdparty%2Fsystemd.git test logind restart with different classes Test logind restart with every possible value of XDG_SESSION_CLASS --- diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index 01dece997ae..b19f42b524d 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -786,17 +786,23 @@ testcase_varlink() { } testcase_restart() { - local UNIT + local classes unit c - UNIT=user-sleeper.service + classes='user user-early user-incomplete greeter lock-screen background background-light manager manager-early' - systemd-run --service-type=notify run0 -u logind-test-user --unit="$UNIT" sleep infinity - systemctl restart systemd-logind + for c in $classes; do + unit="user-sleeper-$c.service" + systemd-run --service-type=notify run0 --setenv XDG_SESSION_CLASS="$c" -u logind-test-user --unit="$unit" sleep infinity + done - systemctl --quiet is-active "$UNIT" - loginctl | grep logind-test-user | grep -qw background + systemctl restart systemd-logind - systemctl kill "$UNIT" + for c in $classes; do + unit="user-sleeper-$c.service" + systemctl --quiet is-active "$unit" + loginctl | grep logind-test-user | grep -qw "$c" + systemctl kill "$unit" + done } setup_test_user