blob: e17da9f9a09ebb40e14e35f008ad7d9c434bab48 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001# Based on runqemu.py test file
2#
3# Copyright (c) 2017 Wind River Systems, Inc.
4#
Brad Bishopc342db32019-05-15 21:57:59 -04005# SPDX-License-Identifier: MIT
6#
Brad Bishop316dfdd2018-06-25 12:45:53 -04007
Brad Bishop316dfdd2018-06-25 12:45:53 -04008from oeqa.selftest.case import OESelftestTestCase
Patrick Williams7784c422022-11-17 07:29:11 -06009from oeqa.utils.commands import bitbake, runqemu
10from oeqa.core.decorator.data import skipIfNotMachine
11import oe.types
Brad Bishop316dfdd2018-06-25 12:45:53 -040012
13class GenericEFITest(OESelftestTestCase):
14 """EFI booting test class"""
Patrick Williams7784c422022-11-17 07:29:11 -060015 @skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently")
16 def test_boot_efi(self):
17 cmd = "runqemu nographic serial wic ovmf"
18 if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]):
19 cmd += " kvm"
20 image = "core-image-minimal"
Brad Bishop316dfdd2018-06-25 12:45:53 -040021
Patrick Williams7784c422022-11-17 07:29:11 -060022 self.write_config("""
23EFI_PROVIDER = "systemd-boot"
Patrick Williams213cb262021-08-07 19:21:33 -050024IMAGE_FSTYPES:pn-%s:append = " wic"
Patrick Williams213cb262021-08-07 19:21:33 -050025MACHINE_FEATURES:append = " efi"
Brad Bishop316dfdd2018-06-25 12:45:53 -040026WKS_FILE = "efi-bootdisk.wks.in"
Patrick Williams213cb262021-08-07 19:21:33 -050027IMAGE_INSTALL:append = " grub-efi systemd-boot kernel-image-bzimage"
Brad Bishop316dfdd2018-06-25 12:45:53 -040028"""
Patrick Williams7784c422022-11-17 07:29:11 -060029% (image))
Brad Bishop316dfdd2018-06-25 12:45:53 -040030
Patrick Williams7784c422022-11-17 07:29:11 -060031 bitbake(image + " ovmf")
32 with runqemu(image, ssh=False, launch_cmd=cmd) as qemu:
Brad Bishop316dfdd2018-06-25 12:45:53 -040033 self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)