Add support for an --image flag to atest.
This enables creating jobs from the CLI that use autoserv to install a new OS image before running the requested test.
This was not added to the database like the reboot before/reboot after flags to maintain backward compatibility and avoid any changes to the database schema.
Also it is not working as a pure parameterized job as the current implementation is not 100% complete and would require more work to finish. And since mixed jobs are not allowed it would also mean moving existing control file jobs to parameterized jobs.
So the implementation of adding a parameterized id to control jobs and using a known test to hold the OS image path is the most straight forward of the options.
Change-Id: I77cdda0c50c222a4c594da2626a71fa55f5957cb
BUG=chromium-os:11486
TEST=Manual testing using atest cli to create jobs with --image parameters and verifying the value is passed to autoserv.
Review URL: http://codereview.chromium.org/6181003
diff --git a/frontend/afe/model_logic.py b/frontend/afe/model_logic.py
index 0ddcefe..d7b553d 100644
--- a/frontend/afe/model_logic.py
+++ b/frontend/afe/model_logic.py
@@ -677,7 +677,9 @@
dest_obj = field_obj.rel.to.smart_get(data[field_name],
valid_only=False)
if to_human_readable:
- if dest_obj.name_field is not None:
+ # parameterized_jobs do not have a name_field
+ if (field_name != 'parameterized_job' and
+ dest_obj.name_field is not None):
data[field_name] = getattr(dest_obj,
dest_obj.name_field)
else: