1#!/bin/bash 2# 3# Copyright 2016 The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17# allow write to /system partition 18adb root 19adb disable-verity 20adb reboot 21adb wait-for-device 22adb root 23adb remount 24 25# push profiler libs 26adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.audio@2.0-vts.profiler.so system/lib64/ 27adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.audio.common@2.0-vts.profiler.so system/lib64/ 28adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.audio.effect@2.0-vts.profiler.so system/lib64/ 29adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.automotive.vehicle@2.0-vts.profiler.so system/lib64/ 30adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.automotive.vehicle@2.1-vts.profiler.so system/lib64/ 31adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.biometrics.fingerprint@2.1-vts.profiler.so system/lib64/ 32adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.bluetooth@1.0-vts.profiler.so system/lib64/ 33adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.boot@1.0-vts.profiler.so system/lib64/ 34adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.broadcastradio@1.0-vts.profiler.so system/lib64/ 35adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.camera.common@1.0-vts.profiler.so system/lib64/ 36adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.camera.device@1.0-vts.profiler.so system/lib64/ 37adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.camera.device@3.2-vts.profiler.so system/lib64/ 38adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.camera.metadata@3.2-vts.profiler.so system/lib64/ 39adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.camera.provider@2.4-vts.profiler.so system/lib64/ 40adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.configstore@1.0-vts.profiler.so system/lib64/ 41adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.contexthub@1.0-vts.profiler.so system/lib64/ 42adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.drm@1.0-vts.profiler.so system/lib64/ 43adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.dumpstate@1.0-vts.profiler.so system/lib64/ 44adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.gatekeeper@1.0-vts.profiler.so system/lib64/ 45adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.gnss@1.0-vts.profiler.so system/lib64/ 46adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.graphics.allocator@2.0-vts.profiler.so system/lib64/ 47adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.graphics.common@1.0-vts.profiler.so system/lib64/ 48adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.graphics.composer@2.1-vts.profiler.so system/lib64/ 49adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.graphics.mapper@2.0-vts.profiler.so system/lib64/ 50adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.health@1.0-vts.profiler.so system/lib64/ 51adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.ir@1.0-vts.profiler.so system/lib64/ 52adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.keymaster@3.0-vts.profiler.so system/lib64/ 53adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.light@2.0-vts.profiler.so system/lib64/ 54adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.media.omx@1.0-vts.profiler.so system/lib64/ 55adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.memtrack@1.0-vts.profiler.so system/lib64/ 56adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.nfc@1.0-vts.profiler.so system/lib64/ 57adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.power@1.0-vts.profiler.so system/lib64/ 58adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.radio@1.0-vts.profiler.so system/lib64/ 59adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.sensors@1.0-vts.profiler.so system/lib64/ 60adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.soundtrigger@2.0-vts.profiler.so system/lib64/ 61adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.thermal@1.0-vts.profiler.so system/lib64/ 62adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.tv.cec@1.0-vts.profiler.so system/lib64/ 63adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.tv.input@1.0-vts.profiler.so system/lib64/ 64adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.usb@1.0-vts.profiler.so system/lib64/ 65adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.vibrator@1.0-vts.profiler.so system/lib64/ 66adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.vr@1.0-vts.profiler.so system/lib64/ 67adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.wifi@1.0-vts.profiler.so system/lib64/ 68adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.wifi.supplicant@1.0-vts.profiler.so system/lib64/ 69 70adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/bin/vts_profiling_configure /data/local/tmp/ 71 72# get cts testcases 73tests=() 74while read -r test 75do 76 tests+=($test) 77done < "${ANDROID_BUILD_TOP}/test/vts/script/cts_test_list.txt" 78 79# run cts testcases 80DATE=`date +%Y-%m-%d` 81for i in ${tests[@]} 82do 83 echo Running $i 84 adb shell rm /data/local/tmp/*.vts.trace 85 adb reboot 86 adb wait-for-device 87 adb root 88 sleep 5 89 adb shell setenforce 0 90 adb shell chmod 777 -R data/local/tmp 91 adb shell ./data/local/tmp/vts_profiling_configure enable /system/lib64/ 92 cts-tradefed run commandAndExit cts --skip-device-info --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker --skip-system-status-check com.android.tradefed.suite.checker.KeyguardStatusChecker -m $i 93 adb shell ls /data/local/tmp/*.vts.trace > temp 94 trace_path=$1/cts-traces/$DATE/$i 95 rm -rf $trace_path 96 mkdir -p $trace_path 97 while read -r trace 98 do 99 adb pull $trace $trace_path 100 done < "temp" 101done 102 103echo "done" 104