summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/target
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-01-03 13:58:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:20 +0000
commit211c5be54cde325242c7788f7e3eeb3f6eea7ac8 (patch)
treebc89619296b4f4dca1a101336aca89857f5a8a3a /meta/lib/oeqa/core/target
parent71e456add86f95889a283f035674c0f40aa77011 (diff)
downloadpoky-211c5be54cde325242c7788f7e3eeb3f6eea7ac8.tar.gz
core/target/qemu.py Adds qemu target
This adds qemu target to be used in testimage. It uses the current QemuRunner class in order to boot and control qemu. [YOCTO #10231] (From OE-Core rev: 44d4e9d0bb31fbc28d8c1fad8860ff56e5ae043a) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/target')
-rw-r--r--meta/lib/oeqa/core/target/qemu.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/target/qemu.py b/meta/lib/oeqa/core/target/qemu.py
new file mode 100644
index 0000000000..641dd6a093
--- /dev/null
+++ b/meta/lib/oeqa/core/target/qemu.py
@@ -0,0 +1,45 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4import os
5import sys
6import signal
7import time
8
9from .ssh import OESSHTarget
10from oeqa.utils.qemurunner import QemuRunner
11
12supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
13
14class OEQemuTarget(OESSHTarget):
15 def __init__(self, logger, ip, server_ip, timeout=300, user='root',
16 port=None, machine='', rootfs='', kernel='', kvm=False,
17 dump_dir='', dump_host_cmds='', display='', bootlog='',
18 tmpdir='', dir_image='', boottime=60):
19
20 super(OEQemuTarget, self).__init__(logger, ip, server_ip, timeout,
21 user, port)
22
23 self.ip = ip
24 self.server_ip = server_ip
25 self.machine = machine
26 self.rootfs = rootfs
27 self.kernel = kernel
28 self.kvm = kvm
29
30 self.runner = QemuRunner(machine=machine, rootfs=rootfs, tmpdir=tmpdir,
31 deploy_dir_image=dir_image, display=display,
32 logfile=bootlog, boottime=boottime,
33 use_kvm=kvm, dump_dir=dump_dir,
34 dump_host_cmds=dump_host_cmds)
35
36 def start(self, params=None, extra_bootparams=None):
37 if self.runner.start(params, extra_bootparams=extra_bootparams):
38 self.ip = self.runner.ip
39 self.server_ip = self.runner.server_ip
40 else:
41 self.stop()
42 raise RuntimeError("FAILED to start qemu - check the task log and the boot log")
43
44 def stop(self):
45 self.runner.stop()