1 if {![installtest_p]} {
2 for {set i 0} { $i < 16} {incr i} {
8 spawn stap -c {echo "hello world"} -we {probe begin {}}
11 "hello world" {pass "cmd_parse1"}
12 timeout {fail "cmd_parse1: unexpected timeout"}
13 eof {fail "cmd_parse1: unexpected EOF"}
17 spawn stap -c {echo "hello "\"world\"} -we {probe begin {}}
20 "hello \"world\"" {pass "cmd_parse2"}
21 timeout {fail "cmd_parse2: unexpected timeout"}
22 eof {fail "cmd_parse2: unexpected EOF"}
26 spawn stap -c {sh -c '(a="hello world"; echo $a)'} -we {probe begin {}}
29 "hello world" {pass "cmd_parse3"}
30 timeout {fail "cmd_parse3: unexpected timeout"}
31 eof {fail "cmd_parse3: unexpected EOF"}
35 spawn stap -c {sh -c '(a="hello "\"world\"; echo $a)'} -we {probe begin {}}
38 "hello \"world\"" {pass "cmd_parse4"}
39 timeout {fail "cmd_parse4: unexpected timeout"}
40 eof {fail "cmd_parse4: unexpected EOF"}
44 spawn stap -c {sh -c '(a="hello "world; echo $a)'} -we {probe begin {}}
47 "hello world" {pass "cmd_parse5"}
48 timeout {fail "cmd_parse5: unexpected timeout"}
49 eof {fail "cmd_parse5: unexpected EOF"}
53 spawn stap -c {bash -c '((a=42+7)); echo "The answer is $a"'} -we {probe begin {}}
56 "The answer is 49" {pass "cmd_parse6"}
57 timeout {fail "cmd_parse6: unexpected timeout"}
58 eof {fail "cmd_parse6: unexpected EOF"}
62 spawn stap -c {sh -c '(echo "Hello World" 1>&2) > /dev/null'} -we {probe begin {}}
65 "Hello World" {pass "cmd_parse7"}
66 timeout {fail "cmd_parse7: unexpected timeout"}
67 eof {fail "cmd_parse7: unexpected EOF"}
74 -re "vm.*" {pass "cmd_parse8"}
75 timeout {fail "cmd_parse8: unexpected timeout"}
76 eof {fail "cmd_parse8: unexpected EOF"}
80 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 1
83 "1 1" { pass cmd_parse9 }
84 timeout { fail "cmd_parse9 timeout" }
85 eof { fail "cmd_parse9 eof" }
89 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 5 a b c d
92 "5 d" { pass cmd_parse10 }
93 timeout { fail "cmd_parse10 timeout" }
94 eof { fail "cmd_parse10 eof" }
98 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 10 a b c d
101 "5 " { pass cmd_parse11 }
102 timeout { fail "cmd_parse11 timeout" }
103 eof { fail "cmd_parse11 eof" }
107 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[0]) exit() }}
110 "0 " { pass cmd_parse12 }
111 timeout { fail "cmd_parse12 timeout" }
112 eof { fail "cmd_parse12 eof" }
116 spawn stap -L syscall.a*
119 -re {(syscall\.a[_a-zA-Z0-9]*(\ [_a-zA-Z0-9\$]+:[^:]+?)+\r\n)+} { pass "cmd_parse13" }
120 timeout {fail "cmd_parse13: unexpected timeout"}
121 eof {fail "cmd_parse13: unexpected EOF"}
125 spawn sh -c "stap -v -v --vp 01020 -h 2>&1"
127 -re {add per-pass verbosity .23242.} { pass "cmd_parse14" }
128 timeout { fail "cmd_parse14: timeout" }
129 eof { fail "cmd_parse14: eof" }
133 set uname [exec uname -r]
134 spawn sh -c "stap -m do_not_cache_me -B kernelrelease -p4 -e 'probe begin {exit()}'"
135 # the \r below is meant to match the "kernelrelease" output, as distinct from
136 # any possible auxiliary make verbosity.
138 -re "$uname\r" { pass "cmd_parse15" }
139 timeout { fail "cmd_parse15: timeout" }
140 eof { fail "cmd_parse15: eof" }
144 set uname [exec uname -m]
145 spawn sh -c "stap -m do_not_cache_me -a $uname -p4 -e 'probe begin {exit()}'"
146 # the \r below is meant to match the "kernelrelease" output, as distinct from
147 # any possible auxiliary make verbosity.
149 -re "do_not_cache_me.ko\r" { pass "cmd_parse16" }
150 timeout { fail "cmd_parse16: timeout" }
151 eof { fail "cmd_parse16: eof" }
156 # NB: when adding extra tests here, increment the ![installtest_p]
157 # loop count too at the top.