]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: wait for sessions being closed
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 May 2024 05:00:12 +0000 (14:00 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 17 May 2024 07:13:52 +0000 (09:13 +0200)
If a session in closing state, the user state will be in online.

Fixes #32698.

test/units/TEST-35-LOGIN.sh

index 0f4b770de31053a9525c25502760e1aa73e33d9d..1ad06526e64ac1b40a63c63d594f1685fe2b16f5 100755 (executable)
@@ -596,7 +596,7 @@ testcase_list_users_sessions_seats() {
         return
     fi
 
-    assert_eq "$(loginctl list-users --no-legend | awk '$2 == "logind-test-user" { print $4 }')" lingering
+    timeout 30 bash -c "until [[ \"\$(loginctl list-users --no-legend | awk '\$2 == \"logind-test-user\" { print \$4 }')\" == lingering ]]; do sleep 1; done"
 }
 
 teardown_stop_idle_session() (