]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - tests/expect.wv
Add command line interface to Expect.pm functionality
[novaboot.git] / tests / expect.wv
diff --git a/tests/expect.wv b/tests/expect.wv
new file mode 100755 (executable)
index 0000000..d47ab76
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+cd $(dirname $0)
+. wvtest.sh
+
+WVSTART Exiton
+WVPASS create_dummy
+WVPASS ./script -t '' --exiton=Hello --remote-cmd="echo Hello; cat"
+
+WVSTART Expect send
+WVPASS create_dummy
+WVPASS ./script -t '' --expect=question --send="answer\n" \
+    --remote-cmd='echo question; read x; echo $x > output'
+WVPASS grep answer output
+
+WVSTART Expect send
+WVPASS create_dummy
+WVPASS ./script -t '' --expect=question --send="answer\n" \
+    --remote-cmd='echo question; read x; echo $x > output'
+WVPASS grep answer output
+
+WVSTART Expect regexp send
+WVPASS create_dummy
+WVPASS ./script -t '' --expect-re=q..st..n --send="answer\n" \
+    --remote-cmd='echo question; read x; echo $x > output'
+WVPASS grep answer output
+
+WVSTART Expect sendcond
+WVPASS create_dummy
+WVPASS ./script -t '' --expect=More --sendcont="\n" \
+    --remote-cmd='seq 100|more'