~liuyq0307/lava-android-test/pm-qa-indefinite-loop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/system/bin/sh

test_func(){
   if [ ! -d /data/benchmark/pm-qa ]; then
       echo "pm-qa=fail"
       exit
   fi  

   mkdir /data/bin/
   cd /data/bin

   busybox ln -s -f /system/bin/busybox awk
   busybox ln -s -f /system/bin/busybox basename
   busybox ln -s -f /system/bin/busybox chmod
   busybox ln -s -f /system/bin/busybox chown
   busybox ln -s -f /system/bin/busybox cp
   busybox ln -s -f /system/bin/busybox diff
   busybox ln -s -f /system/bin/busybox find
   busybox ln -s -f /system/bin/busybox grep
   busybox ln -s -f /system/bin/busybox rm
   busybox ln -s -f /system/bin/busybox seq
   busybox ln -s -f /system/bin/busybox taskset
   busybox ln -s -f /system/bin/busybox tee
   busybox ln -s -f /system/bin/busybox printf
   busybox ln -s -f /system/bin/busybox wc

   busybox ln -s -f /system/bin/fake_command command
   busybox ln -s -f /system/bin/fake_sudo sudo
   busybox ln -s -f /system/bin/fake_udevadm udevadm

   export PATH=/data/bin:$PATH

   cd /data/benchmark/pm-qa

   pwd=$PWD
   echo $pwd
   tests_dirs="cpuidle cpufreq cpuhotplug sched_mc suspend thermal utils"
   files=`find cpuidle cpufreq cpuhotplug sched_mc suspend -name "*.sh"`

   for dir in $tests_dirs
   do
       subDir=`pwd`/$dir
       if [ -d $subDir ]; then
       cd $subDir
       fi

       echo `pwd`
       for file in `find . -name "*.sh"`
       do
       path=$file
       echo $path
       /system/bin/sh $path
       done
       cd ..
   done

   echo "pm-qa=pass"
}

test_func