[autotest] Support scheduling Launch Control builds from suite scheduler.

This change adds the support of scheduling Launch Control builds from
suite scheduler.

For task defined like:
[brollo_test]
run_on: nightly
hour: 17
suite: dummy
os_type: brillo
branches: git_mnc-brillo-dev
targets: dragonboard-userdebug
pool: suites

Suite scheduler will try to schedule the latest build as of
git_mnc-brillo-dev/dragonboard-userdebug/LATEST
for dragonbard daily at 5PM, to run a duts in suites pool.

BUG=chromium:585628
TEST=unittest, local suite scheduler run:
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
  -d /usr/local/autotest/logs -f /usr/local/autotest/ss_test.ini  \
  -e nightly -i git_mnc-brillo-dev/dragonboard-userdebug/2636090  \
  -r /tmp/_autotmp_0pjXWQ_suite_scheduler -o brillo

Also test existing cros build can be scheduled:
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
  -d /usr/local/autotest/logs -f /usr/local/autotest/ss_test.ini  \
  -e nightly  -i veyron_jerry-release/R49-7834.3.0  \
  -r /tmp/_autotmp_0pjXWQ_suite_scheduler

Change-Id: I6dc8ecb95ff0d353a1e8a96f98183945216f9a50
Reviewed-on: https://chromium-review.googlesource.com/329362
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index 821fcf4..01fb48e 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -205,9 +205,11 @@
     if provision.FW_RO_VERSION_PREFIX in builds:
         raise error.SuiteArgumentException(
                 'Updating RO firmware is not supported yet.')
-    # Default test source build to CrOS build if it's not specified.
-    test_source_build = Suite.get_test_source_build(
-            builds, test_source_build=test_source_build)
+    # Default test source build to CrOS build if it's not specified and
+    # run_prod_code is set to False.
+    if not run_prod_code:
+        test_source_build = Suite.get_test_source_build(
+                builds, test_source_build=test_source_build)
 
     suite_name = canonicalize_suite_name(name)
     if run_prod_code:
@@ -228,7 +230,12 @@
                                                           ds, suite_name)
     # Do not change this naming convention without updating
     # site_utils.parse_job_name.
-    name = '%s-%s' % (test_source_build, suite_name)
+    if not run_prod_code:
+        name = '%s-%s' % (test_source_build, suite_name)
+    else:
+        # If run_prod_code is True, test_source_build is not set, use the
+        # first build in the builds list for the sutie job name.
+        name = '%s-%s' % (builds.values()[0], suite_name)
 
     timeout_mins = timeout_mins or timeout * 60
     max_runtime_mins = max_runtime_mins or timeout * 60