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:
  1. Install Python development kit:
    sudo apt-get install python-dev
    
  2. Install Protocol Buffer tools (for Python):
    sudo apt-get install python-protobuf
    sudo apt-get install protobuf-compiler
    
  3. Install Python virtual environment-related tools:
    sudo apt-get install python-virtualenv
    sudo apt-get install python-pip

Testing a patch

To test a patch:

  1. Build a VTS host-side package:
    . build/envsetup.sh
    lunch aosp_arm64-userdebug
    make vts -j
    
  2. Run the default VTS tests:
    vts-tradefed
    tf> run vts     // where vts is the test plan name


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 所有項目:

PlanDescription
vtsFor all default VTS tests.
vts-fuzzFor all default VTS fuzz tests.
vts-halFor all default VTS HAL (hardware abstraction layer) module tests.
vts-hal-profilingFor all default VTS HAL performance profiling tests.
vts-hal-replayFor all default VTS HAL replay tests.
vts-kernelFor all default VTS kernel tests.
vts-libraryFor all default VTS library tests.
vts-performanceFor all default VTS performance tests
vts-camera-itsFor camera ITS (Image Test Suite) tests ported to VTS.
vts-codelabFor VTS codelab.
vts-codelab-multi-deviceFor VTS codelab of multi-device testing.
vts-gceFor VTS tests which can be run on Google Compute Engine (GCE)
vts-hal-autoFor VTS automotive vehicle HAL test.
vts-hal-tvFor VTS tv HAL test.
vts-hostFor VTS host-driven tests.
vts-performance-systraceFor VTS performance tests with systrace enabled.
vts-presubmitFor VTS pre-submit time tests.
vts-securityFor VTS security tests.
vts-systemFor VTS system tests.
vts-vndkfor 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 問題

留言

熱門文章