diff options
author | cmtice <cmtice@google.com> | 2014-01-30 15:52:37 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-02-20 20:09:43 +0000 |
commit | 0cc4e7790afbd514675801a1ffb90517c147270f (patch) | |
tree | 15374d6431f100ad1487f1eb1746c89afdd7434a /crosperf/machine_manager.py | |
parent | fd0b178bef64de689ce86c3cc471daa219bf601f (diff) | |
download | toolchain-utils-0cc4e7790afbd514675801a1ffb90517c147270f.tar.gz |
Add 'build' settings option and xbuddy image format.
This patch updates Crosperf to add the 'build' tag in the
experiment file, and to allow that field to contain xbuddy
syntax for using trybot and/or official builds in the test runs.
It also adds a bit more checking to make sure we have everything
necessary for running 'cros flash' before attempting to use it.
BUG=None
TEST=I have run this using an experiment file that compares a local
image, a trybot image and an official image against each other. It
all worked.
Change-Id: Ia896799061508fb5718a3201b1599d8622de0b3f
Reviewed-on: https://chrome-internal-review.googlesource.com/154097
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/machine_manager.py')
-rw-r--r-- | crosperf/machine_manager.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/crosperf/machine_manager.py b/crosperf/machine_manager.py index 282bbc5b..51e10554 100644 --- a/crosperf/machine_manager.py +++ b/crosperf/machine_manager.py @@ -180,8 +180,14 @@ class MachineManager(object): self.chromeos_root = chromeos_root def ImageMachine(self, machine, label): - checksum = ImageChecksummer().Checksum(label) - if machine.checksum == checksum: + if label.image_type == "local": + checksum = ImageChecksummer().Checksum(label) + elif label.image_type == "trybot": + checksum = machine._GetMD5Checksum(label.chromeos_image) + else: + checksum = None + + if checksum and (machine.checksum == checksum): return chromeos_root = label.chromeos_root if not chromeos_root: @@ -271,7 +277,12 @@ class MachineManager(object): % m.name) def AcquireMachine(self, chromeos_image, label): - image_checksum = ImageChecksummer().Checksum(label) + if label.image_type == "local": + image_checksum = ImageChecksummer().Checksum(label) + elif label.image_type == "trybot": + image_checksum = hashlib.md5(chromeos_image).hexdigest() + else: + image_checksum = None machines = self.GetMachines(label) check_interval_time = 120 with self._lock: @@ -305,7 +316,7 @@ class MachineManager(object): ### return None for m in [machine for machine in self.GetAvailableMachines(label) if not machine.locked]: - if m.checksum == image_checksum: + if image_checksum and (m.checksum == image_checksum): m.locked = True m.test_run = threading.current_thread() return m |