You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
systemd/SOURCES/0299-test-add-a-missing-ses...

46 lines
1.5 KiB

From 3d3681dd81ad5bbae8eab7c1b4487f97678cc875 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Mon, 22 May 2023 15:08:29 +0200
Subject: [PATCH] test: add a missing session activation
Otherwise test_list_user_sessions() would fail unless ordered after
test_session(), which activates the session.
(cherry picked from commit 587ae50d5529d4f312cc95ce8f0ece688c9672dc)
Related: #2209912
---
test/units/testsuite-35.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/units/testsuite-35.sh b/test/units/testsuite-35.sh
index c9b2417bb7..09009fc257 100755
--- a/test/units/testsuite-35.sh
+++ b/test/units/testsuite-35.sh
@@ -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
@@ -586,6 +589,7 @@ EOF
: >/failed
setup_test_user
+test_list_users_sessions
test_enable_debug
test_properties
test_started
@@ -595,7 +599,6 @@ test_sanity_check
test_session
test_lock_idle_action
test_session_properties
-test_list_users_sessions
test_stop_idle_session
touch /testok