]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add a missing session activation
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 22 May 2023 13:08:29 +0000 (15:08 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 22 May 2023 14:02:49 +0000 (16:02 +0200)
Otherwise test_list_user_sessions() would fail unless ordered after
test_session(), which activates the session.

test/units/testsuite-35.sh

index 8cb380d2fd331f2d1c2b07374d180c2a3babd345..cd24fee9e534dc4543a16892806477072b603b0c 100755 (executable)
@@ -529,6 +529,9 @@ test_list_users_sessions() {
     trap cleanup_session RETURN
     create_session
 
+    # Activate the session
+    loginctl activate "$(loginctl --no-legend | awk '$3 == "logind-test-user" { print $1 }')"
+
     assert_eq "$(loginctl list-users --no-legend | awk '$2 == "logind-test-user" { print $1 }')" "$(id -ru logind-test-user)"
     assert_eq "$(loginctl list-users --no-legend | awk '$2 == "logind-test-user" { print $3 }')" no
     assert_eq "$(loginctl list-users --no-legend | awk '$2 == "logind-test-user" { print $4 }')" active
@@ -638,6 +641,7 @@ EOF
 : >/failed
 
 setup_test_user
+test_list_users_sessions
 test_enable_debug
 test_properties
 test_started
@@ -647,7 +651,6 @@ test_sanity_check
 test_session
 test_lock_idle_action
 test_session_properties
-test_list_users_sessions
 test_stop_idle_session
 test_ambient_caps