mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

Currently some tests run in buffer mode and some don't. Those that don't can corrupt stdout/stderr. Switch to using buffer mode everywhere so we're consistent. If there is useful output on stdout/stderr, it will be displayed if the test fails. (From OE-Core rev: 85c1b6fb516aae58240330a0aca659bfafcd3883) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
# Based on runqemu.py test file
|
|
#
|
|
# Copyright (c) 2017 Wind River Systems, Inc.
|
|
#
|
|
|
|
import re
|
|
|
|
from oeqa.selftest.case import OESelftestTestCase
|
|
from oeqa.utils.commands import bitbake, runqemu, get_bb_var
|
|
|
|
class GenericEFITest(OESelftestTestCase):
|
|
"""EFI booting test class"""
|
|
|
|
cmd_common = "runqemu nographic serial wic ovmf"
|
|
efi_provider = "systemd-boot"
|
|
image = "core-image-minimal"
|
|
machine = "qemux86-64"
|
|
recipes_built = False
|
|
|
|
@classmethod
|
|
def setUpLocal(self):
|
|
super(GenericEFITest, self).setUpLocal(self)
|
|
|
|
self.write_config(self,
|
|
"""
|
|
EFI_PROVIDER = "%s"
|
|
IMAGE_FSTYPES_pn-%s_append = " wic"
|
|
MACHINE = "%s"
|
|
MACHINE_FEATURES_append = " efi"
|
|
WKS_FILE = "efi-bootdisk.wks.in"
|
|
IMAGE_INSTALL_append = " grub-efi systemd-boot kernel-image-bzimage"
|
|
"""
|
|
% (self.efi_provider, self.image, self.machine))
|
|
if not self.recipes_built:
|
|
bitbake("ovmf")
|
|
bitbake(self.image)
|
|
self.recipes_built = True
|
|
|
|
@classmethod
|
|
def test_boot_efi(self):
|
|
"""Test generic boot partition with qemu"""
|
|
cmd = "%s %s" % (self.cmd_common, self.machine)
|
|
with runqemu(self.image, ssh=False, launch_cmd=cmd) as qemu:
|
|
self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
|