Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 1 | page.title=Running CTS tests |
| 2 | @jd:body |
| 3 | |
| 4 | <!-- |
| 5 | Copyright 2015 The Android Open Source Project |
| 6 | |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | <div id="qv-wrapper"> |
| 20 | <div id="qv"> |
| 21 | <h2>In this document</h2> |
| 22 | <ol id="auto-toc"> |
| 23 | </ol> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <h2 id=cts_tradefed>Using the CTS tradefed</h2> |
| 28 | <p>See the <a |
| 29 | href="{@docRoot}devices/tech/test_infra/tradefed/index.html">Trade Federation |
| 30 | Overview</a> for an explanation of the Trade Federation (tradefed or TF for |
| 31 | short) continuous test framework.</p> |
| 32 | |
| 33 | <p>To run a test plan:</p> |
| 34 | <ol> |
| 35 | <li>Connect at least one device. |
| 36 | <li>Press the <strong>home</strong> button to set the device to the home screen at the start of CTS. |
| 37 | <li>While a device is running tests, it must not be used for any other tasks |
| 38 | and must be kept in a stationary position (to avoid triggering sensor activity) |
| 39 | with the cameras pointing at an object that could be focused. |
| 40 | <li>Do not press any keys on the device while the CTS is running. Pressing keys |
| 41 | or touching the screen of a test device will interfere with the running tests |
| 42 | and may lead to test failures. |
| 43 | <li>Launch the CTS console by running the <em>cts-tradefed</em> script from |
| 44 | the folder where the CTS package has been unzipped, e.g. |
| 45 | <code>$ ./android-cts/tools/cts-tradefed</code> |
| 46 | <li>You may start the default test plan (containing all of the test packages) by |
| 47 | appending: <code>run cts --plan CTS</code> This will kick off all the CTS tests required for compatibility. |
| 48 | Enter <code>list plans</code> to see a list of test plans in the repository. |
| 49 | Enter <code>list packages</code> to see a list of test packages in the repository. |
| 50 | See the CTS command |
| 51 | reference or type help for a complete list of supported commands. |
| 52 | <li>Alternately, you may run the CTS plan of your choosing from the command line |
| 53 | using: <code>cts-tradefed run cts --plan |
| 54 | <plan_name> |
| 55 | </code> |
| 56 | <li>View test progress and results reported on the console. |
| 57 | <li>If your device is Android 5.0 or later and declares support for an ARM and a |
| 58 | x86 ABI, you should run both the ARM and x86 CTS packages. |
| 59 | </ol> |
| 60 | <h2 id=selecting_cts_plans>Selecting CTS plans</h2> |
| 61 | <p>The following test plans are available:</p> |
| 62 | <ul> |
| 63 | <li><em>CTS</em>—all tests required for compatibility. </li> |
| 64 | <li><em>Signature</em>—the signature verification of all public APIs </li> |
| 65 | <li><em>Android</em>—tests for the Android APIs </li> |
| 66 | <li><em>Java</em>—tests for the Java core library </li> |
| 67 | <li><em>VM</em>—tests for ART or Dalvik </li> |
| 68 | <li><em>Performance</em>—performance tests for your implementation </li> |
| 69 | </ul> |
| 70 | <p>These can be executed with the <code>run cts</code> command.</p> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 71 | <h2 id=cts_reference>CTS console command reference</h2> |
| 72 | |
| 73 | <p class="table-caption" id="console-commands"> |
| 74 | <strong>Table 1.</strong> This table summarizes the CTS console commands for |
| 75 | various uses.</p> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 76 | <table> |
| 77 | <tbody> |
| 78 | <tr> |
| 79 | <th>Host</th> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 80 | <th>Description</th> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 81 | </tr> |
| 82 | <tr> |
| 83 | <td><code>help</code></td> |
| 84 | <td>Display a summary of the most commonly used commands</td> |
| 85 | </tr> |
| 86 | <tr> |
| 87 | <td><code>help all</code></td> |
| 88 | <td>Display the complete list of available commands</td> |
| 89 | </tr> |
| 90 | <tr> |
| 91 | <td><code>exit</code></td> |
| 92 | <td>Gracefully exit the CTS console. Console will close when all currently running tests are finished</td> |
| 93 | </tr> |
| 94 | <tr> |
| 95 | <th>Run</th> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 96 | <th>Description</th> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 97 | </tr> |
| 98 | <tr> |
| 99 | <td><code>run cts</code></td> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 100 | <td>Run the specified tests and displays progress information. One of |
| 101 | <code>--plan</code>, <code>--package</code>, <code>--class</code> or |
| 102 | <code>--continue-session</code> needs to be specified |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 103 | <p>The CTS console can accept other commands while tests are in progress </p> |
| 104 | <p>If no devices are connected, the CTS desktop machine (or host) will wait for a device to be connected before starting tests </p> |
| 105 | <p>If more than one device is connected, the CTS host will choose a device automatically</p></td> |
| 106 | </tr> |
| 107 | <tr> |
| 108 | <td><code>--plan <test_plan_name></code></td> |
| 109 | <td>Run the specified test plan</td> |
| 110 | </tr> |
| 111 | <tr> |
| 112 | <td><code>-- package/-p <test_package_name> [--package/-p <test_package2>...]</code></td> |
| 113 | <td>Run the specified test packages</td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td><code>--class/-c <class_name> [--method/-m <test_method_name></code></td> |
| 117 | <td>Run the specified test class and/or method</td> |
| 118 | </tr> |
| 119 | <tr> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 120 | <td><code>--continue-session</code></td> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 121 | <td>Run all not executed tests from previous CTS session; the sessions testResult.xml will be updated with the new results</td> |
| 122 | </tr> |
| 123 | <tr> |
| 124 | <td><code>--shards <number_of_shards></code></td> |
| 125 | <td>Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel</td> |
| 126 | </tr> |
| 127 | <tr> |
| 128 | <td><code>--serial/-s <deviceID></code></td> |
| 129 | <td>Run CTS on the specific device</td> |
| 130 | </tr> |
| 131 | <tr> |
| 132 | <td><code>-t <class_name>#<test_method_name></code></td> |
| 133 | <td>Run a specific test method</td> |
| 134 | </tr> |
| 135 | <tr> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 136 | <td><code>--force-abi 32|64</code></td> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 137 | <td>On 64-bit devices, run the test against only the 32-bit or 64-bit ABI</td> |
| 138 | </tr> |
| 139 | <tr> |
| 140 | <th>List</th> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 141 | <th>Description</th> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 142 | </tr> |
| 143 | <tr> |
| 144 | <td><code>list packages</code></td> |
| 145 | <td>List all available test packages in the repository</td> |
| 146 | </tr> |
| 147 | <tr> |
| 148 | <td><code>list plans</code></td> |
| 149 | <td>List all available test plans in the repository</td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td><code>list invocations</code></td> |
| 153 | <td>List 'run' commands currently being executed on devices</td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td><code>list commands</code></td> |
| 157 | <td>List all 'run' commands currently in the queue waiting to be assigned to devices</td> |
| 158 | </tr> |
| 159 | <tr> |
| 160 | <td><code>list results</code></td> |
| 161 | <td>List CTS results currently stored in repository</td> |
| 162 | </tr> |
| 163 | <tr> |
| 164 | <td><code>list devices</code></td> |
| 165 | <td>List currently connected devices and their state |
| 166 | <p> </p> |
| 167 | <p>'Available' devices are functioning, idle devices, available for running tests</p> |
| 168 | <p> </p> |
| 169 | <p>'Unavailable' devices are devices visible via adb, but are not responding to adb commands and won't be allocated for tests</p> |
| 170 | <p> </p> |
| 171 | <p>'Allocated' devices are devices currently running tests</td> |
| 172 | </tr> |
| 173 | <tr> |
| 174 | <th>Add</th> |
Clay Murphy | efa4366 | 2015-09-29 18:00:55 -0700 | [diff] [blame^] | 175 | <th>Description</th> |
Clay Murphy | 468ba57 | 2015-04-13 18:25:11 -0700 | [diff] [blame] | 176 | </tr> |
| 177 | <tr> |
| 178 | <td><code>add derivedplan --plan <plan_name><br> |
| 179 | --result/-r<br> |
| 180 | [pass | fail | timeout | notExecuted]<br> |
| 181 | [--session/-s <session_id>]</code></td> |
| 182 | <td>Create a plan derived from given result session; use this option to rerun reports and validate test issues</td> |
| 183 | </tr> |
| 184 | </tbody> |
| 185 | </table> |