mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-07 04:58:57 +00:00
arm/oeqa: Convert linuxboot test case into fvp_boot
The linuxboot test case is already FVP-specific due to the use of the
OEFVPTarget pexpect interface. Clarify this by renaming to fvp_boot.
So that fvp_boot can be used alongside other OEQA test cases (e.g. those
in OE-core):
* Call self.target.transition("off") at the start of the test to
ensure the model starts from reset
* Call self.target.transition("linux") to reuse the "wait for boot"
logic in OEFVPTarget.
Additionally, minimally validate the firmware boot by checking for
common error patterns in all console logs. Expose the runfvp config in
OEFVPTarget to support this.
Align the list of test cases executed on both fvp-base and
fvp-baser-aemv8r64 by using TEST_CASES:append = " fvp_boot" for both.
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -9,7 +9,7 @@ TFM_PLATFORM_IS_FVP = "TRUE"
|
||||
|
||||
# testimage config
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
TEST_SUITES = "fvp_boot"
|
||||
|
||||
# FVP Config
|
||||
FVP_PROVIDER ?= "fvp-corstone1000-native"
|
||||
|
||||
@@ -33,7 +33,7 @@ WKS_FILE_DEPENDS:append = " ${EXTRA_IMAGEDEPENDS}"
|
||||
WKS_FILE ?= "core-image-minimal.corstone500.wks"
|
||||
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
TEST_SUITES = "fvp_boot"
|
||||
|
||||
FVP_PROVIDER ?= "fvp-corstone500-native"
|
||||
FVP_EXE ?= "FVP_Corstone-500"
|
||||
|
||||
@@ -30,7 +30,7 @@ MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
||||
|
||||
# testimage configuration
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
TEST_SUITES:append = " fvp_boot"
|
||||
TEST_TARGET_IP ?= "127.0.0.1:8022"
|
||||
TEST_SERVER_IP ?= "127.0.1.1"
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
||||
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_TARGET_IP = "127.0.0.1:8022"
|
||||
TEST_SUITES:append = " fvp_boot"
|
||||
|
||||
FVP_PROVIDER ?= "fvp-base-a-aem-native"
|
||||
FVP_EXE ?= "FVP_Base_RevC-2xAEMvA"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
require conf/machine/include/tc.inc
|
||||
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
TEST_SUITES = "fvp_boot"
|
||||
|
||||
# FVP Config
|
||||
FVP_PROVIDER ?= "fvp-tc1-native"
|
||||
|
||||
@@ -132,3 +132,7 @@ class OEFVPTarget(OESSHTarget):
|
||||
return attr
|
||||
|
||||
return call_pexpect
|
||||
|
||||
@property
|
||||
def config(self):
|
||||
return self.fvp.getConfig()
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
import pexpect
|
||||
|
||||
|
||||
class FVPBootTest(OERuntimeTestCase):
|
||||
"""
|
||||
This test waits for a Linux login prompt on the default console. It is
|
||||
dependent on the OEFVPTarget test controller
|
||||
"""
|
||||
|
||||
def test_fvp_boot(self):
|
||||
self.target.transition("off")
|
||||
timeout = int(self.td.get('TEST_FVP_LINUX_BOOT_TIMEOUT') or 10*60)
|
||||
self.target.transition("linux", timeout)
|
||||
|
||||
# Check for common error patterns on all consoles
|
||||
for console in self.target.config['consoles']:
|
||||
# "expect" a timeout when searching for the error patterns
|
||||
match = self.target.expect(console,
|
||||
[br'(\[ERR\]|\[ERROR\]|ERROR\:)',
|
||||
pexpect.TIMEOUT],
|
||||
timeout=0)
|
||||
self.assertEqual(match, 1)
|
||||
@@ -1,17 +0,0 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
|
||||
|
||||
class LinuxBootTest(OERuntimeTestCase):
|
||||
"""
|
||||
This test waits for a Linux login prompt on the default console.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
self.console = self.target.DEFAULT_CONSOLE
|
||||
self.timeout = int(self.td.get('TEST_FVP_LINUX_BOOT_TIMEOUT') or 10*60)
|
||||
|
||||
def test_linux_boot(self):
|
||||
self.logger.info(f"{self.console}: Waiting for login prompt")
|
||||
self.target.expect(self.console, r"login\:", self.timeout)
|
||||
Reference in New Issue
Block a user