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