Files
buildroot/support/testing/tests/package/test_fwts.py
Julien Olivain ec694f8f6d package/fwts: bump to version 26.03.00
See release announces:
26.01.00: https://lists.ubuntu.com/archives/fwts-devel/2026-January/014129.html
26.03.00: https://lists.ubuntu.com/archives/fwts-devel/2026-March/014171.html

The website [1] is no longer working. This commit updates FWTS_SITE
to use Github [2], which is now the primary download site in the
release announce.

This commit also rewrote the package patch (to add a new
--disable-werror configure option), which was proposed upstream.
This new option is added in FWTS_CONF_OPTS. With this patch now
proposed upstream, the corresponding .checkpackageignore entry
is also removed.

The license hash is also updated, after a year update in [3].

The fwts efi_runtime kernel module has been removed upstream,
in commit [4]. It is replaced by the Kernel driver efi_test, present
since Kernel v4.9, introduced in commit [5]. This commit removes the
option and updates the runtime test accordingly. A note is added in the
Config.in package help.

Fixes:
https://autobuild.buildroot.org/results/859390dbd2a1d7b3bf43588a461a2ff7dc66f92b/

[1] https://fwts.ubuntu.com/
[2] https://github.com/fwts/fwts
[3] b3cd64e61d
[4] 6d52a62169
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ff6301dabc3ca20ab8f50f8d0252ac05da610d89

Signed-off-by: Julien Olivain <ju.o@free.fr>
[Romain: add a comment for FWTS_AUTORECONF = YES]
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2026-05-17 23:47:48 +02:00

73 lines
2.9 KiB
Python

import os
import infra.basetest
class TestFwts(infra.basetest.BRTest):
kernel_fragment = \
infra.filepath("tests/package/test_fwts/linux-efi-test.fragment")
config = \
f"""
BR2_aarch64=y
BR2_neoverse_n2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-sbsa/assemble-flash-images support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-sbsa/genimage.cfg"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.28"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{kernel_fragment}"
BR2_TARGET_EDK2=y
BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.12"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
BR2_PACKAGE_FWTS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_QEMU=y
BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
"""
def test_run(self):
hda = os.path.join(self.builddir, "images", "disk.img")
flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd")
flash1 = os.path.join(self.builddir, "images", "SBSA_FLASH1.fd")
self.emulator.boot(arch="aarch64",
options=["-M", "sbsa-ref",
"-cpu", "neoverse-n2",
"-m", "512M",
"-pflash", flash0,
"-pflash", flash1,
"-hda", hda])
self.emulator.login()
# Check the program can execute.
self.assertRunOk("fwts --version")
# We run a simple UEFI runtime service variable interface test
# suite. Those tests are using the fwts efi_runtime kernel
# module.
self.assertRunOk("fwts -q uefirtvariable", timeout=30)
# The previous fwts invocation is expected to have created a
# "results.log" report. We check the file exists and contains
# a known header string.
expected_str = "Results generated by fwts:"
cmd = f"grep -F '{expected_str}' results.log"
out, ret = self.emulator.run(cmd)
self.assertEqual(ret, 0)
self.assertTrue(out[0].startswith(expected_str))