Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: client/site_tests/hardware_Components/hardware_Components.py

Issue 3270012: factory_WriteGBB and hardware_Components support locating file using HWID. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: fix tab Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/factory_WriteGBB/factory_WriteGBB.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/hardware_Components/hardware_Components.py
diff --git a/client/site_tests/hardware_Components/hardware_Components.py b/client/site_tests/hardware_Components/hardware_Components.py
index 68d6bad3d395c5d78be1ce6bcb922621dabc8070..ca42b3feecaf75ab1ce5855033668f8faba8ead0 100644
--- a/client/site_tests/hardware_Components/hardware_Components.py
+++ b/client/site_tests/hardware_Components/hardware_Components.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import glob, hashlib, logging, os, pprint, re, sys
+from autotest_lib.client.bin import factory
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
from autotest_lib.client.common_lib import flashrom_util
@@ -297,11 +298,18 @@ class hardware_Components(test.test):
self._pp = pprint.PrettyPrinter()
- def run_once(self, approved_dbs='approved_components', ignored_cids=[]):
+ def run_once(self, approved_dbs='approved_components', ignored_cids=[],
+ shared_dict={}):
self._ignored = ignored_cids
all_failures = ''
os.chdir(self.bindir)
+ # If found the HwQual ID in shared_dict, use the list with the same ID.
+ if 'part_id_hwqual' in shared_dict:
+ id = shared_dict['part_id_hwqual']
+ id = id.rpartition(' ')[0].replace(' ', '_')
+ approved_dbs = 'qualified_components*%s' % id
+
# approved_dbs supports shell-like filename expansion.
for db in glob.iglob(approved_dbs):
self._system = {}
@@ -334,9 +342,10 @@ class hardware_Components(test.test):
all_failures += 'Approved DB: %s' % db
all_failures += self.pformat(self._failures)
else:
- # If one of DBs is matched, record the hwqual_id and exit.
- self.write_test_keyval(
- {'hwqual_id': self._approved['part_id_hwqual'][0]})
+ # If one of DBs is matched, record some data in shared_dict.
+ cids_need_to_be_record = ['part_id_hwqual']
+ for cid in cids_need_to_be_record:
+ factory.log_shared_data(cid, self._approved[cid][0])
return
raise error.TestFail(all_failures)
« no previous file with comments | « client/site_tests/factory_WriteGBB/factory_WriteGBB.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698