]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - tests/novaboot.wv
One more fix for ISO image creation
[novaboot.git] / tests / novaboot.wv
index 0594c6c4c4338eab8a90476febd1ae49b4dadb05..7cee40b020ca0f4da6714f23c65de685de9ca71e 100755 (executable)
@@ -2,39 +2,22 @@
 
 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
@@ -42,6 +25,15 @@ echo '1;' > .novaboot
 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'
@@ -49,16 +41,20 @@ $builddir="build";
 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
@@ -69,12 +65,9 @@ echo '$hypervisor="HYP";' > .novaboot
 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)))