aboutsummaryrefslogtreecommitdiff
path: root/crosperf/label.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2014-01-30 15:52:37 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-20 20:09:43 +0000
commit0cc4e7790afbd514675801a1ffb90517c147270f (patch)
tree15374d6431f100ad1487f1eb1746c89afdd7434a /crosperf/label.py
parentfd0b178bef64de689ce86c3cc471daa219bf601f (diff)
downloadtoolchain-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/label.py')
-rw-r--r--crosperf/label.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/crosperf/label.py b/crosperf/label.py
index 61698653..c212125b 100644
--- a/crosperf/label.py
+++ b/crosperf/label.py
@@ -14,9 +14,13 @@ from utils import misc
class Label(object):
def __init__(self, name, chromeos_image, chromeos_root, board, remote,
image_args, image_md5sum, cache_dir, chrome_src=None):
+
+ self.image_type = self._GetImageType(chromeos_image)
+
# Expand ~
chromeos_root = os.path.expanduser(chromeos_root)
- chromeos_image = os.path.expanduser(chromeos_image)
+ if self.image_type == "local":
+ chromeos_image = os.path.expanduser(chromeos_image)
self.name = name
self.chromeos_image = chromeos_image
@@ -27,7 +31,8 @@ class Label(object):
self.cache_dir = cache_dir
if not chromeos_root:
- chromeos_root = FileUtils().ChromeOSRootFromImage(chromeos_image)
+ if self.image_type == "local":
+ chromeos_root = FileUtils().ChromeOSRootFromImage(chromeos_image)
if not chromeos_root:
raise Exception("No ChromeOS root given for label '%s' and could not "
"determine one from image path: '%s'." %
@@ -52,6 +57,15 @@ class Label(object):
% (name, chrome_src))
self.chrome_src = chromeos_src
+ def _GetImageType(self, chromeos_image):
+ image_type = None
+ if chromeos_image.find("xbuddy://") < 0:
+ image_type = "local"
+ elif chromeos_image.find("trybot") >= 0:
+ image_type = "trybot"
+ else:
+ image_type = "official"
+ return image_type
class MockLabel(object):
def __init__(self, name, chromeos_image, chromeos_root, board, remote,
@@ -67,3 +81,4 @@ class MockLabel(object):
self.chromeos_root = chromeos_root
self.image_args = image_args
self.image_md5sum = image_md5sum
+ self.chrome_src = chrome_src