summaryrefslogtreecommitdiff
path: root/common/scripts/pm-qa.sh
blob: 8736a46726d8f61fc65286ae1460fa3795fb416c (plain)
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
61
62
63
64
65
66
67
#!/system/bin/sh

scripts_dir="/data/benchmark/pm-qa"
test_func(){
   if [ ! -d "${scripts_dir}" ]; 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 "${scripts_dir}"

   pwd_dir=$PWD
   echo $pwd
   tests_dirs="cpuidle cpufreq cpuhotplug suspend thermal"

   for dir in $tests_dirs; do
       var=$dir'_sanity.sh'
       subDir=${pwd_dir}/$dir
       if [ -d $subDir ]; then
           cd $subDir
       else
           continue
       fi

       echo `pwd`

       /system/bin/sh $var
       if [ $? -ne 0 ]; then
           continue
       fi

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

   echo "pm-qa=pass"
}

test_func