mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
oeqa/selftest/cases: add basic u-boot test
This adds basic tests for qemuarm and qemuarm64. So far, U-Boot fails to run properly under KVM since this requires some special care with instructions used for MMIO accesses. Reported upstream by Ahmad Fatoum after debugging the oe-selftest failures for this series: https://lore.kernel.org/u-boot/2211f9f0-cd7d-4b55-860d-a34c04877e7b@pengutronix.de/ For now, simply disable KVM for these tests. (From OE-Core rev: cadbd937e6358f9811f3ba7cf20cc50f8edcd844) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
b5c11f2f04
commit
52684215ae
@@ -0,0 +1,43 @@
|
||||
# Qemu-based u-boot bootloader integration testing
|
||||
#
|
||||
# Copyright OpenEmbedded Contributors
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from oeqa.utils.commands import bitbake, runqemu
|
||||
from oeqa.core.decorator.data import skipIfNotArch
|
||||
from oeqa.core.decorator import OETestTag
|
||||
|
||||
uboot_boot_patterns = {
|
||||
'search_reached_prompt': "stop autoboot",
|
||||
'search_login_succeeded': "=>",
|
||||
'search_cmd_finished': "=>"
|
||||
}
|
||||
|
||||
|
||||
class UBootTest(OESelftestTestCase):
|
||||
|
||||
@skipIfNotArch(['arm', 'aarch64'])
|
||||
@OETestTag("runqemu")
|
||||
def test_boot_uboot(self):
|
||||
"""
|
||||
Tests building u-boot and booting it with QEMU
|
||||
"""
|
||||
|
||||
self.write_config("""
|
||||
QB_DEFAULT_BIOS = "u-boot.bin"
|
||||
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
|
||||
QEMU_USE_KVM = "False"
|
||||
""")
|
||||
bitbake("virtual/bootloader core-image-minimal")
|
||||
|
||||
with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic',
|
||||
boot_patterns=uboot_boot_patterns) as qemu:
|
||||
|
||||
# test if u-boot console works
|
||||
cmd = "version"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
self.assertEqual(status, 1, msg=output)
|
||||
self.assertTrue("U-Boot" in output, msg=output)
|
||||
Reference in New Issue
Block a user