]> sourceware.org Git - systemtap.git/blob - testsuite/systemtap.base/cmd_parse.exp
Merge branch 'master' of git://sources.redhat.com/git/systemtap
[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
This page took 0.102895 seconds and 6 git commands to generate.