[autotest]: Run suites from AFE.
* Updated the AFE to allow for suite runs. When an image is provided
the create_job RPC will redirect to the create_suite_job RPC instead.
* Updated create_suite_job to allow for a control_file to be supplied.
create_suite_job will use this control file rather than what the
devserver stages when it creates the suite job.
* Removed the parameterized job code from create_job as it is not used
and broken.
* The create_job page now includes a 'Pool' text box to specify for
these jobs.
BUG=chromium:358579
TEST=Able to launch suite jobs from run_suite and AFE. And regular tests
kicked off via the AFE still work as well. rpc_interface and
site_rpc_interface unittests, suite_scheduler unittests.
DEPLOY=apache,afe,suite_scheduler
Change-Id: I53312419c32740e78fc07598babeb497c162ba81
Reviewed-on: https://chromium-review.googlesource.com/194349
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index 7041cd3..182641b 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -811,3 +811,18 @@
host_objects=host_objects,
metahost_objects=metahost_objects,
atomic_group=atomic_group)
+
+
+def encode_ascii(control_file):
+ """Force a control file to only contain ascii characters.
+
+ @param control_file: Control file to encode.
+
+ @returns the control file in an ascii encoding.
+
+ @raises error.ControlFileMalformed: if encoding fails.
+ """
+ try:
+ return control_file.encode('ascii')
+ except UnicodeDecodeError as e:
+ raise error.ControlFileMalformed(str(e))
\ No newline at end of file