Debian Codegraph @

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

raw
1 # Check stap global variable option (-G) with an invalid number
2
3 set test "global_opt_invalid"
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_invalid"
13 if {$runtime != ""} {
14 set test "${test}_${runtime}"
15 spawn stap -G var1=z29 -e $script --runtime=$runtime
16 } else {
17 spawn stap -G var1=z29 -e $script
18 }
19 # staprun says "Invalid parameters"; stapdyn says "Invalid argument"
20 expect {
21 -timeout 60
22 -re {ERROR.*Invalid} { pass $test }
23 "systemtap test success" { fail $test }
24 "systemtap test failure" { fail $test }
25 timeout {fail "$test: unexpected timeout"}
26 eof {fail "$test: unexpected EOF"}
27 }
28 catch {close}; catch {wait}
29 }
30