1 if {![installtest_p]} {
2 for {set i 0} { $i < 8} {incr i} {
8 # stap -c 'echo "hello world"' -e 'probe begin {}'
9 spawn stap -c {echo "hello world"} -e {probe begin {}}
12 "hello world" {pass "cmd_parse1"}
13 timeout {fail "cmd_parse1: unexpected timeout"}
14 eof {fail "cmd_parse1: unexpected EOF"}
18 # stap -c 'echo "hello "\"world\"' -e 'probe begin {}'
19 spawn stap -c {echo "hello "\"world\"} -e {probe begin {}}
22 "hello \"world\"" {pass "cmd_parse2"}
23 timeout {fail "cmd_parse2: unexpected timeout"}
24 eof {fail "cmd_parse2: unexpected EOF"}
28 #stap -c '(a="hello world"; echo $a)' -e 'probe begin {}'
29 spawn stap -c {(a="hello world"; echo $a)} -e {probe begin {}}
32 "hello world" {pass "cmd_parse3"}
33 timeout {fail "cmd_parse3: unexpected timeout"}
34 eof {fail "cmd_parse3: unexpected EOF"}
38 #stap -c '(a="hello "\"world\"; echo $a)' -e 'probe begin {}'
39 spawn stap -c {(a="hello "\"world\"; echo $a)} -e {probe begin {}}
42 "hello \"world\"" {pass "cmd_parse4"}
43 timeout {fail "cmd_parse4: unexpected timeout"}
44 eof {fail "cmd_parse4: unexpected EOF"}
48 #stap -c '(a="hello "world; echo $a)' -e 'probe begin {}'
49 spawn stap -c {(a="hello "world; echo $a)} -e {probe begin {}}
52 "hello world" {pass "cmd_parse5"}
53 timeout {fail "cmd_parse5: unexpected timeout"}
54 eof {fail "cmd_parse5: unexpected EOF"}
58 #stap -c '(((a=42+7)); echo "The answer is $a")' -e 'probe begin {}'
59 # NB: not ((a=42+7)) - must not assume bash
60 spawn stap -c {(a=49; echo "The answer is $a")} -e {probe begin {}}
63 "The answer is 49" {pass "cmd_parse6"}
64 timeout {fail "cmd_parse6: unexpected timeout"}
65 eof {fail "cmd_parse6: unexpected EOF"}
69 #stap -c '(echo "Hello World" 1>&2) > /dev/null' -e 'probe begin {}'
70 spawn stap -c {(echo "Hello World" 1>&2) > /dev/null} -e {probe begin {}}
73 "Hello World" {pass "cmd_parse7"}
74 timeout {fail "cmd_parse7: unexpected timeout"}
75 eof {fail "cmd_parse7: unexpected EOF"}
82 -re "vm.*" {pass "cmd_parse8"}
83 timeout {fail "cmd_parse8: unexpected timeout"}
84 eof {fail "cmd_parse8: unexpected EOF"}
88 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 1
91 "1 1" { pass cmd_parse9 }
92 timeout { fail "cmd_parse9 timeout" }
93 eof { fail "cmd_parse9 eof" }
97 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 5 a b c d
100 "5 d" { pass cmd_parse10 }
101 timeout { fail "cmd_parse10 timeout" }
102 eof { fail "cmd_parse10 eof" }
106 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 10 a b c d
109 "5 " { pass cmd_parse11 }
110 timeout { fail "cmd_parse11 timeout" }
111 eof { fail "cmd_parse11 eof" }
115 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[0]) exit() }}
118 "0 " { pass cmd_parse12 }
119 timeout { fail "cmd_parse12 timeout" }
120 eof { fail "cmd_parse12 eof" }
124 spawn stap -L syscall.a*
127 -re {(syscall\.a[_a-zA-Z0-9]*(\ [_a-zA-Z0-9\$]+:(string|long|unknown|stats))*\r\n)+} { pass "cmd_parse13" }
128 timeout {fail "cmd_parse13: unexpected timeout"}
129 eof {fail "cmd_parse13: unexpected EOF"}