summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2012-05-25 04:55:05 (GMT)
committerGerrit <chrome-bot@google.com>2012-05-25 08:46:14 (GMT)
commite7daa06d6c1eddd681e96bcb0c5ba77840bec67e (patch)
treedd24e5c3b6cb314d0f3c258237406c2aaeebd261
parent20bc58b99104a6250a775e9e86e3912fc6f7cb5f (diff)
downloadautotest-e7daa06d6c1eddd681e96bcb0c5ba77840bec67e.tar.gz
autotest-e7daa06d6c1eddd681e96bcb0c5ba77840bec67e.tar.xz
factory_VPD: Allow assigning individual task to run.
Cherry-picked: https://gerrit.chromium.org/gerrit/23613 When overriding VPD values, or when designing factory flow, it is possible that partner want to hard-code fixed VPD values (ex, region), and still able to input volatile values (ex, serial number). To support that, add a new "task_list" param to specify which task to perform. BUG=none TEST=Manually verified factory_VPD in factory UI. Change-Id: I2889b3e8f6feb0fc84a5854f7b2851020e191f3d Reviewed-on: https://gerrit.chromium.org/gerrit/23626 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jon Salz <jsalz@chromium.org>
-rw-r--r--client/site_tests/factory_VPD/factory_VPD.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/site_tests/factory_VPD/factory_VPD.py b/client/site_tests/factory_VPD/factory_VPD.py
index 9196a4f..040343f 100644
--- a/client/site_tests/factory_VPD/factory_VPD.py
+++ b/client/site_tests/factory_VPD/factory_VPD.py
@@ -78,7 +78,11 @@ class ShopFloorVpdTask(task.FactoryTask):
class factory_VPD(test.test):
version = 5
- def run_once(self, override_vpd=None):
+ SERIAL_TASK_NAME = 'serial'
+ REGION_TASK_NAME = 'region'
+
+ def run_once(self, override_vpd=None,
+ task_list=[SERIAL_TASK_NAME, REGION_TASK_NAME]):
factory.log('%s run_once' % self.__class__)
self.tasks = []
self.vpd = override_vpd or {'ro': {}, 'rw': {}}
@@ -87,8 +91,10 @@ class factory_VPD(test.test):
if shopfloor.is_enabled():
self.tasks += [ShopFloorVpdTask(self.vpd)]
else:
- self.tasks += [serial_task.SerialNumberTask(self.vpd),
- region_task.SelectRegionTask(self.vpd)]
+ if self.SERIAL_TASK_NAME in task_list:
+ self.tasks += [serial_task.SerialNumberTask(self.vpd)]
+ if self.REGION_TASK_NAME in task_list:
+ self.tasks += [region_task.SelectRegionTask(self.vpd)]
self.tasks += [WriteVpdTask(self.vpd)]
task.run_factory_tasks(self.job, self.tasks)