aboutsummaryrefslogtreecommitdiff
path: root/build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh
blob: 455a75ee871ea53a3e17c4cd479e0a2c2d31152f (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
#!/system/bin/sh

test_func(){
    if [ ! -f /system/bin/busybox ]; then
         echo "busybox=unexist"
         exit
    fi  

    if /system/bin/busybox [ $# -lt 1 ]; then
        return 0
    fi
    test_cmd=$1
    /system/bin/busybox "$@" 1>/dev/null 2>/dev/null
    if /system/bin/busybox [ $? -ne 0 ]; then
        echo "${test_cmd}=fail"
    else
        echo "${test_cmd}=pass"
    fi
}

rm -r /data/local/tmp/busybox 1>/dev/null 2>/dev/null

test_func mkdir /data/local/tmp/busybox
test_func touch /data/local/tmp/busybox/test.txt
test_func ls /data/local/tmp/busybox/test.txt
test_func ps
test_func whoami
test_func which busybox
test_func basename /data/local/tmp/busybox/test.txt
test_func cp /data/local/tmp/busybox/test.txt /data/local/tmp/busybox/test2.txt
test_func rm /data/local/tmp/busybox/test2.txt
test_func dmesg
test_func grep service /init.rc

rm -r /data/busybox 1>/dev/null 2>/dev/null