mirror of
https://git.yoctoproject.org/poky
synced 2026-05-05 07:39:49 +02:00
This test was overly complex with a setUp() method for a single test case, which was marked as a class function for no good reason. Generalise the test so that it has the possibility of working on more machines in the future, add a decorator so that it only runs on qemux86-64, and respect QEMU_USE_KVM to speed up test execution. (From OE-Core rev: 2bc2ee171f976807053b7da44c1eedbb07c10949) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# Based on runqemu.py test file
|
|
#
|
|
# Copyright (c) 2017 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
from oeqa.selftest.case import OESelftestTestCase
|
|
from oeqa.utils.commands import bitbake, runqemu
|
|
from oeqa.core.decorator.data import skipIfNotMachine
|
|
import oe.types
|
|
|
|
class GenericEFITest(OESelftestTestCase):
|
|
"""EFI booting test class"""
|
|
@skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently")
|
|
def test_boot_efi(self):
|
|
cmd = "runqemu nographic serial wic ovmf"
|
|
if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]):
|
|
cmd += " kvm"
|
|
image = "core-image-minimal"
|
|
|
|
self.write_config("""
|
|
EFI_PROVIDER = "systemd-boot"
|
|
IMAGE_FSTYPES:pn-%s:append = " wic"
|
|
MACHINE_FEATURES:append = " efi"
|
|
WKS_FILE = "efi-bootdisk.wks.in"
|
|
IMAGE_INSTALL:append = " grub-efi systemd-boot kernel-image-bzimage"
|
|
"""
|
|
% (image))
|
|
|
|
bitbake(image + " ovmf")
|
|
with runqemu(image, ssh=False, launch_cmd=cmd) as qemu:
|
|
self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
|