packages: images: tests: add Trisquel test with SeaBIOS.

This test is an easy way to make sure that at least QEMU's SeaBIOS
images work fine.

When designing the GRUB test my intent was mostly to test the grub.cfg
file and also enable further automatic testing to help catch issues
when improving the GRUB configuration.

However since the build system inherited from Libreboot 20220710 is
extremely fragile, and that GNU Boot also starts having the
infrastructure to build on more and more distributions with different
compiler versions (we now supports 2 Trisquel version and 1 PureOS
version), with setups variations (work is ongoing to add support for
building in chroots), it might be a good thing to check if SeaBIOS
works.

This would also catch bugs like bug #66487 ("RC4: All SeaBIOS images
are broken") [1] where the SeaBIOS payload was missing in all images,
however it would not catch situations where SeaBIOS is present in QEMU
images but missing in other images, so different tests must be done
for that situation. In addition it would be costly just to boot a VM
to check for missing files.

[1] https://savannah.gnu.org/bugs/?66487

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-11-29 20:14:27 +01:00 committed by Adrien 'neox' Bourmault
parent 3484eb606a
commit bb8753ebf4
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 15 additions and 4 deletions

View File

@ -61,11 +61,12 @@ run_qemu_x86_64()
${extra_qemu_args} ${extra_qemu_args}
} }
test_grub_cfg_with_lvm() test_gnuboot_with_lvm()
{ {
source config.sh source config.sh
test_name="Test grub.cfg with Trisquel LVM install" test_name="$1"
gnuboot_image_path="$2"
# TODO: Make the test also work with i686. # TODO: Make the test also work with i686.
if [ "${build_cpu}" != "x86_64" ] ; then if [ "${build_cpu}" != "x86_64" ] ; then
@ -82,7 +83,7 @@ test_grub_cfg_with_lvm()
fi fi
run_qemu_x86_64 \ run_qemu_x86_64 \
bin/qemu-pc_2mb/grub_qemu-pc_2mb_corebootfb_usqwerty.rom \ "${gnuboot_image_path}" \
"${rootfs_path}" \ "${rootfs_path}" \
"x86_64-linux" ; ret=$? "x86_64-linux" ; ret=$?
@ -98,7 +99,17 @@ if [ $# -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" == "--help" ] ;} ; then
usage "${progname}" usage "${progname}"
exit 0 exit 0
elif [ $# -eq 0 ] ; then elif [ $# -eq 0 ] ; then
test_grub_cfg_with_lvm # This test is mainly meant to verify if the grub configuration
# can boot a Trisquel rootfs with LVM.
test_gnuboot_with_lvm \
"Test GRUB images and its grub.cfg with a Trisquel LVM install" \
"bin/qemu-pc_2mb/grub_qemu-pc_2mb_corebootfb_usqwerty.rom"
# This test is mainly meant to verify if the SeaBIOS payload is
# broken or not.
test_gnuboot_with_lvm \
"Test SeaBIOS images with a Trisquel (LVM) install" \
"bin/qemu-pc_2mb/seabios_qemu-pc_2mb_txtmode_usqwerty.rom"
else else
usage "${progname}" usage "${progname}"
exit ${EX_USAGE} exit ${EX_USAGE}