From bb8753ebf455aedf47a5a0216581b51dfabcbbc7 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Fri, 29 Nov 2024 20:14:27 +0100 Subject: [PATCH] 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 Acked-by: Adrien 'neox' Bourmault --- resources/packages/roms/test | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/resources/packages/roms/test b/resources/packages/roms/test index 01665fa..565e9f7 100755 --- a/resources/packages/roms/test +++ b/resources/packages/roms/test @@ -61,11 +61,12 @@ run_qemu_x86_64() ${extra_qemu_args} } -test_grub_cfg_with_lvm() +test_gnuboot_with_lvm() { 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. if [ "${build_cpu}" != "x86_64" ] ; then @@ -82,7 +83,7 @@ test_grub_cfg_with_lvm() fi run_qemu_x86_64 \ - bin/qemu-pc_2mb/grub_qemu-pc_2mb_corebootfb_usqwerty.rom \ + "${gnuboot_image_path}" \ "${rootfs_path}" \ "x86_64-linux" ; ret=$? @@ -98,7 +99,17 @@ if [ $# -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" == "--help" ] ;} ; then usage "${progname}" exit 0 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 usage "${progname}" exit ${EX_USAGE}