summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-10-20 23:44:42 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-10-22 22:38:43 +0200
commit8cc354ade3f27036dbd7bfa5140f2461ca0af588 (patch)
treed72115d82b9c247d1de7189b827181b1200eb32c /tests
parent0a9555769ff7e7db39bf055fbb7226052b0397ff (diff)
Handle other responses in test_pamcmds
This extends test_pamcmds to handle other pam/su/passwd errors and responses (as seen on CentOS 5). Also switch to stronger password when changing the test user's password to avoid problems with password strength checks.
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"