]> rtime.felk.cvut.cz Git - novaboot.git/blob - tests/expect.wv
tests: Make shebangs NixOS compatible
[novaboot.git] / tests / expect.wv
1 #!/usr/bin/env bash
2
3 cd $(dirname $0)
4 . wvtest.sh
5
6 WVSTART Exiton
7 WVPASS create_dummy
8 WVPASS ./script -t '' --exiton=Hello --remote-cmd="echo Hello; cat"
9
10 WVSTART Expect send
11 WVPASS create_dummy
12 WVPASS ./script -t '' --expect=question --send="answer\n" \
13     --remote-cmd='echo question; read x; echo $x > output'
14 WVPASS grep answer output
15
16 WVSTART Expect send
17 WVPASS create_dummy
18 WVPASS ./script -t '' --expect=question --send="answer\n" \
19     --remote-cmd='echo question; read x; echo $x > output'
20 WVPASS grep answer output
21
22 WVSTART Expect regexp send
23 WVPASS create_dummy
24 WVPASS ./script -t '' --expect-re=q..st..n --send="answer\n" \
25     --remote-cmd='echo question; read x; echo $x > output'
26 WVPASS grep answer output
27
28 WVSTART Expect sendcond
29 WVPASS create_dummy
30 WVPASS ./script -t '' --expect=More --sendcont="\n" \
31     --remote-cmd='seq 100|more'