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 18 adb root 19 adb disable-verity 20 adb reboot 21 adb wait-for-device 22 adb root 23 adb remount 24 25 # push profiler libs 26 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.audio@2.0-vts.profiler.so system/lib64/ 27 adb 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/ 28 adb 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/ 29 adb 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/ 30 adb 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/ 31 adb 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/ 32 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.bluetooth@1.0-vts.profiler.so system/lib64/ 33 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.boot@1.0-vts.profiler.so system/lib64/ 34 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.broadcastradio@1.0-vts.profiler.so system/lib64/ 35 adb 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/ 36 adb 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/ 37 adb 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/ 38 adb 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/ 39 adb 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/ 40 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.configstore@1.0-vts.profiler.so system/lib64/ 41 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.contexthub@1.0-vts.profiler.so system/lib64/ 42 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.drm@1.0-vts.profiler.so system/lib64/ 43 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.dumpstate@1.0-vts.profiler.so system/lib64/ 44 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.gatekeeper@1.0-vts.profiler.so system/lib64/ 45 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.gnss@1.0-vts.profiler.so system/lib64/ 46 adb 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/ 47 adb 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/ 48 adb 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/ 49 adb 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/ 50 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.health@1.0-vts.profiler.so system/lib64/ 51 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.ir@1.0-vts.profiler.so system/lib64/ 52 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.keymaster@3.0-vts.profiler.so system/lib64/ 53 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.light@2.0-vts.profiler.so system/lib64/ 54 adb 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/ 55 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.memtrack@1.0-vts.profiler.so system/lib64/ 56 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.nfc@1.0-vts.profiler.so system/lib64/ 57 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.power@1.0-vts.profiler.so system/lib64/ 58 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.radio@1.0-vts.profiler.so system/lib64/ 59 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.sensors@1.0-vts.profiler.so system/lib64/ 60 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.soundtrigger@2.0-vts.profiler.so system/lib64/ 61 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.thermal@1.0-vts.profiler.so system/lib64/ 62 adb 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/ 63 adb 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/ 64 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.usb@1.0-vts.profiler.so system/lib64/ 65 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.vibrator@1.0-vts.profiler.so system/lib64/ 66 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.vr@1.0-vts.profiler.so system/lib64/ 67 adb push ${ANDROID_BUILD_TOP}/out/host/linux-x86/vts/android-vts/testcases/DATA/lib64/android.hardware.wifi@1.0-vts.profiler.so system/lib64/ 68 adb 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 70 adb 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 73 tests=() 74 while read -r test 75 do 76 tests+=($test) 77 done < "${ANDROID_BUILD_TOP}/test/vts/script/cts_test_list.txt" 78 79 # run cts testcases 80 DATE=`date +%Y-%m-%d` 81 for i in ${tests[@]} 82 do 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" 101 done 102 103 echo "done" 104