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
34 WVPASS ./script --gen-only --grub2
35 WVPASS git diff --no-index --color - grub.cfg <<EOF
38 module ramdisk ramdisk
42 WVSTART Configuration files
45 WVPASS sh -c "./script --gen-only 2> log"
46 WVPASS grep "novaboot: Read $PWD/.novaboot" log
48 WVSTART Configuration files in symlinked directories
50 echo '1;' > config/.novaboot
52 ( cd script; create_dummy )
53 ln -s ../script config
54 WVPASS sh -c "./config/script/script --gen-only 2> log"
55 WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
57 WVSTART Builddir configuration variable
59 cat > .novaboot <<'EOF'
64 load file < echo Hello
66 WVPASS ./script --gen-only
67 WVPASS test -f build/file
69 WVSTART Configuration directory
71 echo '$test_a = 1;' > dir/a
72 echo '$test_c = 2;' > dir/c
73 echo '$test_c = 1;' > dir/b # Overriden by the 'c' file
74 echo '$test_ign=1;' > dir/b.txt # Ignored
75 WVPASS sh -c 'NOVABOOT_CONFIG_DIR=./dir novaboot --dump-config > config'
76 WVPASS sh -c 'grep \$test config > test'
77 WVPASS diff -u - test <<'EOF'
82 WVSTART Fail with unknown target
84 WVFAIL sh -c "./script --gen-only -t non-existing-target"
86 WVSTART BUILDDIR variable
90 load file < echo Hello
92 WVPASS ./script --gen-only
93 WVPASS test -f build/file
95 WVSTART Hypervisor configuration variable
97 echo '$hypervisor="HYP";' > .novaboot
98 WVPASS ./script --gen-only --pulsar
99 WVPASS grep "exec HYP" config-novaboot
101 WVSTART ISO image generation
103 WVPASS ./script --iso --gen-only
105 WVSTART Recursive target definition
107 cat > .novaboot <<EOF
109 't1' => '--reset-cmd="echo MyResetCmd"',
110 't2' => '--target t1',
113 WVPASS sh -c "./script --target=t2|tee output"
114 WVPASS grep -q ^MyResetCmd output
116 WVSTART Wrong target definition
118 cat > .novaboot <<EOF
119 %targets = ('t1' => '--nonsense');
121 WVPASS sh -c "./script --target=t1 2>&1 |tee output"
122 WVPASS grep -q "Error in target definition" output
124 WVSTART Different ways of specifying target
125 cat > .novaboot <<'EOF'
126 %targets = ('t1' => '--remote-cmd="echo Target1 > t"',
127 't2' => '--remote-cmd="echo Target2 > t"',
128 't3' => '--remote-cmd="echo Target3 > t"');
129 $default_target = 't1';
131 WVPASSSH 'novaboot /dev/null'
132 WVPASS test "$(cat t)" = Target1
133 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot /dev/null'
134 WVPASS test "$(cat t)" = Target2
135 WVPASSSH 'NOVABOOT_TARGET=t2 novaboot --target t3 /dev/null'
136 WVPASS test "$(cat t)" = Target3
138 WVSTART --iprelay-cmd
139 WVPASS novaboot --iprelay-cmd="$(which echo) -e '<iprelayd: connected>\xFF\xFA\x2C\x97\xDF\xFF\xF0 \xFF\xFA\x2C\x97\xFF\xFF\xF0'" --on
141 WVSTART Killing of --remote-cmd when it ignores SIGHUP
142 WVPASS tee script <<'EOF'
144 open(FH, ">", "pid") or die;
147 print "ready pid=$$\n";
151 WVPASS novaboot --remote-cmd='perl script' --remote-expect=ready --exiton=exit /dev/null
152 WVFAIL test -d /proc/$(cat pid)
153 coproc novaboot --remote-cmd='perl script' --remote-expect=ready /dev/null
154 WVPASS sed -e '/ready/q0' <&${COPROC[0]}
155 WVPASS kill $COPROC_PID
156 WVFAIL wait $COPROC_PID # Signal termination is considered a failure
157 WVFAIL test -d /proc/$(cat pid)
159 WVSTART Correct invocation path
161 WVPASS tee dir/.novaboot <<<'print "Config OK\n";'
164 WVPASS novaboot /dev/null | WVPASS grep "Config OK"
166 WVPASS tee dir/Makefile <<EOF
170 WVPASS make -C dir | WVPASS grep "Config OK"
172 WVSTART "INTERACTION variable"
173 WVPASS novaboot --remote-cmd=cat <<<INTERACTION=0
175 WVSTART "Do not accept directories"
176 WVPASS mkdir -p tftproot
177 WVFAIL novaboot --server=tftproot <<<"load $PWD"
179 WVSTART "Accept /dev/null file"
180 WVPASS mkdir -p tftproot
181 WVPASS novaboot --server=tftproot <<<"load /dev/null"
183 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))