1*288bf522SAndroid Build Coastguard Worker# Script to gather perf and perf/watt data for several workloads 2*288bf522SAndroid Build Coastguard Worker# 3*288bf522SAndroid Build Coastguard Worker# Setup: 4*288bf522SAndroid Build Coastguard Worker# 5*288bf522SAndroid Build Coastguard Worker# - device connected to monsoon with USB passthrough enabled 6*288bf522SAndroid Build Coastguard Worker# - network enabled (baseline will be measured and subtracted 7*288bf522SAndroid Build Coastguard Worker# from results) (network needed for chrome, youtube tests) 8*288bf522SAndroid Build Coastguard Worker# - the device is rebooted after each test (can be inhibited 9*288bf522SAndroid Build Coastguard Worker# with "-r 0") 10*288bf522SAndroid Build Coastguard Worker# 11*288bf522SAndroid Build Coastguard Worker# Default behavior is to run each of the known workloads for 12*288bf522SAndroid Build Coastguard Worker# 30 minutes gathering both performance and power data. 13*288bf522SAndroid Build Coastguard Worker# 14*288bf522SAndroid Build Coastguard Worker# The default time can be overridden with the -t option. To 15*288bf522SAndroid Build Coastguard Worker# change individual test times, a config file can be specifed 16*288bf522SAndroid Build Coastguard Worker# via -f with times for individual tests. Example file contents: 17*288bf522SAndroid Build Coastguard Worker# 18*288bf522SAndroid Build Coastguard Worker# idleTime=60 19*288bf522SAndroid Build Coastguard Worker# recentflingTime=60 20*288bf522SAndroid Build Coastguard Worker# chromeTime=60 21*288bf522SAndroid Build Coastguard Worker# youtubeTime=0 22*288bf522SAndroid Build Coastguard Worker# sysappsTime=60 23*288bf522SAndroid Build Coastguard Worker# suntempleTime=5 24*288bf522SAndroid Build Coastguard Worker# 25*288bf522SAndroid Build Coastguard Worker# Output goes to the current directory. 26*288bf522SAndroid Build Coastguard Worker# 27*288bf522SAndroid Build Coastguard Worker# Examples: 28*288bf522SAndroid Build Coastguard Worker# 29*288bf522SAndroid Build Coastguard Worker# - Run all tests for 15 minutes (default is 30): ./pwrtest.sh -t 15 -R MDA20 30*288bf522SAndroid Build Coastguard Worker# 31*288bf522SAndroid Build Coastguard Worker# - Use a config file for test times: ./pwrtest.sh -f ./myconfig -R MDA20 32*288bf522SAndroid Build Coastguard Worker# 33*288bf522SAndroid Build Coastguard Worker# - Use a init file to setup device tuneables after each restart (this is 34*288bf522SAndroid Build Coastguard Worker# a bash script which should include adb commands to set up device): 35*288bf522SAndroid Build Coastguard Worker# ./pwrtest.sh -F devtunables 36*288bf522SAndroid Build Coastguard Worker# 37*288bf522SAndroid Build Coastguard Worker 38*288bf522SAndroid Build Coastguard WorkerdefaultTime=30 39*288bf522SAndroid Build Coastguard Workergarbageminutes=8 40*288bf522SAndroid Build Coastguard Worker 41*288bf522SAndroid Build Coastguard Workerfunction Usage { 42*288bf522SAndroid Build Coastguard Worker echo "Usage: $0 [OPTIONS]" 43*288bf522SAndroid Build Coastguard Worker echo "-d device : device type (shamu, bullhead, ...)" 44*288bf522SAndroid Build Coastguard Worker echo "-f configFile : config file to override individual test times" 45*288bf522SAndroid Build Coastguard Worker echo "-g garbageMinutes : time to skip power measurement at beginning of test" 46*288bf522SAndroid Build Coastguard Worker echo " default=$garbagetime minutes" 47*288bf522SAndroid Build Coastguard Worker echo "-r restart : 0=no reboot between tests, 1=reboot (default)" 48*288bf522SAndroid Build Coastguard Worker echo "-t defaultTimeMin : default time to run each test" 49*288bf522SAndroid Build Coastguard Worker echo " default=$defaultTime minutes" 50*288bf522SAndroid Build Coastguard Worker echo "-D cmddir : directory to find defs.sh" 51*288bf522SAndroid Build Coastguard Worker echo "-F restartHookFile : file of commands to set device tunables after restart (optional)" 52*288bf522SAndroid Build Coastguard Worker echo "-R release : release running on device (MDA20, 2054728, etc)" 53*288bf522SAndroid Build Coastguard Worker} 54*288bf522SAndroid Build Coastguard Worker 55*288bf522SAndroid Build Coastguard Workerrestart=1 56*288bf522SAndroid Build Coastguard Workerhz=5 57*288bf522SAndroid Build Coastguard Workershadowgrid2TimeMax=25 58*288bf522SAndroid Build Coastguard Worker 59*288bf522SAndroid Build Coastguard WorkerCMDDIR=$(dirname $0 2>/dev/null) 60*288bf522SAndroid Build Coastguard WorkerCMDDIR=${CMDDIR:=.} 61*288bf522SAndroid Build Coastguard Worker 62*288bf522SAndroid Build Coastguard WorkerMONSOON=monsoon.par 63*288bf522SAndroid Build Coastguard Worker 64*288bf522SAndroid Build Coastguard Workerwhile [ $# -gt 0 ] 65*288bf522SAndroid Build Coastguard Workerdo 66*288bf522SAndroid Build Coastguard Worker case "$1" in 67*288bf522SAndroid Build Coastguard Worker (-D) CMDDIR=$2; shift;; 68*288bf522SAndroid Build Coastguard Worker (-r) restart=$2; shift;; 69*288bf522SAndroid Build Coastguard Worker (-t) defaultTime=$2; shift;; 70*288bf522SAndroid Build Coastguard Worker (-F) restartfile=$2; shift;; 71*288bf522SAndroid Build Coastguard Worker (-g) garbageminutes=$2; shift;; 72*288bf522SAndroid Build Coastguard Worker (-f) 73*288bf522SAndroid Build Coastguard Worker configFile=$2; 74*288bf522SAndroid Build Coastguard Worker echo "Reading configs from $configFile..." 75*288bf522SAndroid Build Coastguard Worker . ./$configFile 76*288bf522SAndroid Build Coastguard Worker shift;; 77*288bf522SAndroid Build Coastguard Worker (-R) echo $2 > ./build; shift;; 78*288bf522SAndroid Build Coastguard Worker (--) ;; 79*288bf522SAndroid Build Coastguard Worker (--help) 80*288bf522SAndroid Build Coastguard Worker Usage 81*288bf522SAndroid Build Coastguard Worker exit 0;; 82*288bf522SAndroid Build Coastguard Worker (*) 83*288bf522SAndroid Build Coastguard Worker echo "Unknown option: $1" 84*288bf522SAndroid Build Coastguard Worker Usage 85*288bf522SAndroid Build Coastguard Worker exit 1;; 86*288bf522SAndroid Build Coastguard Worker esac 87*288bf522SAndroid Build Coastguard Worker shift 88*288bf522SAndroid Build Coastguard Workerdone 89*288bf522SAndroid Build Coastguard Worker 90*288bf522SAndroid Build Coastguard Worker. $CMDDIR/defs.sh -- 91*288bf522SAndroid Build Coastguard Worker 92*288bf522SAndroid Build Coastguard Workerdevdir="/data/local/tmp" 93*288bf522SAndroid Build Coastguard Workersuntempledir=${CMDDIR}/suntemple 94*288bf522SAndroid Build Coastguard Worker 95*288bf522SAndroid Build Coastguard Workercase $DEVICE in 96*288bf522SAndroid Build Coastguard Worker(shamu|hammerhead) 97*288bf522SAndroid Build Coastguard Worker HWUIMACRO=hwuimacro 98*288bf522SAndroid Build Coastguard Worker onSwipe="700 1847 700 400 50" 99*288bf522SAndroid Build Coastguard Worker ;; 100*288bf522SAndroid Build Coastguard Worker(*) 101*288bf522SAndroid Build Coastguard Worker HWUIMACRO=hwuimacro64 102*288bf522SAndroid Build Coastguard Worker onSwipe="500 1200 500 550 150" 103*288bf522SAndroid Build Coastguard Worker ;; 104*288bf522SAndroid Build Coastguard Workeresac 105*288bf522SAndroid Build Coastguard Worker 106*288bf522SAndroid Build Coastguard Workerscripts="defs.sh systemapps.sh recentfling.sh youtube.sh chromefling.sh" 107*288bf522SAndroid Build Coastguard Worker 108*288bf522SAndroid Build Coastguard Workerif ! $MONSOON >/dev/null 2>&1; then 109*288bf522SAndroid Build Coastguard Worker echo $MONSOON must be in your PATH >&2 110*288bf522SAndroid Build Coastguard Worker exit 1 111*288bf522SAndroid Build Coastguard Workerfi 112*288bf522SAndroid Build Coastguard Worker 113*288bf522SAndroid Build Coastguard Workerfunction usbpassthru { 114*288bf522SAndroid Build Coastguard Worker if [ "$1" = off ]; then 115*288bf522SAndroid Build Coastguard Worker state=off 116*288bf522SAndroid Build Coastguard Worker else 117*288bf522SAndroid Build Coastguard Worker state=on 118*288bf522SAndroid Build Coastguard Worker fi 119*288bf522SAndroid Build Coastguard Worker echo Setting usb pass-thru to $state 120*288bf522SAndroid Build Coastguard Worker monsoon.par --usbpassthrough=$state 121*288bf522SAndroid Build Coastguard Worker} 122*288bf522SAndroid Build Coastguard Worker 123*288bf522SAndroid Build Coastguard Workerfunction pwrcollect { 124*288bf522SAndroid Build Coastguard Worker collectmin=$1 125*288bf522SAndroid Build Coastguard Worker collectmin=${collectmin:=60} 126*288bf522SAndroid Build Coastguard Worker # samples = hz * 60 * minutes 127*288bf522SAndroid Build Coastguard Worker ((samples=5*60*collectmin)) 128*288bf522SAndroid Build Coastguard Worker monsoon.par --timestamp --samples $samples --hz 5 129*288bf522SAndroid Build Coastguard Worker} 130*288bf522SAndroid Build Coastguard Worker 131*288bf522SAndroid Build Coastguard Workerfunction copy_files { 132*288bf522SAndroid Build Coastguard Worker adb shell mkdir -p $devdir 133*288bf522SAndroid Build Coastguard Worker for file in $scripts 134*288bf522SAndroid Build Coastguard Worker do 135*288bf522SAndroid Build Coastguard Worker adb push $CMDDIR/$file $devdir 136*288bf522SAndroid Build Coastguard Worker done 137*288bf522SAndroid Build Coastguard Worker} 138*288bf522SAndroid Build Coastguard Worker 139*288bf522SAndroid Build Coastguard Workerfunction install_suntemple { 140*288bf522SAndroid Build Coastguard Worker echo Checking for suntemple installation... 141*288bf522SAndroid Build Coastguard Worker #stdest=/storage/sdcard0/obb/com.BrueComputing.SunTemple 142*288bf522SAndroid Build Coastguard Worker stdest=/storage/emulated/0/obb/com.BrueComputing.SunTemple 143*288bf522SAndroid Build Coastguard Worker dircontents=$(adb ls $stdest 2>/dev/null) 144*288bf522SAndroid Build Coastguard Worker if [ "$dircontents" = "" ]; then 145*288bf522SAndroid Build Coastguard Worker echo Installing suntemple... 146*288bf522SAndroid Build Coastguard Worker adb install $suntempledir/*.apk 147*288bf522SAndroid Build Coastguard Worker adb shell mkdir -p $stdest 148*288bf522SAndroid Build Coastguard Worker adb push $suntempledir/main*obb $stdest 149*288bf522SAndroid Build Coastguard Worker else 150*288bf522SAndroid Build Coastguard Worker echo dircontents=$dircontents 151*288bf522SAndroid Build Coastguard Worker echo Suntemple already installed. 152*288bf522SAndroid Build Coastguard Worker fi 153*288bf522SAndroid Build Coastguard Worker} 154*288bf522SAndroid Build Coastguard Worker 155*288bf522SAndroid Build Coastguard Workerfunction run_test { 156*288bf522SAndroid Build Coastguard Worker testName=$1 157*288bf522SAndroid Build Coastguard Worker collectMinutes=$2 158*288bf522SAndroid Build Coastguard Worker collectOutput=${testName}-power-raw.out 159*288bf522SAndroid Build Coastguard Worker powerOutput=${testName}-power.out 160*288bf522SAndroid Build Coastguard Worker echo ----------------------------------------------------- 161*288bf522SAndroid Build Coastguard Worker echo TEST: $testName 162*288bf522SAndroid Build Coastguard Worker echo enabled Cores $(adb shell "cat /sys/devices/system/cpu/online") 163*288bf522SAndroid Build Coastguard Worker date 164*288bf522SAndroid Build Coastguard Worker echo ----------------------------------------------------- 165*288bf522SAndroid Build Coastguard Worker usbpassthru off 166*288bf522SAndroid Build Coastguard Worker pwrcollect $collectMinutes > $collectOutput 2>/dev/null 167*288bf522SAndroid Build Coastguard Worker # take off the first 2min of samples 168*288bf522SAndroid Build Coastguard Worker totalSamples=$(cat $collectOutput | wc -l) 169*288bf522SAndroid Build Coastguard Worker # we throw away the first "garbageminutes" of the data 170*288bf522SAndroid Build Coastguard Worker # since it is volatile 171*288bf522SAndroid Build Coastguard Worker ((garbage=hz*60*garbageminutes)) 172*288bf522SAndroid Build Coastguard Worker ((remaining=totalSamples-garbage)) 173*288bf522SAndroid Build Coastguard Worker if [ $remaining -gt 0 ]; then 174*288bf522SAndroid Build Coastguard Worker tail -$remaining $collectOutput > $powerOutput 175*288bf522SAndroid Build Coastguard Worker else 176*288bf522SAndroid Build Coastguard Worker cp $collectOutput $powerOutput 177*288bf522SAndroid Build Coastguard Worker fi 178*288bf522SAndroid Build Coastguard Worker echo power data for $testName copied to $collectOutput 179*288bf522SAndroid Build Coastguard Worker usbpassthru on 180*288bf522SAndroid Build Coastguard Worker sleep 10 181*288bf522SAndroid Build Coastguard Worker adb devices 182*288bf522SAndroid Build Coastguard Worker sleep 10 183*288bf522SAndroid Build Coastguard Worker} 184*288bf522SAndroid Build Coastguard Worker 185*288bf522SAndroid Build Coastguard Workerfunction start_job { 186*288bf522SAndroid Build Coastguard Worker cmdline="$1" 187*288bf522SAndroid Build Coastguard Worker echo Running $cmdline 188*288bf522SAndroid Build Coastguard Worker (adb shell "cd $devdir && nohup $cmdline > test.out") & 189*288bf522SAndroid Build Coastguard Worker sleep 5 190*288bf522SAndroid Build Coastguard Worker kill %1 2>/dev/null 191*288bf522SAndroid Build Coastguard Worker} 192*288bf522SAndroid Build Coastguard Worker 193*288bf522SAndroid Build Coastguard Workerfunction cleanup_job { 194*288bf522SAndroid Build Coastguard Worker testName=$1 195*288bf522SAndroid Build Coastguard Worker processName=$2 196*288bf522SAndroid Build Coastguard Worker processName=${processName:=" sh "} 197*288bf522SAndroid Build Coastguard Worker set -- $(adb shell ps | tr "\r" " " | grep "$processName") 198*288bf522SAndroid Build Coastguard Worker echo killing PID=$2... 199*288bf522SAndroid Build Coastguard Worker adb shell kill $2 200*288bf522SAndroid Build Coastguard Worker sleep 1 201*288bf522SAndroid Build Coastguard Worker echo copying test output to $testName... 202*288bf522SAndroid Build Coastguard Worker adb pull $devdir/test.out 203*288bf522SAndroid Build Coastguard Worker mv test.out ${testName}.out 204*288bf522SAndroid Build Coastguard Worker if [ $restart -gt 0 ]; then 205*288bf522SAndroid Build Coastguard Worker restart_device 206*288bf522SAndroid Build Coastguard Worker else 207*288bf522SAndroid Build Coastguard Worker doKeyevent HOME 208*288bf522SAndroid Build Coastguard Worker fi 209*288bf522SAndroid Build Coastguard Worker} 210*288bf522SAndroid Build Coastguard Worker 211*288bf522SAndroid Build Coastguard Workerfunction airplane_mode { 212*288bf522SAndroid Build Coastguard Worker if [ "$1" = "on" ]; then 213*288bf522SAndroid Build Coastguard Worker mode=true 214*288bf522SAndroid Build Coastguard Worker setting=1 215*288bf522SAndroid Build Coastguard Worker else 216*288bf522SAndroid Build Coastguard Worker mode=false 217*288bf522SAndroid Build Coastguard Worker setting=0 218*288bf522SAndroid Build Coastguard Worker fi 219*288bf522SAndroid Build Coastguard Worker adb shell settings put global airplane_mode_on $setting 220*288bf522SAndroid Build Coastguard Worker adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state $mode 221*288bf522SAndroid Build Coastguard Worker echo Set airplane mode to $mode 222*288bf522SAndroid Build Coastguard Worker} 223*288bf522SAndroid Build Coastguard Worker 224*288bf522SAndroid Build Coastguard Workerfunction restart_device { 225*288bf522SAndroid Build Coastguard Worker adb reboot 226*288bf522SAndroid Build Coastguard Worker echo Wait 60s for device to restart... 227*288bf522SAndroid Build Coastguard Worker sleep 60 228*288bf522SAndroid Build Coastguard Worker while ! adb root 229*288bf522SAndroid Build Coastguard Worker do 230*288bf522SAndroid Build Coastguard Worker echo Waiting for device to come up... 231*288bf522SAndroid Build Coastguard Worker sleep 10 232*288bf522SAndroid Build Coastguard Worker done 233*288bf522SAndroid Build Coastguard Worker echo Wait 30s to complete boot activities... 234*288bf522SAndroid Build Coastguard Worker sleep 30 235*288bf522SAndroid Build Coastguard Worker echo Restart complete. 236*288bf522SAndroid Build Coastguard Worker doTap 897 1075 237*288bf522SAndroid Build Coastguard Worker sleep 2 238*288bf522SAndroid Build Coastguard Worker doSwipe $onSwipe 239*288bf522SAndroid Build Coastguard Worker restartfile=${restartfile:="./restarthook"} 240*288bf522SAndroid Build Coastguard Worker if [ -f $restartfile ]; then 241*288bf522SAndroid Build Coastguard Worker # hook to change tunables after a restart 242*288bf522SAndroid Build Coastguard Worker . $restartfile 243*288bf522SAndroid Build Coastguard Worker fi 244*288bf522SAndroid Build Coastguard Worker} 245*288bf522SAndroid Build Coastguard Worker 246*288bf522SAndroid Build Coastguard Workerusbpassthru on 247*288bf522SAndroid Build Coastguard Workeradb devices 2>/dev/null 248*288bf522SAndroid Build Coastguard Worker 249*288bf522SAndroid Build Coastguard Workerairplane_mode off 250*288bf522SAndroid Build Coastguard Workerif [ $restart -gt 0 ]; then 251*288bf522SAndroid Build Coastguard Worker restart_device 252*288bf522SAndroid Build Coastguard Workerfi 253*288bf522SAndroid Build Coastguard Worker 254*288bf522SAndroid Build Coastguard Workerecho Copying $scripts to device $devdir... 255*288bf522SAndroid Build Coastguard Workercopy_files 256*288bf522SAndroid Build Coastguard Workeradb shell ln -s /data/benchmarktest/hwuimacro/$HWUIMACRO $devdir/$HWUIMACRO 257*288bf522SAndroid Build Coastguard Workertests="" 258*288bf522SAndroid Build Coastguard Worker 259*288bf522SAndroid Build Coastguard Worker# measure background power 260*288bf522SAndroid Build Coastguard WorkeridleTime=${idleTime:=$defaultTime} 261*288bf522SAndroid Build Coastguard Workerif [ $idleTime -gt 0 ]; then 262*288bf522SAndroid Build Coastguard Worker echo Test 1 : measure idle power for $idleTime minutes 263*288bf522SAndroid Build Coastguard Worker run_test idle $idleTime 264*288bf522SAndroid Build Coastguard Worker airplane_mode on 265*288bf522SAndroid Build Coastguard Worker echo Restarting for power baseline in airplane mode... 266*288bf522SAndroid Build Coastguard Worker restart_device 267*288bf522SAndroid Build Coastguard Worker run_test idle-airplane $idleTime 268*288bf522SAndroid Build Coastguard Worker airplane_mode off 269*288bf522SAndroid Build Coastguard Worker # the screen blanks after 30 minutes. The first 2 minutes of the test 270*288bf522SAndroid Build Coastguard Worker # have already been filtered off. For our power baseline, keep the first 271*288bf522SAndroid Build Coastguard Worker # 20 minutes of the results 272*288bf522SAndroid Build Coastguard Worker ((twentyminutes=hz*20*60)) 273*288bf522SAndroid Build Coastguard Worker powerOutput="idle-power.out" 274*288bf522SAndroid Build Coastguard Worker displayPowerOutput="idle-display-power.out" 275*288bf522SAndroid Build Coastguard Worker airplanePowerOutput="idle-airplane-power.out" 276*288bf522SAndroid Build Coastguard Worker airplaneDisplayPowerOutput="idle-airplane-display-power.out" 277*288bf522SAndroid Build Coastguard Worker totalSamples=$(cat $powerOutput | wc -l) 278*288bf522SAndroid Build Coastguard Worker if [ $twentyminutes -lt $totalSamples ]; then 279*288bf522SAndroid Build Coastguard Worker head -$twentyminutes $powerOutput > $displayPowerOutput 280*288bf522SAndroid Build Coastguard Worker head -$twentyminutes $airplanePowerOutput > $airplaneDisplayPowerOutput 281*288bf522SAndroid Build Coastguard Worker else 282*288bf522SAndroid Build Coastguard Worker cp $powerOutput $displayPowerOutput 283*288bf522SAndroid Build Coastguard Worker cp $airplanePowerOutput $airplaneDisplayPowerOutput 284*288bf522SAndroid Build Coastguard Worker fi 285*288bf522SAndroid Build Coastguard Worker tests="$tests idle" 286*288bf522SAndroid Build Coastguard Workerfi 287*288bf522SAndroid Build Coastguard Worker 288*288bf522SAndroid Build Coastguard WorkerrecentflingTime=${recentflingTime:=$defaultTime} 289*288bf522SAndroid Build Coastguard Workerif [ $recentflingTime -gt 0 ]; then 290*288bf522SAndroid Build Coastguard Worker echo $(date) Test 2 : recents fling for $recentflingTime minutes 291*288bf522SAndroid Build Coastguard Worker airplane_mode on 292*288bf522SAndroid Build Coastguard Worker adb shell "cd $devdir && ./systemapps.sh -A -T -i 1" 293*288bf522SAndroid Build Coastguard Worker start_job "./recentfling.sh -N -i 1000 -d $DEVICE" 294*288bf522SAndroid Build Coastguard Worker run_test recentfling $recentflingTime 295*288bf522SAndroid Build Coastguard Worker cleanup_job recentfling 296*288bf522SAndroid Build Coastguard Worker airplane_mode off 297*288bf522SAndroid Build Coastguard Worker date 298*288bf522SAndroid Build Coastguard Worker tests="$tests recentfling" 299*288bf522SAndroid Build Coastguard Workerfi 300*288bf522SAndroid Build Coastguard Worker 301*288bf522SAndroid Build Coastguard WorkersuntempleTime=${suntempleTime:=$defaultTime} 302*288bf522SAndroid Build Coastguard Workerif [ $suntempleTime -gt 0 ]; then 303*288bf522SAndroid Build Coastguard Worker echo $(date) Test 2 : run Sun Temple $suntempleTime minutes 304*288bf522SAndroid Build Coastguard Worker airplane_mode on 305*288bf522SAndroid Build Coastguard Worker install_suntemple 306*288bf522SAndroid Build Coastguard Worker adb shell "am start $suntempleActivity" 307*288bf522SAndroid Build Coastguard Worker run_test suntemple $suntempleTime 308*288bf522SAndroid Build Coastguard Worker adb pull /sdcard/SunTemple/SunTemple/Saved/Logs/SunTemple.log 309*288bf522SAndroid Build Coastguard Worker cleanup_job suntemple BrueComp 310*288bf522SAndroid Build Coastguard Worker airplane_mode off 311*288bf522SAndroid Build Coastguard Worker mv SunTemple.log suntemple.out 312*288bf522SAndroid Build Coastguard Worker # grab the suntemple log 313*288bf522SAndroid Build Coastguard Worker date 314*288bf522SAndroid Build Coastguard Worker tests="$tests suntemple" 315*288bf522SAndroid Build Coastguard Workerfi 316*288bf522SAndroid Build Coastguard Worker 317*288bf522SAndroid Build Coastguard WorkerchromeTime=${chromeTime:=$defaultTime} 318*288bf522SAndroid Build Coastguard Workerif [ $chromeTime -gt 0 ]; then 319*288bf522SAndroid Build Coastguard Worker echo $(date) Test 3 : chrome fling for $chromeTime minutes 320*288bf522SAndroid Build Coastguard Worker start_job "./chromefling.sh -i 1000 -d $DEVICE" 321*288bf522SAndroid Build Coastguard Worker run_test chrome $chromeTime 322*288bf522SAndroid Build Coastguard Worker cleanup_job chrome 323*288bf522SAndroid Build Coastguard Worker date 324*288bf522SAndroid Build Coastguard Worker tests="$tests chrome" 325*288bf522SAndroid Build Coastguard Workerfi 326*288bf522SAndroid Build Coastguard Worker 327*288bf522SAndroid Build Coastguard Workershadowgrid2Time=${shadowgrid2Time:=$defaultTime} 328*288bf522SAndroid Build Coastguard Workerif [ $shadowgrid2Time -gt $shadowgrid2TimeMax ]; then 329*288bf522SAndroid Build Coastguard Worker # we cap shadowgrid2 time since the display goes 330*288bf522SAndroid Build Coastguard Worker # off after 30 minutes 331*288bf522SAndroid Build Coastguard Worker $shadowgrid2Time=$shadowgrid2TimeMax 332*288bf522SAndroid Build Coastguard Workerfi 333*288bf522SAndroid Build Coastguard Workerif [ $shadowgrid2Time -gt 0 ]; then 334*288bf522SAndroid Build Coastguard Worker airplane_mode on 335*288bf522SAndroid Build Coastguard Worker echo $(date) Test 4 : shadowgrid2 for $shadowgrid2Time minutes 336*288bf522SAndroid Build Coastguard Worker start_job "./$HWUIMACRO --onscreen shadowgrid2 100000" 337*288bf522SAndroid Build Coastguard Worker run_test shadowgrid2 $shadowgrid2Time 338*288bf522SAndroid Build Coastguard Worker cleanup_job shadowgrid2 $HWUIMACRO 339*288bf522SAndroid Build Coastguard Worker airplane_mode off 340*288bf522SAndroid Build Coastguard Worker date 341*288bf522SAndroid Build Coastguard Worker tests="$tests shadowgrid2" 342*288bf522SAndroid Build Coastguard Workerfi 343*288bf522SAndroid Build Coastguard Worker 344*288bf522SAndroid Build Coastguard WorkeryoutubeTime=${youtubeTime:=$defaultTime} 345*288bf522SAndroid Build Coastguard Workerif [ $youtubeTime -gt 0 ]; then 346*288bf522SAndroid Build Coastguard Worker echo $(date) Test 5 : youtube for $youtubeTime minutes 347*288bf522SAndroid Build Coastguard Worker start_job "./youtube.sh -i 1000 -d $DEVICE" 348*288bf522SAndroid Build Coastguard Worker run_test youtube $youtubeTime 349*288bf522SAndroid Build Coastguard Worker cleanup_job youtube 350*288bf522SAndroid Build Coastguard Worker date 351*288bf522SAndroid Build Coastguard Worker tests="$tests youtube" 352*288bf522SAndroid Build Coastguard Workerfi 353*288bf522SAndroid Build Coastguard Worker 354*288bf522SAndroid Build Coastguard WorkersysappsTime=${sysappsTime:=$defaultTime} 355*288bf522SAndroid Build Coastguard Workerif [ $sysappsTime -gt 0 ]; then 356*288bf522SAndroid Build Coastguard Worker echo $(date) Test 6 : app switching for $sysappsTime minutes 357*288bf522SAndroid Build Coastguard Worker start_job "./systemapps.sh -T -i 1000 -d $DEVICE" 358*288bf522SAndroid Build Coastguard Worker run_test sysapps $sysappsTime 359*288bf522SAndroid Build Coastguard Worker cleanup_job sysapps 360*288bf522SAndroid Build Coastguard Worker date 361*288bf522SAndroid Build Coastguard Worker tests="$tests sysapps" 362*288bf522SAndroid Build Coastguard Workerfi 363*288bf522SAndroid Build Coastguard Worker 364*288bf522SAndroid Build Coastguard Workerecho Ran tests: $tests 365*288bf522SAndroid Build Coastguard Workerecho $tests > tests 366*288bf522SAndroid Build Coastguard Worker 367