aboutsummaryrefslogtreecommitdiff
path: root/build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/pm_qa/pm-qa.sh
blob: a570d8e8574c6858228a331cb6fab190860fbc9e (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
#!/system/bin/sh

scripts_dir=$1 && shift
if [ -z "${scripts_dir}" ];then
    scripts_dir="/data/benchmark/pm-qa"
fi
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 sched_mc suspend thermal utils"

   for dir in $tests_dirs; do
       subDir=${pwd_dir}/$dir
       if [ -d $subDir ]; then
           cd $subDir
       else
           continue
       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