mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-08 05:09:56 +00:00
arm/oeqa: Use linuxboot and OEFVPSerialTarget instead of noop
Create a new "linuxboot" test that uses the pexpect methods on OEFVPSerialTarget to wait for a Linux login shell. Switch to this test method for fvp-baser-aemv8r64, corstone500 and corstone1000. Issue-Id: SCM-4957 Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Change-Id: Idd749652ee72e244b7a3831dd2295e0bfaed3bfa Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -8,8 +8,8 @@ TFA_TARGET_PLATFORM = "fvp"
|
||||
TFM_PLATFORM_IS_FVP = "TRUE"
|
||||
|
||||
# testimage config
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "noop"
|
||||
TEST_TARGET = "OEFVPSerialTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
|
||||
# FVP Config
|
||||
FVP_PROVIDER ?= "fvp-corstone1000-native"
|
||||
|
||||
@@ -33,8 +33,8 @@ WKS_FILE_DEPENDS:append = " ${EXTRA_IMAGEDEPENDS}"
|
||||
|
||||
WKS_FILE ?= "core-image-minimal.corstone500.wks"
|
||||
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "noop"
|
||||
TEST_TARGET = "OEFVPSerialTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
|
||||
FVP_PROVIDER ?= "fvp-corstone500-native"
|
||||
FVP_EXE ?= "FVP_Corstone-500"
|
||||
|
||||
@@ -33,8 +33,8 @@ PACKAGECONFIG:remove:pn-openssh = "rng-tools"
|
||||
MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
||||
|
||||
# testimage configuration
|
||||
TEST_TARGET = "OEFVPTarget"
|
||||
TEST_SUITES = "ping ssh"
|
||||
TEST_TARGET = "OEFVPSerialTarget"
|
||||
TEST_SUITES = "linuxboot"
|
||||
TEST_TARGET_IP ?= "127.0.0.1:8022"
|
||||
TEST_SERVER_IP ?= "127.0.1.1"
|
||||
|
||||
|
||||
@@ -119,7 +119,9 @@ class FVPRunner:
|
||||
check_telnet()
|
||||
import pexpect
|
||||
port = await self._get_terminal_port(terminal, timeout)
|
||||
return pexpect.spawn(f"telnet localhost {port}", **kwargs)
|
||||
instance = pexpect.spawn(f"telnet localhost {port}", **kwargs)
|
||||
self._pexpects.append(instance)
|
||||
return instance
|
||||
|
||||
def pid(self):
|
||||
return self._fvp_process.pid
|
||||
|
||||
@@ -87,7 +87,8 @@ class OEFVPSerialTarget(OEFVPSSHTarget):
|
||||
This still depends on OEFVPSSHTarget so SSH commands can still be run on
|
||||
the target, but note that this class does not inherently guarantee that
|
||||
the SSH server is running prior to running test cases. Test cases that use
|
||||
SSH should first validate that SSH is available.
|
||||
SSH should first validate that SSH is available, e.g. by depending on the
|
||||
"linuxboot" test case in meta-arm.
|
||||
"""
|
||||
DEFAULT_CONSOLE = "default"
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
|
||||
|
||||
class LinuxBootTest(OERuntimeTestCase):
|
||||
"""
|
||||
This test case is only compatible with the OEFVPSerialTarget as it uses
|
||||
the pexpect interface. It waits for a Linux login prompt on the default
|
||||
console.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
self.console = self.target.DEFAULT_CONSOLE
|
||||
|
||||
def test_linux_boot(self):
|
||||
self.logger.info(f"{self.console}: Waiting for login prompt")
|
||||
self.target.expect(self.console, "login\:", timeout=10*60)
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
|
||||
class NoopTest(OERuntimeTestCase):
|
||||
"""
|
||||
This is a test case which does nothing. Useful when you want to use
|
||||
testimage to verify that an image boots, but you don't have networking so
|
||||
none of the existing test cases are suitable.
|
||||
"""
|
||||
def test_no_op(self):
|
||||
return
|
||||
Reference in New Issue
Block a user