Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pamcmds.expect16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/test_pamcmds.expect b/tests/test_pamcmds.expect
index 567da54..7d5e3be 100644
--- a/tests/test_pamcmds.expect
+++ b/tests/test_pamcmds.expect
@@ -39,8 +39,9 @@ proc reset_password {} {
spawn passwd arthur
expect {
"LDAP administrator password" { send "test\r"; exp_continue }
- -regexp "(New|Retype new) password:" { send "test\r"; exp_continue }
+ -regexp "(New|Retype new)( UNIX)? password:" { send "test\r"; exp_continue }
"password updated successfully" {}
+ "passwd: all authentication tokens updated successfully." {}
"Invalid credentials" abort
"Authentication token manipulation error" abort
default abort
@@ -80,8 +81,9 @@ proc test_login_ok {uid passwd} {
expect "Password:"
send "$passwd\r"
expect {
+ "su: warning: cannot change directory" { exp_continue }
"\$ " {}
- "su: " abort
+ "su: incorrect password" abort
default abort
}
# test whether we are really logged in
@@ -101,6 +103,7 @@ proc test_login_authfail {uid passwd} {
send "$passwd\r"
expect {
"su: Authentication failure" {}
+ "su: incorrect password" {}
"\$ " abort
default abort
}
@@ -114,6 +117,7 @@ proc test_login_unknown {uid passwd} {
"Password:" { send "$passwd\r"; exp_continue }
"Unknown id" {}
"No passwd entry for user" {}
+ "user $uid does not exist" {}
"\$ " abort
default abort
}
@@ -137,8 +141,9 @@ expect {
default abort
}
expect {
- -regexp "(New|Retype new) password:" { send "newpassword\r"; exp_continue }
+ -regexp "(New|Retype new)( UNIX)? password:" { send "DuhevOlNoz5\r"; exp_continue }
"password changed" abort
+ "all authentication tokens updated successfully." abort
"Invalid credentials" {}
"Authentication token manipulation error" {}
"\$ " abort
@@ -154,8 +159,9 @@ expect {
default abort
}
expect {
- -regexp "(New|Retype new) password:" { send "newpassword\r"; exp_continue }
+ -regexp "(New|Retype new)( UNIX)? password:" { send "DuhevOlNoz5\r"; exp_continue }
"password updated successfully" {}
+ "all authentication tokens updated successfully." {}
"Invalid credentials" abort
"Authentication token manipulation error" abort
"\$ " abort
@@ -172,7 +178,7 @@ test_login_authfail arthur test
# test correct password
send_user "test_pamcmds.expect: testing new password...\n"
-test_login_ok arthur newpassword
+test_login_ok arthur DuhevOlNoz5
# test invalid username
send_user "test_pamcmds.expect: testing with unknown username...\n"