48 |
typeset mode=$1 cfg=test/$2 correct=test/results/$3 |
typeset mode=$1 cfg=test/$2 correct=test/results/$3 |
49 |
shift 3 |
shift 3 |
50 |
|
|
51 |
|
local ENV_FILE="" |
52 |
|
if [ "$mode" == "--grub2" ]; then |
53 |
|
ENV_FILE="test/grub2-support_files/env_temp" |
54 |
|
if [ "$1" == "--env" ]; then |
55 |
|
cp "test/grub2-support_files/$2" "$ENV_FILE" |
56 |
|
shift 2 |
57 |
|
else |
58 |
|
cp "test/grub2-support_files/grubenv.0" "$ENV_FILE" |
59 |
|
fi |
60 |
|
ENV_FILE="--env=$ENV_FILE" |
61 |
|
fi |
62 |
|
|
63 |
|
|
64 |
echo "$testing ... $mode $cfg $correct" |
echo "$testing ... $mode $cfg $correct" |
65 |
runme=( ./grubby "$mode" --bad-image-okay -c "$cfg" -o - "$@" ) |
runme=( ./grubby "$mode" --bad-image-okay $ENV_FILE -c "$cfg" -o - "$@" ) |
66 |
if "${runme[@]}" | cmp "$correct" > /dev/null; then |
if "${runme[@]}" | cmp "$correct" > /dev/null; then |
67 |
(( pass++ )) |
(( pass++ )) |
68 |
if $opt_verbose; then |
if $opt_verbose; then |
82 |
fi |
fi |
83 |
} |
} |
84 |
|
|
85 |
|
# Test feature that display some information, checking that output instead of |
86 |
|
# the generated configuration file |
87 |
|
oneDisplayTest() { |
88 |
|
typeset mode=$1 cfg=test/$2 correct=test/results/$3 |
89 |
|
shift 3 |
90 |
|
|
91 |
|
local ENV_FILE="" |
92 |
|
if [ "$mode" == "--grub2" ]; then |
93 |
|
ENV_FILE="test/grub2-support_files/env_temp" |
94 |
|
if [ "$1" == "--env" ]; then |
95 |
|
cp "test/grub2-support_files/$2" "$ENV_FILE" |
96 |
|
shift 2 |
97 |
|
else |
98 |
|
cp "test/grub2-support_files/grubenv.0" "$ENV_FILE" |
99 |
|
fi |
100 |
|
ENV_FILE="--env=$ENV_FILE" |
101 |
|
fi |
102 |
|
|
103 |
|
local BIO="--bad-image-okay" |
104 |
|
if [ "$1" == "--bad-image-bad" ]; then |
105 |
|
BIO="" |
106 |
|
shift |
107 |
|
fi |
108 |
|
|
109 |
|
echo "$testing ... $mode $cfg $correct" |
110 |
|
runme=( ./grubby "$mode" $BIO $ENV_FILE -c "$cfg" "$@" ) |
111 |
|
if "${runme[@]}" 2>&1 | cmp "$correct" > /dev/null; then |
112 |
|
(( pass++ )) |
113 |
|
if $opt_verbose; then |
114 |
|
echo ------------------------------------------------------------- |
115 |
|
echo -n "PASS: " |
116 |
|
printf "%q " "${runme[@]}"; echo |
117 |
|
"${runme[@]}" 2>&1 | diff -U30 "$cfg" - |
118 |
|
echo |
119 |
|
fi |
120 |
|
else |
121 |
|
(( fail++ )) |
122 |
|
echo ------------------------------------------------------------- |
123 |
|
echo -n "FAIL: " |
124 |
|
printf "%q " "${runme[@]}"; echo |
125 |
|
"${runme[@]}" 2>&1 | diff -U30 "$correct" - |
126 |
|
echo |
127 |
|
fi |
128 |
|
} |
129 |
|
|
130 |
|
commandTest() { |
131 |
|
description=$1 |
132 |
|
cmd0=$2 |
133 |
|
text1=$3 |
134 |
|
shift 3 |
135 |
|
echo "$description" |
136 |
|
output0=$(mktemp) |
137 |
|
|
138 |
|
$cmd0 > $output0 |
139 |
|
|
140 |
|
if echo $text1 | cmp $output0 - >/dev/null; then |
141 |
|
(( pass++)) |
142 |
|
if $opt_verbose; then |
143 |
|
echo ------------------------------------------------------------- |
144 |
|
echo -n "PASS: " |
145 |
|
printf "%q " "\"$cmd0\""; echo |
146 |
|
echo $text1 | diff -U30 $output0 - |
147 |
|
echo |
148 |
|
fi |
149 |
|
else |
150 |
|
(( fail++ )) |
151 |
|
echo ------------------------------------------------------------- |
152 |
|
echo -n "FAIL: " |
153 |
|
printf "%q " "\"$cmd0\""; echo |
154 |
|
echo $text1 | diff -U30 $output0 - |
155 |
|
echo |
156 |
|
fi |
157 |
|
} |
158 |
|
|
159 |
# generate convenience functions |
# generate convenience functions |
160 |
for b in $(./grubby --help | \ |
for b in $(./grubby --help | \ |
161 |
sed -n 's/^.*--\([^ ]*\) *configure \1 bootloader$/\1/p'); do |
sed -n 's/^.*--\([^ ]*\) *configure \1 bootloader.*/\1/p'); do |
162 |
eval "${b}Test() { [[ \"$b\" == \$opt_bootloader ]] && oneTest --$b \"\$@\"; }" |
eval "${b}Test() { [[ \"$b\" == \$opt_bootloader ]] && oneTest --$b \"\$@\"; }" |
163 |
|
eval "${b}DisplayTest() { [[ \"$b\" == \$opt_bootloader ]] && oneDisplayTest --$b \"\$@\"; }" |
164 |
done |
done |
165 |
|
|
166 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
181 |
done |
done |
182 |
|
|
183 |
export MALLOC_CHECK_=2 |
export MALLOC_CHECK_=2 |
184 |
|
if [ -n "${RANDOM}" ]; then |
185 |
|
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
186 |
|
else |
187 |
|
export MALLOC_PERTURB_=1 |
188 |
|
fi |
189 |
|
|
190 |
testing="Parse/write comparison" |
testing="Parse/write comparison" |
191 |
for n in test/*.[0-9]*; do |
for n in test/*.[0-9]*; do |
192 |
|
[ -d $n ] && continue |
193 |
n=${n#*/} # remove test/ |
n=${n#*/} # remove test/ |
194 |
b=${n%.*} # remove suffix |
b=${n%.*} # remove suffix |
195 |
[[ $b == $opt_bootloader ]] || continue |
[[ $b == $opt_bootloader ]] || continue |
264 |
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 |
265 |
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=/ |
266 |
|
|
267 |
|
testing="GRUB default index directive" |
268 |
|
grubTest grub.13 setdefaultindex/g.13.0 --set-default-index=0 |
269 |
|
grubTest grub.13 setdefaultindex/g.13.1 --set-default-index=1 |
270 |
|
grubTest grub.13 setdefaultindex/g.13.9 --set-default-index=9 |
271 |
|
|
272 |
|
testing="GRUB display default index" |
273 |
|
grubDisplayTest grub.1 defaultindex/0 --default-index |
274 |
|
grubDisplayTest grub.2 defaultindex/0 --default-index |
275 |
|
grubDisplayTest grub.3 defaultindex/0 --default-index |
276 |
|
grubDisplayTest grub.4 defaultindex/0 --default-index |
277 |
|
grubDisplayTest grub.5 defaultindex/0 --default-index |
278 |
|
grubDisplayTest grub.6 defaultindex/2 --default-index |
279 |
|
grubDisplayTest grub.7 defaultindex/2 --default-index |
280 |
|
grubDisplayTest grub.8 defaultindex/0 --default-index |
281 |
|
grubDisplayTest grub.9 defaultindex/0 --default-index |
282 |
|
grubDisplayTest grub.10 defaultindex/0 --default-index |
283 |
|
grubDisplayTest grub.10 defaultindex/0 --default-index |
284 |
|
|
285 |
|
testing="GRUB display default title" |
286 |
|
grubDisplayTest grub.1 defaulttitle/g.1 --default-title |
287 |
|
grubDisplayTest grub.2 defaulttitle/g.2 --default-title |
288 |
|
grubDisplayTest grub.3 defaulttitle/g.3 --default-title |
289 |
|
grubDisplayTest grub.4 defaulttitle/g.4 --default-title |
290 |
|
grubDisplayTest grub.5 defaulttitle/g.5 --default-title |
291 |
|
grubDisplayTest grub.6 defaulttitle/g.6 --default-title |
292 |
|
grubDisplayTest grub.7 defaulttitle/g.7 --default-title |
293 |
|
grubDisplayTest grub.8 defaulttitle/g.8 --default-title |
294 |
|
grubDisplayTest grub.9 defaulttitle/g.9 --default-title |
295 |
|
grubDisplayTest grub.10 defaulttitle/g.10 --default-title |
296 |
|
grubDisplayTest grub.11 defaulttitle/g.11 --default-title |
297 |
|
|
298 |
testing="LILO default directive" |
testing="LILO default directive" |
299 |
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 |
300 |
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 |
316 |
--boot-filesystem=/ --copy-default --add-kernel=/boot/new-kernel \ |
--boot-filesystem=/ --copy-default --add-kernel=/boot/new-kernel \ |
317 |
--title="Some_Title" |
--title="Some_Title" |
318 |
|
|
319 |
|
testing="Extlinux default directive" |
320 |
|
extlinuxTest extlinux.1 default/extlinux1.1 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title |
321 |
|
extlinuxTest extlinux.1 default/extlinux1.2 --boot-filesystem=/boot --add-kernel /boot/new-kernel --title Some_Title --make-default |
322 |
|
extlinuxTest extlinux.3 default/extlinux3.1 --boot-filesystem=/boot --set-default=/boot/vmlinuz-3.12.0-2.fc21.i686 |
323 |
|
extlinuxTest extlinux.3 default/extlinux3.2 --boot-filesystem=/boot --set-default=/boot/vmlinuz-3.12.0-2.fc21.i686+PAE |
324 |
|
|
325 |
testing="GRUB new kernel argument handling" |
testing="GRUB new kernel argument handling" |
326 |
grubTest grub.1 args/g1.1 --boot-filesystem=/boot \ |
grubTest grub.1 args/g1.1 --boot-filesystem=/boot \ |
327 |
--add-kernel=/boot/foo --title=some_title --args="1234" --copy-default |
--add-kernel=/boot/foo --title=some_title --args="1234" --copy-default |
328 |
grubTest grub.1 args/g1.2 --boot-filesystem=/boot \ |
grubTest grub.1 args/g1.2 --boot-filesystem=/boot \ |
329 |
--add-kernel=/boot/foo --title=some_title --args="1234" |
--add-kernel=/boot/foo --title=some_title --args="1234" |
330 |
|
|
331 |
|
testing="Extlinux new kernel argument handling" |
332 |
|
extlinuxTest extlinux.1 args/extlinux1.1 --boot-filesystem=/boot \ |
333 |
|
--add-kernel=/boot/foo --title=some_title --args="1234" --copy-default |
334 |
|
extlinuxTest extlinux.1 args/extlinux1.2 --boot-filesystem=/boot \ |
335 |
|
--add-kernel=/boot/foo --title=some_title --args="1234" |
336 |
|
|
337 |
testing="GRUB remove kernel" |
testing="GRUB remove kernel" |
338 |
grubTest grub.7 remove/g7.1 --boot-filesystem=/ \ |
grubTest grub.7 remove/g7.1 --boot-filesystem=/ \ |
339 |
--remove-kernel=/boot/vmlinuz-2.4.7-2.5 |
--remove-kernel=/boot/vmlinuz-2.4.7-2.5 |
351 |
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 |
352 |
ziplTest zipl.1 remove/z1.2 --remove-kernel=DEFAULT |
ziplTest zipl.1 remove/z1.2 --remove-kernel=DEFAULT |
353 |
|
|
354 |
|
testing="Extlinux remove kernel" |
355 |
|
extlinuxTest extlinux.4 remove/extlinux4.1 --boot-filesystem=/ \ |
356 |
|
--remove-kernel=/boot/vmlinuz-3.11.7-301.fc20.i686 |
357 |
|
extlinuxTest extlinux.3 remove/extlinux3.1 --boot-filesystem=/ \ |
358 |
|
--remove-kernel=DEFAULT |
359 |
|
|
360 |
testing="GRUB update kernel argument handling" |
testing="GRUB update kernel argument handling" |
361 |
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" |
362 |
grubTest grub.1 updargs/g1.2 --update-kernel=DEFAULT \ |
grubTest grub.1 updargs/g1.2 --update-kernel=DEFAULT \ |
373 |
--remove-args="hdd root ro" |
--remove-args="hdd root ro" |
374 |
grubTest grub.7 updargs/g7.2 --boot-filesystem=/ \ |
grubTest grub.7 updargs/g7.2 --boot-filesystem=/ \ |
375 |
--update-kernel=ALL --args "hde=ide-scsi" |
--update-kernel=ALL --args "hde=ide-scsi" |
|
grubTest grub.7 updargs/g7.2 --boot-filesystem=/ \ |
|
|
--update-kernel=ALL --args "hde=ide-scsi" |
|
376 |
grubTest grub.7 updargs/g7.3 --boot-filesystem=/ \ |
grubTest grub.7 updargs/g7.3 --boot-filesystem=/ \ |
377 |
--update-kernel=DEFAULT --args "hde=ide-scsi" |
--update-kernel=DEFAULT --args "hde=ide-scsi" |
378 |
grubTest grub.7 updargs/g7.4 --boot-filesystem=/ \ |
grubTest grub.7 updargs/g7.4 --boot-filesystem=/ \ |
387 |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
--update-kernel=/vmlinuz-2.4.7-2smp \ |
388 |
--args "ro root=LABEL=/ single" |
--args "ro root=LABEL=/ single" |
389 |
|
|
390 |
|
testing="GRUB lba and root information on SuSE systems" |
391 |
|
GRUBBY_SUSE_RELEASE=test/grub.12-support_files/etc/SuSE-release \ |
392 |
|
GRUBBY_SUSE_GRUB_CONF=test/grub.12-support_files/etc/grub.conf \ |
393 |
|
GRUBBY_GRUB_DEVICE_MAP=test/grub.12-support_files/boot/grub/device.map \ |
394 |
|
grubTest grub.12 info/g12.1 --info=0 |
395 |
|
|
396 |
testing="LILO update kernel argument handling" |
testing="LILO update kernel argument handling" |
397 |
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 \ |
398 |
--args="root=/dev/md1" |
--args="root=/dev/md1" |
407 |
liloTest lilo.3 updargs/l3.2 --update-kernel=ALL \ |
liloTest lilo.3 updargs/l3.2 --update-kernel=ALL \ |
408 |
--remove-args="single" --args "root=/dev/hda2" |
--remove-args="single" --args "root=/dev/hda2" |
409 |
|
|
410 |
|
testing="Extlinux update kernel argument handling" |
411 |
|
extlinuxTest extlinux.1 updargs/extlinux1.1 --update-kernel=DEFAULT --args="root=/dev/hda1" |
412 |
|
extlinuxTest extlinux.1 updargs/extlinux1.2 --update-kernel=DEFAULT \ |
413 |
|
--args="root=/dev/hda1 hda=ide-scsi root=/dev/hda2" |
414 |
|
extlinuxTest extlinux.3 updargs/extlinux3.1 --update-kernel=DEFAULT --args "hdd=notide-scsi" |
415 |
|
extlinuxTest extlinux.3 updargs/extlinux3.2 --update-kernel=DEFAULT \ |
416 |
|
--args "hdd=notide-scsi root=/dev/hdd1" |
417 |
|
extlinuxTest extlinux.3 updargs/extlinux3.2 --update-kernel=DEFAULT \ |
418 |
|
--args "root=/dev/hdd1 hdd=notide-scsi" |
419 |
|
extlinuxTest extlinux.3 updargs/extlinux3.4 --update-kernel=ALL --remove-args="hdd" |
420 |
|
extlinuxTest extlinux.3 updargs/extlinux3.4 --update-kernel=ALL --remove-args="hdd=ide-scsi" |
421 |
|
extlinuxTest extlinux.3 updargs/extlinux3.4 --update-kernel=ALL --remove-args="hdd=foobar" |
422 |
|
extlinuxTest extlinux.3 updargs/extlinux3.7 --update-kernel=ALL \ |
423 |
|
--remove-args="hdd root ro" |
424 |
|
extlinuxTest extlinux.4 updargs/extlinux4.2 --boot-filesystem=/ \ |
425 |
|
--update-kernel=ALL --args "hde=ide-scsi" |
426 |
|
extlinuxTest extlinux.4 updargs/extlinux4.3 --boot-filesystem=/ \ |
427 |
|
--update-kernel=DEFAULT --args "hde=ide-scsi" |
428 |
|
extlinuxTest extlinux.4 updargs/extlinux4.4 --boot-filesystem=/ \ |
429 |
|
--update-kernel=/vmlinuz-3.12.0-2.fc21.i686 \ |
430 |
|
--args "ro root=LABEL=/ console=tty0 console=ttyS1,9600n81 single" |
431 |
|
extlinuxTest extlinux.4 updargs/extlinux4.5 --boot-filesystem=/ \ |
432 |
|
--update-kernel=ALL --args "root=/dev/hda2" |
433 |
|
|
434 |
testing="LILO add kernel" |
testing="LILO add kernel" |
435 |
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" \ |
436 |
--copy-default --boot-filesystem=/boot |
--copy-default --boot-filesystem=/boot |
472 |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default \ |
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default \ |
473 |
--args='console=tty0 console=ttyS1,9600n81 single' |
--args='console=tty0 console=ttyS1,9600n81 single' |
474 |
|
|
475 |
|
testgrub2=n |
476 |
|
ARCH=$(uname -m | sed s,i[3456789]86,ia32,) |
477 |
|
case $ARCH in |
478 |
|
aarch64|ppc|ppc64|ia32|x86_64) testgrub2=y ;; |
479 |
|
esac |
480 |
|
|
481 |
|
if [ "$testgrub2" == "y" ]; then |
482 |
|
testing="GRUB2 add kernel" |
483 |
|
grub2Test grub2.1 add/g2-1.1 --add-kernel=/boot/new-kernel.img \ |
484 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
485 |
|
--copy-default |
486 |
|
case $ARCH in |
487 |
|
aarch64) |
488 |
|
grub2Test grub2.1 add/g2-1.1 --add-kernel=/boot/new-kernel.img \ |
489 |
|
--title='title' \ |
490 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
491 |
|
--copy-default --efi |
492 |
|
;; |
493 |
|
*) |
494 |
|
grub2Test grub2.1 add/g2-1.6 --add-kernel=/boot/new-kernel.img \ |
495 |
|
--title='title' \ |
496 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
497 |
|
--copy-default --efi |
498 |
|
;; |
499 |
|
esac |
500 |
|
grub2Test grub2.6 add/g2-1.7 --add-kernel=/boot/new-kernel.img \ |
501 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
502 |
|
--copy-default --efi |
503 |
|
grub2Test grub2.1 add/g2-1.2 --add-kernel=/boot/new-kernel.img \ |
504 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
505 |
|
--copy-default --make-default |
506 |
|
grub2Test grub2.1 add/g2-1.3 --add-kernel=/boot/new-kernel.img \ |
507 |
|
--title='title' --boot-filesystem=/boot/ --copy-default --make-default |
508 |
|
grub2Test grub2.1 remove/g2-1.4 \ |
509 |
|
--remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \ |
510 |
|
--boot-filesystem=/boot/ |
511 |
|
grub2Test grub2.5 add/g2-1.5 --add-kernel=/boot/new-kernel.img \ |
512 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
513 |
|
--copy-default |
514 |
|
grub2Test grub2.12 add/g2-1.12 \ |
515 |
|
--add-kernel=/boot/vmlinuz-2.6.38.8-32.fc15.x86_64 \ |
516 |
|
--title='Linux, with Fedora 2.6.38.8-32.fc15.x86_64' \ |
517 |
|
--devtree='/boot/dtb-2.6.38.8-32.fc15.x86_64/foobarbaz.dtb' \ |
518 |
|
--initrd=/boot/initramfs-2.6.38.8-32.fc15.x86_64.img \ |
519 |
|
--boot-filesystem=/boot/ --copy-default --efi |
520 |
|
grub2Test grub2.13 add/g2-1.13 \ |
521 |
|
--add-kernel=/boot/vmlinuz-2.6.38.8-32.fc15.x86_64 \ |
522 |
|
--title='Linux, with Fedora 2.6.38.8-32.fc15.x86_64' \ |
523 |
|
--devtree='/boot/dtb-2.6.38.8-32.fc15.x86_64/foobarbaz.dtb' \ |
524 |
|
--initrd=/boot/initramfs-2.6.38.8-32.fc15.x86_64.img \ |
525 |
|
--boot-filesystem=/boot/ --copy-default --efi |
526 |
|
|
527 |
|
testing="GRUB2 add initrd" |
528 |
|
grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \ |
529 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ |
530 |
|
|
531 |
|
testing="GRUB2 display default index" |
532 |
|
grub2DisplayTest grub2.1 defaultindex/0 --default-index |
533 |
|
grub2DisplayTest grub2.2 defaultindex/0 --default-index |
534 |
|
|
535 |
|
testing="GRUB2 display default title" |
536 |
|
grub2DisplayTest grub2.1 defaulttitle/g2.1 --default-title |
537 |
|
grub2DisplayTest grub2.2 defaulttitle/g2.2 --default-title |
538 |
|
|
539 |
|
testing="GRUB2 display debug failure" |
540 |
|
grub2DisplayTest grub2.1 debug/g2.1 --bad-image-bad \ |
541 |
|
--boot-filesystem=/boot --default-kernel --debug |
542 |
|
testing="GRUB2 display debug success" |
543 |
|
grub2DisplayTest grub2.1 debug/g2.1.2 --boot-filesystem=/boot \ |
544 |
|
--default-kernel --debug |
545 |
|
|
546 |
|
testing="GRUB2 remove kernel via index" |
547 |
|
grub2Test grub2.3 remove/g2-1.1 --remove-kernel=1 |
548 |
|
|
549 |
|
testing="GRUB2 remove kernel via title" |
550 |
|
grub2Test grub2.3 remove/g2-1.1 --remove-kernel="TITLE=title2" |
551 |
|
|
552 |
|
testing="GRUB2 (submenu) remove kernel via index" |
553 |
|
grub2Test grub2.4 remove/g2-1.2 --remove-kernel=2 |
554 |
|
|
555 |
|
testing="GRUB2 (submenu) remove kernel via title" |
556 |
|
grub2Test grub2.4 remove/g2-1.2 --remove-kernel="TITLE=title2" |
557 |
|
|
558 |
|
testing="GRUB2 default index directive" |
559 |
|
grub2Test grub2.1 setdefaultindex/g2.1.0 --set-default-index=0 |
560 |
|
grub2Test grub2.1 setdefaultindex/g2.1.1 --set-default-index=1 |
561 |
|
grub2Test grub2.1 setdefaultindex/g2.1.9 --set-default-index=9 |
562 |
|
|
563 |
|
testing="GRUB2 add kernel with default=saved_entry" |
564 |
|
grub2Test grub2.7 add/g2-1.8 --env grubenv.1 \ |
565 |
|
--add-kernel=/boot/new-kernel.img \ |
566 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
567 |
|
--copy-default |
568 |
|
commandTest "saved_default output" \ |
569 |
|
"grub2-editenv test/grub2-support_files/env_temp list" \ |
570 |
|
"saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64" |
571 |
|
|
572 |
|
testing="GRUB2 add kernel with default=saved_entry and a terrible title" |
573 |
|
grub2Test grub2.7 add/g2-1.9 --env grubenv.1 \ |
574 |
|
--add-kernel=/boot/new-kernel.img \ |
575 |
|
--title='Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)' \ |
576 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
577 |
|
--copy-default |
578 |
|
|
579 |
|
testing="GRUB2 set default with default=saved_entry and a terrible name" |
580 |
|
grub2Test grub2.9 add/g2-1.9 --env grubenv.1 --set-default-index=0 |
581 |
|
commandTest "saved_default output" \ |
582 |
|
"grub2-editenv test/grub2-support_files/env_temp list" \ |
583 |
|
'saved_entry=Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)' |
584 |
|
|
585 |
|
testing="GRUB2 set default with default=saved_entry" |
586 |
|
grub2Test grub2.8 add/g2-1.8 --env grubenv.1 --set-default-index=0 |
587 |
|
commandTest "saved_default output" \ |
588 |
|
"grub2-editenv test/grub2-support_files/env_temp list" \ |
589 |
|
"saved_entry=title" |
590 |
|
|
591 |
|
testing="GRUB2 --default-index with default=saved_entry" |
592 |
|
grub2DisplayTest grub2.8 defaultindex/1 --env grubenv.1 --default-index |
593 |
|
|
594 |
|
testing="GRUB2 --default-index with default=saved_entry" |
595 |
|
grub2DisplayTest grub2.8 defaultindex/0 --env grubenv.2 --default-index |
596 |
|
|
597 |
|
testing="GRUB2 --default-title with default=saved_entry" |
598 |
|
grub2DisplayTest grub2.8 defaulttitle/g2.1 --env grubenv.1 --default-title |
599 |
|
|
600 |
|
testing="GRUB2 --default-index with default=saved_entry and empty grubenv" |
601 |
|
grub2DisplayTest grub2.8 defaultindex/0 --env grubenv.0 --default-index |
602 |
|
|
603 |
|
testlinux16=n |
604 |
|
case $ARCH in |
605 |
|
ia32|x86_64) testlinux16=y ;; |
606 |
|
esac |
607 |
|
|
608 |
|
if [ "$testlinux16" == "y" ]; then |
609 |
|
testing="GRUB2 add kernel with linux16" |
610 |
|
grub2Test grub2.10 add/g2-1.10 --add-kernel=/boot/new-kernel.img \ |
611 |
|
--title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ |
612 |
|
--copy-default |
613 |
|
|
614 |
|
testing="GRUB2 add initrd with linux16" |
615 |
|
grub2Test grub2.11 add/g2-1.11 --update-kernel=/boot/new-kernel.img \ |
616 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot/ |
617 |
|
fi |
618 |
|
fi |
619 |
|
|
620 |
testing="YABOOT add kernel" |
testing="YABOOT add kernel" |
621 |
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 \ |
622 |
--title=newtitle |
--title=newtitle |
629 |
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 |
630 |
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 |
631 |
|
|
632 |
|
testing="Extlinux add kernel" |
633 |
|
extlinuxTest extlinux.1 add/extlinux1.1 --add-kernel=/boot/new-kernel.img --title='title' \ |
634 |
|
--initrd=/boot/new-initrd --boot-filesystem=/ |
635 |
|
extlinuxTest extlinux.1 add/extlinux1.2 --add-kernel=/boot/new-kernel.img --title='title' \ |
636 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot |
637 |
|
extlinuxTest extlinux.1 add/extlinux1.3 --add-kernel=/boot/new-kernel.img --title='title' \ |
638 |
|
--initrd=/boot/new-initrd --boot-filesystem=/ --copy-default |
639 |
|
extlinuxTest extlinux.1 add/extlinux1.4 --add-kernel=/boot/new-kernel.img --title='title' \ |
640 |
|
--initrd=/boot/new-initrd --boot-filesystem=/boot --copy-default |
641 |
|
extlinuxTest extlinux.2 add/extlinux2.1 --add-kernel=/boot/vmlinuz-3.12.0-2.fc21.i686 \ |
642 |
|
--initrd=/boot/initrd-3.12.0-2.fc21.i686-new.img --boot-filesystem=/boot --copy-default \ |
643 |
|
--title="Fedora (3.12.0-2.fc21.i686) 20 (Heisenbug)" \ |
644 |
|
--remove-kernel="TITLE=Fedora (3.12.0-2.fc21.i686) 20 (Heisenbug)" |
645 |
|
|
646 |
testing="LILO long titles" |
testing="LILO long titles" |
647 |
liloTest lilo.1 longtitle/l1.1 --add-kernel=/boot/new-kernel.img \ |
liloTest lilo.1 longtitle/l1.1 --add-kernel=/boot/new-kernel.img \ |
648 |
--title="linux-longtitle" --copy-default --boot-filesystem=/boot |
--title="linux-longtitle" --copy-default --boot-filesystem=/boot |