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 <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Pavel Zhukov
2023-02-25 22:20:04 +01:00
committed by Richard Purdie
parent 4add8776ab
commit 2e18bbb307
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# short-description: This file is used in oe-selftest wic module to test uefi-kernel loader
part /boot --source bootimg-efi --sourceparams="loader=uefi-kernel"
part / --source rootfs --fstype=ext4 --align 1024 --use-uuid

View File

@@ -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")