软件环境:ubuntu20.04 aosp
硬件环境:X86 PC
模拟环境:在host ubuntu20.04启动Android虚拟机运行图形HAL VTS;图形CTS
1. 编译
1.编译vts测试包
source build/envsetup.sh
lunch aosp_cf_auto_x86-userdebug
#编译VTS测试包
make vts -j12
#编译VTS测试包
make cts -j12
2. 运行
1.在cuttlefish运行环境准备工作
export ANDROID_SERIAL=0.0.0.0:6520
adb root
adb remount
2.拷贝vts测试包到cf运行环境,解压
cp out/host/linux-x86/vts/android-vts.zip cf-run-dir
cp out/host/linux-x86/cts/android-cts.zip cf-run-dir
unzip android-vts.zip
unzip android-cts.zip
cd android-vts/tools
cd android-cts
./vts-tradefed
./tools/cts-tradefed
3.Graphic 模块VTS&CTS测试
# Graphic Mapper模块VTS测试
run vts -m VtsHalGraphicsMapperV4_0TargetTest
# Graphics模块CTS测试
cts-tf >run cts --module CtsGraphicsTestCases
cts-tf >run cts --module CtsOpenGLTestCases
4.图形可运行模块
VtsHalGraphicsComposerV2_1TargetTest
VtsHalGraphicsComposerV2_2TargetTest
VtsHalGraphicsComposerV2_3TargetTest
VtsHalGraphicsComposerV2_4TargetTest
VtsHalGraphicsMapperV2_0TargetTest
VtsHalGraphicsMapperV2_1TargetTest
VtsHalGraphicsMapperV3_0TargetTest
VtsHalGraphicsMapperV4_0TargetTest
5.稍等10秒有运行结果
3. Vts命令介绍
#单跑某一个模块
> run vts -m <模块名>
#单跑某个测试项
> run vts -m <模块名> -t <测试项名>
#列出结果
> l r
3.1 单独测试
1. 编译图形hal vts
mmm hardware/interfaces/graphics/composer/2.4/vts/functional/
2. 测试二进制文件位于
out/target/product/vsoc_x86/data/nativetest/VtsHalGraphicsComposerV2_4TargetTest/VtsHalGraphicsComposerV2_4TargetTest
3. 单独执行某VTS测试用例
export ANDROID_SERIAL=0.0.0.0:6520
adb root
adb remount
adb push VtsHalGraphicsComposerV2_4TargetTest /data
adb shell /data/VtsHalGraphicsComposerV2_4TargetTest --gtest_filter=* --gtest_repeat=1 --gtest_color=yes --gtest_break_on_failure
4 问题解决
4.1 .E/ClearcutClient: connect timed out
#原因:跑cts时,会从Google server同步一些文件,需要网络能访问外网
#解决办法:ubuntu上运行cts-tradefed/vts-tradefed命令行前
adb shell settings put global http_proxy IP:PORT
export http_proxy=http://IP:PORT;
export https_proxy=http://IP:PORT
export JAVA_TOOL_OPTIONS='-Djava.net.useSystemProxies=true'
#测试结束后ubuntu取消代理
unset http_proxy && unset https_proxy