From 4e14d2355434bef975d1e2a1ea05c1a159fcecde Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 23 Feb 2008 20:37:18 +0000 Subject: PR5770: false systemtap/eof/timeout messages in testsuite.log 2008-02-23 Frank Ch. Eigler * */*.exp: Change all "send \003" to "exec kill -INT -" in order to more reliably kill an inferior stap/stapio/staprun process group. --- testsuite/ChangeLog | 5 +++++ testsuite/lib/stap_run.exp | 5 +++-- testsuite/systemtap.base/onoffprobe.exp | 2 +- testsuite/systemtap.base/overload.exp | 5 +++-- testsuite/systemtap.context/args.tcl | 2 +- testsuite/systemtap.context/backtrace.tcl | 2 +- testsuite/systemtap.context/context.exp | 2 +- testsuite/systemtap.maps/ix_clear.exp | 2 +- testsuite/systemtap.maps/ix_clear2.exp | 2 +- testsuite/systemtap.maps/ix_clear3.exp | 2 +- testsuite/systemtap.maps/pmap_agg_overflow.exp | 2 +- testsuite/systemtap.printf/sharedbuf.exp | 2 +- testsuite/systemtap.samples/crash.exp | 2 +- testsuite/systemtap.stress/whitelist.exp | 4 ++-- 14 files changed, 23 insertions(+), 16 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 2a384fdc..c3ee8d1e 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-02-23 Frank Ch. Eigler + + * */*.exp: Change all "send \003" to "exec kill -INT -" in order + to more reliably kill an inferior stap/stapio/staprun process group. + 2008-02-22 Frank Ch. Eigler * semko/fortyfive.stp: Add ".call" to exclude false (?) positives diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index 5bd1549c..c2b4e74d 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -50,7 +50,7 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } } } - send "\003" + exec kill -INT -[exp_pid] # check the output to see if it is sane set output "^systemtap ending probe\r\n$OUTPUT_CHECK_STRING" @@ -78,7 +78,8 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } } } -re "semantic error:" { fail "$TEST_NAME compilation" } - timeout { fail "$TEST_NAME startup (timeout)"; send "\003" } + timeout { fail "$TEST_NAME startup (timeout)" + exec kill -INT [exp_pid] } eof { fail "$TEST_NAME startup (eof)" } } catch close diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp index b86de4ea..24012cac 100644 --- a/testsuite/systemtap.base/onoffprobe.exp +++ b/testsuite/systemtap.base/onoffprobe.exp @@ -32,7 +32,7 @@ expect { timeout { fail "$test (timeout)" } eof { } } -send "\003" +exec kill -INT -[exp_pid] #FIXME does not handle case of hanging pfaults.stp correctly wait exec rm -f $test.ko diff --git a/testsuite/systemtap.base/overload.exp b/testsuite/systemtap.base/overload.exp index db7f49ef..cbcbe817 100644 --- a/testsuite/systemtap.base/overload.exp +++ b/testsuite/systemtap.base/overload.exp @@ -37,7 +37,7 @@ proc stap_run_overload { TEST_NAME EXPECT_OVERLOAD args } { } } -re "^systemtap starting probe\r\n" { - send "\003" + exec kill -INT -[exp_pid] expect { -timeout 10 @@ -58,7 +58,8 @@ proc stap_run_overload { TEST_NAME EXPECT_OVERLOAD args } { } } -re "semantic error:" { fail "$TEST_NAME compilation" } - timeout { fail "$TEST_NAME startup (timeout)"; send "\003" } + timeout { fail "$TEST_NAME startup (timeout)"; + exec kill -INT -[exp_pid] } eof { fail "$TEST_NAME startup (eof)" } } catch close diff --git a/testsuite/systemtap.context/args.tcl b/testsuite/systemtap.context/args.tcl index 37a43823..7cb79cdf 100644 --- a/testsuite/systemtap.context/args.tcl +++ b/testsuite/systemtap.context/args.tcl @@ -53,6 +53,6 @@ expect { } eof {fail "function arguments: unexpected timeout"} } -send "\003" +exec kill -INT -[exp_pid] close wait diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl index 703f0ec2..f359cd41 100644 --- a/testsuite/systemtap.context/backtrace.tcl +++ b/testsuite/systemtap.context/backtrace.tcl @@ -117,7 +117,7 @@ expect { } eof {fail "backtrace of yyy_func3, yyy_func4.return and timer.profile. unexpected EOF" } } -send "\003" +exec kill -INT -[exp_pid] if {$m1 == 4} { pass "backtrace of yyy_func3" } else { diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp index 11c0f2fc..71201a58 100644 --- a/testsuite/systemtap.context/context.exp +++ b/testsuite/systemtap.context/context.exp @@ -11,7 +11,7 @@ set build_dir "" proc cleanup {} { global build_dir - catch {send "\003"} + catch { exec kill -INT -[exp_pid] } foreach n {1 2} { as_root [list /bin/rm -f /lib/modules/$::uname/kernel/systemtap_test_module$n.ko] as_root [list /sbin/rmmod systemtap_test_module$n] diff --git a/testsuite/systemtap.maps/ix_clear.exp b/testsuite/systemtap.maps/ix_clear.exp index 0c6ca6c3..07417898 100644 --- a/testsuite/systemtap.maps/ix_clear.exp +++ b/testsuite/systemtap.maps/ix_clear.exp @@ -14,7 +14,7 @@ expect { pass "$test passed" } timeout { - send "\003" + exec kill -INT -[exp_pid] fail "$test timed out" } eof { diff --git a/testsuite/systemtap.maps/ix_clear2.exp b/testsuite/systemtap.maps/ix_clear2.exp index c5e72c36..a1b68628 100644 --- a/testsuite/systemtap.maps/ix_clear2.exp +++ b/testsuite/systemtap.maps/ix_clear2.exp @@ -15,7 +15,7 @@ expect { pass "$test passed" } timeout { - send "\003" + exec kill -INT -[exp_pid] fail "$test timed out" } eof { diff --git a/testsuite/systemtap.maps/ix_clear3.exp b/testsuite/systemtap.maps/ix_clear3.exp index 7674fdbc..a2935470 100644 --- a/testsuite/systemtap.maps/ix_clear3.exp +++ b/testsuite/systemtap.maps/ix_clear3.exp @@ -13,7 +13,7 @@ expect { pass "$test passed" } timeout { - send "\003" + exec kill -INT -[exp_pid] fail "$test timed out" } eof { diff --git a/testsuite/systemtap.maps/pmap_agg_overflow.exp b/testsuite/systemtap.maps/pmap_agg_overflow.exp index 1b0a7234..99665057 100644 --- a/testsuite/systemtap.maps/pmap_agg_overflow.exp +++ b/testsuite/systemtap.maps/pmap_agg_overflow.exp @@ -19,7 +19,7 @@ expect { set unsupported 1 } timeout { - send "\003" + exec kill -INT -[exp_pid] fail "$test timed out" } eof {} diff --git a/testsuite/systemtap.printf/sharedbuf.exp b/testsuite/systemtap.printf/sharedbuf.exp index 6a182716..b1fd4c72 100644 --- a/testsuite/systemtap.printf/sharedbuf.exp +++ b/testsuite/systemtap.printf/sharedbuf.exp @@ -52,7 +52,7 @@ expect { } eof {fail "shared buffer hosting. unexpected EOF" } } -send "\003" +exec kill -INT -[exp_pid] if {$c1 == 2 && $c2 == 2} { pass "buffer sharing" } else { diff --git a/testsuite/systemtap.samples/crash.exp b/testsuite/systemtap.samples/crash.exp index 629cff54..9c3e5e05 100644 --- a/testsuite/systemtap.samples/crash.exp +++ b/testsuite/systemtap.samples/crash.exp @@ -19,7 +19,7 @@ expect { timeout { fail "$test - testlog.stp timeout" } timeout { fail "$test - testlog.stp eof" } } -catch { send "\003"; close ; wait } +catch { exec kill -INT -[exp_pid]; close ; wait } # The crash(8) script creates testlog/global or testlog/cpu as_root { chmod -R a+rX testlog } diff --git a/testsuite/systemtap.stress/whitelist.exp b/testsuite/systemtap.stress/whitelist.exp index 00a8208a..4a31c124 100644 --- a/testsuite/systemtap.stress/whitelist.exp +++ b/testsuite/systemtap.stress/whitelist.exp @@ -310,14 +310,14 @@ proc whitelist_run { TEST_NAME {LOAD_GEN_FUNCTION ""} args } { -re {Pass\ 5:\ starting\ run.\r\n} { set error_msg "stap runtime" runbenchs - send -i $stap_id "\003" + exec kill -INT -[exp_pid -i $stap_id] exp_continue } -re {Pass\ 5:\ run\ completed} { set failed 0 } -re {parse\ error|semantic\ error} { set detail "$expect_out(0,string)" } - timeout { set detail "stap timeout"; send "\003" } + timeout { set detail "stap timeout"; exec kill -INT -[exp_pid -i $stap_id] } eof { set failed 0 } } catch {close -i $stap_id} -- cgit From 715a5878413aecc2e50be94f8171f7cca3955b00 Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 23 Feb 2008 22:08:00 +0000 Subject: 2008-02-23 Frank Ch. Eigler * systemtap.samples/args.exp: Remove installation-specific paths from pass/fail judgements. --- testsuite/ChangeLog | 5 +++++ testsuite/systemtap.samples/args.exp | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index c3ee8d1e..41e34c57 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-02-23 Frank Ch. Eigler + + * systemtap.samples/args.exp: Remove installation-specific paths from + pass/fail judgements. + 2008-02-23 Frank Ch. Eigler * */*.exp: Change all "send \003" to "exec kill -INT -" in order diff --git a/testsuite/systemtap.samples/args.exp b/testsuite/systemtap.samples/args.exp index f6d5cec6..54647998 100644 --- a/testsuite/systemtap.samples/args.exp +++ b/testsuite/systemtap.samples/args.exp @@ -5,7 +5,7 @@ set stappath [exec which stap] set staprunpath [exec which staprun] if [file exists $staprunpath] { - pass "$test search for staprun ($staprunpath)" + pass "$test search for staprun" } else { fail "$test search for staprun" return @@ -25,15 +25,15 @@ catch {close}; wait set modpath_cwd "$modname.ko" if [file exists $modpath_cwd] { - pass "$test search for probe module ($modpath_cwd)" + pass "$test search for probe module" } else { - fail "$test search for probe module ($modpath_cwd)" + fail "$test search for probe module" return } exec /bin/rm -f $modpath_cwd if [file exists $tmpdir] { - pass "$test search for tmpdir ($tmpdir)" + pass "$test search for tmpdir" } else { fail "$test search for tmpdir" return @@ -41,9 +41,9 @@ if [file exists $tmpdir] { set modpath "$tmpdir/$modname.ko" if [file exists $modpath] { - pass "$test search for probe module ($modpath)" + pass "$test search for tmpdir probe module" } else { - fail "$test search for probe module ($modpath)" + fail "$test search for tmpdir probe module" return } -- cgit From 8a0dc35ee2dc6164e30e0a4c664768066db047e0 Mon Sep 17 00:00:00 2001 From: fche Date: Sat, 23 Feb 2008 22:33:55 +0000 Subject: 2008-02-23 Frank Ch. Eigler * systemtap.printf/*.exp: Canonicalize pass/fail messages. --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.printf/end1.exp | 4 ++-- testsuite/systemtap.printf/end1b.exp | 6 +++--- testsuite/systemtap.printf/mixed_out.exp | 4 ++-- testsuite/systemtap.printf/mixed_outb.exp | 6 +++--- testsuite/systemtap.printf/out1.exp | 4 ++-- testsuite/systemtap.printf/out1b.exp | 6 +++--- testsuite/systemtap.printf/out2.exp | 4 ++-- testsuite/systemtap.printf/out2b.exp | 6 +++--- testsuite/systemtap.printf/out3.exp | 4 ++-- testsuite/systemtap.printf/out3b.exp | 6 +++--- testsuite/systemtap.printf/string2.exp | 8 ++++---- 12 files changed, 33 insertions(+), 29 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 41e34c57..c6f7ced8 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-02-23 Frank Ch. Eigler + + * systemtap.printf/*.exp: Canonicalize pass/fail messages. + 2008-02-23 Frank Ch. Eigler * systemtap.samples/args.exp: Remove installation-specific paths from diff --git a/testsuite/systemtap.printf/end1.exp b/testsuite/systemtap.printf/end1.exp index 36a2335e..0a4dd32e 100644 --- a/testsuite/systemtap.printf/end1.exp +++ b/testsuite/systemtap.printf/end1.exp @@ -18,12 +18,12 @@ if {[catch {exec stap -o $tmpfile $tpath} res]} { } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return } -pass "$TEST_NAME passed" +pass $TEST_NAME catch {exec rm -f $tmpfile} diff --git a/testsuite/systemtap.printf/end1b.exp b/testsuite/systemtap.printf/end1b.exp index e28dce5b..1764a383 100644 --- a/testsuite/systemtap.printf/end1b.exp +++ b/testsuite/systemtap.printf/end1b.exp @@ -24,18 +24,18 @@ if {[catch {exec stap -b -o $tmpfile $test} res]} { if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } -pass "$TEST_NAME passed" +pass $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" diff --git a/testsuite/systemtap.printf/mixed_out.exp b/testsuite/systemtap.printf/mixed_out.exp index 6967f815..093a8ca1 100644 --- a/testsuite/systemtap.printf/mixed_out.exp +++ b/testsuite/systemtap.printf/mixed_out.exp @@ -18,12 +18,12 @@ if {[catch {exec stap -DMAXACTION=100000 -o $tmpfile $tpath} res]} { } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return } -pass "$TEST_NAME passed" +pass $TEST_NAME catch {exec rm -f $tmpfile} diff --git a/testsuite/systemtap.printf/mixed_outb.exp b/testsuite/systemtap.printf/mixed_outb.exp index 748dd0f2..cbf7b920 100644 --- a/testsuite/systemtap.printf/mixed_outb.exp +++ b/testsuite/systemtap.printf/mixed_outb.exp @@ -24,18 +24,18 @@ if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } -pass "$TEST_NAME passed" +pass $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" diff --git a/testsuite/systemtap.printf/out1.exp b/testsuite/systemtap.printf/out1.exp index 6a27d5be..f89d39bf 100644 --- a/testsuite/systemtap.printf/out1.exp +++ b/testsuite/systemtap.printf/out1.exp @@ -18,12 +18,12 @@ if {[catch {exec stap -o $tmpfile $tpath} res]} { } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return } -pass "$TEST_NAME passed" +pass $TEST_NAME catch {exec rm -f $tmpfile} diff --git a/testsuite/systemtap.printf/out1b.exp b/testsuite/systemtap.printf/out1b.exp index 6edb8772..378ea5cd 100644 --- a/testsuite/systemtap.printf/out1b.exp +++ b/testsuite/systemtap.printf/out1b.exp @@ -24,18 +24,18 @@ if {[catch {exec stap -b -o $tmpfile $test} res]} { if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } -pass "$TEST_NAME passed" +pass $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" diff --git a/testsuite/systemtap.printf/out2.exp b/testsuite/systemtap.printf/out2.exp index 36d5d443..7b312b11 100644 --- a/testsuite/systemtap.printf/out2.exp +++ b/testsuite/systemtap.printf/out2.exp @@ -18,12 +18,12 @@ if {[catch {exec stap -o $tmpfile $tpath} res]} { } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return } -pass "$TEST_NAME passed" +pass $TEST_NAME catch {exec rm -f $tmpfile} diff --git a/testsuite/systemtap.printf/out2b.exp b/testsuite/systemtap.printf/out2b.exp index fc3301ab..f7fdef6b 100644 --- a/testsuite/systemtap.printf/out2b.exp +++ b/testsuite/systemtap.printf/out2b.exp @@ -24,18 +24,18 @@ if {[catch {exec stap -b -o $tmpfile $test} res]} { if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } -pass "$TEST_NAME passed" +pass $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" diff --git a/testsuite/systemtap.printf/out3.exp b/testsuite/systemtap.printf/out3.exp index 8cf63d50..c16db391 100644 --- a/testsuite/systemtap.printf/out3.exp +++ b/testsuite/systemtap.printf/out3.exp @@ -18,12 +18,12 @@ if {[catch {exec stap -DMAXACTION=100000 -o $tmpfile $tpath} res]} { } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "$res" catch {exec rm -f $tmpfile} return } -pass "$TEST_NAME passed" +pass $TEST_NAME catch {exec rm -f $tmpfile} diff --git a/testsuite/systemtap.printf/out3b.exp b/testsuite/systemtap.printf/out3b.exp index af0d6be7..16ee2182 100644 --- a/testsuite/systemtap.printf/out3b.exp +++ b/testsuite/systemtap.printf/out3b.exp @@ -24,18 +24,18 @@ if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" - fail "$TEST_NAME failed" + fail $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" return } -pass "$TEST_NAME passed" +pass $TEST_NAME as_root "/bin/rm -f [glob ${tmpfile}*]" diff --git a/testsuite/systemtap.printf/string2.exp b/testsuite/systemtap.printf/string2.exp index a64bfa38..f380337a 100644 --- a/testsuite/systemtap.printf/string2.exp +++ b/testsuite/systemtap.printf/string2.exp @@ -102,16 +102,16 @@ t is <12345678901234567890123456789012345678901234567890123456789012345678901234 98: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 99: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890} -set TEST_NAME "$srcdir/$subdir/$test.stp" +set TEST_NAME "$subdir/$test.stp" if {![installtest_p]} { untested $TEST_NAME; return } -set res [exec stap $TEST_NAME] +set res [exec stap $srcdir/$subdir/$test.stp] if {[string compare $res $::result_string] == 0} { - pass "$TEST_NAME passed" + pass $TEST_NAME } else { - fail "$TEST_NAME failed" + fail $TEST_NAME puts "EXPECTED:\n-----------------------\n<$::result_string>" puts "-----------------------\n" puts "GOT:\n-----------------------\n<$res>" -- cgit