diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2017-01-03 12:51:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:20 +0000 |
commit | 0e8d0a03f0ea808b6d10d1ce84e74e5e0356a7f9 (patch) | |
tree | 839d6598437b3dbbe8d33af18f45def9d6c12690 /meta/lib/oeqa/runtime | |
parent | 2d34b085333ff1d23fc00cacd68aaeed3d630571 (diff) | |
download | poky-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/oeqa/runtime')
-rw-r--r-- | meta/lib/oeqa/runtime/context.py | 18 |
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 | |||
5 | 5 | ||
6 | from oeqa.core.context import OETestContext, OETestContextExecutor | 6 | from oeqa.core.context import OETestContext, OETestContextExecutor |
7 | from oeqa.core.target.ssh import OESSHTarget | 7 | from oeqa.core.target.ssh import OESSHTarget |
8 | from oeqa.core.target.qemu import OEQemuTarget | ||
8 | from oeqa.utils.dump import HostDumper | 9 | from oeqa.utils.dump import HostDumper |
9 | 10 | ||
10 | from oeqa.runtime.loader import OERuntimeTestLoader | 11 | from oeqa.runtime.loader import OERuntimeTestLoader |
@@ -16,6 +17,7 @@ class OERuntimeTestContext(OETestContext): | |||
16 | 17 | ||
17 | def __init__(self, td, logger, target, host_dumper, image_packages): | 18 | def __init__(self, td, logger, target, host_dumper, image_packages): |
18 | super(OERuntimeTestContext, self).__init__(td, logger) | 19 | super(OERuntimeTestContext, self).__init__(td, logger) |
20 | |||
19 | self.target = target | 21 | self.target = target |
20 | self.image_packages = image_packages | 22 | self.image_packages = image_packages |
21 | self.host_dumper = host_dumper | 23 | self.host_dumper = host_dumper |
@@ -70,17 +72,19 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
70 | runtime_group.add_argument('--packages-manifest', action='store', | 72 | runtime_group.add_argument('--packages-manifest', action='store', |
71 | help="Package manifest of the image under test") | 73 | help="Package manifest of the image under test") |
72 | 74 | ||
75 | runtime_group.add_argument('--qemu-boot', action='store', | ||
76 | help="Qemu boot configuration, only needed when target_type is QEMU.") | ||
73 | 77 | ||
74 | @staticmethod | 78 | @staticmethod |
75 | def getTarget(target_type, target_ip, server_ip): | 79 | def getTarget(target_type, target_ip, server_ip, **kwargs): |
76 | target = None | 80 | target = None |
77 | 81 | ||
78 | if target_type == 'simpleremote': | 82 | if target_type == 'simpleremote': |
79 | target = OESSHTarget(target_ip) | 83 | target = OESSHTarget(target_ip, server_ip, kwargs) |
80 | elif target_type == 'qemu': | 84 | elif target_type == 'qemu': |
81 | raise NotImplementedError("target_type %s isn't implemented yet" % \ | 85 | target = OEQemuTarget(target_ip, server_ip, kwargs) |
82 | target_type) | ||
83 | else: | 86 | else: |
87 | # TODO: Implement custom target module loading | ||
84 | raise TypeError("target_type %s isn't supported" % target_type) | 88 | raise TypeError("target_type %s isn't supported" % target_type) |
85 | 89 | ||
86 | return target | 90 | return target |
@@ -109,8 +113,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
109 | 113 | ||
110 | super(OERuntimeTestContextExecutor, self)._process_args(logger, args) | 114 | super(OERuntimeTestContextExecutor, self)._process_args(logger, args) |
111 | 115 | ||
116 | target_kwargs = {} | ||
117 | target_kwargs['qemuboot'] = args.qemu_boot | ||
118 | |||
112 | self.tc_kwargs['init']['target'] = \ | 119 | self.tc_kwargs['init']['target'] = \ |
113 | OERuntimeTestContextExecutor.getTarget(args.target_type) | 120 | OERuntimeTestContextExecutor.getTarget(args.target_type, |
121 | args.target_ip, args.server_ip, **target_kwargs) | ||
114 | self.tc_kwargs['init']['host_dumper'] = \ | 122 | self.tc_kwargs['init']['host_dumper'] = \ |
115 | OERuntimeTestContextExecutor.getHostDumper(None, | 123 | OERuntimeTestContextExecutor.getHostDumper(None, |
116 | args.host_dumper_dir) | 124 | args.host_dumper_dir) |