Linux is officially supported for building and running VTS. Building on Windows is not supported, but it is possible to run VTS on Windows with Python, Java, and ADB installed.
The following instructions assume Linux environment.
Please follow:
(Optional) During VTS test runs, required Python packages are downloaded from the Python Package Index. There is an option to instead install these packages from a local directory during test runtime by predownloading the packages. First run the lunch command, then set an environment variable VTS_PYPI_PATH as a new local directory to host the Python packages. Then run the download-pypi-packages.sh script:
$ cd ${branch}
$ . test/vts/script/download-pypi-packages.sh
$ export branch=master
$ mkdir ${branch}
$ cd ${branch}
$ repo init -b ${branch} -u persistent https://android.googlesource.com/platform/manifest
$ repo sync -j 8
$ cd ${branch}
$ . build/make/envsetup.sh
$ lunch aosp_arm64-userdebug # or <your device>-userdebug
The below is an optional step:
$ make -j 8
If this fails, please do:
$ repo sync -j 8
$ make -j 8
Such can happen because tip of tree (ToT) may not always be buildable.
$ cd ${branch}
$ make vts -j8
Or use the exact command:
$ make -j8 vts showcommands dist TARGET_PRODUCT=aosp_arm64 WITH_DEXPREOPT=false TARGET_BUILD_VARIANT=userdebug
Let's connect an Android device and a host computer using a USB cable.
adb devices
from a command line shell.adb shell
and if that works, we're ready.For Linux users,
$ vts-tradefed
> run vts
For Windows users, please build on Linux. Then copy the following zip file to Windows and extract it.
out/host/linux-x86/vts/android-vts.zip
Launch the batch file in the extracted folder.
$ android-vts\tools\vts-tradefed_win.bat
> run vts
Example stdout:
… … 08-16 09:36:03 I/ResultReporter: Saved logs for device_logcat in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/device_logcat_7912321856562095748.zip 08-16 09:36:03 I/ResultReporter: Saved logs for host_log in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/host_log_2775945280523850018.zip 08-16 09:36:04 I/ResultReporter: Invocation finished in 18m 50s. PASSED: 18, FAILED: 0, NOT EXECUTED: 2, MODULES: 8 of 10 08-16 09:36:04 I/ResultReporter: Test Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13/test_result.xml 08-16 09:36:04 I/ResultReporter: Full Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13.zip
The uploadable report xml file can be found at
out/host/linux-x86/vts/android-vts/results/
After Android O release, you will be able to upload that xml file to AFPE and obtain a certificate.
$ vi out/host/linux-x86/vts/android-vts/logs/
Then select a directory which captures the time stamp of your test run (e.g., 2016.08.16_09.17.13).
Then select host_log_<timestamp>.zip
and host_log.txt in that zip file for host log.
Then select device_logcat_<timestamp>.zip
and device_logcat.txt in that zip file for device log.
Documented at here.
LTP (Linux Test Project) is part of vts-kernel. This doc shows how to run each LTP test case.