Brillo Tier 1 PTS: Initial Script.
Here is the starting point for the Brillo Tier 1 PTS.
Currently it does the following:
* Connects to a MobLab instance.
* Adds the ADB Host to the MobLab host list.
* Stages an update payload (not yet used).
* Launches the Brillo PTS Sequence.
Added the Brillo PTS Sequence. Currently is just runs the
whitelisted Gtests twice.
Updated sequences to support using the local control file
and not the template.
BUG=b:24774860
TEST=Ran against a local moblab, payload is staged and
whitelisted Gtests run twice.
Change-Id: I421d5d9c659ca654494e10cb37456de6fdd9752d
Reviewed-on: https://chromium-review.googlesource.com/304792
Commit-Ready: Simran Basi <[email protected]>
Tested-by: Simran Basi <[email protected]>
Reviewed-by: Simran Basi <[email protected]>
diff --git a/server/sequence.py b/server/sequence.py
index 365f683..5983af5 100644
--- a/server/sequence.py
+++ b/server/sequence.py
@@ -7,10 +7,12 @@
"""
import logging
+import os
import common
from autotest_lib.client.common_lib import control_data
from autotest_lib.server import utils
+from autotest_lib.server.cros.dynamic_suite import control_file_getter
from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
from autotest_lib.site_utils import job_directories
@@ -32,19 +34,24 @@
parallel_simple(run, machines)
"""
- def __init__(self, name, args=None, iteration=1, duration=None):
+ def __init__(self, name, args=None, iteration=1, duration=None,
+ fetch_control_file=False):
"""
Constructor
- @param name: name of the sever test to run.
+ @param name: name of the server test to run.
@param args: arguments needed by the server test.
@param iteration: number of copy of this test to sechudle
@param duration: expected duration of the test (in seconds).
+ @param fetch_control_file: If True, fetch the control file contents
+ from disk. Otherwise uses the template
+ control file.
"""
self._name = name
self._args = args or {}
self._iteration = iteration
self._duration = duration
+ self._fetch_control_file = fetch_control_file
def child_job_name(self, machine, iteration_number):
@@ -81,16 +88,24 @@
def child_control_file(self):
"""
- Populate the template control file.
+ Generate the child job's control file.
- Populate it with the test name and expand the arguments
- list.
+ If not fetching the contents, use the template control file and
+ populate the template control file with the test name and expand the
+ arguments list.
@param test: name of the test to run
@param args: dictionary of argument for this test.
@returns a fully built control file to be use for the child job.
"""
+ if self._fetch_control_file:
+ # TODO (sbasi): Add arg support.
+ cntl_file_getter = control_file_getter.FileSystemGetter(
+ [os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ '..')])
+ return cntl_file_getter.get_control_file_contents_by_name(
+ self._name)
child_args = ['',]
for arg, value in self._args.iteritems():
child_args.append('%s=%s' % (arg, repr(value)))