aboutsummaryrefslogtreecommitdiff
path: root/lava_android_test/test_definitions/busybox/busybox_test.sh
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-01-03 17:46:21 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2015-01-03 17:46:21 +0800
commitcf7013d6e23f0a0da3bcae5fb9d8e20639b1d21f (patch)
tree4888505a53fc2070d376945391ae48bbee333166 /lava_android_test/test_definitions/busybox/busybox_test.sh
downloadlava-android-test-cf7013d6e23f0a0da3bcae5fb9d8e20639b1d21f.tar.gz
first commit
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'lava_android_test/test_definitions/busybox/busybox_test.sh')
-rwxr-xr-xlava_android_test/test_definitions/busybox/busybox_test.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/lava_android_test/test_definitions/busybox/busybox_test.sh b/lava_android_test/test_definitions/busybox/busybox_test.sh
new file mode 100755
index 0000000..4b3bd4e
--- /dev/null
+++ b/lava_android_test/test_definitions/busybox/busybox_test.sh
@@ -0,0 +1,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/busybox 1>/dev/null 2>/dev/null
+
+test_func mkdir /data/busybox
+test_func touch /data/busybox/test.txt
+test_func ls /data/busybox/test.txt
+test_func ps
+test_func whoami
+test_func which busybox
+test_func basename /data/busybox/test.txt
+test_func cp /data/busybox/test.txt /data/busybox/test2.txt
+test_func rm /data/busybox/test2.txt
+test_func dmesg
+test_func grep service /init.rc
+
+rm -r /data/busybox 1>/dev/null 2>/dev/null