summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/wic/test_uefikernel.wks5
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py20
2 files changed, 25 insertions, 0 deletions
diff --git a/meta-selftest/wic/test_uefikernel.wks b/meta-selftest/wic/test_uefikernel.wks
new file mode 100644
index 0000000000..bede2288f6
--- /dev/null
+++ b/meta-selftest/wic/test_uefikernel.wks
@@ -0,0 +1,5 @@
1# short-description: This file is used in oe-selftest wic module to test uefi-kernel loader
2
3part /boot --source bootimg-efi --sourceparams="loader=uefi-kernel"
4part / --source rootfs --fstype=ext4 --align 1024 --use-uuid
5
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):
1151 out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname)) 1151 out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
1152 self.assertEqual(1, len(out)) 1152 self.assertEqual(1, len(out))
1153 1153
1154 @skipIfNotArch(['i586', 'i686', 'x86_64', 'aarch64'])
1155 def test_uefi_kernel(self):
1156 """ Test uefi-kernel in wic """
1157 config = 'IMAGE_EFI_BOOT_FILES="/etc/fstab;testfile"\nIMAGE_FSTYPES = "wic"\nWKS_FILE = "test_uefikernel.wks"\nMACHINE_FEATURES:append = " efi"\n'
1158 self.append_config(config)
1159 bitbake('core-image-minimal')
1160 self.remove_config(config)
1161
1162 img = 'core-image-minimal'
1163 with NamedTemporaryFile("w", suffix=".wks") as wks:
1164 wks.writelines(['part /boot --source bootimg-efi --sourceparams="loader=uefi-kernel"\n'
1165 'part / --source rootfs --fstype=ext4 --align 1024 --use-uuid\n'\
1166 'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n'])
1167 wks.flush()
1168 cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
1169 runCmd(cmd)
1170 wksname = os.path.splitext(os.path.basename(wks.name))[0]
1171 out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
1172 self.assertEqual(1, len(out))
1173
1154 # TODO this test could also work on aarch64 1174 # TODO this test could also work on aarch64
1155 @skipIfNotArch(['i586', 'i686', 'x86_64']) 1175 @skipIfNotArch(['i586', 'i686', 'x86_64'])
1156 @OETestTag("runqemu") 1176 @OETestTag("runqemu")