]> sourceware.org Git - systemtap.git/blob - testsuite/systemtap.base/cmd_parse.exp
KFAIL cmd_parse15 on kernel < 2.6.29, see commit e0ccd3.
[systemtap.git] / testsuite / systemtap.base / cmd_parse.exp
1 if {![installtest_p]} {
2 for {set i 0} { $i < 16} {incr i} {
3 untested cmd_parse$i
4 }
5 return
6 }
7
8 spawn stap -c {echo "hello world"} -we {probe begin {}}
9 expect {
10 -timeout 60
11 "hello world" {pass "cmd_parse1"}
12 timeout {fail "cmd_parse1: unexpected timeout"}
13 eof {fail "cmd_parse1: unexpected EOF"}
14 }
15 wait;catch {close}
16
17 spawn stap -c {echo "hello "\"world\"} -we {probe begin {}}
18 expect {
19 -timeout 60
20 "hello \"world\"" {pass "cmd_parse2"}
21 timeout {fail "cmd_parse2: unexpected timeout"}
22 eof {fail "cmd_parse2: unexpected EOF"}
23 }
24 wait;catch {close}
25
26 spawn stap -c {sh -c '(a="hello world"; echo $a)'} -we {probe begin {}}
27 expect {
28 -timeout 60
29 "hello world" {pass "cmd_parse3"}
30 timeout {fail "cmd_parse3: unexpected timeout"}
31 eof {fail "cmd_parse3: unexpected EOF"}
32 }
33 wait;catch {close}
34
35 spawn stap -c {sh -c '(a="hello "\"world\"; echo $a)'} -we {probe begin {}}
36 expect {
37 -timeout 60
38 "hello \"world\"" {pass "cmd_parse4"}
39 timeout {fail "cmd_parse4: unexpected timeout"}
40 eof {fail "cmd_parse4: unexpected EOF"}
41 }
42 wait;catch {close}
43
44 spawn stap -c {sh -c '(a="hello "world; echo $a)'} -we {probe begin {}}
45 expect {
46 -timeout 60
47 "hello world" {pass "cmd_parse5"}
48 timeout {fail "cmd_parse5: unexpected timeout"}
49 eof {fail "cmd_parse5: unexpected EOF"}
50 }
51 wait;catch {close}
52
53 spawn stap -c {bash -c '((a=42+7)); echo "The answer is $a"'} -we {probe begin {}}
54 expect {
55 -timeout 60
56 "The answer is 49" {pass "cmd_parse6"}
57 timeout {fail "cmd_parse6: unexpected timeout"}
58 eof {fail "cmd_parse6: unexpected EOF"}
59 }
60 wait;catch {close}
61
62 spawn stap -c {sh -c '(echo "Hello World" 1>&2) > /dev/null'} -we {probe begin {}}
63 expect {
64 -timeout 60
65 "Hello World" {pass "cmd_parse7"}
66 timeout {fail "cmd_parse7: unexpected timeout"}
67 eof {fail "cmd_parse7: unexpected EOF"}
68 }
69 wait;catch {close}
70
71 spawn stap -l {vm.*}
72 expect {
73 -timeout 60
74 -re "vm.*" {pass "cmd_parse8"}
75 timeout {fail "cmd_parse8: unexpected timeout"}
76 eof {fail "cmd_parse8: unexpected EOF"}
77 }
78 wait;catch {close}
79
80 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 1
81 expect {
82 -timeout 60
83 "1 1" { pass cmd_parse9 }
84 timeout { fail "cmd_parse9 timeout" }
85 eof { fail "cmd_parse9 eof" }
86 }
87 wait;catch {close}
88
89 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 5 a b c d
90 expect {
91 -timeout 60
92 "5 d" { pass cmd_parse10 }
93 timeout { fail "cmd_parse10 timeout" }
94 eof { fail "cmd_parse10 eof" }
95 }
96 wait;catch {close}
97
98 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 10 a b c d
99 expect {
100 -timeout 60
101 "5 " { pass cmd_parse11 }
102 timeout { fail "cmd_parse11 timeout" }
103 eof { fail "cmd_parse11 eof" }
104 }
105 wait;catch {close}
106
107 spawn stap -e {probe begin { printf("%d %s\n", argc, argv[0]) exit() }}
108 expect {
109 -timeout 60
110 "0 " { pass cmd_parse12 }
111 timeout { fail "cmd_parse12 timeout" }
112 eof { fail "cmd_parse12 eof" }
113 }
114 wait;catch {close}
115
116 spawn stap -L syscall.a*
117 expect {
118 -timeout 60
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"}
122 }
123 wait;catch {close}
124
125 spawn sh -c "stap -v -v --vp 01020 -h 2>&1"
126 expect {
127 -re {add per-pass verbosity .23242.} { pass "cmd_parse14" }
128 timeout { fail "cmd_parse14: timeout" }
129 eof { fail "cmd_parse14: eof" }
130 }
131 wait;catch {close}
132
133 set uname [exec uname -r]
134 set linux26ver [lindex [split $uname {.-}] 2]
135 if {$linux26ver < 29} {
136 verbose -log "kfail, see commit e0ccd3\n";
137 setup_kfail 4186 "*-*-*"
138 }
139 spawn sh -c "stap -m do_not_cache_me -B kernelrelease -p4 -e 'probe begin {exit()}'"
140 # the \r below is meant to match the "kernelrelease" output, as distinct from
141 # any possible auxiliary make verbosity.
142 expect {
143 -re "$uname\r" { pass "cmd_parse15" }
144 timeout { fail "cmd_parse15: timeout" }
145 eof { fail "cmd_parse15: eof" }
146 }
147 wait;catch {close}
148
149 set uname [exec uname -i]
150 spawn sh -c "stap -m do_not_cache_me -a $uname -p4 -e 'probe begin {exit()}'"
151 # the \r below is meant to match the "kernelrelease" output, as distinct from
152 # any possible auxiliary make verbosity.
153 expect {
154 -re "do_not_cache_me.ko\r" { pass "cmd_parse16" }
155 timeout { fail "cmd_parse16: timeout" }
156 eof { fail "cmd_parse16: eof" }
157 }
158 wait;catch {close}
159
160
161 # NB: when adding extra tests here, increment the ![installtest_p]
162 # loop count too at the top.
This page took 0.042893 seconds and 6 git commands to generate.