Android Vendor Test Suite - VTS
從 Android 8.0 開始, Android framework 和 HAL 分開, VTS 可以用來測試是否這些 vendror hardware 是否透過 HAL interface 能保持兼容
https://source.android.com/compatibility/vts/systems
To set up a testing environment:
- Install Python development kit:
- Install Protocol Buffer tools (for Python):
- Install Python virtual environment-related tools:
Testing a patch
To test a patch:
- Build a VTS host-side package:
- Run the default VTS tests:
e.g. . build/envsetup.sh
lunch RealtekHank-userdebug
make vts -j
中間可能因為memory 不夠而失敗, 不過沒關係, 繼續執行 make vts -j 即可
檔案最後會產生在 out/host/linux-x86/vts/android-vts/tools/vts-tradefed
測試
1. adb
adb devices
adb shell
確認 adb 連線正常
2. 只對某個 module 進行測試
$ vts-tradefed
> run vts -m VtsHalAudioV2_0Target
3. 只對某個 module 的 某個 item 進行測試
$ vts-tradefed
vts-tf > run vts -m VtsHalAudioV2_0Target -t RecommendedOutputStreamConfigSupport
e.g.
vts-tf> run vts -m VtsHalWifiHostapdV1_0Target
VtsHalWifiHostapdV1_1Target
VtsHalWifiNanV1_0Target
VtsHalWifiOffloadV1_0Target
VtsHalWifiSupplicantP2pV1_0Target
VtsHalWifiSupplicantP2pV1_2Target
VtsHalWifiSupplicantV1_0Host
VtsHalWifiSupplicantV1_1Host
VtsHalWifiSupplicantV1_2Host
VtsHalWifiV1_0Host
VtsHalWifiV1_1Target
VtsHalWifiV1_2Target
如果需要 debug 可以加上 -l debug, e.g.
run vts-hal -l debug -m VtsHalWifiV1_0Target
list plans 會 show 所有項目:
Plan | Description |
---|---|
vts | For all default VTS tests. |
vts-fuzz | For all default VTS fuzz tests. |
vts-hal | For all default VTS HAL (hardware abstraction layer) module tests. |
vts-hal-profiling | For all default VTS HAL performance profiling tests. |
vts-hal-replay | For all default VTS HAL replay tests. |
vts-kernel | For all default VTS kernel tests. |
vts-library | For all default VTS library tests. |
vts-performance | For all default VTS performance tests |
vts-camera-its | For camera ITS (Image Test Suite) tests ported to VTS. |
vts-codelab | For VTS codelab. |
vts-codelab-multi-device | For VTS codelab of multi-device testing. |
vts-gce | For VTS tests which can be run on Google Compute Engine (GCE) |
vts-hal-auto | For VTS automotive vehicle HAL test. |
vts-hal-tv | For VTS tv HAL test. |
vts-host | For VTS host-driven tests. |
vts-performance-systrace | For VTS performance tests with systrace enabled. |
vts-presubmit | For VTS pre-submit time tests. |
vts-security | For VTS security tests. |
vts-system | For VTS system tests. |
vts-vndk | for VTS vndk tests. |
===
問題1:
Wrong java version. 1.8 or 9 is required
Java 版本不對, java jvm 是在 /usr/lib/jvm 底下
安裝舊版 java
1. sudo apt install openjdk-8-jdk openjdk-8-jre
2. sudo update-alternatives --config java
3. java -version
問題 2:
pip module
測試的 host 端要連上網, 不然會出現這 python 問題
留言
張貼留言