]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Fix desktop-session-start upstart signal not being emitted since 1.7.5
authorRobert Ancell <robert.ancell@canonical.com>
Mon, 29 Jul 2013 21:56:32 +0000 (22:56 +0100)
committerRobert Ancell <robert.ancell@canonical.com>
Mon, 29 Jul 2013 21:56:32 +0000 (22:56 +0100)
src/seat.c
tests/Makefile.am
tests/scripts/upstart-autologin.conf [new file with mode: 0644]
tests/scripts/upstart-login.conf [new file with mode: 0644]
tests/src/Makefile.am
tests/src/initctl.c
tests/test-upstart-autologin [new file with mode: 0755]
tests/test-upstart-login [new file with mode: 0755]

index 2bf0cb6ed66b7c73a6d26c7f22857984e08ccbf6..a1d34ee3552ecf2a8113d6564bffcf590e88ade9 100644 (file)
@@ -454,7 +454,10 @@ run_session (Seat *seat, Session *session)
     }
 
     if (!IS_GREETER (session))
+    {
         g_signal_emit (seat, signals[RUNNING_USER_SESSION], 0, session);
+        emit_upstart_signal ("desktop-session-start");
+    }
 
     session_run (session);
 
index ec7383377a9bdf44827cacf55d6fb3b520476302..ad12efa7c6b8cc137e729de43cf034a98998ec7c 100644 (file)
@@ -125,6 +125,8 @@ TESTS = \
        test-script-hook-fail-display-setup \
        test-script-hook-fail-greeter-setup \
        test-script-hook-fail-session-setup \
+       test-upstart-autologin \
+       test-upstart-login \
        test-dbus \
        test-lock-seat \
        test-lock-seat-return-session \
@@ -388,6 +390,8 @@ EXTRA_DIST = \
        scripts/unity-login.conf \
        scripts/unity-plymouth.conf \
        scripts/unity-switch.conf \
+       scripts/upstart-autologin.conf \
+       scripts/upstart-login.conf \
        scripts/users.conf \
        scripts/util-path.conf \
        scripts/user-renamed.conf \
diff --git a/tests/scripts/upstart-autologin.conf b/tests/scripts/upstart-autologin.conf
new file mode 100644 (file)
index 0000000..9b17f28
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# Check emits upstart events on autologin
+#
+
+[SeatDefaults]
+autologin-user=have-password1
+user-session=default
+
+[test-initctl-config]
+report-events=true
+
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER-0 START VT=7
+
+# Daemon connects when X server is ready
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+
+#?INIT -q emit login-session-start DISPLAY_MANAGER=lightdm
+#?INIT -q emit desktop-session-start DISPLAY_MANAGER=lightdm
+
+# Session starts
+#?SESSION-X-0 START USER=have-password1
+#?XSERVER-0 ACCEPT-CONNECT
+#?SESSION-X-0 CONNECT-XSERVER
+
+# Cleanup
+#?*STOP-DAEMON
+#?SESSION-X-0 TERMINATE SIGNAL=15
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
diff --git a/tests/scripts/upstart-login.conf b/tests/scripts/upstart-login.conf
new file mode 100644 (file)
index 0000000..6b83f18
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Check emits upstart events on login
+#
+
+[SeatDefaults]
+user-session=default
+
+[test-initctl-config]
+report-events=true
+
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER-0 START VT=7
+
+# Daemon connects when X server is ready
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+
+#?INIT -q emit login-session-start DISPLAY_MANAGER=lightdm
+
+# Greeter starts
+#?GREETER-X-0 START
+#?XSERVER-0 ACCEPT-CONNECT
+#?GREETER-X-0 CONNECT-XSERVER
+#?GREETER-X-0 CONNECT-TO-DAEMON
+#?GREETER-X-0 CONNECTED-TO-DAEMON
+
+# Log into account with a password
+#?*GREETER-X-0 AUTHENTICATE USERNAME=have-password1
+#?GREETER-X-0 SHOW-PROMPT TEXT="Password:"
+#?*GREETER-X-0 RESPOND TEXT="password"
+#?GREETER-X-0 AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE
+#?*GREETER-X-0 START-SESSION
+#?GREETER-X-0 TERMINATE SIGNAL=15
+
+#?INIT -q emit desktop-session-start DISPLAY_MANAGER=lightdm
+
+# Session starts
+#?SESSION-X-0 START USER=have-password1
+#?XSERVER-0 ACCEPT-CONNECT
+#?SESSION-X-0 CONNECT-XSERVER
+
+# Cleanup
+#?*STOP-DAEMON
+#?SESSION-X-0 TERMINATE SIGNAL=15
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
index 9c1b4911c67166341f1581aef8759789a32b48f3..a41005281e7fe04703408ad08daebbbb54ba3479 100644 (file)
@@ -178,7 +178,7 @@ test_session_LDADD = \
        $(GIO_UNIX_LIBS) \
        $(XCB_LIBS)
 
-initctl_SOURCES = initctl.c
+initctl_SOURCES = initctl.c status.c status.h
 initctl_CFLAGS = \
        $(WARN_CFLAGS) \
        $(GLIB_CFLAGS) \
index 428771f05cb0d2c80dce8ea80fbb240b0d845b22..5d97b81f3067f39d28db4008ac6e3bd1cd0532fa 100644 (file)
@@ -2,8 +2,29 @@
 #include <string.h>
 #include <glib.h>
 
+#include "status.h"
+
+static GKeyFile *config;
+
 int
 main (int argc, char **argv)
 {
+    status_connect (NULL);
+
+    config = g_key_file_new ();
+    g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
+
+    if (g_key_file_get_boolean (config, "test-initctl-config", "report-events", NULL))
+    {
+        GString *status_text;
+        int i;
+
+        status_text = g_string_new ("INIT");
+        for (i = 1; i < argc; i++)
+            g_string_append_printf (status_text, " %s", argv[i]);
+        status_notify (status_text->str);
+        g_string_free (status_text, TRUE);
+    }
+
     return EXIT_SUCCESS;
 }
diff --git a/tests/test-upstart-autologin b/tests/test-upstart-autologin
new file mode 100755 (executable)
index 0000000..16cb197
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner upstart-autologin test-gobject-greeter
diff --git a/tests/test-upstart-login b/tests/test-upstart-login
new file mode 100755 (executable)
index 0000000..c8b7dab
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner upstart-login test-gobject-greeter