summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/commands.py
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2024-10-11 14:01:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-11 15:57:44 +0100
commitb5c11f2f04ba1bf66d2e0887ae3fbd19ce1105c0 (patch)
tree345dfe5049d197825fd6b42650a246fcc3714276 /meta/lib/oeqa/utils/commands.py
parent6b90b53c7a103b0658702c06169f64f09b43bde7 (diff)
downloadpoky-b5c11f2f04ba1bf66d2e0887ae3fbd19ce1105c0.tar.gz
oeqa: support passing custom boot patterns to runqemu
This allows defining non-standard patterns from QEMU tests just as they are already supported by the testimage.bbclass. Will allow testing non-Linux shells in QEMU, too (e.g. a U-Boot shell or another bootloader shell). (From OE-Core rev: f9e6c3deee5a4159a09396b625a7327f6c204df5) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r--meta/lib/oeqa/utils/commands.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index bf2f49d0c0..ca22d69f29 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -312,7 +312,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec=
312 f.write('LAYERSERIES_COMPAT_%s = "%s"\n' % (templayername, corenames)) 312 f.write('LAYERSERIES_COMPAT_%s = "%s"\n' % (templayername, corenames))
313 313
314@contextlib.contextmanager 314@contextlib.contextmanager
315def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True): 315def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, boot_patterns = {}, discard_writes=True):
316 """ 316 """
317 Starts a context manager for a 'oeqa.targetcontrol.QemuTarget' resource. 317 Starts a context manager for a 'oeqa.targetcontrol.QemuTarget' resource.
318 The underlying Qemu will be booted into a shell when the generator yields 318 The underlying Qemu will be booted into a shell when the generator yields
@@ -330,6 +330,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
330 image_fstype (str): IMAGE_FSTYPE to use 330 image_fstype (str): IMAGE_FSTYPE to use
331 launch_cmd (str): directly run this command and bypass automatic runqemu parameter generation 331 launch_cmd (str): directly run this command and bypass automatic runqemu parameter generation
332 overrides (dict): dict of "'<bitbake-variable>': value" pairs that allows overriding bitbake variables 332 overrides (dict): dict of "'<bitbake-variable>': value" pairs that allows overriding bitbake variables
333 boot_patterns (dict): dict of "'<pattern-name>': value" pairs to override default boot patterns, e.g. when not booting Linux
333 discard_writes (boolean): enables qemu -snapshot feature to prevent modifying original image 334 discard_writes (boolean): enables qemu -snapshot feature to prevent modifying original image
334 """ 335 """
335 336
@@ -361,7 +362,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
361 362
362 logdir = recipedata.getVar("TEST_LOG_DIR") 363 logdir = recipedata.getVar("TEST_LOG_DIR")
363 364
364 qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype) 365 qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype, boot_patterns=boot_patterns)
365 finally: 366 finally:
366 # We need to shut down tinfoil early here in case we actually want 367 # We need to shut down tinfoil early here in case we actually want
367 # to run tinfoil-using utilities with the running QEMU instance. 368 # to run tinfoil-using utilities with the running QEMU instance.