From: Tom Yu Date: Sat, 9 Nov 2002 01:39:45 +0000 (+0000) Subject: tests/dejagnu leaks ptys X-Git-Tag: krb5-1.3-alpha1~282 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6aad500e71be103d9331b0b07fdee8af1d8a52e7;p=krb5.git tests/dejagnu leaks ptys * default.exp: Add (disabled) debugging code for catching leaking ptys. expect eof from the correct spawn_ids when killing kdc and kadmind to avoid leaking ptys. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14984 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog index 0ae598d65..83a2d90d2 100644 --- a/src/tests/dejagnu/config/ChangeLog +++ b/src/tests/dejagnu/config/ChangeLog @@ -1,3 +1,9 @@ +2002-11-08 Tom Yu + + * default.exp: Add (disabled) debugging code for catching leaking + ptys. expect eof from the correct spawn_ids when killing kdc and + kadmind to avoid leaking ptys. + 2002-10-07 Tom Yu * default.exp (stop_kerberos_daemons): Kill, expect eof, wait, in diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index 843c8909c..4eb76ca4a 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -34,6 +34,26 @@ set kdc_supported_enctypes "des-cbc-crc:normal" # request a des-cbc-md4 session key. Since only des-cbc-crc is in the # KDC's permitted_enctypes list, the TGT will be unusable. +# KLUDGE for tracking down leaking ptys +if 0 { + rename spawn oldspawn + rename wait oldwait + proc spawn { args } { + upvar 1 spawn_id spawn_id + verbose "spawn: args=$args" + set pid [eval oldspawn $args] + verbose "spawn: pid=$pid spawn_id=$spawn_id" + return $pid + } + proc wait { args } { + upvar 1 spawn_id spawn_id + verbose "wait: args=$args" + set ret [eval oldwait $args] + verbose "wait: $ret" + return $ret + } +} + # The des.des3-tgt.no-kdc-des3 pass will fail if the KDC doesn't # constrain ticket key enctypes to those in permitted_enctypes. It # does this by not putting des3 in the permitted_enctypes, while @@ -1501,8 +1521,12 @@ proc stop_kerberos_daemons { } { verbose "entered stop_kerberos_daemons" if [info exists kdc_pid] { - catch "exec kill $kdc_pid" - catch "expect eof" + if [catch "exec kill $kdc_pid" msg] { + verbose "kill kdc: $msg" + } + if [catch "expect -i $kdc_spawn_id eof" msg] { + verbose "expect kdc eof: $msg" + } set kdc_list [wait -i $kdc_spawn_id] verbose "wait -i $kdc_spawn_id returned $kdc_list (kdc)" unset kdc_pid @@ -1510,8 +1534,12 @@ proc stop_kerberos_daemons { } { } if [info exists kadmind_pid] { - catch "exec kill $kadmind_pid" - catch "expect eof" + if [catch "exec kill $kadmind_pid" msg] { + verbose "kill kadmind: $msg" + } + if [catch "expect -i $kadmind_spawn_id eof" msg] { + verbose "expect kadmind eof: $msg" + } set kadmind_list [wait -i $kadmind_spawn_id] verbose "wait -i $kadmind_spawn_id returned $kadmind_list (kadmind5)" unset kadmind_pid