diff options
author | hunt <hunt> | 2007-08-20 17:45:38 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-08-20 17:45:38 +0000 |
commit | 322566b3574d9cb452e20f9b74bc0b7d3d9dcfe6 (patch) | |
tree | 65badf1abfcc7b57e7f3abfdf3ff0a0e580a9e97 /testsuite/systemtap.base | |
parent | faf96009ef461ba6e956cffc5ff5b7ba8cc32f60 (diff) | |
download | systemtap-steved-322566b3574d9cb452e20f9b74bc0b7d3d9dcfe6.tar.gz systemtap-steved-322566b3574d9cb452e20f9b74bc0b7d3d9dcfe6.tar.xz systemtap-steved-322566b3574d9cb452e20f9b74bc0b7d3d9dcfe6.zip |
2007-08-20 Martin Hunt <hunt@redhat.com>
* systemtap.base/cmd_parse.exp: New file. Test
command parsing for "-c".
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r-- | testsuite/systemtap.base/cmd_parse.exp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp new file mode 100644 index 00000000..31676a6f --- /dev/null +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -0,0 +1,69 @@ +if {![installtest_p]} { + for {set i 0} { $i < 8} {incr i} { + untested cmd_parse$i + } + return +} + +# stap -c 'echo "hello world"' -e 'probe begin {}' +spawn stap -c {echo "hello world"} -e {probe begin {}} +expect { + -timeout 60 + "hello world" {pass "cmd_parse1"} + timeout {fail "cmd_parse1: unexpected timeout"} + eof {fail "cmd_parse1: unexpected EOF"} +} + +# stap -c 'echo "hello "\"world\"' -e 'probe begin {}' +spawn stap -c {echo "hello "\"world\"} -e {probe begin {}} +expect { + -timeout 60 + "hello \"world\"" {pass "cmd_parse2"} + timeout {fail "cmd_parse2: unexpected timeout"} + eof {fail "cmd_parse2: unexpected EOF"} +} + +#stap -c '(a="hello world"; echo $a)' -e 'probe begin {}' +spawn stap -c {(a="hello world"; echo $a)} -e {probe begin {}} +expect { + -timeout 60 + "hello world" {pass "cmd_parse3"} + timeout {fail "cmd_parse3: unexpected timeout"} + eof {fail "cmd_parse3: unexpected EOF"} +} + +#stap -c '(a="hello "\"world\"; echo $a)' -e 'probe begin {}' +spawn stap -c {(a="hello "\"world\"; echo $a)} -e {probe begin {}} +expect { + -timeout 60 + "hello \"world\"" {pass "cmd_parse4"} + timeout {fail "cmd_parse4: unexpected timeout"} + eof {fail "cmd_parse4: unexpected EOF"} +} + +#stap -c '(a="hello "world; echo $a)' -e 'probe begin {}' +spawn stap -c {(a="hello "world; echo $a)} -e {probe begin {}} +expect { + -timeout 60 + "hello world" {pass "cmd_parse5"} + timeout {fail "cmd_parse5: unexpected timeout"} + eof {fail "cmd_parse5: unexpected EOF"} +} + +#stap -c '(((a=42+7)); echo "The answer is $a")' -e 'probe begin {}' +spawn stap -c {(((a=42+7)); echo "The answer is $a")} -e {probe begin {}} +expect { + -timeout 60 + "The answer is 49" {pass "cmd_parse6"} + timeout {fail "cmd_parse6: unexpected timeout"} + eof {fail "cmd_parse6: unexpected EOF"} +} + +#stap -c '(echo "Hello World" 1>&2) > /dev/null' -e 'probe begin {}' +spawn stap -c {(echo "Hello World" 1>&2) > /dev/null} -e {probe begin {}} +expect { + -timeout 60 + "Hello World" {pass "cmd_parse7"} + timeout {fail "cmd_parse7: unexpected timeout"} + eof {fail "cmd_parse7: unexpected EOF"} +} |