[autotest] Add --retry option to run_suite

Pipe the retry configuration ->frontend->suite control files.
This allows us to enable/disable retry for each suite run.

The next step is to update all the suite control files to
pipe 'job_retry' to dynamic suite which will be done in CL:200308

TEST=unittest;
locally run a suite with and without the option, observe
tests were retried/not retried.
1) ./run_suite.py --build trybot-lumpy-release/R37-5858.0.0-b2105
--suite_name dummy --board lumpy --retry=True
2)./run_suite.py --build trybot-lumpy-release/R37-5858.0.0-b2105
--suite_name dummy --board lumpy
BUG=chromium:373929
DEPLOY=apache

Change-Id: I2c8c9caf36fd2132d75bd381e015d0adfddda34f
Reviewed-on: https://chromium-review.googlesource.com/200223
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index aa7c349..1c90778 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -107,7 +107,8 @@
 def create_suite_job(name='', board='', build='', pool='', control_file='',
                      check_hosts=True, num=None, file_bugs=False, timeout=24,
                      timeout_mins=None, priority=priorities.Priority.DEFAULT,
-                     suite_args=None, wait_for_results=True, **kwargs):
+                     suite_args=None, wait_for_results=True, job_retry=False,
+                     **kwargs):
     """
     Create a job to run a test suite on the given device with the given image.
 
@@ -133,6 +134,7 @@
                        determine which tests to run.
     @param wait_for_results: Set to False to run the suite job without waiting
                              for test jobs to finish. Default is True.
+    @param job_retry: Set to True to enable job-level retry. Default is False.
     @param kwargs: extra keyword args. NOT USED.
 
     @raises ControlFileNotFound: if a unique suite control file doesn't exist.
@@ -175,7 +177,8 @@
                    'devserver_url': ds.url(),
                    'priority': priority,
                    'suite_args' : suite_args,
-                   'wait_for_results': wait_for_results
+                   'wait_for_results': wait_for_results,
+                   'job_retry': job_retry
                    }
 
     control_file = tools.inject_vars(inject_dict, control_file)