From 08c541e746fbcc85a4c4ec3b28a3bf1aab490c0f Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 9 Jul 2014 10:47:24 -0500 Subject: [PATCH] Clean up sdt_misc.exp a bit. * testsuite/systemtap.base/sdt_misc.exp: Make log output match the commands being run. Catch errors on "system" calls to avoid the test aborting with a tcl error. Do an initial cleanup to avoid test leftovers, which might have been created by another user. --- testsuite/systemtap.base/sdt_misc.exp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/testsuite/systemtap.base/sdt_misc.exp b/testsuite/systemtap.base/sdt_misc.exp index 8f0f57687..ddf696df6 100644 --- a/testsuite/systemtap.base/sdt_misc.exp +++ b/testsuite/systemtap.base/sdt_misc.exp @@ -33,6 +33,9 @@ proc cleanup_handler { verbose } { } } +# Start with a clean slate +cleanup_handler 0 + # Compile a C program to use as the user-space probing target set stap_path $env(SYSTEMTAP_PATH)/stap set sup_dpath "[pwd]/sdt_misc_.d" @@ -170,20 +173,20 @@ for {set i 0} {$i < [llength $pbtype_flags]} {incr i} { } # This is perhaps a wee bit clumsy - verbose -log "$loop_exepath >| ,semclean 2>&1 & TEST=\$! ; \ + verbose -log "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path --runtime=$runtime $srcdir/$subdir/sdt_misc.stp $loop_exepath >| ,semout ; \ /bin/kill -SIGINT \$TEST" - system "$loop_exepath >,semclean 2>&1 & TEST=\$! ; \ + catch {system "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path --runtime=$runtime $srcdir/$subdir/sdt_misc.stp $loop_exepath >| ,semout ; \ - /bin/kill -SIGINT \$TEST" + /bin/kill -SIGINT \$TEST"} } elseif {[uprobes_p]} { # This is perhaps a wee bit clumsy - verbose -log "$loop_exepath >| ,semclean 2>&1 & TEST=\$! ; \ + verbose -log "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path $srcdir/$subdir/sdt_misc.stp $loop_exepath >| ,semout ; \ /bin/kill -SIGINT \$TEST" - system "$loop_exepath >,semclean 2>&1 & TEST=\$! ; \ + catch {system "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path $srcdir/$subdir/sdt_misc.stp $loop_exepath >| ,semout ; \ - /bin/kill -SIGINT \$TEST" + /bin/kill -SIGINT \$TEST"} } else { untested "$test $pbtype_mssg attach" continue @@ -456,20 +459,20 @@ for {set i 0} {$i < [llength $pbtype_flags]} {incr i} { } # This is perhaps a wee bit clumsy - verbose -log "$loop_exepath >| ,semclean 2>&1 & TEST=\$! ; \ + verbose -log "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path --runtime=$runtime $srcdir/$subdir/sdt_misc.stp $loop_exepath $supl_sopath >| ,semout ; \ /bin/kill -SIGINT \$TEST" - system "$loop_exepath >,semclean 2>&1 & TEST=\$! ; \ + catch {system "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path --runtime=$runtime $srcdir/$subdir/sdt_misc.stp $loop_exepath $supl_sopath >| ,semout ; \ - /bin/kill -SIGINT \$TEST" + /bin/kill -SIGINT \$TEST"} } elseif {[uprobes_p]} { # This is perhaps a wee bit clumsy - verbose -log "$loop_exepath >| ,semclean 2>&1 & TEST=\$! ; \ + verbose -log "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path $srcdir/$subdir/sdt_misc.stp $loop_exepath $supl_sopath >| ,semout ; \ /bin/kill -SIGINT \$TEST" - system "$loop_exepath >,semclean 2>&1 & TEST=\$! ; \ + catch {system "$loop_exepath > ,semclean 2>&1 & TEST=\$! ; \ $stap_path $srcdir/$subdir/sdt_misc.stp $loop_exepath $supl_sopath >| ,semout ; \ - /bin/kill -SIGINT \$TEST" + /bin/kill -SIGINT \$TEST"} } else { untested "$test $pbtype_mssg shared attach" continue -- 2.43.5