aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-01-03 12:51:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:20 +0000
commit0e8d0a03f0ea808b6d10d1ce84e74e5e0356a7f9 (patch)
tree839d6598437b3dbbe8d33af18f45def9d6c12690 /meta/lib
parent2d34b085333ff1d23fc00cacd68aaeed3d630571 (diff)
downloadopenembedded-core-contrib-0e8d0a03f0ea808b6d10d1ce84e74e5e0356a7f9.tar.gz
oeqa/runtime/context.py: Prepare for qemu
This commit will prepare context to use qemu and not just simpleremote. (From OE-Core rev: 7485a08c967916fb6edff4cc573d9314ec577031) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/context.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py
index ab7caa62c1..f0f6e62944 100644
--- a/meta/lib/oeqa/runtime/context.py
+++ b/meta/lib/oeqa/runtime/context.py
@@ -5,6 +5,7 @@ import os
from oeqa.core.context import OETestContext, OETestContextExecutor
from oeqa.core.target.ssh import OESSHTarget
+from oeqa.core.target.qemu import OEQemuTarget
from oeqa.utils.dump import HostDumper
from oeqa.runtime.loader import OERuntimeTestLoader
@@ -16,6 +17,7 @@ class OERuntimeTestContext(OETestContext):
def __init__(self, td, logger, target, host_dumper, image_packages):
super(OERuntimeTestContext, self).__init__(td, logger)
+
self.target = target
self.image_packages = image_packages
self.host_dumper = host_dumper
@@ -70,17 +72,19 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
runtime_group.add_argument('--packages-manifest', action='store',
help="Package manifest of the image under test")
+ runtime_group.add_argument('--qemu-boot', action='store',
+ help="Qemu boot configuration, only needed when target_type is QEMU.")
@staticmethod
- def getTarget(target_type, target_ip, server_ip):
+ def getTarget(target_type, target_ip, server_ip, **kwargs):
target = None
if target_type == 'simpleremote':
- target = OESSHTarget(target_ip)
+ target = OESSHTarget(target_ip, server_ip, kwargs)
elif target_type == 'qemu':
- raise NotImplementedError("target_type %s isn't implemented yet" % \
- target_type)
+ target = OEQemuTarget(target_ip, server_ip, kwargs)
else:
+ # TODO: Implement custom target module loading
raise TypeError("target_type %s isn't supported" % target_type)
return target
@@ -109,8 +113,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
super(OERuntimeTestContextExecutor, self)._process_args(logger, args)
+ target_kwargs = {}
+ target_kwargs['qemuboot'] = args.qemu_boot
+
self.tc_kwargs['init']['target'] = \
- OERuntimeTestContextExecutor.getTarget(args.target_type)
+ OERuntimeTestContextExecutor.getTarget(args.target_type,
+ args.target_ip, args.server_ip, **target_kwargs)
self.tc_kwargs['init']['host_dumper'] = \
OERuntimeTestContextExecutor.getHostDumper(None,
args.host_dumper_dir)