From 2062506389b7b0d295ee645d41520c7d80e58b4d Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 2 Nov 2002 18:27:11 +0000 Subject: [PATCH] This fixes some test suite password prompt checks that were missed 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 | 5 ++++ .../passwd/unit-test/kpasswd.0/changing.exp | 12 +++++----- src/kadmin/passwd/unit-test/lib/helpers.exp | 24 +++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/kadmin/passwd/unit-test/ChangeLog b/src/kadmin/passwd/unit-test/ChangeLog index 1b622e0ed..b67050b3f 100644 --- a/src/kadmin/passwd/unit-test/ChangeLog +++ b/src/kadmin/passwd/unit-test/ChangeLog @@ -1,3 +1,8 @@ +2002-11-02 Tom Yu + + * kpasswd.0/changing.exp: + * lib/helpers.exp: Make checks for password prompts more lenient. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp b/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp index 3466b9295..9aa5143ca 100644 --- a/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp +++ b/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp @@ -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." diff --git a/src/kadmin/passwd/unit-test/lib/helpers.exp b/src/kadmin/passwd/unit-test/lib/helpers.exp index 2d0320e6e..25b71a20e 100644 --- a/src/kadmin/passwd/unit-test/lib/helpers.exp +++ b/src/kadmin/passwd/unit-test/lib/helpers.exp @@ -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" -- 2.26.2