diff options
author | Dave Brolley <brolley@redhat.com> | 2009-08-06 14:35:08 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-08-06 14:35:08 -0400 |
commit | 6dc27b9452aa2f52dfb3414c0ad8192ec65fb2d1 (patch) | |
tree | e4ddccdf7613a7788ad74bbc18727d35abf133fe /testsuite | |
parent | 3c96130fde2f114d0ecca13870ac91b00219cf6c (diff) | |
parent | cab97f033153b93d1d26388a25a65052cf36fc8d (diff) | |
download | systemtap-steved-6dc27b9452aa2f52dfb3414c0ad8192ec65fb2d1.tar.gz systemtap-steved-6dc27b9452aa2f52dfb3414c0ad8192ec65fb2d1.tar.xz systemtap-steved-6dc27b9452aa2f52dfb3414c0ad8192ec65fb2d1.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/lib/systemtap.exp | 23 | ||||
-rw-r--r-- | testsuite/systemtap.base/bz10078.exp | 6 | ||||
-rw-r--r-- | testsuite/systemtap.base/bz10294.c | 21 | ||||
-rw-r--r-- | testsuite/systemtap.base/bz10294.stp | 4 | ||||
-rw-r--r-- | testsuite/systemtap.base/bz6850.exp | 6 | ||||
-rw-r--r-- | testsuite/systemtap.base/bz6905.exp | 25 | ||||
-rw-r--r-- | testsuite/systemtap.base/statement.exp | 38 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes.exp | 6 | ||||
-rw-r--r-- | testsuite/systemtap.printf/end1b.exp | 8 | ||||
-rw-r--r-- | testsuite/systemtap.printf/mixed_outb.exp | 8 | ||||
-rw-r--r-- | testsuite/systemtap.printf/out1b.exp | 8 | ||||
-rw-r--r-- | testsuite/systemtap.printf/out2b.exp | 8 | ||||
-rw-r--r-- | testsuite/systemtap.printf/out3b.exp | 8 |
13 files changed, 112 insertions, 57 deletions
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 76fd57bd..82afb6b7 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -26,6 +26,29 @@ proc utrace_p {} { } +proc uprobes_p {} { + global env + if {! [utrace_p]} { + return 0 + } + set uprobes $env(SYSTEMTAP_RUNTIME)/uprobes + set res [catch "exec make -q -C $uprobes uprobes.ko" output] + if {$res != 0} { + if {! [installtest_p]} { + # build as user in the source tree + verbose -log "exec make -C $uprobes" + set res [catch "exec make -C $uprobes" output] + verbose -log "OUT $output" + verbose -log "RC $res" + } else { + # build as root in the installed location + set res [as_root "make -C $uprobes"] + } + } + if {$res == 0} { return 1 } else { return 0 } +} + + proc print_systemtap_version {} { set version [exec /bin/uname -r] set location "/boot/vmlinux-$version" diff --git a/testsuite/systemtap.base/bz10078.exp b/testsuite/systemtap.base/bz10078.exp index cad3a3a8..8928a078 100644 --- a/testsuite/systemtap.base/bz10078.exp +++ b/testsuite/systemtap.base/bz10078.exp @@ -3,7 +3,7 @@ set test bz10078 catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" } -if {![utrace_p]} { +if {![uprobes_p]} { catch {exec rm -f $test} untested "$test -p4" untested "$test -p5" @@ -19,9 +19,7 @@ if {! [installtest_p]} { return } -# Pick up the stap being tested. -set stapexe [exec /usr/bin/which stap] -spawn sudo $stapexe $srcdir/$subdir/$test.stp -c ./$test +spawn stap $srcdir/$subdir/$test.stp -c ./$test set ok 0 expect { -timeout 60 diff --git a/testsuite/systemtap.base/bz10294.c b/testsuite/systemtap.base/bz10294.c new file mode 100644 index 00000000..1ea9a0d9 --- /dev/null +++ b/testsuite/systemtap.base/bz10294.c @@ -0,0 +1,21 @@ +int func_a(int a) +{ + a = a + 1; + return a; +} + + +int func_b(int b) +{ + b = b + 2; + return b; +} + +int main() +{ + int a; + + a = func_a(1); + a = a + func_b(a); + return 0; +} diff --git a/testsuite/systemtap.base/bz10294.stp b/testsuite/systemtap.base/bz10294.stp new file mode 100644 index 00000000..0a18c45f --- /dev/null +++ b/testsuite/systemtap.base/bz10294.stp @@ -0,0 +1,4 @@ +#! stap -p2 +probe process("./bz10294").statement("*@bz10294.c:10-10") { + printf("ok") +} diff --git a/testsuite/systemtap.base/bz6850.exp b/testsuite/systemtap.base/bz6850.exp index 32ecdaf5..1b88ac10 100644 --- a/testsuite/systemtap.base/bz6850.exp +++ b/testsuite/systemtap.base/bz6850.exp @@ -3,7 +3,7 @@ set test bz6850 catch {exec gcc -g -o bz6850 $srcdir/$subdir/bz6850.c} err if {$err == "" && [file exists bz6850]} then { pass "$test compile" } else { fail "$test compile" } -if {![utrace_p]} { +if {![uprobes_p]} { catch {exec rm -f $test} untested "$test -p4" untested "$test -p5" @@ -19,9 +19,7 @@ if {! [installtest_p]} { return } -# Pick up the stap being tested. -set stapexe [exec /usr/bin/which stap] -spawn sudo $stapexe $srcdir/$subdir/bz6850.stp -c ./bz6850 +spawn stap $srcdir/$subdir/bz6850.stp -c ./bz6850 expect { -timeout 60 -re {[^\r\n]*called\r\n} { exp_continue } diff --git a/testsuite/systemtap.base/bz6905.exp b/testsuite/systemtap.base/bz6905.exp deleted file mode 100644 index 8119159e..00000000 --- a/testsuite/systemtap.base/bz6905.exp +++ /dev/null @@ -1,25 +0,0 @@ -set test bz6905 - -catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err -if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" } - -if {![utrace_p]} { - catch {exec rm -f $test} - untested "$test -p2" - return -} - -set stapexe [exec /usr/bin/which stap] -spawn sudo $stapexe -p2 $srcdir/$subdir/$test.stp -set hint 0 -set probes 0 -expect { - -timeout 60 - -re "# probes" { incr hint; exp_continue } - -re {process.*statement.*} { incr probes; exp_continue } - timeout { fail "$test (timeout)" } - eof { } -} -wait -if { $hint == 1 && $probes > 0 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" } -exec rm -f $test diff --git a/testsuite/systemtap.base/statement.exp b/testsuite/systemtap.base/statement.exp new file mode 100644 index 00000000..d8fce8d8 --- /dev/null +++ b/testsuite/systemtap.base/statement.exp @@ -0,0 +1,38 @@ +set test bz6905 + +catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err +if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" } + +spawn stap -p2 $srcdir/$subdir/$test.stp +set hint 0 +set probes 0 +expect { + -timeout 60 + -re "# probes" { incr hint; exp_continue } + -re {process.*statement.*} { incr probes; exp_continue } + timeout { fail "$test (timeout)" } + eof { } +} +wait +if { $hint == 1 && $probes > 0 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" } +exec rm -f $test + +set test bz10294 + +catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err +if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" } + +spawn stap -p2 $srcdir/$subdir/$test.stp +set hint 0 +set probes 0 +expect { + -timeout 60 + -re "# probes" { incr hint; exp_continue } + -re {process.*statement.*} { incr probes; exp_continue } + timeout { fail "$test (timeout)" } + eof { } +} +wait +if { $hint == 1 && $probes == 1 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" } +exec rm -f $test + diff --git a/testsuite/systemtap.base/uprobes.exp b/testsuite/systemtap.base/uprobes.exp index 6344cbf0..bdd620b3 100644 --- a/testsuite/systemtap.base/uprobes.exp +++ b/testsuite/systemtap.base/uprobes.exp @@ -18,7 +18,7 @@ if [file exists $path] then { pass "$test prep" } else { fail "$test prep" } catch {exec gcc -g -o jennie jennie.c} err if {$err == "" && [file exists jennie]} then { pass "$test compile" } else { fail "$test compile" } -if {![utrace_p]} { +if {! [uprobes_p]} { untested "$test -p4"; untested "$test -p5" catch {exec rm -f jennie.c jennie} return @@ -33,9 +33,7 @@ if {! [installtest_p]} { return } -# Pick up the stap being tested. -set stapexe [exec /usr/bin/which stap] -spawn sudo $stapexe $srcdir/$subdir/uprobes.stp -w -c "./jennie 1 2 3 4" +spawn stap $srcdir/$subdir/uprobes.stp -w -c "./jennie 1 2 3 4" set ok 0 expect { -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*argc=0x[1-5][^\r\n]*\r\n} { incr ok; exp_continue } diff --git a/testsuite/systemtap.printf/end1b.exp b/testsuite/systemtap.printf/end1b.exp index 46cdc9c7..c3c9d4cf 100644 --- a/testsuite/systemtap.printf/end1b.exp +++ b/testsuite/systemtap.printf/end1b.exp @@ -18,24 +18,24 @@ if {[catch {exec mktemp -t staptestXXXXXX} tmpfile]} { if {[catch {exec stap -b -o $tmpfile $test} res]} { puts "stap failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } pass $TEST_NAME -as_root "/bin/rm -f [glob ${tmpfile}*]" +eval [list exec /bin/rm -f] [glob "${tmpfile}*"] diff --git a/testsuite/systemtap.printf/mixed_outb.exp b/testsuite/systemtap.printf/mixed_outb.exp index c15520b1..1225f9ce 100644 --- a/testsuite/systemtap.printf/mixed_outb.exp +++ b/testsuite/systemtap.printf/mixed_outb.exp @@ -18,24 +18,24 @@ if {[catch {exec mktemp -t staptestXXXXXX} tmpfile]} { if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { fail $TEST_NAME puts "stap failed: $res" - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } pass $TEST_NAME -as_root "/bin/rm -f [glob ${tmpfile}*]" +eval [list exec /bin/rm -f] [glob "${tmpfile}*"] diff --git a/testsuite/systemtap.printf/out1b.exp b/testsuite/systemtap.printf/out1b.exp index 24efbf4c..d09dadef 100644 --- a/testsuite/systemtap.printf/out1b.exp +++ b/testsuite/systemtap.printf/out1b.exp @@ -18,24 +18,24 @@ if {[catch {exec mktemp -t staptestXXXXXX} tmpfile]} { if {[catch {exec stap -b -o $tmpfile $test} res]} { fail $TEST_NAME puts "stap failed: $res" - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } pass $TEST_NAME -as_root "/bin/rm -f [glob ${tmpfile}*]" +eval [list exec /bin/rm -f] [glob "${tmpfile}*"] diff --git a/testsuite/systemtap.printf/out2b.exp b/testsuite/systemtap.printf/out2b.exp index 70a98ea2..bb732c42 100644 --- a/testsuite/systemtap.printf/out2b.exp +++ b/testsuite/systemtap.printf/out2b.exp @@ -18,24 +18,24 @@ if {[catch {exec mktemp -t staptestXXXXXX} tmpfile]} { if {[catch {exec stap -b -o $tmpfile $test} res]} { fail $TEST_NAME puts "stap failed: $res" - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } pass $TEST_NAME -as_root "/bin/rm -f [glob ${tmpfile}*]" +eval [list exec /bin/rm -f] [glob "${tmpfile}*"] diff --git a/testsuite/systemtap.printf/out3b.exp b/testsuite/systemtap.printf/out3b.exp index d49625e9..5d82512a 100644 --- a/testsuite/systemtap.printf/out3b.exp +++ b/testsuite/systemtap.printf/out3b.exp @@ -18,24 +18,24 @@ if {[catch {exec mktemp -t staptestXXXXXX} tmpfile]} { if {[catch {exec stap -DMAXACTION=100000 -b -o $tmpfile $test} res]} { fail $TEST_NAME puts "stap failed: $res" - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {eval [list exec $stap_merge_path -o $tmpfile] [glob "${tmpfile}_*"]} res]} { puts "merge failed: $res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } if {[catch {exec cmp $tmpfile $srcdir/$subdir/large_output} res]} { puts "$res" fail $TEST_NAME - as_root "/bin/rm -f [glob ${tmpfile}*]" + eval [list exec /bin/rm -f] [glob "${tmpfile}*"] return } pass $TEST_NAME -as_root "/bin/rm -f [glob ${tmpfile}*]" +eval [list exec /bin/rm -f] [glob "${tmpfile}*"] |