summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/uprobes.exp
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-09-05 14:49:04 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-09-05 14:49:04 -0400
commit40be866ffcfc21a15836643cc7c2437ed5c91e8f (patch)
tree8f5add1619e2650e1dcdcdefb53c0d0887f31d8e /testsuite/systemtap.base/uprobes.exp
parent337cd273963410c9a1fa46b10287e72c146df054 (diff)
downloadsystemtap-steved-40be866ffcfc21a15836643cc7c2437ed5c91e8f.tar.gz
systemtap-steved-40be866ffcfc21a15836643cc7c2437ed5c91e8f.tar.xz
systemtap-steved-40be866ffcfc21a15836643cc7c2437ed5c91e8f.zip
PR4255: uprobes test case
Diffstat (limited to 'testsuite/systemtap.base/uprobes.exp')
-rw-r--r--testsuite/systemtap.base/uprobes.exp36
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/uprobes.exp b/testsuite/systemtap.base/uprobes.exp
new file mode 100644
index 00000000..a0ae3e76
--- /dev/null
+++ b/testsuite/systemtap.base/uprobes.exp
@@ -0,0 +1,36 @@
+
+
+set test uprobes
+
+# Compile a little C program to use as the user-space probing victim
+set path "jennie.c"
+set fp [open $path "w"]
+puts $fp "int main (int argc, char *argv[])"
+puts $fp "{"
+puts $fp "if (argc > 1) main (argc - 1, argv);"
+puts $fp "}"
+close $fp
+
+# too easy
+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 { pass "$test compile" }
+
+set rc [stap_run_batch $srcdir/$subdir/uprobes.stp]
+if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" }
+
+if {! [installtest_p]} { untested "$test -p5"; return }
+
+spawn sudo stap -v $srcdir/$subdir/uprobes.stp -c "./jennie 1 2 3 4"
+set ok 0
+expect {
+ -re {^Pass[^\r\n]*\r\n} { exp_continue }
+ -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*call[^\r\n]*\r\n} { incr ok; exp_continue }
+ -re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*return[^\r\n]*\r\n} { incr ok; exp_continue }
+ -timeout 30
+ timeout { }
+ eof { }
+}
+if {$ok == 10} then { pass "$test -p5" } else { fail "$test -p5 ($ok)" }
+catch {wait; close}