summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog25
-rw-r--r--testsuite/Makefile.am2
-rw-r--r--testsuite/Makefile.in2
-rwxr-xr-xtestsuite/buildok/seven.stp2
-rwxr-xr-xtestsuite/buildok/seventeen.stp4
-rw-r--r--testsuite/lib/stap_compile.exp2
-rw-r--r--testsuite/lib/stap_run.exp2
-rw-r--r--testsuite/lib/stap_run2.exp2
-rw-r--r--testsuite/lib/stap_run_binary.exp2
-rw-r--r--testsuite/lib/stap_run_exact.exp2
-rw-r--r--testsuite/lib/systemtap.exp9
-rw-r--r--testsuite/systemtap.base/vars.exp32
-rw-r--r--testsuite/systemtap.base/warnings.stp2
-rw-r--r--testsuite/systemtap.examples/ChangeLog8
-rw-r--r--testsuite/systemtap.examples/check.exp44
-rw-r--r--testsuite/systemtap.examples/helloworld.meta2
-rw-r--r--testsuite/systemtap.examples/traceio2.meta2
17 files changed, 104 insertions, 40 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 14243b80..9dd388ad 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2008-08-05 Stan Cox <scox@redhat.com>
+
+ * systemtap.base/warnings.stp: Use relative instead of absolute line.
+ * systemtap.base/vars.exp: New test.
+
+2008-08-03 Wenji Huang <wenji.huang@oracle.com>
+
+ * buildok/seven.stp: Correct for 2.6.27.
+ * buildok/seventeen.stp: Ditto.
+
+2008-07-29 Dave Brolley <brolley@redhat.com>
+
+ * Makefile.am (SYSTEMTAP_PATH): Add $(EXTRA_SYSTEMTAP_PATH).
+ * lib/stap_compile.exp: Revert previous change.
+ * lib/stap_run.exp: Likewise.
+ * lib/stap_run2.exp: Likewise.
+ * lib/stap_run_binary.exp: Likewise.
+ * lib/stap_run_exact.exp: Likewise.
+ * lib/systemtap.exp (stap_exec): Removed.
+ * Makefile.in: Regenerated.
+
+2008-07-24 Dave Nomura <dcnltc@us.ibm.com>
+
+ * systemtap.base/itrace.stp: Added simple tests of itrace probe.
+
2008-07-14 Dave Brolley <brolley@redhat.com>
* Makefile.am (TOOL_OPTS): New variable.
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 5f3044cd..03c70cb6 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -40,7 +40,7 @@ SYSTEMTAP_RUNTIME=$(DESTDIR)$(pkgdatadir)/runtime
SYSTEMTAP_TAPSET=$(DESTDIR)$(pkgdatadir)/tapset
LD_LIBRARY_PATH=$(DESTDIR)$(libdir)/systemtap
CRASH_LIBDIR=$(DESTDIR)$(libdir)/systemtap
-SYSTEMTAP_PATH=$(DESTDIR)$(bindir)
+SYSTEMTAP_PATH=$(EXTRA_SYSTEMTAP_PATH):$(DESTDIR)$(bindir)
RUNTESTDEFAULTFLAGS = --tool $$tool --tool_opts \'$(TOOL_OPTS)\' --srcdir $$srcdir
EXPECT = expect
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 8fe7a21f..cc23aed4 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -149,7 +149,7 @@ SYSTEMTAP_RUNTIME = $(DESTDIR)$(pkgdatadir)/runtime
SYSTEMTAP_TAPSET = $(DESTDIR)$(pkgdatadir)/tapset
LD_LIBRARY_PATH = $(DESTDIR)$(libdir)/systemtap
CRASH_LIBDIR = $(DESTDIR)$(libdir)/systemtap
-SYSTEMTAP_PATH = $(DESTDIR)$(bindir)
+SYSTEMTAP_PATH = $(EXTRA_SYSTEMTAP_PATH):$(DESTDIR)$(bindir)
RUNTESTDEFAULTFLAGS = --tool $$tool --tool_opts \'$(TOOL_OPTS)\' --srcdir $$srcdir
EXPECT = expect
RUNTEST = "env SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$$PATH $(srcdir)/execrc runtest"
diff --git a/testsuite/buildok/seven.stp b/testsuite/buildok/seven.stp
index d6f6e5a9..dc3bc786 100755
--- a/testsuite/buildok/seven.stp
+++ b/testsuite/buildok/seven.stp
@@ -6,6 +6,7 @@
# first: enums and ints
+%( kernel_v <= "2.6.26" %?
probe kernel.function("find_pid")
{
%( kernel_v >= "2.6.17" %?
@@ -15,6 +16,7 @@ probe kernel.function("find_pid")
. sprint($nr) . ")")
%)
}
+%)
# second: opaque pointers and enums
diff --git a/testsuite/buildok/seventeen.stp b/testsuite/buildok/seventeen.stp
index 9adffa48..e4a7a8e8 100755
--- a/testsuite/buildok/seventeen.stp
+++ b/testsuite/buildok/seventeen.stp
@@ -5,5 +5,9 @@
probe kernel.function("pipe_write")
{
+%( kernel_v > "2.6.26" %?
+ printf("0x%x\n", $write_pipefifo_fops->llseek)
+%:
printf("0x%x\n", $write_fifo_fops->llseek)
+%)
}
diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp
index 8f82018f..35124a44 100644
--- a/testsuite/lib/stap_compile.exp
+++ b/testsuite/lib/stap_compile.exp
@@ -4,7 +4,7 @@
# - script is the script to compile
# Additional arguments are passed to stap as-is.
proc stap_compile { TEST_NAME compile script args } {
- set cmd [concat [stap_exec] {-v -p4 -e} $script $args]
+ set cmd [concat stap {-v -p4 -e} $script $args]
verbose -log "running $cmd"
eval spawn $cmd
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp
index 5f67d773..c0027e95 100644
--- a/testsuite/lib/stap_run.exp
+++ b/testsuite/lib/stap_run.exp
@@ -26,7 +26,7 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
- set cmd [concat [stap_exec] -v $args]
+ set cmd [concat stap -v $args]
if [file readable $test_file_name] {
lappend cmd $test_file_name
}
diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp
index 1d9dc0b3..9849aefb 100644
--- a/testsuite/lib/stap_run2.exp
+++ b/testsuite/lib/stap_run2.exp
@@ -15,7 +15,7 @@ proc stap_run2 { TEST_NAME args } {
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
- set cmd [concat [stap_exec] $args $test_file_name]
+ set cmd [concat stap $args $test_file_name]
catch {eval exec $cmd} res
set n 0
diff --git a/testsuite/lib/stap_run_binary.exp b/testsuite/lib/stap_run_binary.exp
index a5e1195a..1d31d817 100644
--- a/testsuite/lib/stap_run_binary.exp
+++ b/testsuite/lib/stap_run_binary.exp
@@ -13,7 +13,7 @@ proc stap_run_binary { TEST_NAME} {
if {[info procs installtest_p] != "" && ![installtest_p]} {untested $TEST_NAME; return}
set hex_args {-ve 8/1 "%02x " "\n"}
- set res [exec [stap_exec] $test_file_name | hexdump $hex_args]
+ set res [exec stap $test_file_name | hexdump $hex_args]
if {[string compare $res $::result_string] == 0} {
pass "$TEST_NAME"
diff --git a/testsuite/lib/stap_run_exact.exp b/testsuite/lib/stap_run_exact.exp
index 23c22ec0..6a473798 100644
--- a/testsuite/lib/stap_run_exact.exp
+++ b/testsuite/lib/stap_run_exact.exp
@@ -12,7 +12,7 @@
proc stap_run_exact { TEST_NAME test_file_name args } {
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
- set cmd [concat [stap_exec] $args $test_file_name]
+ set cmd [concat stap $args $test_file_name]
catch {eval exec $cmd} res
set n 0
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp
index e74bd13c..db5c1587 100644
--- a/testsuite/lib/systemtap.exp
+++ b/testsuite/lib/systemtap.exp
@@ -16,15 +16,6 @@ proc use_server_p {} {
}
-proc stap_exec {} {
- if {[info procs use_server_p] != "" && [use_server_p]} then {
- return "stap-client"
- } else {
- return "stap"
- }
-}
-
-
proc print_systemtap_version {} {
set version [exec /bin/uname -r]
set location "/boot/vmlinux-$version"
diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp
new file mode 100644
index 00000000..7541c01b
--- /dev/null
+++ b/testsuite/systemtap.base/vars.exp
@@ -0,0 +1,32 @@
+# Script for testing $$vars, $$parms, $$locals
+
+set test "vars"
+
+# grab C statement that $$vars yields
+set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} 2>&1 | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/..\".*$//}]
+catch {eval exec $cmd} vars
+
+# grab C statement that $$parms yields
+set cmd [regsub "vars" $cmd "parms"]
+catch {eval exec $cmd} parms
+
+# grab C statement that $$locals yields
+set cmd [regsub "parms" $cmd "locals"]
+catch {eval exec $cmd} locals
+
+# syntax check of $$vars C statement
+set vars_ok [regexp "(\[a-z_\]+=%#llx *)+" $vars]
+if {!$vars_ok} {
+ fail "$test"
+} else {
+ pass "$test"
+}
+
+# $$vars should be equivalent to $$parms + $$locals
+if {![string equal [string trim $vars] \
+ [string trim [concat $parms " " $locals]]]} {
+ fail "$test parms/locals"
+} else {
+ pass "$test parms/locals"
+}
+
diff --git a/testsuite/systemtap.base/warnings.stp b/testsuite/systemtap.base/warnings.stp
index 94ed57b3..d71b3034 100644
--- a/testsuite/systemtap.base/warnings.stp
+++ b/testsuite/systemtap.base/warnings.stp
@@ -9,7 +9,7 @@ probe never { print(elide+me1) bar () }
# PR 6611
-probe probea = kernel.statement("bio_init@fs/bio.c:135")
+probe probea = kernel.statement("bio_init@fs/bio.c+3")
{ printf("%d", funca(2)); elide_me6="foo" }
probe probea { printf("%d", funcb(2,3)); printf("%s",var) }
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index d75ad014..7cb39fb9 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-01 William Cohen <wcohen@redhat.com>
+
+ * helloworld.meta, traceio2.meta: Tweak test_installcheck.
+
+2008-08-01 William Cohen <wcohen@redhat.com>
+
+ * check.exp: Run both tests for installcheck tests.
+
2008-07-11 Mark Wielaard <mwielaard@redhat.com>
* traceio.meta: s/decending/descending/ in description.
diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp
index 2ac43050..14d9a57e 100644
--- a/testsuite/systemtap.examples/check.exp
+++ b/testsuite/systemtap.examples/check.exp
@@ -32,6 +32,23 @@ proc extract_tag { META_DATA TAG } {
return $value
}
+proc run_command { test command } {
+ #FIXME tcl says that single quotes not dealt with
+ if { $command != "" } then {
+ verbose -log "attempting command $command"
+ set res [catch {eval exec $command} value]
+ verbose -log "OUT $value"
+ verbose -log "RC $res"
+ if {$res != 0 } {
+ fail $test
+ } else {
+ pass $test
+ }
+ } else {
+ untested $test
+ }
+}
+
set curdir [pwd]
set src_examples $srcdir/systemtap.examples
@@ -39,36 +56,21 @@ set meta_files [lsort [exec find $src_examples -path "*.meta"]]
foreach file $meta_files {
set dir [file dirname $file]
set test [regsub {.*/testsuite/} $file ""]
+ set test [regsub {.meta} $test ""]
cd $dir
set meta_data [get_meta_data $file]
set test_check [extract_tag "$meta_data" "test_check"]
+ set command $test_check
+ run_command "$test build" $command
set test_installcheck [extract_tag "$meta_data" "test_installcheck"]
- # Would like to run the tests (-p5), but pass fail logic too
- # simple and fails for many examples
- # FIXME following line prevents installcheck with "--tools_opts install"
- set test_installcheck ""
+ # The pass/fail logic too simple and fails for some examples
+ # FIXME would like to be able to run more complicated test code
if {[info procs installtest_p] != "" && [installtest_p]
&& $test_installcheck != "" } then {
set command $test_installcheck
- } else {
- set command $test_check
- }
-
- #FIXME tcl says that single quotes not dealt with
- if { $command != "" } then {
- verbose -log "attempting command $command"
- set res [catch {eval exec $command} value]
- verbose -log "OUT $value"
- verbose -log "RC $res"
- if {$res != 0 } {
- fail $test
- } else {
- pass $test
- }
- } else {
- untested $test
+ run_command "$test run" $command
}
}
diff --git a/testsuite/systemtap.examples/helloworld.meta b/testsuite/systemtap.examples/helloworld.meta
index f56b7ca3..60bc53f2 100644
--- a/testsuite/systemtap.examples/helloworld.meta
+++ b/testsuite/systemtap.examples/helloworld.meta
@@ -10,4 +10,4 @@ output: text
scope: system-wide
description: A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits.
test_check: stap -p4 helloworld.stp
-test_installcheck: stap helloworld.stp -c "sleep 1"
+test_installcheck: stap helloworld.stp
diff --git a/testsuite/systemtap.examples/traceio2.meta b/testsuite/systemtap.examples/traceio2.meta
index e6bca1a9..4b63108c 100644
--- a/testsuite/systemtap.examples/traceio2.meta
+++ b/testsuite/systemtap.examples/traceio2.meta
@@ -10,4 +10,4 @@ output: trace
scope: system-wide
description: Print out the executable name and process number as reads and writes to the specified device occur.
test_check: stap -p4 traceio2.stp 0x0801
-test_installcheck: /bin/sh eval stap traceio2.stp 0x0801 -c "sleep 1"
+test_installcheck: stap traceio2.stp 0x0801 -c "sleep 1"