Fixed bug with flashing different devices in testbed
Testbeds were not able to flash different devices in
a single testbed. The code would always use the first
build image rather than the correct one for the device.
BUG=b:33662054
TEST=None
Change-Id: Ibc54e3b0ff7bc053f80006fb5488b36b1d1f11f6
Reviewed-on: https://chromium-review.googlesource.com/421047
Commit-Ready: Benjamin Peake <bpeake@chromium.org>
Tested-by: Benjamin Peake <bpeake@chromium.org>
Reviewed-by: Tom Turney <tturney@google.com>
diff --git a/server/hosts/testbed.py b/server/hosts/testbed.py
index 66b6fcc..a4bd04a 100644
--- a/server/hosts/testbed.py
+++ b/server/hosts/testbed.py
@@ -357,14 +357,16 @@
logging.info('Installing build %s on DUT with serial %s.',
build, serial)
host = self.get_adb_devices()[serial]
- if not build_url:
- build_url, _ = host.stage_build_for_install(build)
+ if build_url:
+ device_build_url = build_url
+ else:
+ device_build_url, _ = host.stage_build_for_install(build)
arguments.append({'host': host,
- 'build_url': build_url,
+ 'build_url': device_build_url,
'build_local_path': build_local_path})
attribute_name = '%s_%s' % (constants.JOB_REPO_URL,
host.adb_serial)
- host_attributes[attribute_name] = build_url
+ host_attributes[attribute_name] = device_build_url
thread_pool = pool.ThreadPool(_POOL_SIZE)
thread_pool.map(self._install_device, arguments)