Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 1 | CTS Trade Federation |
| 2 | --------------------- |
| 3 | |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 4 | CTS Trade Federation, cts-tradefed for short, is the next |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 5 | generation test harness for CTS. |
| 6 | |
| 7 | cts-tradefed is built on top of the Android Trade Federation test harness. |
| 8 | |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 9 | It works in a similar manner to the prior CTS harness, but supports some |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 10 | advanced features such as: |
| 11 | |
| 12 | - modular, flexible extensible design. cts-tradefed can be extended to |
| 13 | support running CTS in a continuous test environment. |
| 14 | - supports sharding a CTS test run across multiple devices in parallel |
| 15 | - automatically continue a CTS test run on another device if connection |
| 16 | is lost |
| 17 | |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 18 | Configuring cts-tradefed |
| 19 | ------------------------ |
| 20 | |
| 21 | 1. Ensure 'adb' is in your current PATH. adb can be found in the |
| 22 | Android SDK available from http://developer.android.com |
| 23 | |
| 24 | Example: |
| 25 | PATH=$PATH:/home/myuser/android-sdk-linux_x86/platform-tools |
| 26 | |
| 27 | 2. Follow the 'Setting up your device' steps documented in the |
| 28 | CTS User Manual. The CTS User Manual can be downloaded at |
| 29 | http://source.android.com/compatibility/downloads.html |
| 30 | |
| 31 | 3. Connect the device to the host machine. |
| 32 | |
| 33 | 4. Ensure device is visible via 'adb devices' |
| 34 | |
| 35 | Using cts-tradefed |
| 36 | ------------------- |
| 37 | |
| 38 | To run a test plan on a single device: |
| 39 | |
| 40 | 1. Make sure you have at least one device connected |
Stuart Scott | ebf808b | 2013-10-24 10:34:57 -0700 | [diff] [blame] | 41 | 2. Launch the cts-tradefed console by running the 'cts-tradefed'. If you've |
| 42 | downloaded and extracted the CTS zip, the script can be found at |
| 43 | android-cts/tools/cts-tradefed |
| 44 | Or else if you are working from the Android source tree and have run make cts, |
| 45 | the script can be found at |
| 46 | out/host/linux-x86/cts/android-cts/tools/cts-tradefed |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 47 | 3. Type: |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 48 | 'run cts --plan CTS' to run the default CTS plan |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 49 | |
| 50 | Some other useful commands are |
| 51 | |
| 52 | To run a test package: |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 53 | 'run cts --package <packagename>' |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 54 | |
| 55 | To run a test class: |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 56 | 'run cts --class <full test class name>' |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 57 | |
| 58 | To shard a plan test run on multiple devices |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 59 | 'run cts --plan CTS --shards <number of shards> |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 60 | note: all connected devices must be running the same build |
| 61 | |
| 62 | For more options: |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 63 | 'run cts --help' |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 64 | |
| 65 | CTS Tradefed Development |
| 66 | ------------------------ |
| 67 | See http://source.android.com for instructions on obtaining the Android |
| 68 | platform source code and setting up a build environment. |
| 69 | |
| 70 | The source for the CTS extensions for tradefed can be found at |
| 71 | <android source root>/cts/tools/tradefed-host |
| 72 | |
Brian Muramatsu | 6320440 | 2011-12-02 12:00:05 -0800 | [diff] [blame] | 73 | The source for the tradefed framework can be found on the 'tradefed' branch. |
Brett Chabot | 1589b60 | 2011-02-17 17:32:25 -0800 | [diff] [blame] | 74 | |
| 75 | Perform these steps to build and run cts-tradefed from the development |
| 76 | environment: |
| 77 | cd <path to android source root> |
| 78 | make cts |
| 79 | cts-tradefed |
| 80 | |
| 81 | More documentation and details on using and extending trade federation will |
| 82 | be forthcoming in the near future. |
| 83 | |