Merge lp:~terceiro/lava-dispatcher/device-version into lp:lava-dispatcher
- device-version
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | 404 |
Merged at revision: | 418 |
Proposed branch: | lp:~terceiro/lava-dispatcher/device-version |
Merge into: | lp:lava-dispatcher |
Diff against target: |
313 lines (+173/-17) 9 files modified
lava_dispatcher/context.py (+3/-0) lava_dispatcher/device/fastmodel.py (+16/-0) lava_dispatcher/device/qemu.py (+10/-0) lava_dispatcher/device/target.py (+14/-2) lava_dispatcher/job.py (+1/-0) lava_dispatcher/tests/__init__.py (+4/-1) lava_dispatcher/tests/helper.py (+52/-0) lava_dispatcher/tests/test_config.py (+4/-14) lava_dispatcher/tests/test_device_version.py (+69/-0) |
To merge this branch: | bzr merge lp:~terceiro/lava-dispatcher/device-version |
Related bugs: | |
Related blueprints: |
Device Version Support
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle (community) | Approve | ||
Review via email: mp+130404@code.launchpad.net |
Commit message
Description of the change
This is the dispatcher part of the device version support implementation.
You will notice that the master image part is not done, since I could not get my board to work yet. In the current state of the code, master image devices will always return 'unknown' as their device versions.
Michael Hudson-Doyle (mwhudson) wrote : | # |
Antonio Terceiro (terceiro) wrote : | # |
Michael Hudson-Doyle escreveu:
> > === modified file 'lava_dispatche
> > lava_dispatcher
> > lava_dispatcher
> > +20,7 @@
> >
> > import contextlib
> > import logging
> > +import subprocess
> >
> > from lava_dispatcher
> > Target
> > @@ -76,4 +77,10 @@
> > proc = logging_
> > return proc
> >
> > + def get_device_
> > + try:
> > + return subprocess.
> > + except subprocess.
> > + return "unknown"
>
> Not sure this is the right thing to do -- should we not parse the
> -version of the qemu binary we actually use, which might not be the
> packaged version?
Yeah, you are right. I was kind of afraid of parsing the very
non-machine-
thing to do after all.
> > +def _create_
> > + config = create_
> > + target = FastModelTarget
> > + return target
>
> Could you call this _create_
Agreed. This name was from before Andy's reorganization, and after the
merge I ended up keeping it. But _create_
better.
> > +class TestDeviceVersi
> > +
> > + def test_base(self):
> > + target = Target(None, None)
> > + assert(
>
> It would be more Pythonic to write this as:
>
> self.assertIsIn
fixed - thanks.
--
Antonio Terceiro
Software Engineer - Linaro
http://
- 400. By Antonio Terceiro
-
merge with latest code
- 401. By Antonio Terceiro
-
create more realistic target instances for testing
- 402. By Antonio Terceiro
-
Use actual qemu binary - we might not be using the packaged one
- 403. By Antonio Terceiro
-
more Pythonic assertion of instance type
- 404. By Antonio Terceiro
-
return last version present in the output of --version
Michael Hudson-Doyle (mwhudson) wrote : | # |
Looks good now, thanks.
Preview Diff
1 | === modified file 'lava_dispatcher/context.py' | |||
2 | --- lava_dispatcher/context.py 2012-09-30 17:01:44 +0000 | |||
3 | +++ lava_dispatcher/context.py 2012-10-22 18:03:24 +0000 | |||
4 | @@ -55,3 +55,6 @@ | |||
5 | 55 | self._host_result_dir = tempfile.mkdtemp() | 55 | self._host_result_dir = tempfile.mkdtemp() |
6 | 56 | atexit.register(shutil.rmtree, self._host_result_dir) | 56 | atexit.register(shutil.rmtree, self._host_result_dir) |
7 | 57 | return self._host_result_dir | 57 | return self._host_result_dir |
8 | 58 | |||
9 | 59 | def get_device_version(self): | ||
10 | 60 | return self.client.target_device.get_device_version() | ||
11 | 58 | 61 | ||
12 | === modified file 'lava_dispatcher/device/fastmodel.py' | |||
13 | --- lava_dispatcher/device/fastmodel.py 2012-10-17 16:52:05 +0000 | |||
14 | +++ lava_dispatcher/device/fastmodel.py 2012-10-22 18:03:24 +0000 | |||
15 | @@ -26,6 +26,8 @@ | |||
16 | 26 | import shutil | 26 | import shutil |
17 | 27 | import stat | 27 | import stat |
18 | 28 | import threading | 28 | import threading |
19 | 29 | import re | ||
20 | 30 | import subprocess | ||
21 | 29 | 31 | ||
22 | 30 | from lava_dispatcher.device.target import ( | 32 | from lava_dispatcher.device.target import ( |
23 | 31 | Target | 33 | Target |
24 | @@ -255,6 +257,20 @@ | |||
25 | 255 | return [create_attachment('rtsm.log', content)] | 257 | return [create_attachment('rtsm.log', content)] |
26 | 256 | return [] | 258 | return [] |
27 | 257 | 259 | ||
28 | 260 | def get_device_version(self): | ||
29 | 261 | cmd = '%s --version' % self._sim_binary | ||
30 | 262 | try: | ||
31 | 263 | banner = subprocess.check_output(cmd, shell = True) | ||
32 | 264 | return self._parse_fastmodel_version(banner) | ||
33 | 265 | except subprocess.CalledProcessError: | ||
34 | 266 | return "unknown" | ||
35 | 267 | |||
36 | 268 | def _parse_fastmodel_version(self, banner): | ||
37 | 269 | match = re.search('Fast Models \[([0-9.]+)', banner) | ||
38 | 270 | if match: | ||
39 | 271 | return match.group(1) | ||
40 | 272 | else: | ||
41 | 273 | return "unknown" | ||
42 | 258 | 274 | ||
43 | 259 | class _pexpect_drain(threading.Thread): | 275 | class _pexpect_drain(threading.Thread): |
44 | 260 | ''' The simulator process can dump a lot of information to its console. If | 276 | ''' The simulator process can dump a lot of information to its console. If |
45 | 261 | 277 | ||
46 | === modified file 'lava_dispatcher/device/qemu.py' | |||
47 | --- lava_dispatcher/device/qemu.py 2012-10-17 16:52:05 +0000 | |||
48 | +++ lava_dispatcher/device/qemu.py 2012-10-22 18:03:24 +0000 | |||
49 | @@ -20,6 +20,8 @@ | |||
50 | 20 | 20 | ||
51 | 21 | import contextlib | 21 | import contextlib |
52 | 22 | import logging | 22 | import logging |
53 | 23 | import subprocess | ||
54 | 24 | import re | ||
55 | 23 | 25 | ||
56 | 24 | from lava_dispatcher.device.target import ( | 26 | from lava_dispatcher.device.target import ( |
57 | 25 | Target | 27 | Target |
58 | @@ -76,4 +78,12 @@ | |||
59 | 76 | proc = logging_spawn(qemu_cmd, logfile=self.sio, timeout=1200) | 78 | proc = logging_spawn(qemu_cmd, logfile=self.sio, timeout=1200) |
60 | 77 | return proc | 79 | return proc |
61 | 78 | 80 | ||
62 | 81 | def get_device_version(self): | ||
63 | 82 | try: | ||
64 | 83 | output = subprocess.check_output([self.context.config.default_qemu_binary, '--version']) | ||
65 | 84 | matches = re.findall('[0-9]+\.[0-9a-z.+\-:~]+', output) | ||
66 | 85 | return matches[-1] | ||
67 | 86 | except subprocess.CalledProcessError: | ||
68 | 87 | return "unknown" | ||
69 | 88 | |||
70 | 79 | target_class = QEMUTarget | 89 | target_class = QEMUTarget |
71 | 80 | 90 | ||
72 | === modified file 'lava_dispatcher/device/target.py' | |||
73 | --- lava_dispatcher/device/target.py 2012-10-17 16:52:05 +0000 | |||
74 | +++ lava_dispatcher/device/target.py 2012-10-22 18:03:24 +0000 | |||
75 | @@ -70,9 +70,15 @@ | |||
76 | 70 | self.sio = SerialIO(sys.stdout) | 70 | self.sio = SerialIO(sys.stdout) |
77 | 71 | 71 | ||
78 | 72 | self.boot_options = [] | 72 | self.boot_options = [] |
80 | 73 | self.scratch_dir = utils.mkdtemp(context.config.lava_image_tmpdir) | 73 | self._scratch_dir = None |
81 | 74 | self.deployment_data = {} | 74 | self.deployment_data = {} |
82 | 75 | 75 | ||
83 | 76 | @property | ||
84 | 77 | def scratch_dir(self): | ||
85 | 78 | if self._scratch_dir is None: | ||
86 | 79 | self._scratch_dir = utils.mkdtemp(context.config.lava_image_tmpdir) | ||
87 | 80 | return self._scratch_dir | ||
88 | 81 | |||
89 | 76 | def power_on(self): | 82 | def power_on(self): |
90 | 77 | """ responsible for powering on the target device and returning an | 83 | """ responsible for powering on the target device and returning an |
91 | 78 | instance of a pexpect session | 84 | instance of a pexpect session |
92 | @@ -148,6 +154,13 @@ | |||
93 | 148 | def get_test_data_attachments(self): | 154 | def get_test_data_attachments(self): |
94 | 149 | return [] | 155 | return [] |
95 | 150 | 156 | ||
96 | 157 | def get_device_version(self): | ||
97 | 158 | """ Returns the device version associated with the device, i.e. version | ||
98 | 159 | of emulation software, or version of master image. Must be overriden in | ||
99 | 160 | subclasses. | ||
100 | 161 | """ | ||
101 | 162 | return 'unknown' | ||
102 | 163 | |||
103 | 151 | def _customize_ubuntu(self, rootdir): | 164 | def _customize_ubuntu(self, rootdir): |
104 | 152 | self.deployment_data = Target.ubuntu_deployment_data | 165 | self.deployment_data = Target.ubuntu_deployment_data |
105 | 153 | with open('%s/root/.bashrc' % rootdir, 'a') as f: | 166 | with open('%s/root/.bashrc' % rootdir, 'a') as f: |
106 | @@ -169,7 +182,6 @@ | |||
107 | 169 | # just no upstart or dash assumptions | 182 | # just no upstart or dash assumptions |
108 | 170 | self._customize_oe(mnt) | 183 | self._customize_oe(mnt) |
109 | 171 | 184 | ||
110 | 172 | |||
111 | 173 | class SerialIO(file): | 185 | class SerialIO(file): |
112 | 174 | def __init__(self, logfile): | 186 | def __init__(self, logfile): |
113 | 175 | self.serialio = StringIO() | 187 | self.serialio = StringIO() |
114 | 176 | 188 | ||
115 | === modified file 'lava_dispatcher/job.py' | |||
116 | --- lava_dispatcher/job.py 2012-08-30 04:22:50 +0000 | |||
117 | +++ lava_dispatcher/job.py 2012-10-22 18:03:24 +0000 | |||
118 | @@ -142,6 +142,7 @@ | |||
119 | 142 | 142 | ||
120 | 143 | metadata = { | 143 | metadata = { |
121 | 144 | 'target.hostname': self.target, | 144 | 'target.hostname': self.target, |
122 | 145 | 'target.device_version': self.context.get_device_version(), | ||
123 | 145 | } | 146 | } |
124 | 146 | 147 | ||
125 | 147 | if 'device_type' in self.job_data: | 148 | if 'device_type' in self.job_data: |
126 | 148 | 149 | ||
127 | === modified file 'lava_dispatcher/tests/__init__.py' | |||
128 | --- lava_dispatcher/tests/__init__.py 2011-06-27 04:55:08 +0000 | |||
129 | +++ lava_dispatcher/tests/__init__.py 2012-10-22 18:03:24 +0000 | |||
130 | @@ -1,6 +1,9 @@ | |||
131 | 1 | import unittest | 1 | import unittest |
132 | 2 | 2 | ||
133 | 3 | def test_suite(): | 3 | def test_suite(): |
135 | 4 | module_names = ['lava_dispatcher.tests.test_config',] | 4 | module_names = [ |
136 | 5 | 'lava_dispatcher.tests.test_config', | ||
137 | 6 | 'lava_dispatcher.tests.test_device_version', | ||
138 | 7 | ] | ||
139 | 5 | loader = unittest.TestLoader() | 8 | loader = unittest.TestLoader() |
140 | 6 | return loader.loadTestsFromNames(module_names) | 9 | return loader.loadTestsFromNames(module_names) |
141 | 7 | 10 | ||
142 | === added file 'lava_dispatcher/tests/helper.py' | |||
143 | --- lava_dispatcher/tests/helper.py 1970-01-01 00:00:00 +0000 | |||
144 | +++ lava_dispatcher/tests/helper.py 2012-10-22 18:03:24 +0000 | |||
145 | @@ -0,0 +1,52 @@ | |||
146 | 1 | # Copyright (C) 2012 Linaro Limited | ||
147 | 2 | # | ||
148 | 3 | # Author: Antonio Terceiro <antonio.terceiro@linaro.org> | ||
149 | 4 | # | ||
150 | 5 | # This file is part of LAVA Dispatcher. | ||
151 | 6 | # | ||
152 | 7 | # LAVA Dispatcher is free software; you can redistribute it and/or modify | ||
153 | 8 | # it under the terms of the GNU General Public License as published by | ||
154 | 9 | # the Free Software Foundation; either version 2 of the License, or | ||
155 | 10 | # (at your option) any later version. | ||
156 | 11 | # | ||
157 | 12 | # LAVA Dispatcher is distributed in the hope that it will be useful, | ||
158 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
159 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
160 | 15 | # GNU General Public License for more details. | ||
161 | 16 | # | ||
162 | 17 | # You should have received a copy of the GNU General Public License | ||
163 | 18 | # along with this program; if not, see <http://www.gnu.org/licenses>. | ||
164 | 19 | |||
165 | 20 | import os | ||
166 | 21 | from lava_dispatcher.config import get_config, get_device_config | ||
167 | 22 | |||
168 | 23 | __tmp_dir = os.getenv("TMPDIR") or '/tmp' | ||
169 | 24 | __tmp_config_dir = os.path.join(__tmp_dir, 'lava-dispatcher-config') | ||
170 | 25 | |||
171 | 26 | def create_config(name, data): | ||
172 | 27 | filename = os.path.join(__tmp_config_dir, name) | ||
173 | 28 | if not os.path.exists(os.path.dirname(filename)): | ||
174 | 29 | os.mkdir(os.path.dirname(filename)) | ||
175 | 30 | with open(filename, 'w') as f: | ||
176 | 31 | for key in data.keys(): | ||
177 | 32 | f.write("%s = %s\n" % (key, data[key])) | ||
178 | 33 | |||
179 | 34 | def create_device_config(name, data): | ||
180 | 35 | create_config("devices/%s.conf" % name, data) | ||
181 | 36 | return get_device_config(name, __tmp_config_dir) | ||
182 | 37 | |||
183 | 38 | def setup_config_dir(): | ||
184 | 39 | os.mkdir(__tmp_config_dir) | ||
185 | 40 | |||
186 | 41 | def cleanup_config_dir(): | ||
187 | 42 | os.system('rm -rf %s' % __tmp_config_dir) | ||
188 | 43 | |||
189 | 44 | from unittest import TestCase | ||
190 | 45 | |||
191 | 46 | class LavaDispatcherTestCase(TestCase): | ||
192 | 47 | |||
193 | 48 | def setUp(self): | ||
194 | 49 | setup_config_dir() | ||
195 | 50 | |||
196 | 51 | def tearDown(self): | ||
197 | 52 | cleanup_config_dir() | ||
198 | 0 | 53 | ||
199 | === modified file 'lava_dispatcher/tests/test_config.py' | |||
200 | --- lava_dispatcher/tests/test_config.py 2012-10-16 02:26:18 +0000 | |||
201 | +++ lava_dispatcher/tests/test_config.py 2012-10-22 18:03:24 +0000 | |||
202 | @@ -17,33 +17,23 @@ | |||
203 | 17 | # You should have received a copy of the GNU General Public License | 17 | # You should have received a copy of the GNU General Public License |
204 | 18 | # along with this program; if not, see <http://www.gnu.org/licenses>. | 18 | # along with this program; if not, see <http://www.gnu.org/licenses>. |
205 | 19 | 19 | ||
206 | 20 | import os | ||
207 | 21 | from unittest import TestCase | 20 | from unittest import TestCase |
208 | 22 | 21 | ||
209 | 23 | from lava_dispatcher.config import get_config, get_device_config | 22 | from lava_dispatcher.config import get_config, get_device_config |
210 | 24 | from lava_dispatcher.utils import string_to_list | 23 | from lava_dispatcher.utils import string_to_list |
211 | 25 | from lava_dispatcher.client.base import LavaClient | 24 | from lava_dispatcher.client.base import LavaClient |
212 | 26 | 25 | ||
213 | 26 | from lava_dispatcher.tests.helper import * | ||
214 | 27 | |||
215 | 27 | test_config_dir = os.path.join(os.path.dirname(__file__), 'test-config') | 28 | test_config_dir = os.path.join(os.path.dirname(__file__), 'test-config') |
216 | 28 | print test_config_dir | ||
217 | 29 | |||
218 | 30 | tmp_dir = os.getenv("TMPDIR") or '/tmp' | ||
219 | 31 | tmp_config_dir = os.path.join(tmp_dir, 'lava-dispatcher-config') | ||
220 | 32 | |||
221 | 33 | def create_config(name, data): | ||
222 | 34 | filename = os.path.join(tmp_config_dir, name) | ||
223 | 35 | os.mkdir(os.path.dirname(filename)) | ||
224 | 36 | with open(filename, 'w') as f: | ||
225 | 37 | for key in data.keys(): | ||
226 | 38 | f.write("%s = %s\n" % (key, data[key])) | ||
227 | 39 | 29 | ||
228 | 40 | class TestConfigData(TestCase): | 30 | class TestConfigData(TestCase): |
229 | 41 | 31 | ||
230 | 42 | def setUp(self): | 32 | def setUp(self): |
232 | 43 | os.mkdir(tmp_config_dir) | 33 | setup_config_dir() |
233 | 44 | 34 | ||
234 | 45 | def tearDown(self): | 35 | def tearDown(self): |
236 | 46 | os.system('rm -rf %s' % tmp_config_dir) | 36 | cleanup_config_dir() |
237 | 47 | 37 | ||
238 | 48 | def test_beagle01_uboot_cmds(self): | 38 | def test_beagle01_uboot_cmds(self): |
239 | 49 | beagle01_config = get_device_config("beaglexm01", test_config_dir) | 39 | beagle01_config = get_device_config("beaglexm01", test_config_dir) |
240 | 50 | 40 | ||
241 | === added file 'lava_dispatcher/tests/test_device_version.py' | |||
242 | --- lava_dispatcher/tests/test_device_version.py 1970-01-01 00:00:00 +0000 | |||
243 | +++ lava_dispatcher/tests/test_device_version.py 2012-10-22 18:03:24 +0000 | |||
244 | @@ -0,0 +1,69 @@ | |||
245 | 1 | # Copyright (C) 2012 Linaro Limited | ||
246 | 2 | # | ||
247 | 3 | # Author: Antonio Terceiro <antonio.terceiro@linaro.org> | ||
248 | 4 | # | ||
249 | 5 | # This file is part of LAVA Dispatcher. | ||
250 | 6 | # | ||
251 | 7 | # LAVA Dispatcher is free software; you can redistribute it and/or modify | ||
252 | 8 | # it under the terms of the GNU General Public License as published by | ||
253 | 9 | # the Free Software Foundation; either version 2 of the License, or | ||
254 | 10 | # (at your option) any later version. | ||
255 | 11 | # | ||
256 | 12 | # LAVA Dispatcher is distributed in the hope that it will be useful, | ||
257 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
258 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
259 | 15 | # GNU General Public License for more details. | ||
260 | 16 | # | ||
261 | 17 | # You should have received a copy of the GNU General Public License | ||
262 | 18 | # along with this program; if not, see <http://www.gnu.org/licenses>. | ||
263 | 19 | |||
264 | 20 | from unittest import TestCase | ||
265 | 21 | import re | ||
266 | 22 | from lava_dispatcher.tests.helper import LavaDispatcherTestCase, create_device_config, create_config, __tmp_config_dir | ||
267 | 23 | |||
268 | 24 | from lava_dispatcher.device.target import Target | ||
269 | 25 | from lava_dispatcher.device.qemu import QEMUTarget | ||
270 | 26 | from lava_dispatcher.device.fastmodel import FastModelTarget | ||
271 | 27 | from lava_dispatcher.context import LavaContext | ||
272 | 28 | from lava_dispatcher.config import get_config | ||
273 | 29 | |||
274 | 30 | def _create_fastmodel_target(): | ||
275 | 31 | config = create_device_config('fastmodel01', { 'device_type': 'fastmodel', 'simulator_binary': '/path/to/fastmodel', 'license_server': 'foo.local' }) | ||
276 | 32 | target = FastModelTarget(None, config) | ||
277 | 33 | return target | ||
278 | 34 | |||
279 | 35 | def _create_qemu_target(): | ||
280 | 36 | create_config('lava-dispatcher.conf', {'default_qemu_binary': 'qemu-system-arm'}) | ||
281 | 37 | device_config = create_device_config('qemu01', { 'device_type': 'qemu' }) | ||
282 | 38 | dispatcher_config = get_config(__tmp_config_dir) | ||
283 | 39 | |||
284 | 40 | context = LavaContext('qemu01', dispatcher_config, None, None) | ||
285 | 41 | return QEMUTarget(context, device_config) | ||
286 | 42 | |||
287 | 43 | class TestDeviceVersion(LavaDispatcherTestCase): | ||
288 | 44 | |||
289 | 45 | def test_base(self): | ||
290 | 46 | target = Target(None, None) | ||
291 | 47 | self.assertIsInstance(target.get_device_version(), str) | ||
292 | 48 | |||
293 | 49 | def test_qemu(self): | ||
294 | 50 | target = _create_qemu_target() | ||
295 | 51 | device_version = target.get_device_version() | ||
296 | 52 | assert(re.search('^[0-9.]+', device_version)) | ||
297 | 53 | |||
298 | 54 | def test_fastmodel(self): | ||
299 | 55 | banner = "\n".join([ | ||
300 | 56 | "Fast Models [7.1.36 (May 17 2012)]", | ||
301 | 57 | "Copyright 2000-2012 ARM Limited.", | ||
302 | 58 | "All Rights Reserved.", | ||
303 | 59 | "Top component name: RTSM_VE_Cortex_A15x1_A7x1" | ||
304 | 60 | ]) | ||
305 | 61 | target = _create_fastmodel_target() | ||
306 | 62 | version = target._parse_fastmodel_version(banner) | ||
307 | 63 | self.assertEqual('7.1.36', version) | ||
308 | 64 | |||
309 | 65 | def test_fastmodel_wrong_format(self): | ||
310 | 66 | client = _create_fastmodel_target() | ||
311 | 67 | version = client._parse_fastmodel_version('random string') | ||
312 | 68 | self.assertEqual('unknown', version) | ||
313 | 69 |
Antonio Terceiro <email address hidden> writes:
> This is the dispatcher part of the device version support implementation.
>
> You will notice that the master image part is not done, since I could
> not get my board to work yet. In the current state of the code, master
> image devices will always return 'unknown' as their device versions.
This looks mostly fine, thanks! Just a couple of comments.
> === modified file 'lava_dispatche r/device/ qemu.py' --- /device/ qemu.py 2012-10-17 16:52:05 +0000 +++ /device/ qemu.py 2012-10-18 17:49:26 +0000 @@ -20,6 .device. target import ( spawn(qemu_ cmd, logfile=self.sio, timeout=1200) version( self): check_output( ["dpkg- query", "--showformat= ${Version} ", "--show", "qemu-system"]) CalledProcessEr ror:
> lava_dispatcher
> lava_dispatcher
> +20,7 @@
>
> import contextlib
> import logging
> +import subprocess
>
> from lava_dispatcher
> Target
> @@ -76,4 +77,10 @@
> proc = logging_
> return proc
>
> + def get_device_
> + try:
> + return subprocess.
> + except subprocess.
> + return "unknown"
Not sure this is the right thing to do -- should we not parse the
-version of the qemu binary we actually use, which might not be the
packaged version?
> target_class = QEMUTarget
>
> === added file 'lava_dispatche r/tests/ test_device_ version. py' /tests/ test_device_ version. py 1970-01-01 00:00:00 +0000 /tests/ test_device_ version. py 2012-10-18 17:49:26 +0000 www.gnu. org/licenses>. .tests. helper import LavaDispatcherT estCase, create_ device_ config .device. target import Target .device. qemu import QEMUTarget .device. fastmodel import FastModelTarget fastmodel( ): device_ config( 'fastmodel01' , { 'device_type': 'fastmodel', 'simulator_binary': '/path/ to/fastmodel' , 'license_server': 'foo.local' }) (None, config)
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -0,0 +1,59 @@
> +# Copyright (C) 2012 Linaro Limited
> +#
> +# Author: Antonio Terceiro <email address hidden>
> +#
> +# This file is part of LAVA Dispatcher.
> +#
> +# LAVA Dispatcher is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# LAVA Dispatcher is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, see <http://
> +
> +from unittest import TestCase
> +import re
> +from lava_dispatcher
> +
> +from lava_dispatcher
> +from lava_dispatcher
> +from lava_dispatcher
> +
> +def _create_
> + config = create_
> + target = FastModelTarget
> + return target
Could you call this _create_ fastmodel_ target( ) do you think?
> +class TestDeviceVersi on(LavaDispatch erTestCase) : type(target. get_device_ version( )) is str)
> +
> + def test_base(self):
> + target = Target(None, None)
> + assert(
It would be more Pyt...