aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-03-24 01:44:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-26 13:17:01 +0100
commit9305d816bdf8837ea3a407091cb7f24a9a3ae8dc (patch)
tree6f2035ab9ee5da91bacea3c05ff6c86ce6a63f2e /meta/lib/oeqa/targetcontrol.py
parentaccf0362f964cc9d6330b6e52e83d748d890521f (diff)
downloadopenembedded-core-contrib-9305d816bdf8837ea3a407091cb7f24a9a3ae8dc.tar.gz
openembedded-core-contrib-9305d816bdf8837ea3a407091cb7f24a9a3ae8dc.tar.bz2
openembedded-core-contrib-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/targetcontrol.py')
-rw-r--r--meta/lib/oeqa/targetcontrol.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 2f071e0901..ea89538002 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -117,10 +117,15 @@ class QemuTarget(BaseTarget):
super(QemuTarget, self).__init__(d)
- self.image_fstype = image_fstype or self.get_image_fstype(d)
+ self.rootfs = ''
+ self.kernel = ''
+ self.image_fstype = ''
+
+ if d.getVar('FIND_ROOTFS') == '1':
+ self.image_fstype = image_fstype or self.get_image_fstype(d)
+ self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
+ self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
- self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
- self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
dump_target_cmds = d.getVar("testimage_dump_target")
dump_host_cmds = d.getVar("testimage_dump_host")
dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
@@ -176,8 +181,13 @@ class QemuTarget(BaseTarget):
bb.note("Qemu log file: %s" % self.qemulog)
super(QemuTarget, self).deploy()
- def start(self, params=None, ssh=True, extra_bootparams=None, runqemuparams=''):
- if self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams):
+ def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd=''):
+ if launch_cmd:
+ start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd)
+ else:
+ start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams)
+
+ if start:
if ssh:
self.ip = self.runner.ip
self.server_ip = self.runner.server_ip