]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Add a test for the case seat0 has CanGraphical=false on startup
authorRobert Ancell <robert.ancell@canonical.com>
Fri, 5 Sep 2014 03:44:22 +0000 (15:44 +1200)
committerRobert Ancell <robert.ancell@canonical.com>
Fri, 5 Sep 2014 03:44:22 +0000 (15:44 +1200)
tests/Makefile.am
tests/scripts/multi-seat-seat0-non-graphical.conf [new file with mode: 0644]
tests/src/test-runner.c
tests/test-multi-seat-seat0-non-graphical [new file with mode: 0755]

index 1685d28365ce75bcfeac8297daa14ef2b0dce6ae..3e5dca298a7b4caf4207526a80691812b2e5863d 100644 (file)
@@ -181,6 +181,7 @@ TESTS = \
        test-open-file-descriptors \
        test-xdmcp-server-open-file-descriptors \
        test-multi-seat \
+       test-multi-seat-seat0-non-graphical \
        test-multi-seat-non-graphical \
        test-multi-seat-change-graphical \
        test-mir-autologin \
@@ -446,8 +447,9 @@ EXTRA_DIST = \
        scripts/mir-session-compositor-crash.conf \
        scripts/mir-session-crash.conf \
        scripts/multi-seat.conf \
-       scripts/multi-seat-non-graphical.conf \
        scripts/multi-seat-change-graphical.conf \
+       scripts/multi-seat-non-graphical.conf \
+       scripts/multi-seat-seat0-non-graphical.conf \
        scripts/no-accounts-service.conf \
        scripts/no-config.conf \
        scripts/no-console-kit.conf \
diff --git a/tests/scripts/multi-seat-seat0-non-graphical.conf b/tests/scripts/multi-seat-seat0-non-graphical.conf
new file mode 100644 (file)
index 0000000..b392595
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Check seat0 is started only once it becomes graphical
+#
+
+[test-runner-config]
+seat0-can-graphical=false
+
+#?*START-DAEMON
+#?RUNNER DAEMON-START
+
+# Check no seat is added
+#?*WAIT
+
+# Go graphical
+#?*UPDATE-SEAT ID=seat0 CAN-GRAPHICAL=TRUE
+
+# seat0 starts
+#?XSERVER-0 START VT=7 SEAT=seat0
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_SESSION_CLASS=greeter
+#?LOGIN1 ACTIVATE-SESSION SESSION=c0
+#?XSERVER-0 ACCEPT-CONNECT
+#?GREETER-X-0 CONNECT-XSERVER
+#?GREETER-X-0 CONNECT-TO-DAEMON
+#?GREETER-X-0 CONNECTED-TO-DAEMON
+
+# Cleanup
+#?*STOP-DAEMON
+#?GREETER-X-0 TERMINATE SIGNAL=15
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
index 2dfcfd9663662f5e55e47ccc60142291f1e91d65..8136872d2c9985219134e397ec9ffadeb09898f8 100644 (file)
@@ -1839,6 +1839,7 @@ login1_name_acquired_cb (GDBusConnection *connection,
         handle_login1_call,
     };
     GDBusNodeInfo *login1_info;
+    Login1Seat *seat0;
     GError *error = NULL;
 
     login1_info = g_dbus_node_info_new_for_xml (login1_interface, &error);
@@ -1859,7 +1860,11 @@ login1_name_acquired_cb (GDBusConnection *connection,
     g_dbus_node_info_unref (login1_info);
 
     /* We always have seat0 */
-    add_login1_seat (connection, "seat0", FALSE);
+    seat0 = add_login1_seat (connection, "seat0", FALSE);
+    if (g_key_file_has_key (config, "test-runner-config", "seat0-can-graphical", NULL))
+        seat0->can_graphical = g_key_file_get_boolean (config, "test-runner-config", "seat0-can-graphical", NULL);
+    if (g_key_file_has_key (config, "test-runner-config", "seat0-can-multi-session", NULL))
+        seat0->can_multi_session = g_key_file_get_boolean (config, "test-runner-config", "seat0-can-multi-session", NULL);
 
     service_count--;
     if (service_count == 0)
diff --git a/tests/test-multi-seat-seat0-non-graphical b/tests/test-multi-seat-seat0-non-graphical
new file mode 100755 (executable)
index 0000000..3f16c91
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner multi-seat-seat0-non-graphical test-gobject-greeter