summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
5 5
6from oeqa.core.context import OETestContext, OETestContextExecutor 6from oeqa.core.context import OETestContext, OETestContextExecutor
7from oeqa.core.target.ssh import OESSHTarget 7from oeqa.core.target.ssh import OESSHTarget
8from oeqa.core.target.qemu import OEQemuTarget
8from oeqa.utils.dump import HostDumper 9from oeqa.utils.dump import HostDumper
9 10
10from oeqa.runtime.loader import OERuntimeTestLoader 11from 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)