From 61e4ec4c74b7571ade18f93c5afdd40ac3d124af Mon Sep 17 00:00:00 2001 From: dsmith Date: Mon, 4 Feb 2008 21:14:20 +0000 Subject: 2008-02-04 David Smith PR 4446. * systemtap.base/marker.exp: Added tests for marker "$format" variable. --- testsuite/systemtap.base/marker.exp | 46 ++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'testsuite/systemtap.base') 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 +} -- cgit From 3f545051d7334d4afcc95cca9f9de33a07462f44 Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 6 Feb 2008 17:30:41 +0000 Subject: 2008-02-06 Masami Hiramatsu * systemtap.base/procfs.exp: Added PROCFS.ko cleanup. * systemtap.context/context.exp: Added cleanup call. * systemtap.printf/end1b.exp: Passed evaluated command string to as_root. * systemtap.printf/mixed_outb.exp: Ditto. * systemtap.printf/out1b.exp: Ditto. * systemtap.printf/out2b.exp: Ditto. * systemtap.printf/out3b.exp: Ditto. --- testsuite/systemtap.base/procfs.exp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testsuite/systemtap.base') 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 -- cgit From 983aeb407de6b516a794d750d329b3780149ed4f Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 6 Feb 2008 21:43:54 +0000 Subject: 2008-02-06 Masami Hiramatsu * systemtap.base/cmd_parse.exp: Added 'wait' between tests for preventing unexpected EOF. --- testsuite/systemtap.base/cmd_parse.exp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testsuite/systemtap.base') 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 -- cgit From dd09faf3e937d62dce3629e33689a8f2f64ce4ad Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Feb 2008 18:26:10 +0000 Subject: 2008-02-07 Martin Hunt * systemtap.base/debugpath.exp: Remove explicit closes. Stap will terminate without help, and cleanup after itself. --- testsuite/systemtap.base/debugpath.exp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'testsuite/systemtap.base') diff --git a/testsuite/systemtap.base/debugpath.exp b/testsuite/systemtap.base/debugpath.exp index 67b9eb70..ffa4ba7b 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,4 @@ expect { timeout { fail "$test (timeout2)" } eof { fail "$test (eof)" } } -catch { close ; wait } + -- cgit From 6a0e95e23737a7405a416be25cde6db740032a5f Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Feb 2008 18:32:19 +0000 Subject: Restore accidently deleted line. --- testsuite/systemtap.base/debugpath.exp | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite/systemtap.base') diff --git a/testsuite/systemtap.base/debugpath.exp b/testsuite/systemtap.base/debugpath.exp index ffa4ba7b..b0b12207 100644 --- a/testsuite/systemtap.base/debugpath.exp +++ b/testsuite/systemtap.base/debugpath.exp @@ -17,3 +17,4 @@ expect { eof { fail "$test (eof)" } } +wait -- cgit