Teach the devserver to get control files for a specific suite.
Today the devserver is only capable of fecthing a list of
all control files. This cl adds a method that consults
a suite->control file map generated at build time, and returns
a list of control files for a specific suite.
BUG=chromium:252398, chromium:260980
TEST=Ran a suite with several control files and confirmed
that the tests are parsed in the same way as they were
when all control files were returned. Confirmed the
fallback path of just fetching all control files when
a suite not in the suite->control file map is specified.
CQ-DEPEND=CL:I5b42044c3e8242643e6576f96e0a7f98d4b96884
Change-Id: I6b590c8c40a863e6744875a26ac228ffd4dd8794
Reviewed-on: https://gerrit.chromium.org/gerrit/61623
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Tested-by: Prashanth Balasubramanian <beeps@chromium.org>
diff --git a/devserver.py b/devserver.py
index b8c3024..0e592ef 100755
--- a/devserver.py
+++ b/devserver.py
@@ -102,6 +102,7 @@
Returns:
number of white space chars before characters start.
"""
+ # pylint: disable=W1401
matched = re.match('^\s+', string)
if matched:
return len(matched.group())
@@ -646,7 +647,9 @@
Example URL:
To List all control files:
- http://dev-server/controlfiles?board=x86-alex-release&build=R18-1514.0.0
+ http://dev-server/controlfiles?suite_name=&build=daisy_spring-release/R29-4279.0.0
+ To List all control files for, say, the bvt suite:
+ http://dev-server/controlfiles?suite_name=bvt&build=daisy_spring-release/R29-4279.0.0
To return the contents of a path:
http://dev-server/controlfiles?board=x86-alex-release&build=R18-1514.0.0&control_path=client/sleeptest/control
@@ -655,6 +658,10 @@
control_path: If you want the contents of a control file set this
to the path. E.g. client/site_tests/sleeptest/control
Optional, if not provided return a list of control files is returned.
+ suite_name: If control_path is not specified but a suite_name is
+ specified, list the control files belonging to that suite instead of
+ all control files. The empty string for suite_name will list all control
+ files for the build.
Returns:
Contents of a control file if control_path is provided.
A list of control files if no control_path is provided.
@@ -667,8 +674,12 @@
'Error: build= is required!')
if 'control_path' not in params:
- return common_util.GetControlFileList(
- updater.static_dir, params['build'])
+ if 'suite_name' in params and params['suite_name']:
+ return common_util.GetControlFileListForSuite(
+ updater.static_dir, params['build'], params['suite_name'])
+ else:
+ return common_util.GetControlFileList(
+ updater.static_dir, params['build'])
else:
return common_util.GetControlFile(
updater.static_dir, params['build'], params['control_path'])