]> sourceware.org Git - systemtap.git/blob - testsuite/systemtap.base/cmd_parse.exp
PR6731: Updated listing mode through adding -L option.
[systemtap.git] / testsuite / systemtap.base / cmd_parse.exp
1 if {![installtest_p]} {
2 for {set i 0} { $i < 8} {incr i} {
3 untested cmd_parse$i
4 }
5 return
6 }
7
8 # stap -c 'echo "hello world"' -e 'probe begin {}'
9 spawn stap -c {echo "hello world"} -e {probe begin {}}
10 expect {
11 -timeout 60
12 "hello world" {pass "cmd_parse1"}
13 timeout {fail "cmd_parse1: unexpected timeout"}
14 eof {fail "cmd_parse1: unexpected EOF"}
15 }
16 wait
17
18 # stap -c 'echo "hello "\"world\"' -e 'probe begin {}'
19 spawn stap -c {echo "hello "\"world\"} -e {probe begin {}}
20 expect {
21 -timeout 60
22 "hello \"world\"" {pass "cmd_parse2"}
23 timeout {fail "cmd_parse2: unexpected timeout"}
24 eof {fail "cmd_parse2: unexpected EOF"}
25 }
26 wait
27
28 #stap -c '(a="hello world"; echo $a)' -e 'probe begin {}'
29 spawn stap -c {(a="hello world"; echo $a)} -e {probe begin {}}
30 expect {
31 -timeout 60
32 "hello world" {pass "cmd_parse3"}
33 timeout {fail "cmd_parse3: unexpected timeout"}
34 eof {fail "cmd_parse3: unexpected EOF"}
35 }
36 wait
37
38 #stap -c '(a="hello "\"world\"; echo $a)' -e 'probe begin {}'
39 spawn stap -c {(a="hello "\"world\"; echo $a)} -e {probe begin {}}
40 expect {
41 -timeout 60
42 "hello \"world\"" {pass "cmd_parse4"}
43 timeout {fail "cmd_parse4: unexpected timeout"}
44 eof {fail "cmd_parse4: unexpected EOF"}
45 }
46 wait
47
48 #stap -c '(a="hello "world; echo $a)' -e 'probe begin {}'
49 spawn stap -c {(a="hello "world; echo $a)} -e {probe begin {}}
50 expect {
51 -timeout 60
52 "hello world" {pass "cmd_parse5"}
53 timeout {fail "cmd_parse5: unexpected timeout"}
54 eof {fail "cmd_parse5: unexpected EOF"}
55 }
56 wait
57
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 {}}
61 expect {
62 -timeout 60
63 "The answer is 49" {pass "cmd_parse6"}
64 timeout {fail "cmd_parse6: unexpected timeout"}
65 eof {fail "cmd_parse6: unexpected EOF"}
66 }
67 wait
68
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 {}}
71 expect {
72 -timeout 60
73 "Hello World" {pass "cmd_parse7"}
74 timeout {fail "cmd_parse7: unexpected timeout"}
75 eof {fail "cmd_parse7: unexpected EOF"}
76 }
77 wait
78
79 spawn stap -l {vm.*}
80 expect {
81 -timeout 60
82 -re "vm.*" {pass "cmd_parse8"}
83 timeout {fail "cmd_parse8: unexpected timeout"}
84 eof {fail "cmd_parse8: unexpected EOF"}
85 }
86 wait
87
88 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 1
89 expect {
90 -timeout 60
91 "1 1" { pass cmd_parse9 }
92 timeout { fail "cmd_parse9 timeout" }
93 eof { fail "cmd_parse9 eof" }
94 }
95 wait
96
97 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 5 a b c d
98 expect {
99 -timeout 60
100 "5 d" { pass cmd_parse10 }
101 timeout { fail "cmd_parse10 timeout" }
102 eof { fail "cmd_parse10 eof" }
103 }
104 wait
105
106 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 10 a b c d
107 expect {
108 -timeout 60
109 "5 " { pass cmd_parse11 }
110 timeout { fail "cmd_parse11 timeout" }
111 eof { fail "cmd_parse11 eof" }
112 }
113 wait
114
115 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[0]) exit() }}
116 expect {
117 -timeout 60
118 "0 " { pass cmd_parse12 }
119 timeout { fail "cmd_parse12 timeout" }
120 eof { fail "cmd_parse12 eof" }
121 }
122 wait
123
124 spawn stap -L syscall.a*
125 expect {
126 -timeout 60
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"}
130 }
131 wait
This page took 0.099379 seconds and 6 git commands to generate.