This document describes how to write, update, run, disable, and enumerate tests that are in a Test Suite.
A test suite is a collection of tests, client and server side, that are run on across a particular build to validate a larger system.
Test Suites build on the Autotest control file specification.
In order to create a valid suite the following two requirements need to be met:
We have a mechanism that allows suites of tests to be defined dynamically by a control file at runtime.
The infrastructure finds login_LoginSuccess by matching the contents of the SUITE field in its control file against the suite tag passed into
This section will go over adding, removing, and marking tests as experimental.
Some suites have restrictions when it comes to adding tests to them. To read about the requirements of a particular test suite refer to its suite control under autotest/files/test_suite/control.suite_name.
For example: control.bvt
Add the SUITE="suite_name" to the control file of the test you want to be run in the suite. If this test is new add it as an experimental test first, see below.
To disable a test remove the Suite Name from the SUITE= Tag, if it is the only suite in the SUITE variable remove the entire variable.
You may consider marking a test as experimental to avoid closing of the tree but continue running tests.
Some times you may want to add tests that are experimental to start gathering some data but you do not want the tree to be closed. To do this use the EXPERIMENTAL control file variable.
An example of a test marked experimental.
These are options that you can use to tweak the behavior in your suite control file.
Boolean, if the hosts required are not currently in good health fail the suite. You may want to let the suite sit around for a while and wait for the hosts to be repaired. Default: True
Whether or not you want the suite to re-image machines before running the tests. Default: False
If you only want the suite to include non-experimental tests. Default: True
Whether or not bugs should be filed when tests fail (See below for a more detailed example)
If you want to apply a dependency across the whole suite (See below for a more detailed example)
How long each job should be allowed to run in a suite. Default is 24 hours. (See below for an example)
In addition to DEPENDENCIES specified on a per-test level, a set of suite dependencies can be specified at the suite level. These dependencies will be appended to the dependency list of all tests when they are run through that suite. To add suite-level dependencies, pass in your desired dependencies to dynamic_suite.reimage_and_run with the suite_dependencies argument. For example:
Multiple suite-level dependencies can be given as a comma separated string.
If your suite is already being run via suite_scheduler, you only need to edit the suite control file.
In your suite control file pass the max_runtime_mins option:
An example to allow tests to run for 6 hours.
There is a tool under the autotest repo to enumerate tests that will run in a suite.
From within the chroot the following command can be executed:
-a option is to specify what Autotest directory to look in.
The argument bvt is the SUITE you are intersted in.
Note that if your suite contains multiple control files that are associated with the same autotest, you may get an error that says something like this:
TestError: <AUTOTEST_NAME> already exists; multiple tests cannot run with the same subdirectory
To fix this, add a "tag" parameter to the job.run_test() in the associated control files (e.g., job.run_test('foo', tag='some_tag')) to distinguish them and make the results get written into uniquely-named result directories.
Suite scheduler is the piece of software that is responsible for kicking off suites out of band based on a set of events as opposed to in a waterfall. If you are interested in running suites in a waterfall refer to the HW_Test section below. Below is a run down on how this works and what needs to happen to add new suites to this configuration.
Suites are scheduled based off of build artifacts, the autotest tarball generated at build time is used to enumerate what control files belong to what suites and what version of those particular tests should be run. If updated a test on TOT it will need to be back ported to every branch that needs those updates just like any other change.
If your suite is a part of bvt, kaen_bvt, or smoke it will automatically run and no further action must be taken.
An out of band process runs on the Autotest server to schedule suite runs based on a number of events. The code lives under autotest/files/site_utils/suite_scheduler and is configured via a Python config file located under autotest/files/suite_scheduler.ini
To add your suite send a code review with a new entry as outlined below.
There are 5 parts to a configuration entry.
The top level unique name marker is part of the Python config format and must be unique and it should reflect what suite is being configured.
Pending implementation: new_chrome crosbug.com/30269
*If there are other events you would like to have available please file a bug.
The suite line can only be used to describe one individual suite. The name used pertains to the suite added under autotest/files/test_suites/control.suite_name. The above example would invoke the control.kernel_weekly_regression suite file.
There are three different branch specs that can be used to ensure your suite runs on a particular branch:
A pool is a label on a machine like pool:bvt. We are using pools extensively currently as our dependency support is not quite there yet. Unless you are doing something out of the ordinary with extra hardware required to be attached to the DUT you should always use pool: suites which is a general pool for suite runs.
If you are doing things that require extra hardware chances are there is already a precedent for this in the suite_scheduler.ini file and you should reference those. When in doubt ask firstname.lastname@example.org.
Suites can also be run as a step in the buildbot waterfall. This assumes you are running your builds via cbuildbot, if you are not please file a bug with your need and the Lab team can look at how to best direct you.
*Note when running the HW_Test step you are blocking your waterfall on actual hardware tests. If you do not want your builders to block on this consider using Suite Scheduler as described above.
*Note if your build master is not on the master2 vlan you will need to file a bug with the Chrome OS lab team so a proxy connection can be set up.
Adding a HW_Test step to your cbuildbot config is as easy as editing cbuildbot_config.py in the chromite repo and adding a hw_test entry like the following:
Example running the bvt suite for a lumpy build:
You need to specify upload_hw_test_artifacts so that Autotest has access to the image and the build artifacts via Google Storage and specify what suite(s) you want to run via a list called hw_tests.
For suite jobs:
For sub-jobs run from the suite:
If a particular test is set with EXPERIMENTAL = True it is prefaced with experimental_test_name.
*This is not a typical use case for users.
Suite scheduler lives under autotest/files/site_utils/suite_scheduler/suite_scheduler.py
An example of forcing all nightly suites for stumpy to be kicked off.
If you need to run an individual suite for a particular build but not all of the suites that would be kicked off by a particular event you can use the same command the buildbots use, run_suite.py.
Other than the BVT suite no other suite results are displayed on the buildbot waterfall. To see your results you need to refer to the Autotest dashboard at http://cautotest.corp.google.com/results/dashboard.