diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2017-03-24 01:44:59 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-26 13:17:01 +0100 |
commit | 9305d816bdf8837ea3a407091cb7f24a9a3ae8dc (patch) | |
tree | 6f2035ab9ee5da91bacea3c05ff6c86ce6a63f2e /meta/lib/oeqa/utils/commands.py | |
parent | accf0362f964cc9d6330b6e52e83d748d890521f (diff) | |
download | openembedded-core-9305d816bdf8837ea3a407091cb7f24a9a3ae8dc.tar.gz openembedded-core-9305d816bdf8837ea3a407091cb7f24a9a3ae8dc.tar.bz2 openembedded-core-9305d816bdf8837ea3a407091cb7f24a9a3ae8dc.zip |
oeqa/targetcontrol.py: modify it to test runqemu
Modify the following files to test runqemu:
targetcontrol.py
utils/commands.py
utils/qemurunner.py
We need simulate how "runqemu" works in command line, so when test
"runqemu", the targetcontrol.py, utils/commands.py and
utils/qemurunner.py don't have to find the rootfs or set env vars.
[YOCTO #10249]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
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.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 82c5908e9c..6528a98427 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -218,7 +218,10 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec= @contextlib.contextmanager -def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): +def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None): + """ + launch_cmd means directly run the command, don't need set rootfs or env vars. + """ import bb.tinfoil import bb.build @@ -230,6 +233,12 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): import oeqa.targetcontrol tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage") tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000") + # Tell QemuTarget() whether need find rootfs/kernel or not + if launch_cmd: + tinfoil.config_data.setVar("FIND_ROOTFS", '0') + else: + tinfoil.config_data.setVar("FIND_ROOTFS", '1') + recipedata = tinfoil.parse_recipe(pn) # The QemuRunner log is saved out, but we need to ensure it is at the right @@ -260,7 +269,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None): try: qemu.deploy() try: - qemu.start(ssh=ssh, runqemuparams=runqemuparams) + qemu.start(ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd) except bb.build.FuncFailed: raise Exception('Failed to start QEMU - see the logs in %s' % logdir) |