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 GRUB2 with default BOOT_METHOD=multiboot
34 WVPASS ./script --gen-only --grub2
35 WVPASS git diff --no-index --color - boot/grub/grub.cfg <<EOF
38 module ramdisk ramdisk
42 WVSTART GRUB2 with BOOT_METHOD=linux
48 WVPASS ./script --gen-only --grub2
49 WVPASS git diff --no-index --color - boot/grub/grub.cfg <<EOF
56 WVSTART Configuration files
59 WVPASS sh -c "./script --gen-only 2> log"
60 WVPASS grep "novaboot: Read $PWD/.novaboot" log
62 WVSTART Configuration files in symlinked directories
64 echo '1;' > config/.novaboot
66 ( cd script; create_dummy )
67 ln -s ../script config
68 WVPASS sh -c "./config/script/script --gen-only 2> log"
69 WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
71 WVSTART Builddir configuration variable
73 cat > .novaboot <<'EOF'
78 load file < echo Hello
80 WVPASS ./script --gen-only
81 WVPASS test -f build/file
83 WVSTART Configuration directory
85 echo '$test_a = 1;' > dir/a
86 echo '$test_c = 2;' > dir/c
87 echo '$test_c = 1;' > dir/b # Overriden by the 'c' file
88 echo '$test_ign=1;' > dir/b.txt # Ignored
89 WVPASS sh -c 'NOVABOOT_CONFIG_DIR=./dir novaboot --dump-config > config'
90 WVPASS sh -c 'grep \$test config > test'
91 WVPASS diff -u - test <<'EOF'
96 WVSTART Fail with unknown target
98 WVFAIL sh -c "./script --gen-only -t non-existing-target"
100 WVSTART BUILDDIR variable
101 WVPASS mkdir -p build
102 create_script <<'EOF'
104 load file < echo Hello
106 WVPASS ./script --gen-only
107 WVPASS test -f build/file
109 WVSTART Hypervisor configuration variable
111 echo '$hypervisor="HYP";' > .novaboot
112 WVPASS ./script --gen-only --pulsar
113 WVPASS grep "exec HYP" config-novaboot
115 WVSTART ISO image generation
117 WVPASS ./script --iso --gen-only
119 WVSTART Recursive target definition
121 cat > .novaboot <<EOF
123 't1' => '--reset-cmd="echo MyResetCmd"',
124 't2' => '--target t1',
127 WVPASS sh -c "./script --target=t2|tee output"
128 WVPASS grep -q ^MyResetCmd output
130 WVSTART Wrong target definition
132 cat > .novaboot <<EOF
133 %targets = ('t1' => '--nonsense');
135 WVPASS sh -c "./script --target=t1 2>&1 |tee output"
136 WVPASS grep -q "Error in target definition" output
138 WVSTART Different ways of specifying target
139 cat > .novaboot <<'EOF'
140 %targets = ('t1' => '--remote-cmd="echo Target1 > t"',
141 't2' => '--remote-cmd="echo Target2 > t"',
142 't3' => '--remote-cmd="echo Target3 > t"');
143 $default_target = 't1';
145 WVPASSSH 'novaboot /dev/null'
146 WVPASS test "$(cat t)" = Target1
147 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot /dev/null'
148 WVPASS test "$(cat t)" = Target2
149 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot --target t3 /dev/null'
150 WVPASS test "$(cat t)" = Target3
152 WVSTART --iprelay-cmd
153 WVPASS novaboot --iprelay-cmd="$(which echo) -e '<iprelayd: connected>\xFF\xFA\x2C\x97\xDF\xFF\xF0 \xFF\xFA\x2C\x97\xFF\xFF\xF0'" --on
155 WVSTART Killing of --remote-cmd when it ignores SIGHUP
156 WVPASS tee script <<'EOF'
158 open(FH, ">", "pid") or die;
161 print "ready pid=$$\n";
165 WVPASS novaboot --remote-cmd='perl script' --remote-expect=ready --exiton=exit /dev/null
166 WVFAIL test -d /proc/$(cat pid)
167 coproc novaboot --remote-cmd='perl script' --remote-expect=ready /dev/null
168 WVPASS sed -e '/ready/q0' <&${COPROC[0]}
169 WVPASS kill $COPROC_PID
170 WVFAIL wait $COPROC_PID # Signal termination is considered a failure
171 WVFAIL test -d /proc/$(cat pid)
173 WVSTART Correct invocation path
175 WVPASS tee dir/.novaboot <<<'print "Config OK\n";'
178 WVPASS novaboot /dev/null | WVPASS grep "Config OK"
180 WVPASS tee dir/Makefile <<EOF
184 WVPASS make -C dir | WVPASS grep "Config OK"
186 WVSTART "INTERACTION variable"
187 WVPASS novaboot --remote-cmd=cat <<<INTERACTION=0
189 WVSTART "Do not accept directories"
190 WVPASS mkdir -p tftproot
191 WVFAIL novaboot --server=tftproot <<<"load $PWD"
193 WVSTART "Accept /dev/null file"
194 WVPASS mkdir -p tftproot
195 WVPASS novaboot --server=tftproot <<<"load /dev/null"
197 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))