]> sourceware.org Git - systemtap.git/blob - testsuite/systemtap.base/cmd_parse.exp
PR6925: --vp (per-pass verbosity) 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 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;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;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;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;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;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;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;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;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;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;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;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;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\$]+:(string|long|unknown|stats))*\r\n)+} { pass "cmd_parse13" }
120 timeout {fail "cmd_parse13: unexpected timeout"}
121 eof {fail "cmd_parse13: unexpected EOF"}
122 }
123 wait;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}
This page took 0.04445 seconds and 6 git commands to generate.