+2001-10-31 Tom Yu <tlyu@mit.edu>
+
+ * default.exp (check_k5login, check_klogin): Error out if there is
+ a nonexistent .k5login or .klogin for root.
+ (setup_{kadmind_,}srvtab, add_{random,kerberos}_key): Notice
+ unmatched output to avoid timing out on certain errors. Look for
+ command echoes. Clear the expect_after list in places to avoid
+ problems with lingering expect_after clauses against invalid
+ spawn_ids. expect eof in places to avoid pty deadlock.
+
2001-10-27 Tom Yu <tlyu@mit.edu>
* default.exp: Mark as unused the test passes that won't
global env
global REALMNAME
- if {![file exists ~/.k5login] && $env(USER) != "root"} {
- return 1
+ if {![file exists ~/.k5login]} {
+ if {$env(USER) == "root"} {
+ return 0
+ } else {
+ return 1
+ }
}
verbose "looking for $env(USER)@$REALMNAME in ~/.k5login" 2
global env
global REALMNAME
- if {![file exists ~/.klogin] && $env(USER) != "root" } {
- return 1
+ if {![file exists ~/.klogin]} {
+ if {$env(USER) == "root"} {
+ return 0
+ } else {
+ return 1
+ }
}
verbose "looking for $env(USER) in ~/.klogin" 2
envstack_pop
catch expect_after
expect_after {
+ -re "(.*)\r\nkadmin.local: " {
+ fail "kadmin.local admin-keytab (unmatched output: $expect_out(1,string)"
+ catch "exec rm -f $tmppwd/admin-keytab"
+ catch "expect_after"
+ return 0
+ }
timeout {
fail "kadmin.local admin-keytab (timeout)"
catch "exec rm -f $tmppwd/admin-keytab"
}
expect "kadmin.local: "
send "xst -k admin-new-srvtab kadmin/admin\r"
+ expect "xst -k admin-new-srvtab kadmin/admin\r\n"
expect -re ".*Entry for principal kadmin/admin.* added to keytab WRFILE:admin-new-srvtab."
expect "kadmin.local: "
if ![string match "" $exec_output] {
verbose -log "$exec_output"
perror "can't mv admin-new-srvtab"
+ catch expect_after
return 0
}
send "xst -k changepw-new-srvtab kadmin/changepw\r"
+ expect "xst -k changepw-new-srvtab kadmin/changepw\r\n"
expect -re ".*Entry for principal kadmin/changepw.* added to keytab WRFILE:changepw-new-srvtab."
expect "kadmin.local: "
send "quit\r"
- expect "\r"
- expect_after
+ expect eof
+ catch expect_after
if ![check_exit_status "kadmin.local admin-keytab"] {
catch "exec rm -f $tmppwd/admin-keytab"
perror "kadmin.local admin-keytab exited abnormally"
send "masterkey$KEY\r"
expect {
-re "\[Cc\]ouldn't" {
+ expect eof
break
}
"Cannot find/read stored" exp_continue
}
}
set ret [catch $body]
+ catch expect_after
if $ret {
set failall 1
if $standalone {
break
}
}
- if [catch $body] {
+ set ret [catch $body]
+ catch "expect eof"
+ catch expect_after
+ if $ret {
set failall 1
if $standalone {
fail $test
break
}
}
- if [catch $body] {
+ set ret [catch $body]
+ catch "expect eof"
+ catch expect_after
+ if $ret {
set failall 1
if $standalone {
fail $test
break
}
}
- if [catch $body] {
+ set ret [catch $body]
+ catch "expect eof"
+ catch expect_after
+ if $ret {
set failall 1
if $standalone {
fail $test
break
}
}
- if [catch $body] {
+ set ret [catch $body]
+ catch "expect eof"
+ catch expect_after
+ if $ret {
set failall 1
if $standalone {
fail $test
"Principal \"$kkey@$REALMNAME\" created" { }
"Principal or policy already exists while creating*" { }
}
+ expect eof
if ![check_exit_status kadmin] {
break
}
}
}
if [catch $body] {
+ catch expect_after
if $standalone {
fail $test
}
return 0
} else {
+ catch expect_after
if $standalone {
pass $test
}
spawn $KADMIN_LOCAL -r $REALMNAME
envstack_pop
expect_after {
+ -re "(.*)\r\nkadmin.local: " {
+ fail "kadmin.local srvtab (unmatched output: $expect_out(1,string))"
+ if {!$standalone} {
+ catch "exec rm -f $tmppwd/srvtab"
+ }
+ catch "expect_after"
+ return 0
+ }
timeout {
fail "kadmin.local srvtab"
if {!$standalone} {
}
expect "kadmin.local: "
send "quit\r"
- expect "\r"
- expect_after
+ expect eof
+ catch expect_after
if ![check_exit_status "kadmin.local srvtab"] {
if {!$standalone} {
catch "exec rm -f $tmppwd/srvtab"