[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH v2 6/9] oeqa/utils/commands: document runqemu context manager
From:       Enrico Jörns <ejo () pengutronix ! de>
Date:       2023-03-31 10:40:22
Message-ID: 20230331104025.1478393-7-ejo () pengutronix ! de
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

Usage and arguments are not necessarily self-explaining.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 meta/lib/oeqa/utils/commands.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index f4daea2507..efbb6ab6f2 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -314,7 +314,22 @@ def create_temp_layer(templayerdir, templayername, priority=999, \
recipepathspec=  @contextlib.contextmanager
 def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, \
qemuparams=None, overrides={}, discard_writes=True):  """
-    launch_cmd means directly run the command, don't need set rootfs or env vars.
+    Starts a context manager for a 'oeqa.targetcontrol.QemuTarget' resource.
+    The underlying Qemu will be booted into a shell when the generator yields.
+
+    Usage:
+
+        with runqemu('core-image-minimal') as qemu:
+            qemu.run_serial('cat /proc/cpuinfo')
+
+    Args:
+        pn (str): (image) recipe to run on
+        ssh (boolean): whether or not to enable SSH (network access)
+        runqemuparams (str): space-separated list of params to pass to 'runqemu' \
script (like 'nographics', 'ovmf', etc.) +        image_fstype (str): IMAGE_FSTYPE to \
use +        launch_cmd (str): directly run this command and bypass automatic runqemu \
parameter generation +        overrides (dict): dict of "'<bitbake-variable>': value" \
pairs that allows overriding bitbake variables +        discard_writes (boolean): \
enables qemu -snapshot feature to prevent modifying original image  """
 
     import bb.tinfoil
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#179428): https://lists.openembedded.org/g/openembedded-core/message/179428
Mute This Topic: https://lists.openembedded.org/mt/97970651/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic