android VTS

https://source.android.com/compatibility/vts

https://source.android.com/devices/tech/test_infra/tradefed/fundamentals/vts

可以用UD去验证问题,但是vts认证必须要User版本刷GSI

建立测试环境

要设置测试环境,请按以下步骤操作:

  1. 安装 Python 开发工具包:
    sudo apt-get install python-dev
    

安装协议缓冲区工具(适用于 Python):

sudo apt-get install python-protobuf
sudo apt-get install protobuf-compiler

安装 Python 虚拟环境相关工具:

sudo apt-get install python-virtualenv
sudo apt-get install python-pip

测试补丁

要测试补丁,请按以下步骤操作:

  1. 构建 VTS 主机端软件包:
    . build/envsetup.sh
    lunch aosp_arm64-userdebug
    make vts -j
    

运行默认的 VTS 测试:

$ cd *installation-path*/android-vts/tools

vts-tradefed
tf> run vts     // where vts is the test plan name

> run vts -m <模块名> -t <测试项名>

-------

https://www.jianshu.com/p/4576b2c76e9e

2、VTS测试流程

1)替换谷歌system.img

VTS测试要求刷入谷歌提供AOSP的system.img (GSI)。在user版本中,如果直接使用flash tool单独烧录GSI时,会导致无法开机。

之所以会出现这种问题,是由于在user/userdebug版本中,dm-verity是使能的,替换GSI后导致dm-verity不能通过。 如果要解决这个问题,就需要进行unlock操作,并且要用fastboot来刷入刷入谷歌提供的system.img .

具体操作如下:

    1. 在设置中打开 OEM unlocking 选项
    1. 在设置中打开 USB debugging 选项
    1. 长按音量 + 和电源键进入fastboot模式
    1. 连接到电脑上,分别执行fastboot flashing unlockfastboot oem unlock
      执行命令后需要选择音量 + 来确认unlock。
    2.  fastboot getvar unlocked
    3. fastboot reboot fastboot
  •  adb reboot fastboot (Q版本之前使用adb reboot bootloader)
  • fastboot devices
  •    fastboot flash boot boot-debug.img 
       fastboot flash system system.img
  •  
    1. 执行 fastboot 命令刷入google提供的 system.img (GSI):
      fastboot flash system system.img(需要根据软件版本的信息来选择GSI版本)
    2.  fastboot flash boot boot-debug.img 替换boot-debug.img
  • 6 .(Android P版本需要执行) fastboot flash vbmeta vbmeta.img

  •      recovery mode: factory reset

    1. 重启: fastboot reboot (reboot system now)

2)VTS测试

Running VTS

主机端设置

  • 首先设置基本测试环境 GMS测试环境.

  • VTS测试环境配置:
    安装 Python 开发工具包:sudo apt-get install python-dev
    安装协议缓冲区工具(适用于 Python):sudo apt-get install python-protobuf protobuf-compiler
    安装 Python 虚拟环境相关工具:sudo apt-get install python-virtualenv python-pip

  • 下载并解压VTS测试工具

手机端设置

  • 擦除设备上的用户数据(即运行fastboot -w)。

  • 刷入谷歌提供的system.img (GSI),使用与设备的ABI相对应的GSI,是否支持A / B更新以及设备的security_patch_level:

    ABI A/B Non A/B security_patch_level
    Arm64 aosp_arm64_ab aosp_arm64_a Uses the format: [year][month][date]
    Arm32 aosp_arm_ab aosp_arm_a Uses the format: [year][month][date]
    x86_64 aosp_x86_64_ab aosp_x86_64_a Uses the format: [year][month][date]
    x86_32 aosp_x86_32_ab aosp_x86_32_a Uses the format: [year][month][date]
  • https://source.android.com/compatibility/cts/setup

  • Android 8.x的设备不需要安装SIM卡,但是Android P及更高版本的设备将需要SIM卡进行VTS测试。

  • 确保手机可以连接到IPV6的wifi网络,如果设备具有GPS / Wi-Fi / Bluetooth/Cellular功能,则必须重置设备并打开位置设置。

  • 通过usb将手机连接到电脑上,通过 adb shell 来保证可以正确的连接。

  • security ->none

run vts -m VtsTrebleFrameworkVintfTest -t VtsTrebleFrameworkVintfTest#SystemVendorTest.ServedHwbinderHalsAreInManifest

run vts -m VtsTrebleVendorVintfTest -t VtsTrebleVendorVintfTest#DeviceManifest/SingleManifestTest.HalsAreServed

run vts -m VtsTrebleVendorVintfTest -t VtsTrebleVendorVintfTest#DeviceManifest/SingleManifestTest.InterfacesAreReleased/0_64bit

猜你喜欢

转载自blog.csdn.net/kv110/article/details/105539834
VTS