1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# |
3 |
|
# test.sh -- grubby regression tests |
4 |
|
# |
5 |
|
# Copyright 2007-2008 Red Hat, Inc. All rights reserved. |
6 |
|
# |
7 |
|
# This program is free software; you can redistribute it and/or modify |
8 |
|
# it under the terms of the GNU General Public License as published by |
9 |
|
# the Free Software Foundation; either version 2 of the License, or |
10 |
|
# (at your option) any later version. |
11 |
|
# |
12 |
|
# This program is distributed in the hope that it will be useful, |
13 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
# GNU General Public License for more details. |
16 |
|
# |
17 |
|
# You should have received a copy of the GNU General Public License |
18 |
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 |
|
# |
20 |
|
|
21 |
|
if [ -n "$TOPDIR" ]; then |
22 |
|
LD_LIBRARY_PATH="$TOPDIR/nash:$TOPDIR/bdevid:/usr/lib:/lib" |
23 |
|
export LD_LIBRARY_PATH |
24 |
|
fi |
25 |
|
|
26 |
ARCH=$(uname -m) |
#---------------------------------------------------------------------- |
27 |
|
# Global vars |
28 |
elilotest="" |
#---------------------------------------------------------------------- |
29 |
lilotest="" |
|
30 |
grubtest="" |
cmd=${0##*/} |
31 |
zipltest="" |
opt_bootloader=* |
32 |
yaboottest="" |
opt_verbose=false |
33 |
|
read -d '' usage <<EOT |
34 |
case "$ARCH" in |
usage: test.sh [ -hv ] |
35 |
i?86) |
|
36 |
lilotest="yes" |
-b B --bootloader=B Test bootloader B instead of all |
37 |
grubtest="yes" |
-h --help Show this help message |
38 |
;; |
-v --verbose Verbose output |
39 |
x86_64) |
EOT |
40 |
lilotest="yes" |
declare -i pass=0 fail=0 |
41 |
grubtest="yes" |
testing= |
42 |
;; |
|
43 |
ppc*) |
#---------------------------------------------------------------------- |
44 |
yaboottest="yes" |
# Functions |
45 |
;; |
#---------------------------------------------------------------------- |
46 |
s390*) |
|
47 |
zipltest="yes" |
oneTest() { |
48 |
;; |
typeset mode=$1 cfg=test/$2 correct=test/results/$3 |
49 |
*) |
shift 3 |
50 |
echo "Not running any tests for $ARCH" |
|
51 |
exit 0 |
echo "$testing ... $mode $cfg $correct" |
52 |
esac |
runme=( ./grubby "$mode" --bad-image-okay -c "$cfg" -o - "$@" ) |
53 |
|
if "${runme[@]}" | cmp "$correct" > /dev/null; then |
54 |
export MALLOC_CHECK_=2 |
(( pass++ )) |
55 |
|
if $opt_verbose; then |
56 |
RESULT=0 |
echo ------------------------------------------------------------- |
57 |
|
echo -n "PASS: " |
58 |
oneTest () { |
printf "%q " "${runme[@]}"; echo |
59 |
mode=$1 |
"${runme[@]}" | diff -U30 "$cfg" - |
60 |
cfg=test/$2 |
echo |
61 |
correct=test/results/$3 |
fi |
62 |
shift; shift; shift |
else |
63 |
./grubby $mode --bad-image-okay -c $cfg -o - "$@" | cmp $correct > /dev/null |
(( fail++ )) |
|
|
|
|
if [ $? != 0 ]; then |
|
64 |
echo ------------------------------------------------------------- |
echo ------------------------------------------------------------- |
65 |
echo FAILURE: $cfg $correct "$@" |
echo -n "FAIL: " |
66 |
echo -n ./grubby $mode --bad-image-okay -c $cfg -o - |
printf "%q " "${runme[@]}"; echo |
67 |
for arg in "$@"; do |
"${runme[@]}" | diff -U30 "$correct" - |
68 |
echo -n " \"$arg\"" |
echo |
|
done |
|
|
echo "" |
|
|
./grubby $mode --bad-image-okay -c $cfg -o - "$@" | diff -u $correct -; |
|
|
RESULT=1 |
|
69 |
fi |
fi |
70 |
} |
} |
71 |
|
|
72 |
liloTest() { |
# Test feature that display some information, checking that output instead of |
73 |
if [ -z "$lilotest" ]; then echo "skipping LILO test" ; return; fi |
# the generated configuration file |
74 |
oneTest --lilo "$@" |
oneDisplayTest() { |
75 |
} |
typeset mode=$1 cfg=test/$2 correct=test/results/$3 |
76 |
|
shift 3 |
77 |
eliloTest() { |
|
78 |
if [ -z "$elilotest" ]; then echo "skipping ELILO test" ; return; fi |
echo "$testing ... $mode $cfg $correct" |
79 |
oneTest --elilo "$@" |
runme=( ./grubby "$mode" --bad-image-okay -c "$cfg" "$@" ) |
80 |
|
if "${runme[@]}" | cmp "$correct" > /dev/null; then |
81 |
|
(( pass++ )) |
82 |
|
if $opt_verbose; then |
83 |
|
echo ------------------------------------------------------------- |
84 |
|
echo -n "PASS: " |
85 |
|
printf "%q " "${runme[@]}"; echo |
86 |
|
"${runme[@]}" | diff -U30 "$cfg" - |
87 |
|
echo |
88 |
|
fi |
89 |
|
else |
90 |
|
(( fail++ )) |
91 |
|
echo ------------------------------------------------------------- |
92 |
|
echo -n "FAIL: " |
93 |
|
printf "%q " "${runme[@]}"; echo |
94 |
|
"${runme[@]}" | diff -U30 "$correct" - |
95 |
|
echo |
96 |
|
fi |
97 |
} |
} |
98 |
|
|
99 |
grubTest() { |
# generate convenience functions |
100 |
if [ -z "$grubtest" ]; then echo "skipping GRUB test" ; return; fi |
for b in $(./grubby --help | \ |
101 |
oneTest --grub "$@" |
sed -n 's/^.*--\([^ ]*\) *configure \1 bootloader$/\1/p'); do |
102 |
} |
eval "${b}Test() { [[ \"$b\" == \$opt_bootloader ]] && oneTest --$b \"\$@\"; }" |
103 |
|
eval "${b}DisplayTest() { [[ \"$b\" == \$opt_bootloader ]] && oneDisplayTest --$b \"\$@\"; }" |
104 |
|
done |
105 |
|
|
106 |
yabootTest() { |
#---------------------------------------------------------------------- |
107 |
if [ -z "$yaboottest" ]; then echo "skipping YABOOT test" ; return; fi |
# Main |
108 |
oneTest --yaboot "$@" |
#---------------------------------------------------------------------- |
109 |
} |
|
110 |
|
# Use /usr/bin/getopt which supports GNU-style long options |
111 |
|
args=$(getopt -o b:hv --long bootloader,help,verbose -n "$cmd" -- "$@") || exit |
112 |
|
eval set -- "$args" |
113 |
|
while true; do |
114 |
|
case $1 in |
115 |
|
-b|--bootloader) opt_bootloader=$2; shift 2 ;; |
116 |
|
-h|--help) echo "$usage"; exit 0 ;; |
117 |
|
-v|--verbose) opt_verbose=true; shift ;; |
118 |
|
--) shift; break ;; |
119 |
|
*) echo "failed to process cmdline args" >&2; exit 1 ;; |
120 |
|
esac |
121 |
|
done |
122 |
|
|
123 |
ziplTest() { |
export MALLOC_CHECK_=2 |
|
if [ -z "$zipltest" ]; then echo "skipping Z/IPL test" ; return; fi |
|
|
oneTest --zipl "$@" |
|
|
} |
|
124 |
|
|
125 |
echo "Parse/write comparison..." |
testing="Parse/write comparison" |
126 |
for n in $(cd test; echo grub.[0-9]*); do |
for n in test/*.[0-9]*; do |
127 |
grubTest $n ../$n --remove-kernel 1234 |
n=${n#*/} # remove test/ |
128 |
|
b=${n%.*} # remove suffix |
129 |
|
[[ $b == $opt_bootloader ]] || continue |
130 |
|
${b}Test $n ../$n --remove-kernel 1234 |
131 |
done |
done |
132 |
|
|
133 |
for n in $(cd test; echo lilo.[0-9]*); do |
testing="Permission preservation" |
134 |
liloTest $n ../$n --remove-kernel 1234 |
unset b |
135 |
|
for n in test/*.[0-9]*; do |
136 |
|
n=${n#*/} # remove test/ |
137 |
|
[[ ${n%.*} == "$b" ]] && continue |
138 |
|
b=${n%.*} # remove suffix |
139 |
|
[[ $b == $opt_bootloader ]] || continue |
140 |
|
|
141 |
|
echo "$testing ... --$b" |
142 |
|
|
143 |
|
cp test/$n ${b}-test |
144 |
|
chmod 0614 ${b}-test |
145 |
|
touch -t 200301010101.00 ${b}-test |
146 |
|
time=$(ls -l ${b}-test | awk '{ print $6 " " $7 " "$8}') |
147 |
|
perm=$(ls -l ${b}-test | awk '{print $1}') |
148 |
|
./grubby --${b} --add-kernel bar --title title -c ${b}-test |
149 |
|
if [[ $? != 0 ]]; then |
150 |
|
echo " FAIL (grubby returned non-zero)" |
151 |
|
(( fail++ )) |
152 |
|
elif newtime=$(ls -l ${b}-test | awk '{ print $6 " " $7 " "$8}') && \ |
153 |
|
newperm=$(ls -l ${b}-test | awk '{print $1}') && \ |
154 |
|
[[ $time == "$newtime" || $perm != "$newperm" ]] |
155 |
|
then |
156 |
|
echo " FAIL ($perm $newperm)"; |
157 |
|
(( fail++ )) |
158 |
|
else |
159 |
|
(( pass++ )) |
160 |
|
fi |
161 |
|
rm -f ${b}-test |
162 |
done |
done |
163 |
|
|
164 |
echo "Permission preservation..." |
testing="Following symlinks" |
165 |
cp test/grub.1 grub-test |
unset b |
166 |
chmod 0614 grub-test |
for n in test/*.[0-9]*; do |
167 |
touch -t 200301010101.00 grub-test |
n=${n#*/} # remove test/ |
168 |
time=$(ls -l grub-test | awk '{ print $6 " " $7 " "$8}') |
[[ ${n%.*} == "$b" ]] && continue |
169 |
perm=$(ls -l grub-test | awk '{print $1}') |
b=${n%.*} # remove suffix |
170 |
./grubby --grub --add-kernel bar --title title -c grub-test |
[[ $b == $opt_bootloader ]] || continue |
171 |
newtime=$(ls -l grub-test | awk '{ print $6 " " $7 " "$8}') |
|
172 |
newperm=$(ls -l grub-test | awk '{print $1}') |
echo "$testing ... --$b" |
173 |
if [ "$time" == "$newtime" -o "$perm" != "$newperm" ]; then |
|
174 |
echo " failed ($perm $newperm)"; |
cp test/${b}.1 ${b}-test |
175 |
fi |
ln -s ./${b}-test mytest |
176 |
rm -f grub-test |
./grubby --${b} --add-kernel bar --title title -c mytest |
177 |
|
if [[ $? != 0 ]]; then |
178 |
cp test/lilo.1 lilo-test |
echo " failed (grubby returned non-zero)" |
179 |
chmod 0614 lilo-test |
(( fail++ )) |
180 |
touch -t 200301010101.00 lilo-test |
elif [[ ! -L mytest ]]; then |
181 |
time=$(ls -l lilo-test | awk '{ print $6 " " $7 " "$8}') |
echo " failed (not a symlink)" |
182 |
perm=$(ls -l lilo-test | awk '{print $1}') |
(( fail++ )) |
183 |
./grubby --lilo --add-kernel bar --title title -c lilo-test |
elif target=$(readlink mytest) && [[ $target != "./${b}-test" ]]; then |
184 |
newtime=$(ls -l lilo-test | awk '{ print $6 " " $7 " "$8}') |
echo " failed (wrong target)" |
185 |
newperm=$(ls -l lilo-test | awk '{print $1}') |
(( fail++ )) |
186 |
if [ "$time" == "$newtime" -o "$perm" != "$newperm" ]; then |
else |
187 |
echo " failed ($perm $newperm)"; |
(( pass++ )) |
188 |
fi |
fi |
189 |
rm -f lilo-test |
rm -f ${b}-test mytest |
190 |
|
done |
|
echo "Following symlinks..." |
|
|
cp test/grub.1 grub-test |
|
|
ln -s grub-test mytest |
|
|
./grubby --grub --add-kernel bar --title title -c mytest |
|
|
if [ ! -L mytest ]; then |
|
|
echo " failed (not a symlink)" |
|
|
fi |
|
|
target=$(ls -l mytest | awk '{ print $11 }') |
|
|
if [ "$target" != grub-test ]; then |
|
|
echo " failed (wrong target)" |
|
|
fi |
|
|
rm -f grub-test mytest |
|
191 |
|
|
192 |
echo "GRUB default directive..." |
testing="GRUB default directive" |
193 |
grubTest grub.1 default/g1.1 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title |
grubTest grub.1 default/g1.1 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title |
194 |
grubTest grub.1 default/g1.2 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title --make-default |
grubTest grub.1 default/g1.2 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title --make-default |
195 |
grubTest grub.3 default/g3.1 --boot-filesystem=/boot --set-default=/boot/vmlinuz-2.4.7-2 |
grubTest grub.3 default/g3.1 --boot-filesystem=/boot --set-default=/boot/vmlinuz-2.4.7-2 |
198 |
grubTest grub.4 default/g4.2 --boot-filesystem=/ --set-default=/boot/vmlinuz-2.4.7-ac3 --remove-kernel /boot/vmlinuz-2.4.7-2.5 --add-kernel=/boot/new-kernel --copy-default --title New_Title |
grubTest grub.4 default/g4.2 --boot-filesystem=/ --set-default=/boot/vmlinuz-2.4.7-ac3 --remove-kernel /boot/vmlinuz-2.4.7-2.5 --add-kernel=/boot/new-kernel --copy-default --title New_Title |
199 |
grubTest grub.6 default/g6.1 --remove-kernel=/boot/vmlinuz-2.4.7-2.9 --boot-filesystem=/ |
grubTest grub.6 default/g6.1 --remove-kernel=/boot/vmlinuz-2.4.7-2.9 --boot-filesystem=/ |
200 |
|
|
201 |
echo "LILO default directive..." |
testing="LILO default directive" |
202 |
liloTest lilo.1 default/l1.1 --set-default=/boot/vmlinuz-2.4.18-4 |
liloTest lilo.1 default/l1.1 --set-default=/boot/vmlinuz-2.4.18-4 |
203 |
liloTest lilo.1 default/l1.2 --remove-kernel=/boot/vmlinuz-2.4.18-4smp |
liloTest lilo.1 default/l1.2 --remove-kernel=/boot/vmlinuz-2.4.18-4smp |
204 |
liloTest lilo.1 default/l1.3 --add-kernel /boot/kernel --title label \ |
liloTest lilo.1 default/l1.3 --add-kernel /boot/kernel --title label \ |
206 |
liloTest lilo.1 default/l1.4 --add-kernel /boot/kernel --title label \ |
liloTest lilo.1 default/l1.4 --add-kernel /boot/kernel --title label \ |
207 |
--copy-default --make-default |
--copy-default --make-default |
208 |
|
|
209 |
echo "Z/IPL default directive..." |
testing="Z/IPL default directive" |
210 |
ziplTest zipl.1 default/z1.1 --add-kernel /boot/new-kernel --title test |
ziplTest zipl.1 default/z1.1 --add-kernel /boot/new-kernel --title test |
211 |
ziplTest zipl.1 default/z1.2 --add-kernel /boot/new-kernel --title test --make-default |
ziplTest zipl.1 default/z1.2 --add-kernel /boot/new-kernel --title test --make-default |
212 |
|
|
213 |
echo "GRUB fallback directive..." |
testing="GRUB fallback directive" |
214 |
grubTest grub.5 fallback/g5.1 --remove-kernel=/boot/vmlinuz-2.4.7-ac3 \ |
grubTest grub.5 fallback/g5.1 --remove-kernel=/boot/vmlinuz-2.4.7-ac3 \ |
215 |
--boot-filesystem=/ |
--boot-filesystem=/ |
216 |
grubTest grub.5 fallback/g5.2 --remove-kernel=/boot/vmlinuz-2.4.7-2.5 \ |
grubTest grub.5 fallback/g5.2 --remove-kernel=/boot/vmlinuz-2.4.7-2.5 \ |
219 |
--boot-filesystem=/ --copy-default --add-kernel=/boot/new-kernel \ |
--boot-filesystem=/ --copy-default --add-kernel=/boot/new-kernel \ |
220 |
--title="Some_Title" |
--title="Some_Title" |
221 |
|
|
222 |
echo "GRUB new kernel argument handling..." |
testing="GRUB new kernel argument handling" |
223 |
grubTest grub.1 args/g1.1 --boot-filesystem=/boot \ |
grubTest grub.1 args/g1.1 --boot-filesystem=/boot \ |
224 |
--add-kernel=/boot/foo --title=some_title --args="1234" --copy-default |
--add-kernel=/boot/foo --title=some_title --args="1234" --copy-default |
225 |
grubTest grub.1 args/g1.2 --boot-filesystem=/boot \ |
grubTest grub.1 args/g1.2 --boot-filesystem=/boot \ |
226 |
--add-kernel=/boot/foo --title=some_title --args="1234" |
--add-kernel=/boot/foo --title=some_title --args="1234" |
227 |
|
|
228 |
echo "GRUB remove kernel..." |
testing="GRUB remove kernel" |
229 |
grubTest grub.7 remove/g7.1 --boot-filesystem=/ \ |
grubTest grub.7 remove/g7.1 --boot-filesystem=/ \ |
230 |
--remove-kernel=/boot/vmlinuz-2.4.7-2.5 |
--remove-kernel=/boot/vmlinuz-2.4.7-2.5 |
231 |
grubTest grub.3 remove/g3.1 --boot-filesystem=/ \ |
grubTest grub.3 remove/g3.1 --boot-filesystem=/ \ |
233 |
grubTest grub.9 remove/g9.1 --boot-filesystem=/boot \ |
grubTest grub.9 remove/g9.1 --boot-filesystem=/boot \ |
234 |
--remove-kernel=/boot/vmlinuz-2.4.7-2 |
--remove-kernel=/boot/vmlinuz-2.4.7-2 |
235 |
|
|
236 |
echo "YABOOT remove kernel..." |
testing="YABOOT remove kernel" |
237 |
yabootTest yaboot.1 remove/y1.1 --boot-filesystem=/ --remove-kernel=DEFAULT |
yabootTest yaboot.1 remove/y1.1 --boot-filesystem=/ --remove-kernel=DEFAULT |
238 |
yabootTest yaboot.1 remove/y1.2 --boot-filesystem=/ --remove-kernel=/boot/vmlinuz-2.5.50-eepro |
yabootTest yaboot.1 remove/y1.2 --boot-filesystem=/ --remove-kernel=/boot/vmlinuz-2.5.50-eepro |
239 |
yabootTest yaboot.2 remove/y2.1 --boot-filesystem=/ --remove-kernel=/boot/vmlinux-2.5.50 |
yabootTest yaboot.2 remove/y2.1 --boot-filesystem=/ --remove-kernel=/boot/vmlinux-2.5.50 |
240 |
|
|
241 |
echo "Z/IPL remove kernel..." |
testing="Z/IPL remove kernel" |
242 |
ziplTest zipl.1 remove/z1.1 --remove-kernel=/boot/vmlinuz-2.4.9-38 |
ziplTest zipl.1 remove/z1.1 --remove-kernel=/boot/vmlinuz-2.4.9-38 |
243 |
ziplTest zipl.1 remove/z1.2 --remove-kernel=DEFAULT |
ziplTest zipl.1 remove/z1.2 --remove-kernel=DEFAULT |
244 |
|
|
245 |
echo "GRUB update kernel argument handling..." |
testing="GRUB update kernel argument handling" |
246 |
grubTest grub.1 updargs/g1.1 --update-kernel=DEFAULT --args="root=/dev/hda1" |
grubTest grub.1 updargs/g1.1 --update-kernel=DEFAULT --args="root=/dev/hda1" |
247 |
grubTest grub.1 updargs/g1.2 --update-kernel=DEFAULT \ |
grubTest grub.1 updargs/g1.2 --update-kernel=DEFAULT \ |
248 |
--args="root=/dev/hda1 hda=ide-scsi root=/dev/hda2" |
--args="root=/dev/hda1 hda=ide-scsi root=/dev/hda2" |
265 |
grubTest grub.7 updargs/g7.4 --boot-filesystem=/ \ |
grubTest grub.7 updargs/g7.4 --boot-filesystem=/ \ |
266 |
--update-kernel=/vmlinuz-2.4.7-2 \ |
--update-kernel=/vmlinuz-2.4.7-2 \ |
267 |
--args "ro root=LABEL=/ console=tty0 console=ttyS1,9600n81 single" |
--args "ro root=LABEL=/ console=tty0 console=ttyS1,9600n81 single" |
268 |
|
grubTest grub.7 updargs/g7.5 --boot-filesystem=/ \ |
269 |
|
--update-kernel=ALL --args "root=/dev/hda2" |
270 |
grubTest grub.11 updargs/g11.1 --boot-filesystem=/ \ |
grubTest grub.11 updargs/g11.1 --boot-filesystem=/ \ |
271 |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
272 |
--args "ro root=LABEL=/ console=tty0 console=ttyS1,9600n81 single" |
--args "ro root=LABEL=/ console=tty0 console=ttyS1,9600n81 single" |
274 |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
275 |
--args "ro root=LABEL=/ single" |
--args "ro root=LABEL=/ single" |
276 |
|
|
277 |
echo "LILO update kernel argument handling..." |
testing="LILO update kernel argument handling" |
278 |
liloTest lilo.1 updargs/l1.1 --update-kernel=/boot/vmlinuz-2.4.18-4 \ |
liloTest lilo.1 updargs/l1.1 --update-kernel=/boot/vmlinuz-2.4.18-4 \ |
279 |
--args="root=/dev/md1" |
--args="root=/dev/md1" |
280 |
liloTest lilo.1 updargs/l1.2 --update-kernel=/boot/vmlinuz-2.4.18-4smp \ |
liloTest lilo.1 updargs/l1.2 --update-kernel=/boot/vmlinuz-2.4.18-4smp \ |
288 |
liloTest lilo.3 updargs/l3.2 --update-kernel=ALL \ |
liloTest lilo.3 updargs/l3.2 --update-kernel=ALL \ |
289 |
--remove-args="single" --args "root=/dev/hda2" |
--remove-args="single" --args "root=/dev/hda2" |
290 |
|
|
291 |
echo "LILO add kernel..." |
testing="LILO add kernel" |
292 |
liloTest lilo.4 add/l4.1 --add-kernel=/boot/new-kernel.img --title="title" \ |
liloTest lilo.4 add/l4.1 --add-kernel=/boot/new-kernel.img --title="title" \ |
293 |
--copy-default --boot-filesystem=/boot |
--copy-default --boot-filesystem=/boot |
294 |
liloTest lilo.4 add/l4.2 --add-kernel=/boot/new-kernel.img --title="linux" \ |
liloTest lilo.4 add/l4.2 --add-kernel=/boot/new-kernel.img --title="linux" \ |
303 |
--initrd=/boot/new-initrd --copy-default --boot-filesystem=/boot --remove-kernel "TITLE=linux" |
--initrd=/boot/new-initrd --copy-default --boot-filesystem=/boot --remove-kernel "TITLE=linux" |
304 |
|
|
305 |
|
|
306 |
echo "GRUB add kernel..." |
testing="GRUB add kernel" |
307 |
grubTest grub.1 add/g1.1 --add-kernel=/boot/new-kernel.img --title='title' \ |
grubTest grub.1 add/g1.1 --add-kernel=/boot/new-kernel.img --title='title' \ |
308 |
--initrd=/boot/new-initrd --boot-filesystem=/ |
--initrd=/boot/new-initrd --boot-filesystem=/ |
309 |
grubTest grub.1 add/g1.2 --add-kernel=/boot/new-kernel.img --title='title' \ |
grubTest grub.1 add/g1.2 --add-kernel=/boot/new-kernel.img --title='title' \ |
312 |
--initrd=/boot/new-initrd --boot-filesystem=/ --copy-default |
--initrd=/boot/new-initrd --boot-filesystem=/ --copy-default |
313 |
grubTest grub.1 add/g1.4 --add-kernel=/boot/new-kernel.img --title='title' \ |
grubTest grub.1 add/g1.4 --add-kernel=/boot/new-kernel.img --title='title' \ |
314 |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default |
315 |
|
grubTest grub.1 add/g1.5 --add-kernel=/boot/new-kernel.img --title='title' \ |
316 |
|
--initrd=/boot/new-initrd --extra-initrd=/boot/extra-initrd --boot-filesystem=/ |
317 |
|
grubTest grub.1 add/g1.6 --add-kernel=/boot/new-kernel.img --title='title' \ |
318 |
|
--initrd=/boot/new-initrd --extra-initrd=/boot/extra-initrd --boot-filesystem=/boot |
319 |
grubTest grub.2 add/g2.1 --add-kernel=/boot/vmlinuz-2.4.7-2 \ |
grubTest grub.2 add/g2.1 --add-kernel=/boot/vmlinuz-2.4.7-2 \ |
320 |
--initrd=/boot/initrd-2.4.7-new.img --boot-filesystem=/boot --copy-default \ |
--initrd=/boot/initrd-2.4.7-new.img --boot-filesystem=/boot --copy-default \ |
321 |
--title="Red Hat Linux (2.4.7-2)" \ |
--title="Red Hat Linux (2.4.7-2)" \ |
329 |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default \ |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default \ |
330 |
--args='console=tty0 console=ttyS1,9600n81 single' |
--args='console=tty0 console=ttyS1,9600n81 single' |
331 |
|
|
332 |
echo "YABOOT add kernel..." |
testing="GRUB2 add kernel" |
333 |
|
grub2Test grub2.1 add/g2-1.1 --add-kernel=/boot/new-kernel.img --title='title' \ |
334 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ --copy-default |
335 |
|
grub2Test grub2.1 add/g2-1.2 --add-kernel=/boot/new-kernel.img --title='title' \ |
336 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
337 |
|
--copy-default --make-default |
338 |
|
grub2Test grub2.1 add/g2-1.3 --add-kernel=/boot/new-kernel.img --title='title' \ |
339 |
|
--boot-filesystem=/boot/ --copy-default --make-default |
340 |
|
|
341 |
|
testing="GRUB2 add initrd" |
342 |
|
grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \ |
343 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ |
344 |
|
|
345 |
|
testing="YABOOT add kernel" |
346 |
yabootTest yaboot.1 add/y1.1 --copy-default --boot-filesystem=/ --add-kernel=/boot/new-kernel \ |
yabootTest yaboot.1 add/y1.1 --copy-default --boot-filesystem=/ --add-kernel=/boot/new-kernel \ |
347 |
--title=newtitle |
--title=newtitle |
348 |
yabootTest yaboot.1 add/y1.2 --add-kernel=/boot/new-kernel --boot-filesystem=/ --title=newtitle |
yabootTest yaboot.1 add/y1.2 --add-kernel=/boot/new-kernel --boot-filesystem=/ --title=newtitle |
349 |
|
|
350 |
echo "YABOOT empty label..." |
testing="YABOOT empty label" |
351 |
yabootTest yaboot.3 add/y3.1 --add-kernel=/boot/new-kernel --boot-filesystem=/ --title=newtitle |
yabootTest yaboot.3 add/y3.1 --add-kernel=/boot/new-kernel --boot-filesystem=/ --title=newtitle |
352 |
|
|
353 |
echo "Z/IPL add kernel..." |
testing="Z/IPL add kernel" |
354 |
ziplTest zipl.1 add/z1.1 --add-kernel=/boot/new-kernel.img --title test |
ziplTest zipl.1 add/z1.1 --add-kernel=/boot/new-kernel.img --title test |
355 |
ziplTest zipl.1 add/z1.2 --add-kernel=/boot/new-kernel.img --title test --copy-default |
ziplTest zipl.1 add/z1.2 --add-kernel=/boot/new-kernel.img --title test --copy-default |
356 |
|
|
357 |
echo "LILO long titles..." |
testing="LILO long titles" |
358 |
liloTest lilo.1 longtitle/l1.1 --add-kernel=/boot/new-kernel.img \ |
liloTest lilo.1 longtitle/l1.1 --add-kernel=/boot/new-kernel.img \ |
359 |
--title="linux-longtitle" --copy-default --boot-filesystem=/boot |
--title="linux-longtitle" --copy-default --boot-filesystem=/boot |
360 |
liloTest lilo.1 longtitle/l1.2 --add-kernel=/boot/new-kernel.img \ |
liloTest lilo.1 longtitle/l1.2 --add-kernel=/boot/new-kernel.img \ |
362 |
liloTest lilo.7 longtitle/l7.1 --add-kernel=/boot/new-kernel.img \ |
liloTest lilo.7 longtitle/l7.1 --add-kernel=/boot/new-kernel.img \ |
363 |
--title="linux-longtitle-fix" --copy-default --boot-filesystem=/boot |
--title="linux-longtitle-fix" --copy-default --boot-filesystem=/boot |
364 |
|
|
365 |
echo "ELILO long titles..." |
testing="ELILO long titles" |
366 |
eliloTest lilo.7 longtitle/e7.1 --add-kernel=/boot/new-kernel.img \ |
eliloTest lilo.7 longtitle/e7.1 --add-kernel=/boot/new-kernel.img \ |
367 |
--title="linux-longtitle-fix" --copy-default --boot-filesystem=/boot |
--title="linux-longtitle-fix" --copy-default --boot-filesystem=/boot |
368 |
|
|
369 |
echo "GRUB add multiboot..." |
testing="GRUB add multiboot" |
370 |
grubTest grub.1 multiboot/g1.1 --add-multiboot=/boot/xen.gz \ |
grubTest grub.1 multiboot/g1.1 --add-multiboot=/boot/xen.gz \ |
371 |
--add-kernel=/boot/vmlinuz-2.6.10-1.1088_FC4 --boot-filesystem=/boot \ |
--add-kernel=/boot/vmlinuz-2.6.10-1.1088_FC4 --boot-filesystem=/boot \ |
372 |
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
390 |
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
391 |
--boot-filesystem=/boot |
--boot-filesystem=/boot |
392 |
|
|
393 |
echo "GRUB remove multiboot..." |
testing="GRUB remove multiboot" |
394 |
grubTest grub.10 multiboot/g10.5 --boot-filesystem=/boot \ |
grubTest grub.10 multiboot/g10.5 --boot-filesystem=/boot \ |
395 |
--remove-kernel=/boot/vmlinuz-2.6.10-1.1076_FC4 |
--remove-kernel=/boot/vmlinuz-2.6.10-1.1076_FC4 |
396 |
grubTest grub.10 multiboot/g10.6 --boot-filesystem=/boot \ |
grubTest grub.10 multiboot/g10.6 --boot-filesystem=/boot \ |
398 |
grubTest grub.10 multiboot/g10.7 --boot-filesystem=/boot \ |
grubTest grub.10 multiboot/g10.7 --boot-filesystem=/boot \ |
399 |
--remove-multiboot=/boot/xen.gz |
--remove-multiboot=/boot/xen.gz |
400 |
|
|
401 |
exit $RESULT |
testing="ELILO add multiboot" |
402 |
|
eliloTest elilo.1 multiboot/e1.1 --add-multiboot=/boot/xen.gz \ |
403 |
|
--add-kernel=/boot/vmlinuz-2.6.10-1.1088_FC4 --boot-filesystem=/boot \ |
404 |
|
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
405 |
|
--mbargs="dom0_mem=130000" |
406 |
|
eliloTest elilo.1 multiboot/e1.2 --add-multiboot=/boot/xen.gz \ |
407 |
|
--add-kernel=/boot/vmlinuz-2.6.10-1.1088_FC4 --boot-filesystem=/boot \ |
408 |
|
--initrd=/boot/initrd-2.6.10-1.1088_FC4.img --title foo \ |
409 |
|
--mbargs="dom0_mem=130000" --copy-default |
410 |
|
|
411 |
|
testing="ELILO remove multiboot" |
412 |
|
eliloTest elilo.2 multiboot/e2.1 --boot-filesystem=/boot \ |
413 |
|
--remove-kernel=/boot/vmlinuz-2.6.10-1.1076_FC4 |
414 |
|
eliloTest elilo.2 multiboot/e2.2 --boot-filesystem=/boot \ |
415 |
|
--remove-kernel=/boot/vmlinuz-2.6.10-1.1082_FC4 |
416 |
|
eliloTest elilo.2 multiboot/e2.3 --boot-filesystem=/boot \ |
417 |
|
--remove-multiboot=/boot/xen.gz |
418 |
|
|
419 |
|
printf "\n%d (%d%%) tests passed, %d (%d%%) tests failed\n" \ |
420 |
|
$pass $(((100*pass)/(pass+fail))) \ |
421 |
|
$fail $(((100*fail)/(pass+fail))) |
422 |
|
|
423 |
|
exit $(( !!fail )) |