diff options
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r-- | testsuite/systemtap.base/cmd_parse.exp | 7 | ||||
-rw-r--r-- | testsuite/systemtap.base/debugpath.exp | 6 | ||||
-rw-r--r-- | testsuite/systemtap.base/marker.exp | 46 | ||||
-rw-r--r-- | testsuite/systemtap.base/procfs.exp | 2 |
4 files changed, 58 insertions, 3 deletions
diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp index 31676a6f..cf15698f 100644 --- a/testsuite/systemtap.base/cmd_parse.exp +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -13,6 +13,7 @@ expect { timeout {fail "cmd_parse1: unexpected timeout"} eof {fail "cmd_parse1: unexpected EOF"} } +wait # stap -c 'echo "hello "\"world\"' -e 'probe begin {}' spawn stap -c {echo "hello "\"world\"} -e {probe begin {}} @@ -22,6 +23,7 @@ expect { timeout {fail "cmd_parse2: unexpected timeout"} eof {fail "cmd_parse2: unexpected EOF"} } +wait #stap -c '(a="hello world"; echo $a)' -e 'probe begin {}' spawn stap -c {(a="hello world"; echo $a)} -e {probe begin {}} @@ -31,6 +33,7 @@ expect { timeout {fail "cmd_parse3: unexpected timeout"} eof {fail "cmd_parse3: unexpected EOF"} } +wait #stap -c '(a="hello "\"world\"; echo $a)' -e 'probe begin {}' spawn stap -c {(a="hello "\"world\"; echo $a)} -e {probe begin {}} @@ -40,6 +43,7 @@ expect { timeout {fail "cmd_parse4: unexpected timeout"} eof {fail "cmd_parse4: unexpected EOF"} } +wait #stap -c '(a="hello "world; echo $a)' -e 'probe begin {}' spawn stap -c {(a="hello "world; echo $a)} -e {probe begin {}} @@ -49,6 +53,7 @@ expect { timeout {fail "cmd_parse5: unexpected timeout"} eof {fail "cmd_parse5: unexpected EOF"} } +wait #stap -c '(((a=42+7)); echo "The answer is $a")' -e 'probe begin {}' spawn stap -c {(((a=42+7)); echo "The answer is $a")} -e {probe begin {}} @@ -58,6 +63,7 @@ expect { timeout {fail "cmd_parse6: unexpected timeout"} eof {fail "cmd_parse6: unexpected EOF"} } +wait #stap -c '(echo "Hello World" 1>&2) > /dev/null' -e 'probe begin {}' spawn stap -c {(echo "Hello World" 1>&2) > /dev/null} -e {probe begin {}} @@ -67,3 +73,4 @@ expect { timeout {fail "cmd_parse7: unexpected timeout"} eof {fail "cmd_parse7: unexpected EOF"} } +wait diff --git a/testsuite/systemtap.base/debugpath.exp b/testsuite/systemtap.base/debugpath.exp index 67b9eb70..b0b12207 100644 --- a/testsuite/systemtap.base/debugpath.exp +++ b/testsuite/systemtap.base/debugpath.exp @@ -6,7 +6,8 @@ expect { timeout { fail "$test (timeout1)" } eof { fail "$test (eof)" } } -catch { close; wait } + +wait set test "debugpath-good" spawn env SYSTEMTAP_DEBUGINFO_PATH=:/usr/lib/debug stap -e "probe kernel.function(\"sys_open\") {}" -p2 @@ -15,4 +16,5 @@ expect { timeout { fail "$test (timeout2)" } eof { fail "$test (eof)" } } -catch { close ; wait } + +wait diff --git a/testsuite/systemtap.base/marker.exp b/testsuite/systemtap.base/marker.exp index bfa3b02d..59d6fd33 100644 --- a/testsuite/systemtap.base/marker.exp +++ b/testsuite/systemtap.base/marker.exp @@ -11,7 +11,7 @@ proc stap_compile { TEST_NAME compile script args } { set cmd [concat {stap -v -p4 -e} $script $args] - puts "running $cmd" + verbose -log "running $cmd" eval spawn $cmd set compile_errors 0 expect { @@ -192,3 +192,47 @@ if {$kernel_markers_found == 0} { set script [format $kernel_script_arg3 $num_marker_name {\[0\]}] stap_compile $TEST_NAME 0 $script } + +set TEST_NAME "K_MARKER11" +if {$kernel_markers_found == 0} { + untested "$TEST_NAME : no kernel markers present" +} else { + # Try compiling a script that prints the format string of a + # marker. + set script [format $kernel_script_arg \ + [lindex $kernel_marker_names 0] {\$format}] + stap_compile $TEST_NAME 1 $script +} + +set TEST_NAME "K_MARKER12" +if {$kernel_markers_found == 0} { + untested "$TEST_NAME : no kernel markers present" +} else { + # Try compiling a script that writes to a marker format string + # (which isn't allowed). + set script [format $kernel_script_arg2 \ + [lindex $kernel_marker_names 0] {\$format}] + stap_compile $TEST_NAME 0 $script +} + +set TEST_NAME "K_MARKER13" +if {$kernel_markers_found == 0} { + untested "$TEST_NAME : no kernel markers present" +} else { + # Try compiling a script that treats the marker format string as a + # structure (which isn't allowed). + set script [format $kernel_script_arg \ + [lindex $kernel_marker_names 0] {\$format->foo}] + stap_compile $TEST_NAME 0 $script +} + +set TEST_NAME "K_MARKER14" +if {$kernel_markers_found == 0} { + untested "$TEST_NAME : no kernel markers present" +} else { + # Try compiling a script that treats the marker format string like + # an array (which isn't allowed). + set script [format $kernel_script_arg \ + [lindex $kernel_marker_names 0] {\$format\[0\]}] + stap_compile $TEST_NAME 0 $script +} diff --git a/testsuite/systemtap.base/procfs.exp b/testsuite/systemtap.base/procfs.exp index ac00acc6..182f1e2e 100644 --- a/testsuite/systemtap.base/procfs.exp +++ b/testsuite/systemtap.base/procfs.exp @@ -110,3 +110,5 @@ set systemtap_script { # test procfs probes set output_string "\\mfinal value = goodbye\\M\r\n" stap_run $test proc_read_write $output_string -e $systemtap_script -m $test + +exec /bin/rm -f ${test}.ko |