page.title=Running CTS tests @jd:body
See the Trade Federation Overview for an explanation of the Trade Federation (tradefed or TF for short) continuous test framework.
To run a test plan:
$ ./android-cts/tools/cts-tradefed
run
cts --plan CTS
. This kicks off all CTS tests required for compatibility.
list plans
to view a list of
test plans in the repository or list package
s to view a list of
test packages in the repository.
list modules
to
see a list of test modules.
cts-tradefed run cts --plan
Note: When running Android 6.0 (Marshmallow)
CTS only, we recommend you use the --skip-preconditions
option to
skip the experimental pre-conditions feature that may cause issues for when
executing CTS tests.
For Android 6.0 or earlier, you'll use CTS v1.
The following test plans are available:
These can be executed with the run cts
command.
Host | Description |
---|---|
help |
Display a summary of the most commonly used commands |
help all |
Display the complete list of available commands |
exit |
Gracefully exit the CTS console. Console will close when all currently running tests are finished |
Run | Description |
run cts |
Run the specified tests and displays progress information. One of
--plan , --package , --class or
--continue-session needs to be specified
The CTS console can accept other commands while tests are in progress If no devices are connected, the CTS desktop machine (or host) will wait for a device to be connected before starting tests If more than one device is connected, the CTS host will choose a device automatically |
--plan <test_plan_name> |
Run the specified test plan |
--package/-p <test_package_name> [--package/-p <test_package2>...] |
Run the specified test packages |
--class/-c <class_name> [--method/-m <test_method_name> |
Run the specified test class and/or method |
--continue-session |
Run all not executed tests from previous CTS session; the sessions testResult.xml will be updated with the new results |
--shards <number_of_shards> |
Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel |
--serial/-s <deviceID> |
Run CTS on the specific device |
-t <class_name>#<test_method_name> |
Run a specific test method |
--force-abi 32|64 |
On 64-bit devices, run the test against only the 32-bit or 64-bit ABI |
List | Description |
list packages |
List all available test packages in the repository |
list plans |
List all available test plans in the repository |
list invocations |
List 'run' commands currently being executed on devices |
list commands |
List all 'run' commands currently in the queue waiting to be assigned to devices |
list results |
List CTS results currently stored in repository |
list devices |
List currently connected devices and their state
'Available' devices are functioning, idle devices, available for running tests
'Unavailable' devices are devices visible via adb, but are not responding to adb commands and won't be allocated for tests
'Allocated' devices are devices currently running tests |
Add | Description |
add derivedplan --plan <plan_name> |
Create a plan derived from given result session; use this option to rerun reports and validate test issues |
For Android 7.0 or later, you'll use CTS v2.
Available test plans include the following:
Other available configurations include the following:
All of these plans and configs can be executed with the run cts
command.
Host | Description |
---|---|
help |
Display a summary of the most commonly used commands |
help all |
Display the complete list of available commands |
version |
Show the version. |
exit |
Gracefully exit the CTS console. Console will close when all currently running tests are finished. |
Run | Description |
run cts |
Run the default CTS plan (that is, the full CTS invocation). The CTS console can accept other commands while tests are in progress. If no devices are connected, the CTS desktop machine (or host) will wait for a device to be connected before starting tests. If more than one device is connected, the CTS host will choose a device automatically. |
--plan <test_plan_name> |
Run the specified test plan. |
-- module/-m <test_module_name> [--module/-m <test_module2>...] |
Run the specified test module or modules. For example, run cts --module CtsGestureTestCases
executes the gesture test module (this can be shortened to run cts -m Gesture ).
run cts -m Gesture --test android.gesture.cts.GestureTest#testGetStrokes runs the specific
package, class, or test. |
-- module/-m <test_module_name> -- test <test_name> |
Run the specified module and test. For example,
run cts -m Gesture --test android.gesture.cts.GestureTest#testGetStrokes runs the specific
package, class, or test. |
--retry |
Retry all tests that failed or were not executed from the previous sessions.
Use list results to get the session id. |
--shards <number_of_shards> |
Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel. |
--serial/-s <deviceID> |
Run CTS on the specific device. |
--include-filter <module_name> [--include-filter <module2>...] |
Run only with the specified modules. |
--exclude-filter <module_name> [--exclude-filter <module2>...] |
Exclude the specified modules from the run. |
--log-level-display/-l <log_level> |
Run with the minimum specified log level displayed to STDOUT. Valid values: [VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT]. |
--abi <abi_name> |
Force the test to run on the given ABI, 32 or 64. By default CTS runs a test once for each ABI the device supports. |
--logcat , --bugreport , and --screenshoot-on-failure |
Give more visibility into failures and can help with diagnostics. |
--device-token |
Specifies a given device has the given token eg. --device-token 1a2b3c4d:sim-card. . |
--skip-device-info |
Skips collection of information about the device. Note: do not use this option when running CTS for approval. |
--skip-preconditions |
Bypasses verification and setup of the device's configuration, such as pushing media files or checking for Wi-Fi connection. |
List | Description |
list modules |
List all available test modules in the repository. |
list plans or list configs |
List all available test plans (configs) in the repository. |
list invocations |
List 'run' commands currently being executed on devices. |
list commands |
List all 'run' commands currently in the queue waiting to be assigned to devices. |
list results |
List CTS results currently stored in repository. |
list devices |
List currently connected devices and their state.
'Available' devices are functioning, idle devices, available for running tests.
'Unavailable' devices are devices visible via adb, but are not responding to adb commands and won't be allocated for tests.
'Allocated' devices are devices currently running tests. |
Dump | Description |
dump logs |
Dump the tradefed logs for all running invocations. |