[autotest] Do not allow unicode control files.
Our system does not properly handle non-ascii characters. Therefore,
rather than having the scheduler explode somewhere down the line, let's
just explicitly disallow control files that contain unicode characters.
BUG=chromium-os:39337
TEST=local run_suite
Change-Id: Id2dcee75087803f1bd4236872f75e71039ae034b
Reviewed-on: https://gerrit.chromium.org/gerrit/44401
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index 40447dd..0aef296 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -66,6 +66,12 @@
if not control_file_in:
raise error.ControlFileEmpty(
"Fetching %s returned no data." % suite_name)
+ # Force control files to only contain ascii characters.
+ try:
+ control_file_in.encode('ascii')
+ except UnicodeDecodeError as e:
+ raise error.ControlFileMalformed(str(e))
+
return control_file_in