From 74cfb929e4f16c39551ab6a3ab252fef7d9ea220 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 29 Apr 2024 12:16:16 +0200 Subject: [PATCH] test: adjust list-sessions for systemd 256 changes In systemd 256 list-session now also includes a manager session: 4 1000 admin - 538 user web console no - 5 1000 admin - 544 manager - no - --- test/verify/check-session | 3 ++- test/verify/check-static-login | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/verify/check-session b/test/verify/check-session index 188b8a591ae5..6ec49668c995 100755 --- a/test/verify/check-session +++ b/test/verify/check-session @@ -50,7 +50,8 @@ class TestSession(testlib.MachineCase): # Check session type if not m.ostree_image: - session_id = m.execute("loginctl list-sessions | awk '/admin/ {print $1}'").strip() + # Systemd 256 also shows a class=manager session for admin + session_id = m.execute("loginctl list-sessions | grep -v manager | awk '/admin/ {print $1}'").strip() self.assertEqual(m.execute(f"loginctl show-session -p Type {session_id}").strip(), "Type=web") # Logout diff --git a/test/verify/check-static-login b/test/verify/check-static-login index efff8bdec92f..91a3706bd969 100755 --- a/test/verify/check-static-login +++ b/test/verify/check-static-login @@ -830,6 +830,9 @@ matchrule = ^DC=LAN,DC=COCKPIT,CN=alice$ self.assertGreaterEqual(len(sessions), 1) for session in sessions: out = m.execute('loginctl session-status ' + session) + # Skip manager session + if "Class: manager" in out: + continue if "State: active" in out: # skip closing sessions self.assertIn(session_leader, out) self.assertIn('cockpit-bridge', out)