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-27 08:15:06 +0100 |
commit | b742fd023e71320990b26b979dd65632fbd347a2 (patch) | |
tree | 9454d7b5c045f3b4bb9d5ef17f54b6e0af95b5e1 /meta/lib/oeqa/targetcontrol.py | |
parent | 58e6e7c2043d7f4b48ec3b4b9daf25f5766fa5d2 (diff) | |
download | poky-b742fd023e71320990b26b979dd65632fbd347a2.tar.gz |
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]
(From OE-Core rev: 9305d816bdf8837ea3a407091cb7f24a9a3ae8dc)
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.py | 20 |
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): | |||
117 | 117 | ||
118 | super(QemuTarget, self).__init__(d) | 118 | super(QemuTarget, self).__init__(d) |
119 | 119 | ||
120 | self.image_fstype = image_fstype or self.get_image_fstype(d) | 120 | self.rootfs = '' |
121 | self.kernel = '' | ||
122 | self.image_fstype = '' | ||
123 | |||
124 | if d.getVar('FIND_ROOTFS') == '1': | ||
125 | self.image_fstype = image_fstype or self.get_image_fstype(d) | ||
126 | self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) | ||
127 | self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') | ||
121 | self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) | 128 | self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) |
122 | self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) | ||
123 | self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') | ||
124 | dump_target_cmds = d.getVar("testimage_dump_target") | 129 | dump_target_cmds = d.getVar("testimage_dump_target") |
125 | dump_host_cmds = d.getVar("testimage_dump_host") | 130 | dump_host_cmds = d.getVar("testimage_dump_host") |
126 | dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") | 131 | dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") |
@@ -176,8 +181,13 @@ class QemuTarget(BaseTarget): | |||
176 | bb.note("Qemu log file: %s" % self.qemulog) | 181 | bb.note("Qemu log file: %s" % self.qemulog) |
177 | super(QemuTarget, self).deploy() | 182 | super(QemuTarget, self).deploy() |
178 | 183 | ||
179 | def start(self, params=None, ssh=True, extra_bootparams=None, runqemuparams=''): | 184 | def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd=''): |
180 | if self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams): | 185 | if launch_cmd: |
186 | start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd) | ||
187 | else: | ||
188 | start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams) | ||
189 | |||
190 | if start: | ||
181 | if ssh: | 191 | if ssh: |
182 | self.ip = self.runner.ip | 192 | self.ip = self.runner.ip |
183 | self.server_ip = self.runner.server_ip | 193 | self.server_ip = self.runner.server_ip |