Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/global_opt_unknown.exp

raw
1 # Check stap global variable option (-G) for unknown names
2
3 set test "global_opt_unknown"
4 if {![installtest_p]} {
5 untested $test
6 return
7 }
8
9 set script "global var1=9 ; probe begin { if (var1 == 9) println(\"systemtap test success\") else println(\"systemtap test failure\") ; exit() }"
10
11 foreach runtime [get_runtime_list] {
12 set test "global_opt_unknown"
13 if {$runtime != ""} {
14 set test "${test}_${runtime}"
15 spawn stap -G var2=29 -e $script --runtime=$runtime
16 } elseif {![min_kernel_vers_p 3.11]} {
17 # kernel started ignoring in commit 54041d8a7333 (v3.11-rc1~44^2~2)
18 unsupported "$test - kernel won't ignore unknown options"
19 continue
20 } else {
21 spawn stap -G var2=29 -e $script
22 }
23 # stapdyn prints a warning on stderr, but staprun modules print into dmesg.
24 # Either is fine as long as we still get the expected output from probe begin.
25 expect {
26 -timeout 60
27 "systemtap test success" { pass $test }
28 "systemtap test failure" { fail $test }
29 timeout {fail "$test: unexpected timeout"}
30 eof {fail "$test: unexpected EOF"}
31 }
32 catch {close}; catch {wait}
33 }
34