This fixes some test suite password prompt checks that were missed
authorTom Yu <tlyu@mit.edu>
Sat, 2 Nov 2002 18:27:11 +0000 (18:27 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 2 Nov 2002 18:27:11 +0000 (18:27 +0000)
earlier.

* kpasswd.0/changing.exp:
* lib/helpers.exp: Make checks for password prompts more lenient.

ticket: 1217
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14961 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/passwd/unit-test/ChangeLog
src/kadmin/passwd/unit-test/kpasswd.0/changing.exp
src/kadmin/passwd/unit-test/lib/helpers.exp

index 1b622e0ed365000054c2f93d1e5870ba4a333b2a..b67050b3f43b8c4229cdca1308cfcad1e3ddc8c0 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-02  Tom Yu  <tlyu@mit.edu>
+
+       * kpasswd.0/changing.exp: 
+       * lib/helpers.exp: Make checks for password prompts more lenient.
+
 2002-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index 3466b9295c8b60d8ede32cdc3195c98311eee39a..9aa5143caa8a5d44d46adf08b4b0f62a367f146f 100644 (file)
@@ -30,17 +30,17 @@ test_win {test1} {D.8: change password} test1 test1 newpass
 test_win {test1} {D.9: test changed password} test1 newpass test1
 
 mytest "D.22: No policy description was shown" test1 4 {
-       -re "Changing password for test1.*\\.$s+Old password:"
+       -re "Changing password for test1.*\\.$s+Old password:\[^\n\]*$"
                { send "test1\n" }
 } {
        -re "$s+.*$s+.*$s+.*char.*classes.*"
                { myfail "policy description displayed" }
        timeout { mypass }
 } {
-       -re "^$s+New password:"
+       -re "^$s+New password:\[^\n\]*$"
                { send "newpass\n" }
 } {
-       -re "^$s+New password \\(again\\):"
+       -re "^$s+New password \\(again\\):\[^\n\]*\$"
                { send "ssapwen\n" }
 } {
        -re "$s+New passwords do not match - password not changed."
@@ -70,13 +70,13 @@ test_3pass {pol1} {D.12: new password in history} pol1 \
        4 {New password was used previously.  Please choose a different password.}
 
 mytest "D.18: Policy description was shown" pol1 4 {
-       -re "Changing password for pol1.*\\.$s+Old password:"
+       -re "Changing password for pol1.*\\.$s+Old password:\[^\n\]*$"
                { send "polAAAAAA\n" }
 } {
-       -re "$s+.*$s+.*$s+.*8 char.*2 classes.*$s+New password:"
+       -re "$s+.*$s+.*$s+.*8 char.*2 classes.*$s+New password:\[^\n\]*$"
                { send "newpass1234\n" }
 } {
-       -re "^$s+New password \\(again\\):"
+       -re "^$s+New password \\(again\\):\[^\n\]*$"
                { send "newpass4321\n" }
 } {
        -re "$s+New passwords do not match - password not changed."
index 2d0320e6eddfa934c701eda35fa776050a20ff55..25b71a20e01180a906f044024b715cfbe44aa279 100644 (file)
@@ -97,7 +97,7 @@ proc kinit { princ pass } {
        spawn -noecho $KINIT -5 $princ;
 
        expect {
-               -re {Password for .*: $}
+               -re "Password for .*:\[^\n\]*$"
                    {send "$pass\n"}
                timeout {puts "Timeout waiting for prompt" ; close }
        }
@@ -147,24 +147,24 @@ proc test_win { args name princ pass1 { pass2 "\001\001" } } {
        if { $pass2 == "\001\001" } { set pass2 "$pass1" }
 
        mytest "$name" $args 0 {
-               -re "Changing password for $princ.*\\.$s+Old password:"
+               -re "Changing password for $princ.*\\.$s+Old password:\[^\n\]*$"
                        { send "$pass1\n" }
        } {
                -re "Old Kerberos password is incorrect. Please try again."
                        { close; myfail "Old password incorrect" }
                -re "${initerr_regexp}(.+\[^\r\n\t\ \])\r\n"
                        { close; myfail "init error: $expect_out(1,string)" }
-               -re "^$s+New password:"
+               -re "$s+New password:\[^\n\]*$"
                        { send "$pass2\n" }
-               -re "^$s+.*$s+.*$s+.*$s+New password:"
+               -re "$s+.*$s+.*$s+.*$s+New password:\[^\n\]*$"
                        { send "$pass2\n" }
        } {
-               -re "^$s+New password \\(again\\):"
+               -re "$s+New password \\(again\\):\[^\n\]*$"
                        { send "$pass2\n" }
        } {
-               -re "^$s+Kerberos password changed."
+               -re "$s+Kerberos password changed."
                        { mypass }
-               -re "^$s+Password changed."
+               -re "$s+Password changed."
                        { close; myfail "Wrong message on success." }
        }
 }
@@ -176,7 +176,7 @@ proc test_initerr { args name princ pass status err } {
        regsub -all "$s+" $err "$s+" err2
 
        mytest "$name" $args $status {
-               -re "Changing password for $princ.*\\.$s+Old password:"
+               -re "Changing password for $princ.*\\.$s+Old password:\[^\n\]*$"
                        { send "$pass\n" }
        } {
                -re "$err2"
@@ -195,19 +195,19 @@ proc test_3pass { args name princ pass1 pass2 pass3 status err } {
        regsub -all "$s+" $err "$s+" err2
 
        mytest "$name" $args $status {
-               -re "Changing password for $princ.*\\.$s+Old password:"
+               -re "Changing password for $princ.*\\.$s+Old password:\[^\n\]*$"
                        { send "$pass1\n" }
        } {
                -re "Old Kerberos password is incorrect. Please try again."
                        { close; myfail "Old password incorrect" }
                -re "${initerr_regexp}(.+)\r\n"
                        { close; myfail "init error: $expect_out(1,string)" }
-               -re "^$s+New password:"
+               -re "$s+New password:\[^\n\]*$"
                        { send "$pass2\n" }
-               -re "^$s+.*$s+.*$s+.*$s+New password:"
+               -re "$s+.*$s+.*$s+.*$s+New password:\[^\n\]*$"
                        { send "$pass2\n" }
        } {
-               -re "^$s+New password \\(again\\):"
+               -re "$s+New password \\(again\\):\[^\n\]*$"
                        { send "$pass3\n" }
        } {
                -re "$s+$err2"