Run CTS media tests locally

We added the functionality in CTS that can make the media test modules to run by:

  1. Loading the content on a device under test (DUT) SD card.
  2. Hosting the media files on the local server for CTS.
  3. Hosting the media files on the host machine used to execute test suites.

CTS can connect to partner, local, or third-party servers. CTS can't connect to Google servers.

Downloads

The downloads files are available as shown below.

For Android 11

  • CTS Media 1.5
    • CtsMediaTestCases
    • CtsMediaStressTestCases
    • CtsMediaBitstreamsTestCases

For Android 12 and above

* CtsMediaTestCases.apk has been split into smaller test cases for Android 13 and above.

Set up CTS media tests

  • Unzip the downloaded contents of android-cts-media-1.5.zip in the android-cts-media-1.5 folder.
  • Unzip the downloaded contents of CtsMediaTestCases.zip media files in the CtsMediaTestCases folder.

The CtsMediaTestCases module supports the SD card method and the local server hosting method.

SD card method (for CtsMediaTestCases only)

Copy the files onto the device SD card and run the module using the following command.

$adb push CtsMediaTestCases /sdcard/

Local server method (for CtsMediaTestCases only)

  1. (Optional) Host DynamicConfig.json on local server.
  2. Have a local server with https enabled with a valid CA certificate and non-authenticated. For example, https://example.com.
  3. Host the media files on that server and get the URL.
  4. Modify DynamicConfig.json and host it on same location. For example, https://example.com/a/b/DynamicConfig.json).

Host machine method (for all three modules)

Move android-cts-media-1.5 folder in the /tmp/ folder of the host machine.

Run CTS media tests

SD card method (for CtsMediaTestCases only)

Single module run

$run cts -m CtsMediaTestCases --dynamic-config-url
https://storage.googleapis.com/cts_media/DynamicConfig_local.json --shard-count 6

This downloads the files from the images folder on dl.google.com. If you want to use the local images folder from android-cts-media-1.5.zip, use this:

$run cts -m CtsMediaTestCases --module-arg
CtsMediaTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig_local.json --module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Full CTS run (CtsMediaTestCases on SD card)

$run cts --module-arg CtsMediaTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig_local.json --module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Local server method

You may replace the default JSON config path with your custom local server path.

Single module run

$run cts -m CtsMediaTestCases --dynamic-config-url
https://storage.googleapis.com/cts_media/DynamicConfig.json

This downloads the files from the images folder on dl.google.com. If you want to use the local images folder from android-cts-media-1.5.zip, use this:

$run cts -m CtsMediaTestCases --module-arg CtsMediaTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig.json --module-arg
CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Full CTS run (CtsMediaTestCases on SD card)

$run cts --module-arg CtsMediaTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig.json --module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Host machine method

You can run the CTS media tests for all three modules on the host machine.

Run modules individually or together

Run the following command to run the modules individually.

$run cts -m CtsMediaTestCases
--module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Run the following command to run all the modules together.

$run cts --include-filter CtsMediaTestCases --module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --include-filter CtsMediaStressTestCases --module-arg
CtsMediaStressTestCases:local-media-path:/tmp/android-cts-media-1.5 --include-filter
CtsMediaBitstreamsTestCases --module-arg CtsMediaBitstreamsTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6

Full CTS run (with individual module parameters)

$run cts --module-arg CtsMediaTestCases:local-media-path:/tmp/android-cts-media-1.5 --module-arg CtsMediaStressTestCases:local-media-path:/tmp/android-cts-media-1.5 --module-arg CtsMediaBitstreamsTestCases:local-media-path:/tmp/android-cts-media-1.5 --shard-count 6