]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Fix autologin use case and add a test for it
authorMichael Terry <michael.terry@canonical.com>
Tue, 18 Feb 2014 22:07:03 +0000 (17:07 -0500)
committerMichael Terry <michael.terry@canonical.com>
Tue, 18 Feb 2014 22:07:03 +0000 (17:07 -0500)
src/seat.c
tests/Makefile.am
tests/scripts/shared-data-dirs-autologin.conf [new file with mode: 0644]
tests/test-shared-data-dirs-autologin [new file with mode: 0755]

index 11307036a6939d85d3c485d82c977e237e27982e..bf0d9b0eb8b813cd8fe361573180393c09474c78 100644 (file)
@@ -1520,8 +1520,13 @@ seat_real_start (Seat *seat)
             session = create_user_session (seat, autologin_username, TRUE);
 
         if (session)
+        {
             session_set_pam_service (session, AUTOLOGIN_SERVICE);
 
+            /* Make sure shared user directory for this user exists */
+            shared_data_manager_ensure_user_dir (shared_data_manager_get_instance (), session_get_username (session));
+        }
+
         /* Load in background if required */
         if (autologin_in_background && session)
         {
index 92ab7c4d75cd8131ce22ef690e182dc52820e4b8..734fc66e7a2b4aeed4dae9631b75c31f93a4ac36 100644 (file)
@@ -111,6 +111,7 @@ TESTS = \
        test-script-hook-fail-greeter-setup \
        test-script-hook-fail-session-setup \
        test-shared-data-dirs \
+       test-shared-data-dirs-autologin \
        test-upstart-autologin \
        test-upstart-login \
        test-dbus \
@@ -408,6 +409,7 @@ EXTRA_DIST = \
        scripts/plymouth-no-seat.conf \
        scripts/restart-authentication.conf \
        scripts/shared-data-dirs.conf \
+       scripts/shared-data-dirs-autologin.conf \
        scripts/script-hooks.conf \
        scripts/script-hook-fail-display-setup.conf \
        scripts/script-hook-fail-greeter-setup.conf \
diff --git a/tests/scripts/shared-data-dirs-autologin.conf b/tests/scripts/shared-data-dirs-autologin.conf
new file mode 100644 (file)
index 0000000..8a9fe10
--- /dev/null
@@ -0,0 +1,31 @@
+#
+# Make sure we manage shared user data directories when autologin is used
+#
+
+[SeatDefaults]
+autologin-user=have-password1
+
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER-0 START VT=7 SEAT=seat0
+
+# Daemon connects when X server is ready
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+
+# Session starts
+#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 DESKTOP_SESSION=default USER=have-password1
+#?XSERVER-0 ACCEPT-CONNECT
+#?SESSION-X-0 CONNECT-XSERVER
+
+# Make sure we created the directory as we started session
+#?*LIST-SHARED-DATA-DIRS
+#?RUNNER LIST-SHARED-DATA-DIRS DIRS=have-password1:1000:100:0770,lightdm:100:100:0770
+
+# Cleanup
+#?*STOP-DAEMON
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?SESSION-X-0 TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
diff --git a/tests/test-shared-data-dirs-autologin b/tests/test-shared-data-dirs-autologin
new file mode 100755 (executable)
index 0000000..710661f
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner shared-data-dirs-autologin test-gobject-greeter