summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorRichard Hansen <rhansen@rhansen.org>2023-04-17 04:33:07 -0400
committerRobert Ancell <robert.ancell@gmail.com>2023-04-28 13:34:51 +1200
commite520b32f9c4ab67b704874341f95925980349eab (patch)
tree5d02787d3a1e6c7871a443635c017906ff63f976 /tests/src
parentc84feb03279e7b1993e5307d4542e02bd5475629 (diff)
downloadlightdm-git-e520b32f9c4ab67b704874341f95925980349eab.tar.gz
Disable user switching if logind says it isn't supported
This should work now that seat_local_get_active_session returns the proper value for non-seat0 seats. Note: systemd-logind v245 and older erroneously report CanMultiSession=no on non-seat0 seats even when it is supported. This change will break those users. See <https://github.com/systemd/systemd/pull/15337>.
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test-runner.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c
index 118c786f..7de9694c 100644
--- a/tests/src/test-runner.c
+++ b/tests/src/test-runner.c
@@ -697,10 +697,11 @@ handle_command (const gchar *command)
}
else if (strcmp (name, "SEAT-CAN-SWITCH") == 0)
{
+ const gchar *path = g_hash_table_lookup (params, "PATH");
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) result = g_dbus_connection_call_sync (dbus_conn,
"org.freedesktop.DisplayManager",
- "/org/freedesktop/DisplayManager/Seat0",
+ path ? path : "/org/freedesktop/DisplayManager/Seat0",
"org.freedesktop.DBus.Properties",
"Get",
g_variant_new ("(ss)", "org.freedesktop.DisplayManager.Seat", "CanSwitch"),
@@ -711,6 +712,8 @@ handle_command (const gchar *command)
&error);
g_autoptr(GString) status = g_string_new ("RUNNER SEAT-CAN-SWITCH");
+ if (path)
+ g_string_append_printf (status, " PATH=%s", path);
if (result)
{
g_autoptr(GVariant) value = NULL;