]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Add regression tests for PAM crashing (disabled for now, enable once session-refactor...
authorRobert Ancell <robert.ancell@canonical.com>
Wed, 29 Feb 2012 06:30:07 +0000 (17:30 +1100)
committerRobert Ancell <robert.ancell@canonical.com>
Wed, 29 Feb 2012 06:30:07 +0000 (17:30 +1100)
tests/Makefile.am
tests/src/libsystem.c
tests/src/test-runner.c

index ae3ec001e89df1a92a5200520c551b48fc376a1b..db7e8628b2122efccbb2eabd4ec6fc7a20d0ea8e 100644 (file)
@@ -87,8 +87,10 @@ TESTS = \
        test-no-accounts-service \
        test-no-console-kit
 
-# FIXME: Fails, needs fixing in the daemon
+# FIXME: These fail, fixed in session-refactor3 branch
+#      test-autologin-crash-authenticate
 #      test-autologin-new-authtok
+#      test-login-crash-authenticate
 
 #      test-session-exit-error
 #      test-greeter-no-exit
@@ -126,6 +128,7 @@ EXTRA_DIST = \
        data/xsessions/alternative.desktop \
        data/xsessions/default.desktop \
        scripts/autologin.conf \
+       scripts/autologin-crash-authenticate.conf \
        scripts/autologin-denied.conf \
        scripts/autologin-expired.conf \
        scripts/autologin-guest.conf \
@@ -150,6 +153,7 @@ EXTRA_DIST = \
        scripts/lock-seat.conf \
        scripts/lock-session.conf \
        scripts/login.conf \
+       scripts/login-crash-authenticate.conf \
        scripts/login-guest.conf \
        scripts/login-guest-disabled.conf \
        scripts/login-guest-fail-setup-script.conf \
index 1c5383df2fb486802939efa1739cb9498d60ba44..bb203b55341eda80885903a839765c6151aeee0b 100644 (file)
@@ -303,6 +303,10 @@ pam_authenticate (pam_handle_t *pamh, int flags)
         free (resp);
     }
 
+    /* Crash on authenticate */
+    if (strcmp (pamh->user, "crash-authenticate") == 0)
+        kill (getpid (), SIGSEGV);
+
     /* Look up password database */
     entry = getpwnam (pamh->user);
 
index e13581d2c357e82305f89640c4546d694596f8a9..790da582e6da5ae23f4c5b622c91b367c7ada672 100644 (file)
@@ -1335,11 +1335,13 @@ main (int argc, char **argv)
         {"expired",          "",         TRUE,  "Expired User",       NULL,  NULL, NULL,          NULL,          1015},
         /* This account needs a password change */
         {"new-authtok",      "",         TRUE,  "New Token User",     NULL,  NULL, NULL,          NULL,          1016},
-        /* change-user1 is switched to change-user2 when authentication succeeds */
+        /* This account is switched to change-user2 when authentication succeeds */
         {"change-user1",     "",         TRUE,  "Change User 1",      NULL,  NULL, NULL,          NULL,          1017},
         {"change-user2",     "",         TRUE,  "Change User 2",      NULL,  NULL, NULL,          NULL,          1018},
-        /* change-user-invalid switches to invalid-user when authentication succeeds */
+        /* This account switches to invalid-user when authentication succeeds */
         {"change-user-invalid", "",      TRUE,  "Invalid Change User",NULL,  NULL, NULL,          NULL,          1019},
+        /* This account crashes on authentication */
+        {"crash-authenticate", "",       TRUE,  "Crash Auth User",    NULL,  NULL, NULL,          NULL,          1020},
         {NULL,               NULL,       FALSE, NULL,                 NULL,  NULL, NULL,          NULL,             0}
     };
     passwd_data = g_string_new ("");