cd $(dirname $0)
. wvtest.sh
-PATH=$(dirname $PWD):$PATH # Find our version of novaboot first
-function create_script ()
-{
- (echo "#!/usr/bin/env novaboot"; cat) > script
- chmod +x script
-}
+WVSTART Invoke with no script
+WVPASS novaboot -t '' < /dev/null
-function create_dummy ()
-{
- create_script <<EOF
-kernel
-file
-EOF
- touch kernel
- touch file
-}
-
-WVSTART Pulsar root
+WVSTART Invoke as script
create_dummy
-WVPASS ./script --gen-only --pulsar --pulsar-root=ASDF
-WVPASS grep "root ASDF" config-novaboot
+WVPASS ./script --gen-only
-WVSTART Bender
+WVSTART Invoke as script with absolute path
create_dummy
-WVPASS ./script --gen-only --bender --pulsar
-WVPASS grep "bender" config-novaboot
+WVPASS $PWD/script --gen-only
-WVSTART Chainloader support
+WVSTART Pulsar root
create_dummy
-WVPASS ./script --gen-only --chainloader=chain1 -chainloader=chain2 --pulsar
-WVPASS grep "exec chain1" config-novaboot
-WVPASS grep "load chain2" config-novaboot
+WVPASS ./script --gen-only --pulsar --pulsar-root=ASDF
+WVPASS grep "root ASDF" config-novaboot
WVSTART Configuration files
create_dummy
WVPASS sh -c "./script --gen-only 2> log"
WVPASS grep "novaboot: Read $PWD/.novaboot" log
+WVSTART Configuration files in symlinked directories
+mkdir config
+echo '1;' > config/.novaboot
+mkdir script
+( cd script; create_dummy )
+ln -s ../script config
+WVPASS sh -c "./config/script/script --gen-only 2> log"
+WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
+
WVSTART Builddir configuration variable
WVPASS mkdir -p build
cat > .novaboot <<'EOF'
1;
EOF
create_script <<'EOF'
-file < echo Hello
+load file < echo Hello
EOF
WVPASS ./script --gen-only
WVPASS test -f build/file
+WVSTART Fail with unknown target
+create_dummy
+WVFAIL sh -c "./script --gen-only -t non-existing-target"
+
WVSTART BUILDDIR variable
WVPASS mkdir -p build
create_script <<'EOF'
BUILDDIR=build
-file < echo Hello
+load file < echo Hello
EOF
WVPASS ./script --gen-only
WVPASS test -f build/file
WVPASS ./script --gen-only --pulsar
WVPASS grep "exec HYP" config-novaboot
-
-exit
-
# Broken
WVSTART ISO image generation
create_dummy
-WVPASS ./script --iso
+WVPASS ./script --iso --target ''
# Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))