[autotest] Support run_suite with suite package and SSP for Brillo.
This change allows one to run run_suite command without using
--run_prod_code for Brillo build.
create_suite_job will use test_suites and control_files packages from
the Brillo build to create suite job and its test jobs.
Server-side packaging is also supported for newer builds that have
autotest_server_package artifact build.
BUG=chromium:584705
TEST=run in local instance, unittest, verify in moblab
Change-Id: Ia96ca4de919b178302580c23f911bb6445016285
Reviewed-on: https://chromium-review.googlesource.com/332431
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/server/cros/dynamic_suite/tools.py b/server/cros/dynamic_suite/tools.py
index 6fd5fe6..11507ae 100644
--- a/server/cros/dynamic_suite/tools.py
+++ b/server/cros/dynamic_suite/tools.py
@@ -40,9 +40,17 @@
return _CONFIG.get_config_value('CROS', 'infrastructure_user', type=str)
-def package_url_pattern():
- """Returns package_url_pattern from global_config."""
- return _CONFIG.get_config_value('CROS', 'package_url_pattern', type=str)
+def package_url_pattern(is_launch_control_build=False):
+ """Returns package_url_pattern from global_config.
+
+ @param is_launch_control_build: True if the package url is for Launch
+ Control build. Default is False.
+ """
+ if is_launch_control_build:
+ return _CONFIG.get_config_value('ANDROID', 'package_url_pattern',
+ type=str)
+ else:
+ return _CONFIG.get_config_value('CROS', 'package_url_pattern', type=str)
def try_job_timeout_mins():
@@ -62,14 +70,17 @@
return package_url_pattern() % (devserver_url, build)
-def get_devserver_build_from_package_url(package_url):
+def get_devserver_build_from_package_url(package_url,
+ is_launch_control_build=False):
"""The inverse method of get_package_url.
@param package_url: a string specifying the package url.
+ @param is_launch_control_build: True if the package url is for Launch
+ Control build. Default is False.
@return tuple containing the devserver_url, build.
"""
- pattern = package_url_pattern()
+ pattern = package_url_pattern(is_launch_control_build)
re_pattern = pattern.replace('%s', '(\S+)')
devserver_build_tuple = re.search(re_pattern, package_url).groups()