summaryrefslogtreecommitdiff
path: root/cbuildbot/metadata_lib.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2014-07-25 14:48:50 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-28 07:17:56 +0000
commita95e8538e5cbae05966eb35ab7fc60aecca30602 (patch)
tree4d98b5211e249d53aff7641c56fb9070badfcb9a /cbuildbot/metadata_lib.py
parente2f3eb089c691a965f95390845a4f711a62e79b3 (diff)
downloadchromite-a95e8538e5cbae05966eb35ab7fc60aecca30602.tar.gz
Add code to put the firmware versions in the metadata.
This code works by calling the firmware updater shellball with the -V option which makes it print various version strings and a manifest of its contents. That output is parsed, and the main and EC version strings are extracted. If that file doesn't exist, for instance on boards like x86-generic, then the fields are returned as None. That's then stored in the metadata json. A unit test was added for the version extracting code. BUG=chromium:309687 TEST=Ran run_tests. Ran a butteryfly tryjob and verified that firmware version strings were in the metadata. Ran an x86-generic tryjob and verified that the absence of firmware was reported. Ran an x86-mario and stumpy tryjob. Change-Id: I459456578b79d8032d44b75a6012231a5e1328e2 Reviewed-on: https://chromium-review.googlesource.com/209940 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'cbuildbot/metadata_lib.py')
-rw-r--r--cbuildbot/metadata_lib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cbuildbot/metadata_lib.py b/cbuildbot/metadata_lib.py
index 840779479..c235e953f 100644
--- a/cbuildbot/metadata_lib.py
+++ b/cbuildbot/metadata_lib.py
@@ -131,6 +131,7 @@ class CBuildbotMetadata(object):
# be copied into a normal list.
temp = self._metadata_dict.copy()
temp['cl_actions'] = list(self._cl_action_list)
+
return temp
def GetJSON(self):
@@ -158,6 +159,10 @@ class CBuildbotMetadata(object):
self._cl_action_list.append(cl_action)
return self
+ def SetFirmwareVersions(self, main=None, ec=None):
+ self._metadata_dict['main_fw_version'] = main or 'None'
+ self._metadata_dict['ec_fw_version'] = ec or 'None'
+
@staticmethod
def _ChangeAsSmallDictionary(change):
"""Returns a small dictionary representation of a gerrit change.