aboutsummaryrefslogtreecommitdiff
path: root/build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh')
-rwxr-xr-xbuild/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh b/build/lib.linux-x86_64-2.7/lava_android_test/test_definitions/busybox/busybox_test.sh
new file mode 100755
index 0000000..455a75e
--- /dev/null
+++ b/build/lib.linux-x86_64-2.7/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/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