]> rtime.felk.cvut.cz Git - novaboot.git/blob - tests/novaboot.wv
0019185b4205f39e4957bec79de53bb83a82c7a5
[novaboot.git] / tests / novaboot.wv
1 #!/bin/bash
2
3 cd $(dirname $0)
4 . wvtest.sh
5
6 WVSTART Invoke with no script
7 WVPASS novaboot -t '' < /dev/null
8
9 WVSTART Invoke as script
10 create_dummy
11 WVPASS ./script --gen-only
12
13 WVSTART Invoke as script with absolute path
14 create_dummy
15 WVPASS $PWD/script --gen-only
16
17 WVSTART Pulsar root
18 create_dummy
19 WVPASS ./script --gen-only --pulsar --pulsar-root=ASDF
20 WVPASS grep "root ASDF" config-novaboot
21
22 WVSTART Bender
23 create_dummy
24 WVPASS ./script --gen-only --bender --pulsar
25 WVPASS grep "bender" config-novaboot
26
27 WVSTART Chainloader support
28 create_dummy
29 WVPASS ./script --gen-only --chainloader=chain1 -chainloader=chain2 --pulsar
30 WVPASS grep "exec chain1" config-novaboot
31 WVPASS grep "load chain2" config-novaboot
32
33 WVSTART Configuration files
34 create_dummy
35 echo '1;' > .novaboot
36 WVPASS sh -c "./script --gen-only 2> log"
37 WVPASS grep "novaboot: Read $PWD/.novaboot" log
38
39 WVSTART Configuration files in symlinked directories
40 mkdir config
41 echo '1;' > config/.novaboot
42 mkdir script
43 ( cd script; create_dummy )
44 ln -s ../script config
45 WVPASS sh -c "./config/script/script --gen-only 2> log"
46 WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
47
48 WVSTART Builddir configuration variable
49 WVPASS mkdir -p build
50 cat > .novaboot <<'EOF'
51 $builddir="build";
52 1;
53 EOF
54 create_script <<'EOF'
55 load file < echo Hello
56 EOF
57 WVPASS ./script --gen-only
58 WVPASS test -f build/file
59
60 WVSTART Fail with unknown target
61 create_dummy
62 WVFAIL sh -c "./script --gen-only -t non-existing-target"
63
64 WVSTART BUILDDIR variable
65 WVPASS mkdir -p build
66 create_script <<'EOF'
67 BUILDDIR=build
68 load file < echo Hello
69 EOF
70 WVPASS ./script --gen-only
71 WVPASS test -f build/file
72
73 WVSTART Hypervisor configuration variable
74 create_dummy
75 echo '$hypervisor="HYP";' > .novaboot
76 WVPASS ./script --gen-only --pulsar
77 WVPASS grep "exec HYP" config-novaboot
78
79 exit 0
80
81 # Broken
82 WVSTART ISO image generation
83 create_dummy
84 WVPASS ./script --iso
85
86 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))