Merge lp:~terceiro/lava-dispatcher/nexus into lp:lava-dispatcher
- nexus
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~terceiro/lava-dispatcher/nexus |
Merge into: | lp:lava-dispatcher |
Diff against target: |
231 lines (+211/-0) 3 files modified
lava_dispatcher/config.py (+3/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/nexus.conf (+40/-0) lava_dispatcher/device/nexus.py (+168/-0) |
To merge this branch: | bzr merge lp:~terceiro/lava-dispatcher/nexus |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Validation Team | Pending | ||
Review via email: mp+136807@code.launchpad.net |
Commit message
Description of the change
This is work in progress; you will note the number of FIXME's and TODO's in lava_dispatcher
With the current state, I can already run a full boot test job, like the one in the commit message of rev 475:
http://
It would be nice to receive comments about the changes that were needed to other files outside of the Nexus implementation itself.
Michael Hudson-Doyle (mwhudson) wrote : | # |
Antonio Terceiro (terceiro) wrote : | # |
On Sun, Dec 02, 2012 at 10:16:20PM -0000, Michael Hudson-Doyle wrote:
> Antonio Terceiro <email address hidden> writes:
>
> > Antonio Terceiro has proposed merging lp:~terceiro/lava-dispatcher/nexus into lp:lava-dispatcher.
> >
> > Requested reviews:
> > Linaro Validation Team (linaro-validation)
> >
> > For more details, see:
> > https:/
> >
> > This is work in progress; you will note the number of FIXME's and TODO's in lava_dispatcher
>
> This looks pretty good on the whole!
Thanks! :)
> > With the current state, I can already run a full boot test job, like the one in the commit message of rev 475:
> >
> > http://
> >
> > It would be nice to receive comments about the changes that were needed to other files outside of the Nexus implementation itself.
>
> I think they mostly seem reasonable. I'd be happy to see them merged
> without the nexus bits if that would make your life easier.
I will merge them, in that case. A cleaner diff will make my life a
little easier, for sure.
> > === added file 'lava_dispatche
> > --- lava_dispatcher
> > +++ lava_dispatcher
> > @@ -0,0 +1,106 @@
> > +# 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://
> > +
> > +import subprocess
> > +import pexpect
> > +from time import sleep
> > +from lava_dispatcher
> > + Target
> > +)
> > +from lava_dispatcher
> > + download_image
> > +)
> > +from lava_dispatcher
> > + logging_spawn
> > +)
> > +
> > +class NexusTarget(
> > +
> > + def __init__(self, context, config):
> > + super(NexusTarget, self)._
> > +
> > + def deploy_
> > + sdir = self.scratch_dir
> > +
> > + # TODO it seems boot, system and userdata are usually .tar.gz files,
> > + # and I am currently assuming they are .img and flashing them directly
>
> Would be good to talk to the android team about what to do here I guess.
OK, will do it.
> > + boot = download_
> > + # FIXME uncomment these two - skipping t...
- 479. By Antonio Terceiro
-
merge from trunk
- 480. By Antonio Terceiro
-
merge recent trunk updates
- 481. By Antonio Terceiro
-
recent trunk changes
- 482. By Antonio Terceiro
-
no need to erase partitions just before they are reflashed
- 483. By Antonio Terceiro
-
only accepts .img files. that's all the android team need.
- 484. By Antonio Terceiro
-
trunk updates
- 485. By Antonio Terceiro
-
trunk updates
- 486. By Antonio Terceiro
-
Implement get_device_version
- 487. By Antonio Terceiro
-
implement file_system() API
With this I got lava-test-shell pretty much working. I still need to do more
tests, though. - 488. By Antonio Terceiro
-
oops - previously commented code had a syntax error
- 489. By Antonio Terceiro
-
oops, another embarassing bug
- 490. By Antonio Terceiro
-
missing import statement
- 491. By Antonio Terceiro
-
fix example config
- 492. By Antonio Terceiro
-
sanitize terminfo hack
- 493. By Antonio Terceiro
-
Fixes trying to make lava-test-shell work on the Nexus
exec > /dev/console in special does not really help because we only have `adb
shell` and not access to an actual console. - 494. By Antonio Terceiro
-
Need to mark make_filesystem
_readwrite as a context manager - 495. By Antonio Terceiro
-
AOSP does not have `tee` :-/
- 496. By Antonio Terceiro
-
turn the device on if it's not already.
This makes it possible to use lava_test_shell the way it is supposed to (i.e. not requiring to explicitly run boot_linaro*_image before).
- 497. By Antonio Terceiro
-
Chenges to make lava-test-runner run on the nexus
- 498. By Antonio Terceiro
-
oops, forgot to actually echo the line to stdout
- 499. By Antonio Terceiro
-
trunk updates
- 500. By Antonio Terceiro
-
Also remove `sleep 15` from lava-test-
runner- ubuntu - 501. By Antonio Terceiro
-
mark pending work
- 502. By Antonio Terceiro
-
use shell builtin type instead of which
which is not present in AOSP
- 503. By Antonio Terceiro
-
Install custom-made mkfifo binary
- 504. By Antonio Terceiro
-
Fix lava_test_shell bin directory location
- 505. By Antonio Terceiro
-
Log commands run on host when in debug mode
- 506. By Antonio Terceiro
-
Do not send output to /dev/console
- 507. By Antonio Terceiro
-
file_system already implemented
- 508. By Antonio Terceiro
-
Remove `-t N` from read calls.
BTW I've just found out that `read -t N < FIFO` does not work at all.
- 509. By Antonio Terceiro
-
Do not expect that `read -t` will ever work
- 510. By Antonio Terceiro
-
trunk updates
- 511. By Antonio Terceiro
-
trunk updates
- 512. By Antonio Terceiro
-
Run lava-test-runner in the background; drop mkfifo binary
- 513. By Antonio Terceiro
-
sync with trunk
- 514. By Antonio Terceiro
-
remove /etc/ cleanup hack and do not ignore unexisting directory when pulling (create it before pulling instead)
- 515. By Antonio Terceiro
-
more lava-test-runner stdin usage fixes
- 516. By Antonio Terceiro
-
grrr - fix reference to undefined variable
- 517. By Antonio Terceiro
-
fix argument handling in lava-test-*-attach
- 518. By Antonio Terceiro
-
revert earlier change that broke things.
- 519. By Antonio Terceiro
-
finish fixes for running lava-test-runner in the foreground
- 520. By Antonio Terceiro
-
Extract method
- 521. By Antonio Terceiro
-
Allow overriding the image directory.
This is useful when running the dispatcher inside the VM, but can also support
the use case where the dispatcher is on a machine and the phone is physically
plugged to another. - 522. By Antonio Terceiro
-
sync from trunk
- 523. By Antonio Terceiro
-
using `lava dispatch --target DEVICE` here
- 524. By Antonio Terceiro
-
Get version number from configured adb_command
- 525. By Antonio Terceiro
-
Use the working dir (renamed from image dir) also for pulling data out of the device
- 526. By Antonio Terceiro
-
oops - missed changes to default config
- 527. By Antonio Terceiro
-
merge changes required to make lava-android-test work
- 528. By Antonio Terceiro
-
sync from trunk
- 529. By Antonio Terceiro
-
merge latest lava-android-test changes
- 530. By Antonio Terceiro
-
sync from trunk
- 531. By Antonio Terceiro
-
I don't believe that extract_tarball and get_test_
data_attachment will be useful - 532. By Antonio Terceiro
-
sync from trunk
- 533. By Antonio Terceiro
-
Replay fix done in the lava-test-
shell-nexus- aosp branch - 534. By Antonio Terceiro
-
sync from better command line handling branch
- 535. By Antonio Terceiro
-
merge wait-for-prompt branch for testing
- 536. By Antonio Terceiro
-
sync from trunk
- 537. By Antonio Terceiro
-
power_off is not viable
- 538. By Antonio Terceiro
-
Extract Methods
- 539. By Antonio Terceiro
-
Missed reference to reboot method
- 540. By Antonio Terceiro
-
No crazy stuff, I guess
All of the required fixes were merged into trunk before
- 541. By Antonio Terceiro
-
Separate all required API methods from private implementation methods
private methods marked with _ and moved to below the public API
- 542. By Antonio Terceiro
-
Require deploy before power_on()
- 543. By Antonio Terceiro
-
sync from trunk
- 544. By Antonio Terceiro
-
remove spaces around = in keyword argument
- 545. By Antonio Terceiro
-
minor changes to doc
- 546. By Antonio Terceiro
-
Clarify intent of some methods
- 547. By Antonio Terceiro
-
address more review comments
- removed sudo from config file. I assume the user running the dispatcher has
the proper permissions
- removed _make_filesystem_readwrite - not needed anymore
- implemented fastboot detection
- added timeout to all calls. Default: 10 minutes - 548. By Antonio Terceiro
-
Name revealling intention: s/_powered_
on/_booted/ - 549. By Antonio Terceiro
-
Add some debug logging
- 550. By Antonio Terceiro
-
Better explanation for nexus_working_
directory
Unmerged revisions
Preview Diff
1 | === modified file 'lava_dispatcher/config.py' | |||
2 | --- lava_dispatcher/config.py 2013-01-10 21:37:58 +0000 | |||
3 | +++ lava_dispatcher/config.py 2013-01-15 18:36:22 +0000 | |||
4 | @@ -91,6 +91,9 @@ | |||
5 | 91 | arm_probe_config = schema.StringOption(default='/usr/local/etc/arm-probe-config') | 91 | arm_probe_config = schema.StringOption(default='/usr/local/etc/arm-probe-config') |
6 | 92 | arm_probe_channels = schema.ListOption(default=['VDD_VCORE1']) | 92 | arm_probe_channels = schema.ListOption(default=['VDD_VCORE1']) |
7 | 93 | 93 | ||
8 | 94 | adb_command = schema.StringOption() | ||
9 | 95 | fastboot_command = schema.StringOption() | ||
10 | 96 | nexus_working_directory = schema.StringOption(default = None) | ||
11 | 94 | 97 | ||
12 | 95 | class OptionDescriptor(object): | 98 | class OptionDescriptor(object): |
13 | 96 | def __init__(self, name): | 99 | def __init__(self, name): |
14 | 97 | 100 | ||
15 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/nexus.conf' | |||
16 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/nexus.conf 1970-01-01 00:00:00 +0000 | |||
17 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/nexus.conf 2013-01-15 18:36:22 +0000 | |||
18 | @@ -0,0 +1,40 @@ | |||
19 | 1 | client_type = nexus | ||
20 | 2 | |||
21 | 3 | # The ADB command line. | ||
22 | 4 | # | ||
23 | 5 | # In the case where there are more than one android devices plugged into a | ||
24 | 6 | # single host, this connection command must be overriden on each device to | ||
25 | 7 | # include the serial number of the device, e.g. | ||
26 | 8 | # | ||
27 | 9 | # serial_number = XXXXXXXXXXXXXXXX | ||
28 | 10 | # adb_command = adb -s %(serial_number)s | ||
29 | 11 | adb_command = adb | ||
30 | 12 | |||
31 | 13 | # The fastboot command. | ||
32 | 14 | # | ||
33 | 15 | # The same as above: if you have more than one device, you will want to | ||
34 | 16 | # override this in your device config to add a serial number, e.g. | ||
35 | 17 | # | ||
36 | 18 | # serial_number = XXXXXXXXXXXXXXXX | ||
37 | 19 | # fastboot_command = sudo fastboot -s %(serial_number)s | ||
38 | 20 | # | ||
39 | 21 | # Of course, in the case you override both adb_command *and* fastboot_command, | ||
40 | 22 | # you don't need to specify `serial_number` twice. | ||
41 | 23 | fastboot_command = sudo fastboot | ||
42 | 24 | |||
43 | 25 | # Working directory for temporary. By default, the usual place for LAVA images | ||
44 | 26 | # will be used. | ||
45 | 27 | # | ||
46 | 28 | # This is useful when the lava dispatcher is controlling Nexus phones that are | ||
47 | 29 | # physically plugged to other machines. In this case, you should set | ||
48 | 30 | # nexus_work_directory to a shared directory between the machine running the | ||
49 | 31 | # dispatcher and the machine where the phone is plugged. | ||
50 | 32 | # | ||
51 | 33 | # OBS: this shared directory must have the same path in both machines. | ||
52 | 34 | nexus_working_directory = | ||
53 | 35 | |||
54 | 36 | connection_command = %(adb_command)s shell | ||
55 | 37 | |||
56 | 38 | enable_network_after_boot_android = false | ||
57 | 39 | android_adb_over_usb = true | ||
58 | 40 | android_adb_over_tcp = false | ||
59 | 0 | 41 | ||
60 | === added file 'lava_dispatcher/device/nexus.py' | |||
61 | --- lava_dispatcher/device/nexus.py 1970-01-01 00:00:00 +0000 | |||
62 | +++ lava_dispatcher/device/nexus.py 2013-01-15 18:36:22 +0000 | |||
63 | @@ -0,0 +1,168 @@ | |||
64 | 1 | # Copyright (C) 2012 Linaro Limited | ||
65 | 2 | # | ||
66 | 3 | # Author: Antonio Terceiro <antonio.terceiro@linaro.org> | ||
67 | 4 | # | ||
68 | 5 | # This file is part of LAVA Dispatcher. | ||
69 | 6 | # | ||
70 | 7 | # LAVA Dispatcher is free software; you can redistribute it and/or modify | ||
71 | 8 | # it under the terms of the GNU General Public License as published by | ||
72 | 9 | # the Free Software Foundation; either version 2 of the License, or | ||
73 | 10 | # (at your option) any later version. | ||
74 | 11 | # | ||
75 | 12 | # LAVA Dispatcher is distributed in the hope that it will be useful, | ||
76 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
77 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
78 | 15 | # GNU General Public License for more details. | ||
79 | 16 | # | ||
80 | 17 | # You should have received a copy of the GNU General Public License | ||
81 | 18 | # along | ||
82 | 19 | # with this program; if not, see <http://www.gnu.org/licenses>. | ||
83 | 20 | |||
84 | 21 | import subprocess | ||
85 | 22 | import pexpect | ||
86 | 23 | from time import sleep | ||
87 | 24 | import logging | ||
88 | 25 | import contextlib | ||
89 | 26 | |||
90 | 27 | from lava_dispatcher.device.target import ( | ||
91 | 28 | Target | ||
92 | 29 | ) | ||
93 | 30 | from lava_dispatcher.downloader import ( | ||
94 | 31 | download_image | ||
95 | 32 | ) | ||
96 | 33 | from lava_dispatcher.utils import ( | ||
97 | 34 | logging_spawn, | ||
98 | 35 | mkdtemp | ||
99 | 36 | ) | ||
100 | 37 | |||
101 | 38 | class NexusTarget(Target): | ||
102 | 39 | |||
103 | 40 | def __init__(self, context, config): | ||
104 | 41 | super(NexusTarget, self).__init__(context, config) | ||
105 | 42 | self._powered_on = False | ||
106 | 43 | self._working_dir = None | ||
107 | 44 | |||
108 | 45 | def deploy_android(self, boot, system, userdata): | ||
109 | 46 | |||
110 | 47 | boot = self._get_image(boot) | ||
111 | 48 | system = self._get_image(system) | ||
112 | 49 | userdata = self._get_image(userdata) | ||
113 | 50 | |||
114 | 51 | self.reboot_os() | ||
115 | 52 | |||
116 | 53 | self.fastboot('erase boot') | ||
117 | 54 | |||
118 | 55 | self.fastboot('flash system %s' % system) | ||
119 | 56 | self.fastboot('flash userdata %s' % userdata) | ||
120 | 57 | |||
121 | 58 | self.deployment_data = Target.android_deployment_data | ||
122 | 59 | self.deployment_data['boot_image'] = boot | ||
123 | 60 | |||
124 | 61 | def power_on(self): | ||
125 | 62 | self.reboot_os() | ||
126 | 63 | self.reboot_bootloader() | ||
127 | 64 | self.boot_test_image() | ||
128 | 65 | |||
129 | 66 | self._powered_on = True | ||
130 | 67 | proc = self.adb('shell', spawn = True) | ||
131 | 68 | proc.sendline("") # required to put the adb shell in a reasonable state | ||
132 | 69 | proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1']) | ||
133 | 70 | self._runner = self._get_runner(proc) | ||
134 | 71 | |||
135 | 72 | return proc | ||
136 | 73 | |||
137 | 74 | def reboot_os(self): | ||
138 | 75 | # tell android to reboot. A failure probably means that the device is not | ||
139 | 76 | # booted on android, and we ignore that. | ||
140 | 77 | self.adb('reboot', ignore_failure = True) | ||
141 | 78 | sleep(10) | ||
142 | 79 | |||
143 | 80 | def reboot_bootloader(self): | ||
144 | 81 | self.fastboot('reboot') | ||
145 | 82 | sleep(10) | ||
146 | 83 | |||
147 | 84 | def boot_test_image(self): | ||
148 | 85 | self.fastboot('boot %s' % self.deployment_data['boot_image']) | ||
149 | 86 | self.adb('wait-for-device') | ||
150 | 87 | |||
151 | 88 | def power_off(self, proc): | ||
152 | 89 | # there is no way to power off the Nexus while USB is plugged on; even | ||
153 | 90 | # if you remove power, it will stay on. | ||
154 | 91 | pass | ||
155 | 92 | |||
156 | 93 | @contextlib.contextmanager | ||
157 | 94 | def file_system(self, partition, directory): | ||
158 | 95 | |||
159 | 96 | if not self._powered_on: | ||
160 | 97 | self.power_on() | ||
161 | 98 | |||
162 | 99 | mount_point = self.get_partition_mount_point(partition) | ||
163 | 100 | |||
164 | 101 | with self.make_filesystem_readwrite(mount_point): | ||
165 | 102 | host_dir = '%s/mnt/%s' % (self.working_dir, directory) | ||
166 | 103 | target_dir = '%s/%s' % (mount_point, directory) | ||
167 | 104 | |||
168 | 105 | subprocess.check_call(['mkdir', '-p', host_dir]) | ||
169 | 106 | self.adb('pull %s %s' % (target_dir, host_dir), ignore_failure = True) | ||
170 | 107 | |||
171 | 108 | yield host_dir | ||
172 | 109 | |||
173 | 110 | self.adb('push %s %s' % (host_dir, target_dir)) | ||
174 | 111 | |||
175 | 112 | def get_partition_mount_point(self, partition): | ||
176 | 113 | lookup = { | ||
177 | 114 | self.config.data_part_android_org: '/data', | ||
178 | 115 | self.config.sys_part_android_org: '/system', | ||
179 | 116 | } | ||
180 | 117 | return lookup[partition] | ||
181 | 118 | |||
182 | 119 | @contextlib.contextmanager | ||
183 | 120 | def make_filesystem_readwrite(self, mount_point): | ||
184 | 121 | if mount_point == '/system': | ||
185 | 122 | self._runner.run("mount -o remount,rw %s" % mount_point) | ||
186 | 123 | yield | ||
187 | 124 | if mount_point == '/system': | ||
188 | 125 | self._runner.run("mount -o remount,ro %s" % mount_point) | ||
189 | 126 | |||
190 | 127 | def get_device_version(self): | ||
191 | 128 | # this is tricky, because fastboot does not have a visible version | ||
192 | 129 | # number. For now let's use just the adb version number. | ||
193 | 130 | return subprocess.check_output( | ||
194 | 131 | "%s version | sed 's/.* version //'" % self.config.adb_command, | ||
195 | 132 | shell = True | ||
196 | 133 | ).strip() | ||
197 | 134 | |||
198 | 135 | def adb(self, args, ignore_failure = False, spawn = False): | ||
199 | 136 | cmd = self.config.adb_command + ' ' + args | ||
200 | 137 | if spawn: | ||
201 | 138 | return logging_spawn(cmd, timeout = 60) | ||
202 | 139 | else: | ||
203 | 140 | self._call(cmd, ignore_failure) | ||
204 | 141 | |||
205 | 142 | def fastboot(self, args, ignore_failure = False): | ||
206 | 143 | self._call(self.config.fastboot_command + ' ' + args, ignore_failure) | ||
207 | 144 | |||
208 | 145 | def _call(self, cmd, ignore_failure): | ||
209 | 146 | logging.debug("Running on the host: %s" % cmd) | ||
210 | 147 | if ignore_failure: | ||
211 | 148 | subprocess.call(cmd, shell = True) | ||
212 | 149 | else: | ||
213 | 150 | subprocess.check_call(cmd, shell = True) | ||
214 | 151 | |||
215 | 152 | def _get_image(self, url): | ||
216 | 153 | sdir = self.working_dir | ||
217 | 154 | image = download_image(url, self.context, sdir, decompress=False) | ||
218 | 155 | return image | ||
219 | 156 | |||
220 | 157 | @property | ||
221 | 158 | def working_dir(self): | ||
222 | 159 | if (self.config.nexus_working_directory is None or | ||
223 | 160 | self.config.nexus_working_directory.strip() == ''): | ||
224 | 161 | return self.scratch_dir | ||
225 | 162 | |||
226 | 163 | if self._working_dir is None: | ||
227 | 164 | self._working_dir = mkdtemp(self.config.nexus_working_directory) | ||
228 | 165 | return self._working_dir | ||
229 | 166 | |||
230 | 167 | |||
231 | 168 | target_class = NexusTarget |
Antonio Terceiro <email address hidden> writes:
> Antonio Terceiro has proposed merging lp:~terceiro/lava-dispatcher/nexus into lp:lava-dispatcher. /code.launchpad .net/~terceiro/ lava-dispatcher /nexus/ +merge/ 136807 /device/ nexus.py. ;-)
>
> Requested reviews:
> Linaro Validation Team (linaro-validation)
>
> For more details, see:
> https:/
>
> This is work in progress; you will note the number of FIXME's and TODO's in lava_dispatcher
This looks pretty good on the whole!
> With the current state, I can already run a full boot test job, like the one in the commit message of rev 475: bazaar. launchpad. net/~terceiro/ lava-dispatcher /nexus/ revision/ 475
>
> http://
>
> It would be nice to receive comments about the changes that were needed to other files outside of the Nexus implementation itself.
I think they mostly seem reasonable. I'd be happy to see them merged
without the nexus bits if that would make your life easier.
> === added file 'lava_dispatche r/device/ nexus.py' /device/ nexus.py 1970-01-01 00:00:00 +0000 /device/ nexus.py 2012-11-28 22:45:26 +0000 www.gnu. org/licenses>. .device. target import ( .downloader import ( .utils import ( Target) : _init__ (context, config) android( self, boot, system, userdata):
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -0,0 +1,106 @@
> +# 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://
> +
> +import subprocess
> +import pexpect
> +from time import sleep
> +from lava_dispatcher
> + Target
> +)
> +from lava_dispatcher
> + download_image
> +)
> +from lava_dispatcher
> + logging_spawn
> +)
> +
> +class NexusTarget(
> +
> + def __init__(self, context, config):
> + super(NexusTarget, self)._
> +
> + def deploy_
> + sdir = self.scratch_dir
> +
> + # TODO it seems boot, system and userdata are usually .tar.gz files,
> + # and I am currently assuming they are .img and flashing them directly
Would be good to talk to the android team about what to do here I guess.
> + boot = download_ image(boot, self.context, sdir, decompress=False) image(system, self.context, sdir, decompress=False) image(userdata, self.context, sdir, decompress=False) ['erase' , 'boot'])
> + # FIXME uncomment these two - skipping them makes testing faster
> + #system = download_
> + #userdata = download_
> +
> + self.reboot()
> + sleep(10)
> +
> + self.fastboot(
> + # FIXME uncomment these two - skipp...