diff options
author | Tom Yu <tlyu@mit.edu> | 2010-01-12 02:49:53 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2010-01-12 02:49:53 +0000 |
commit | 0756cb0e13168cd12878bd6fca0ef8eb048264be (patch) | |
tree | b5e557ba8e27deecad1d189dcbabebb7f3d48c48 | |
parent | fcb404aa41828343ae942733c28dfb92c01ebb09 (diff) | |
download | krb5-0756cb0e13168cd12878bd6fca0ef8eb048264be.zip krb5-0756cb0e13168cd12878bd6fca0ef8eb048264be.tar.gz krb5-0756cb0e13168cd12878bd6fca0ef8eb048264be.tar.bz2 |
pull up r22648 from trunk
------------------------------------------------------------------------
r22648 | tlyu | 2009-08-28 17:36:28 -0400 (Fri, 28 Aug 2009) | 8 lines
ticket: 6553
subject: use perror instead of error in kadm5 test suite
target_version: 1.7.1
tags: pullup
Use "perror" instead of "error" to ensure that framework error
conditions actually cause "make check" to report failure.
ticket: 6553
version_fixed: 1.7.1
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@23632 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/kadm5/unit-test/config/unix.exp | 54 | ||||
-rw-r--r-- | src/lib/kadm5/unit-test/lib/lib.t | 24 |
2 files changed, 39 insertions, 39 deletions
diff --git a/src/lib/kadm5/unit-test/config/unix.exp b/src/lib/kadm5/unit-test/config/unix.exp index 3f36655..5cc83a0 100644 --- a/src/lib/kadm5/unit-test/config/unix.exp +++ b/src/lib/kadm5/unit-test/config/unix.exp @@ -131,85 +131,85 @@ proc api_start {} { set pid [spawn $API] expect { -re "$prompt$" {} - eof { error "EOF starting API" } - timeout { error "Timeout starting API" } + eof { perror "EOF starting API" } + timeout { perror "Timeout starting API" } } if {! [info exists env(TCLUTIL)]} { - error "TCLUTIL environment variable isn't set" + perror "TCLUTIL environment variable isn't set" } # tcl 8.4 for some reason screws up autodetection of output # EOL translation. Work around it for now. send "if { \[info commands fconfigure\] ne \"\" } { fconfigure stdout -translation lf }\n" expect { -re "$prompt$" {} - eof { error "EOF starting API" } - timeout { error "Timeout starting API" } + eof { perror "EOF starting API" } + timeout { perror "Timeout starting API" } } send "source $env(TCLUTIL)\n" expect { -re "$prompt$" {} - eof { error "EOF starting API" } - timeout { error "Timeout starting API" } + eof { perror "EOF starting API" } + timeout { perror "Timeout starting API" } } send "set current_struct_version \[expr \$OVSEC_KADM_STRUCT_VERSION &~ \$OVSEC_KADM_STRUCT_VERSION_MASK\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set current_api_version \[expr \$OVSEC_KADM_API_VERSION_1 &~ \$OVSEC_KADM_API_VERSION_MASK\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set bad_struct_version_mask \[expr 0x65432100 | \$current_struct_version\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set bad_api_version_mask \[expr 0x65432100 | \$current_api_version\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set no_api_version_mask \$current_api_version\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set no_struct_version_mask \$current_struct_version\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set old_api_version \[expr \$OVSEC_KADM_API_VERSION_MASK | 0x00\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set old_struct_version \[expr \$OVSEC_KADM_STRUCT_VERSION_MASK | 0x00\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set new_api_version \[expr \$OVSEC_KADM_API_VERSION_MASK | 0xca\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } send "set new_struct_version \[expr \$OVSEC_KADM_STRUCT_VERSION_MASK | 0xca\]\n" expect { -re "$prompt$" {} - eof { error "EOF setting API varibles"} - timeout { error "timeout setting API varibles"} + eof { perror "EOF setting API varibles"} + timeout { perror "timeout setting API varibles"} } set api_pid $pid diff --git a/src/lib/kadm5/unit-test/lib/lib.t b/src/lib/kadm5/unit-test/lib/lib.t index 2027794..b430230 100644 --- a/src/lib/kadm5/unit-test/lib/lib.t +++ b/src/lib/kadm5/unit-test/lib/lib.t @@ -22,7 +22,7 @@ proc lib_start_api {} { $OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 \ lib_handle }]} { - error "$test: unexpected failure in init" + perror "$test: unexpected failure in init" return } verbose "+++ restarted api ($lib_pid) for lib" @@ -40,7 +40,7 @@ proc cmd {command} { expect { -re "OK .*$prompt$" { return 1 } -re "ERROR .*$prompt$" { return 0 } - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } timeout { fail "$test: timeout"; return 0 } eof { fail "$test: eof"; api_exit; lib_start_api; return 0 } } @@ -52,7 +52,7 @@ proc tcl_cmd {command} { send "[string trim $command]\n" expect { -re "$prompt$" { return 1} - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } timeout { error_and_restart "timeout" } eof { api_exit; lib_start_api; return 0 } } @@ -69,7 +69,7 @@ proc one_line_succeed_test {command} { -re "ERROR .*$prompt$" { fail "$test: $expect_out(buffer)"; return 0 } - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } timeout { fail "$test: timeout"; return 0 } eof { fail "$test: eof"; api_exit; lib_start_api; return 0 } } @@ -85,7 +85,7 @@ proc one_line_fail_test {command code} { -re "ERROR .*$code.*$prompt$" { pass "$test"; return 1 } -re "ERROR .*$prompt$" { fail "$test: bad failure"; return 0 } -re "OK .*$prompt$" { fail "$test: bad success"; return 0 } - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } timeout { fail "$test: timeout"; return 0 } eof { fail "$test: eof"; api_exit; lib_start_api; return 0 } } @@ -100,7 +100,7 @@ proc one_line_fail_test_nochk {command} { expect { -re "ERROR .*$prompt$" { pass "$test:"; return 1 } -re "OK .*$prompt$" { fail "$test: bad success"; return 0 } - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } timeout { fail "$test: timeout"; return 0 } eof { fail "$test: eof"; api_exit; lib_start_api; return 0 } } @@ -111,7 +111,7 @@ proc resync {} { expect { -re "$prompt$" {} - "wrong # args" { error "$test: wrong number args"; return 0 } + "wrong # args" { perror "$test: wrong number args"; return 0 } eof { api_exit; lib_start_api } } } @@ -246,7 +246,7 @@ proc kinit { princ pass {opts ""} } { # the parent, which is us, to read pending data. expect { - "when initializing cache" { error "kinit failed: $expect_out(buffer)" } + "when initializing cache" { perror "kinit failed: $expect_out(buffer)" } eof {} } wait @@ -282,20 +282,20 @@ proc create_principal_with_keysalts {name keysalts} { spawn $kadmin_local -e "$keysalts" expect { "kadmin.local:" {} - default { error "waiting for kadmin.local prompt"; return 1} + default { perror "waiting for kadmin.local prompt"; return 1} } send "ank -pw \"$name\" \"$name\"\n" expect { -re "Principal \"$name.*\" created." {} "kadmin.local:" { - error "expecting principal created message"; + perror "expecting principal created message"; return 1 } - default { error "waiting for principal created message"; return 1 } + default { perror "waiting for principal created message"; return 1 } } expect { "kadmin.local:" {} - default { error "waiting for kadmin.local prompt"; return 1 } + default { perror "waiting for kadmin.local prompt"; return 1 } } close wait |