6 WVSTART Invoke with no script
7 WVPASS novaboot -t '' < /dev/null
9 WVSTART Invoke as script
11 WVPASS ./script --gen-only
13 WVSTART Invoke as script with absolute path
15 WVPASS $PWD/script --gen-only
19 WVPASS ./script --gen-only --pulsar --pulsar-root=ASDF
20 WVPASS grep "root ASDF" config-novaboot
22 WVSTART Pulsar supports chld
26 WVPASS ./script --gen-only --pulsar
27 WVPASS grep "chld grub" config-novaboot
29 WVSTART Configuration files
32 WVPASS sh -c "./script --gen-only 2> log"
33 WVPASS grep "novaboot: Read $PWD/.novaboot" log
35 WVSTART Configuration files in symlinked directories
37 echo '1;' > config/.novaboot
39 ( cd script; create_dummy )
40 ln -s ../script config
41 WVPASS sh -c "./config/script/script --gen-only 2> log"
42 WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
44 WVSTART Builddir configuration variable
46 cat > .novaboot <<'EOF'
51 load file < echo Hello
53 WVPASS ./script --gen-only
54 WVPASS test -f build/file
56 WVSTART Configuration directory
58 echo '$test_a = 1;' > dir/a
59 echo '$test_c = 2;' > dir/c
60 echo '$test_c = 1;' > dir/b # Overriden by the 'c' file
61 echo '$test_ign=1;' > dir/b.txt # Ignored
62 WVPASS sh -c 'NOVABOOT_CONFIG_DIR=./dir novaboot --dump-config > config'
63 WVPASS sh -c 'grep \$test config > test'
64 WVPASS diff -u - test <<'EOF'
69 WVSTART Fail with unknown target
71 WVFAIL sh -c "./script --gen-only -t non-existing-target"
73 WVSTART BUILDDIR variable
77 load file < echo Hello
79 WVPASS ./script --gen-only
80 WVPASS test -f build/file
82 WVSTART Hypervisor configuration variable
84 echo '$hypervisor="HYP";' > .novaboot
85 WVPASS ./script --gen-only --pulsar
86 WVPASS grep "exec HYP" config-novaboot
88 WVSTART ISO image generation
90 WVPASS ./script --iso --gen-only
92 WVSTART Recursive target definition
96 't1' => '--reset-cmd="echo MyResetCmd"',
97 't2' => '--target t1',
100 WVPASS sh -c "./script --target=t2|tee output"
101 WVPASS grep -q ^MyResetCmd output
103 WVSTART Wrong target definition
105 cat > .novaboot <<EOF
106 %targets = ('t1' => '--nonsense');
108 WVPASS sh -c "./script --target=t1 2>&1 |tee output"
109 WVPASS grep -q "Error in target definition" output
111 WVSTART Different ways of specifying target
112 cat > .novaboot <<'EOF'
113 %targets = ('t1' => '--remote-cmd="echo Target1 > t"',
114 't2' => '--remote-cmd="echo Target2 > t"',
115 't3' => '--remote-cmd="echo Target3 > t"');
116 $default_target = 't1';
118 WVPASSSH 'novaboot /dev/null'
119 WVPASS test "$(cat t)" = Target1
120 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot /dev/null'
121 WVPASS test "$(cat t)" = Target2
122 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot --target t3 /dev/null'
123 WVPASS test "$(cat t)" = Target3
125 WVSTART --iprelay-cmd
126 WVPASS novaboot --iprelay-cmd="/bin/echo -e '<iprelayd: connected>\xFF\xFA\x2C\x97\xDF\xFF\xF0 \xFF\xFA\x2C\x97\xFF\xFF\xF0'" --on
128 WVSTART Killing of --remote-cmd when it ignores SIGHUP
129 WVPASS tee script <<'EOF'
131 open(FH, ">", "pid") or die;
134 print "ready pid=$$\n";
138 WVPASS novaboot --remote-cmd='perl script' --remote-expect=ready --exiton=exit /dev/null
139 WVFAIL test -d /proc/$(cat pid)
140 coproc novaboot --remote-cmd='perl script' --remote-expect=ready /dev/null
141 WVPASS sed -e '/ready/q0' <&${COPROC[0]}
142 WVPASS kill $COPROC_PID
143 WVFAIL wait $COPROC_PID # Signal termination is considered a failure
144 WVFAIL test -d /proc/$(cat pid)
146 WVSTART Correct invocation path
148 WVPASS tee dir/.novaboot <<<'print "Config OK\n";'
151 WVPASS novaboot /dev/null | WVPASS grep "Config OK"
153 WVPASS tee dir/Makefile <<EOF
157 WVPASS make -C dir | WVPASS grep "Config OK"
159 WVSTART "INTERACTION variable"
160 WVPASS novaboot --remote-cmd=cat <<<INTERACTION=0
162 WVSTART "Do not accept directories"
163 WVPASS mkdir -p tftproot
164 WVFAIL novaboot --server=tftproot <<<"load $PWD"
166 WVSTART "Accept /dev/null file"
167 WVPASS mkdir -p tftproot
168 WVPASS novaboot --server=tftproot <<<"load /dev/null"
170 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))