From 2e18bbb307e050650845314f7837cc4d5d8aea86 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Sat, 25 Feb 2023 22:20:04 +0100 Subject: oeqa/selftest/wic: Add test for uefi-kernel loader This is regression test for [1]. [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15033 (From OE-Core rev: d8ef15bb9ef652bf85002fe523ff5060b47bca6a) Signed-off-by: Pavel Zhukov Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/wic.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'meta/lib/oeqa/selftest/cases/wic.py') diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index ca1abb970a..b9430cdb3b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1151,6 +1151,26 @@ class Wic2(WicTestCase): out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname)) self.assertEqual(1, len(out)) + @skipIfNotArch(['i586', 'i686', 'x86_64', 'aarch64']) + def test_uefi_kernel(self): + """ Test uefi-kernel in wic """ + config = 'IMAGE_EFI_BOOT_FILES="/etc/fstab;testfile"\nIMAGE_FSTYPES = "wic"\nWKS_FILE = "test_uefikernel.wks"\nMACHINE_FEATURES:append = " efi"\n' + self.append_config(config) + bitbake('core-image-minimal') + self.remove_config(config) + + img = 'core-image-minimal' + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines(['part /boot --source bootimg-efi --sourceparams="loader=uefi-kernel"\n' + 'part / --source rootfs --fstype=ext4 --align 1024 --use-uuid\n'\ + 'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n']) + wks.flush() + cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) + runCmd(cmd) + wksname = os.path.splitext(os.path.basename(wks.name))[0] + out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname)) + self.assertEqual(1, len(out)) + # TODO this test could also work on aarch64 @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") -- cgit v1.2.3-54-g00ecf