Skip to content

Commit 4f49774

Browse files
committed
Fix desktop-session-start upstart signal not being emitted since 1.7.5
1 parent 3a8ff67 commit 4f49774

File tree

8 files changed

+116
-1
lines changed

8 files changed

+116
-1
lines changed

src/seat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,10 @@ run_session (Seat *seat, Session *session)
454454
}
455455

456456
if (!IS_GREETER (session))
457+
{
457458
g_signal_emit (seat, signals[RUNNING_USER_SESSION], 0, session);
459+
emit_upstart_signal ("desktop-session-start");
460+
}
458461

459462
session_run (session);
460463

tests/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ TESTS = \
125125
test-script-hook-fail-display-setup \
126126
test-script-hook-fail-greeter-setup \
127127
test-script-hook-fail-session-setup \
128+
test-upstart-autologin \
129+
test-upstart-login \
128130
test-dbus \
129131
test-lock-seat \
130132
test-lock-seat-return-session \
@@ -388,6 +390,8 @@ EXTRA_DIST = \
388390
scripts/unity-login.conf \
389391
scripts/unity-plymouth.conf \
390392
scripts/unity-switch.conf \
393+
scripts/upstart-autologin.conf \
394+
scripts/upstart-login.conf \
391395
scripts/users.conf \
392396
scripts/util-path.conf \
393397
scripts/user-renamed.conf \

tests/scripts/upstart-autologin.conf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Check emits upstart events on autologin
3+
#
4+
5+
[SeatDefaults]
6+
autologin-user=have-password1
7+
user-session=default
8+
9+
[test-initctl-config]
10+
report-events=true
11+
12+
#?RUNNER DAEMON-START
13+
14+
# X server starts
15+
#?XSERVER-0 START VT=7
16+
17+
# Daemon connects when X server is ready
18+
#?*XSERVER-0 INDICATE-READY
19+
#?XSERVER-0 INDICATE-READY
20+
#?XSERVER-0 ACCEPT-CONNECT
21+
22+
#?INIT -q emit login-session-start DISPLAY_MANAGER=lightdm
23+
#?INIT -q emit desktop-session-start DISPLAY_MANAGER=lightdm
24+
25+
# Session starts
26+
#?SESSION-X-0 START USER=have-password1
27+
#?XSERVER-0 ACCEPT-CONNECT
28+
#?SESSION-X-0 CONNECT-XSERVER
29+
30+
# Cleanup
31+
#?*STOP-DAEMON
32+
#?SESSION-X-0 TERMINATE SIGNAL=15
33+
#?XSERVER-0 TERMINATE SIGNAL=15
34+
#?RUNNER DAEMON-EXIT STATUS=0

tests/scripts/upstart-login.conf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Check emits upstart events on login
3+
#
4+
5+
[SeatDefaults]
6+
user-session=default
7+
8+
[test-initctl-config]
9+
report-events=true
10+
11+
#?RUNNER DAEMON-START
12+
13+
# X server starts
14+
#?XSERVER-0 START VT=7
15+
16+
# Daemon connects when X server is ready
17+
#?*XSERVER-0 INDICATE-READY
18+
#?XSERVER-0 INDICATE-READY
19+
#?XSERVER-0 ACCEPT-CONNECT
20+
21+
#?INIT -q emit login-session-start DISPLAY_MANAGER=lightdm
22+
23+
# Greeter starts
24+
#?GREETER-X-0 START
25+
#?XSERVER-0 ACCEPT-CONNECT
26+
#?GREETER-X-0 CONNECT-XSERVER
27+
#?GREETER-X-0 CONNECT-TO-DAEMON
28+
#?GREETER-X-0 CONNECTED-TO-DAEMON
29+
30+
# Log into account with a password
31+
#?*GREETER-X-0 AUTHENTICATE USERNAME=have-password1
32+
#?GREETER-X-0 SHOW-PROMPT TEXT="Password:"
33+
#?*GREETER-X-0 RESPOND TEXT="password"
34+
#?GREETER-X-0 AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE
35+
#?*GREETER-X-0 START-SESSION
36+
#?GREETER-X-0 TERMINATE SIGNAL=15
37+
38+
#?INIT -q emit desktop-session-start DISPLAY_MANAGER=lightdm
39+
40+
# Session starts
41+
#?SESSION-X-0 START USER=have-password1
42+
#?XSERVER-0 ACCEPT-CONNECT
43+
#?SESSION-X-0 CONNECT-XSERVER
44+
45+
# Cleanup
46+
#?*STOP-DAEMON
47+
#?SESSION-X-0 TERMINATE SIGNAL=15
48+
#?XSERVER-0 TERMINATE SIGNAL=15
49+
#?RUNNER DAEMON-EXIT STATUS=0

tests/src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ test_session_LDADD = \
178178
$(GIO_UNIX_LIBS) \
179179
$(XCB_LIBS)
180180

181-
initctl_SOURCES = initctl.c
181+
initctl_SOURCES = initctl.c status.c status.h
182182
initctl_CFLAGS = \
183183
$(WARN_CFLAGS) \
184184
$(GLIB_CFLAGS) \

tests/src/initctl.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,29 @@
22
#include <string.h>
33
#include <glib.h>
44

5+
#include "status.h"
6+
7+
static GKeyFile *config;
8+
59
int
610
main (int argc, char **argv)
711
{
12+
status_connect (NULL);
13+
14+
config = g_key_file_new ();
15+
g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
16+
17+
if (g_key_file_get_boolean (config, "test-initctl-config", "report-events", NULL))
18+
{
19+
GString *status_text;
20+
int i;
21+
22+
status_text = g_string_new ("INIT");
23+
for (i = 1; i < argc; i++)
24+
g_string_append_printf (status_text, " %s", argv[i]);
25+
status_notify (status_text->str);
26+
g_string_free (status_text, TRUE);
27+
}
28+
829
return EXIT_SUCCESS;
930
}

tests/test-upstart-autologin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./src/dbus-env ./src/test-runner upstart-autologin test-gobject-greeter

tests/test-upstart-login

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./src/dbus-env ./src/test-runner upstart-login test-gobject-greeter

0 commit comments

Comments
 (0)