]> sourceware.org Git - systemtap.git/commitdiff
dump_probe_aliases.exp: new testcase for --dump-probe-aliases
authorJonathan Lebon <jlebon@redhat.com>
Tue, 1 Apr 2014 15:41:39 +0000 (11:41 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Tue, 1 Apr 2014 19:37:15 +0000 (15:37 -0400)
testsuite/systemtap.base/dump_probe_aliases.exp [new file with mode: 0644]

diff --git a/testsuite/systemtap.base/dump_probe_aliases.exp b/testsuite/systemtap.base/dump_probe_aliases.exp
new file mode 100644 (file)
index 0000000..b83f661
--- /dev/null
@@ -0,0 +1,56 @@
+set test "dump_probe_aliases"
+
+# This test verifies that stap --dump-probe-aliases works properly.
+# Namely, we look for specific aliases in the stap output. We also check
+# that only the -v version includes aliases starting with '_'.
+
+proc has_alias { output wanted alias } {
+   global test subtest
+
+   set inlist [lsearch $output $alias]
+   if {[expr  $wanted && $inlist > 0] \
+    || [expr !$wanted && $inlist < 0]} {
+      pass "$test ($subtest)"
+   } else {
+      fail "$test ($subtest)"
+   }
+}
+
+# Get output for --dump-probe-aliases
+if {[catch {exec -ignorestderr stap --dump-probe-aliases 2>/dev/null} output]} {
+   fail "$test (can't get output of stap --dump-probe-aliases)"
+   return
+} else {
+   pass "$test (got output of stap --dump-probe-aliases)"
+}
+
+# Get output for -v --dump-probe-aliases
+if {[catch {exec -ignorestderr stap -v --dump-probe-aliases 2>/dev/null} outputv]} {
+   fail "$test (can't get output of stap -v --dump-probe-aliases)"
+   return
+} else {
+   pass "$test (got output of stap -v --dump-probe-aliases)"
+}
+
+# Split outputs into lines
+set output  [split $output  "\n"]
+set outputv [split $outputv "\n"]
+
+set subtest "oneshot in output"
+has_alias $output 1 "oneshot += begin"
+
+set subtest "vfs.read in output"
+has_alias $output 1 "vfs.read = kernel.function(\"vfs_read\")"
+
+set subtest "__syscall.lseek not in output"
+has_alias $output 0 "__syscall.lseek = kernel.function(\"sys_lseek\").call"
+
+set subtest "oneshot in -v output"
+has_alias $outputv 1 "oneshot += begin"
+
+set subtest "vfs.read in -v output"
+has_alias $outputv 1 "vfs.read = kernel.function(\"vfs_read\")"
+
+set subtest "__syscall.lseek in -v output"
+has_alias $outputv 1 "__syscall.lseek = kernel.function(\"sys_lseek\").call"
+
This page took 0.029354 seconds and 5 git commands to generate.