svn rev #23632: branches/krb5-1-7/src/lib/kadm5/unit-test/ config/ lib/
tlyu@MIT.EDU
tlyu at MIT.EDU
Mon Jan 11 21:49:53 EST 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=23632
Commit By: tlyu
Log Message:
ticket: 6553
version_fixed: 1.7.1
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.
Changed Files:
U branches/krb5-1-7/src/lib/kadm5/unit-test/config/unix.exp
U branches/krb5-1-7/src/lib/kadm5/unit-test/lib/lib.t
Modified: branches/krb5-1-7/src/lib/kadm5/unit-test/config/unix.exp
===================================================================
--- branches/krb5-1-7/src/lib/kadm5/unit-test/config/unix.exp 2010-01-12 02:49:47 UTC (rev 23631)
+++ branches/krb5-1-7/src/lib/kadm5/unit-test/config/unix.exp 2010-01-12 02:49:53 UTC (rev 23632)
@@ -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 \$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
Modified: branches/krb5-1-7/src/lib/kadm5/unit-test/lib/lib.t
===================================================================
--- branches/krb5-1-7/src/lib/kadm5/unit-test/lib/lib.t 2010-01-12 02:49:47 UTC (rev 23631)
+++ branches/krb5-1-7/src/lib/kadm5/unit-test/lib/lib.t 2010-01-12 02:49:53 UTC (rev 23632)
@@ -22,7 +22,7 @@
$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 @@
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 }
}
}
@@ -246,7 +246,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
@@ -282,20 +282,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