svn rev #22648: trunk/src/lib/kadm5/unit-test/ config/ lib/
tlyu@MIT.EDU
tlyu at MIT.EDU
Fri Aug 28 17:36:29 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22648
Commit By: tlyu
Log Message:
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.
Changed Files:
U trunk/src/lib/kadm5/unit-test/config/unix.exp
U trunk/src/lib/kadm5/unit-test/lib/lib.t
Modified: trunk/src/lib/kadm5/unit-test/config/unix.exp
===================================================================
--- trunk/src/lib/kadm5/unit-test/config/unix.exp 2009-08-28 21:22:10 UTC (rev 22647)
+++ trunk/src/lib/kadm5/unit-test/config/unix.exp 2009-08-28 21:36:28 UTC (rev 22648)
@@ -131,85 +131,85 @@
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 \$KADM5_STRUCT_VERSION &~ \$KADM5_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 \$KADM5_API_VERSION_2 &~ \$KADM5_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 \$KADM5_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 \$KADM5_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 \$KADM5_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 \$KADM5_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
Modified: trunk/src/lib/kadm5/unit-test/lib/lib.t
===================================================================
--- trunk/src/lib/kadm5/unit-test/lib/lib.t 2009-08-28 21:22:10 UTC (rev 22647)
+++ trunk/src/lib/kadm5/unit-test/lib/lib.t 2009-08-28 21:36:28 UTC (rev 22648)
@@ -22,7 +22,7 @@
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_2 \
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 @@
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 @@
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 @@
-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 @@
-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 @@
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 @@
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 }
}
}
@@ -247,7 +247,7 @@
# 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
@@ -283,20 +283,20 @@
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
More information about the cvs-krb5
mailing list