summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-01-23 11:07:26 +0800
committerChase Qi <chase.qi@linaro.org>2017-01-23 11:11:13 +0800
commitf4dd1fd4226bf016fa434081cb44464d652392ee (patch)
tree0c4ea5836d5dff34cb4927e65c22cd0a20b5f9f3 /automated
parent7aa508c220cf5a43f50c4b66744746c4d3afd32f (diff)
downloadtest-definitions-pipe-f4dd1fd4226bf016fa434081cb44464d652392ee.tar.gz
automated: linux: add busybox test
Change-Id: I4caa10b60609da218f4c825c4f166c9dbc8497d4 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/linux/busybox/busybox.sh50
-rw-r--r--automated/linux/busybox/busybox.yaml28
2 files changed, 78 insertions, 0 deletions
diff --git a/automated/linux/busybox/busybox.sh b/automated/linux/busybox/busybox.sh
new file mode 100755
index 0000000..a34a636
--- /dev/null
+++ b/automated/linux/busybox/busybox.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Busybox smoke tests.
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+
+[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+mkdir -p "${OUTPUT}"
+cd "${OUTPUT}" || exit 1
+
+busybox
+exit_on_fail "busybox-existence"
+
+busybox mkdir dir
+check_return "mkdir"
+
+busybox touch dir/file.txt
+check_return "touch"
+
+busybox ls dir/file.txt
+check_return "ls"
+
+busybox cp dir/file.txt dir/file.txt.bak
+check_return "cp"
+
+busybox rm dir/file.txt.bak
+check_return "rm"
+
+busybox echo 'busybox test' > dir/file.txt
+check_return "echo"
+
+busybox cat dir/file.txt
+check_return "cat"
+
+busybox grep 'busybox' dir/file.txt
+check_return "grep"
+
+# shellcheck disable=SC2016
+busybox awk '{printf("%s: awk\n", $0)}' dir/file.txt
+check_return "awk"
+
+busybox free
+check_return "free"
+
+busybox df
+check_return "df"
diff --git a/automated/linux/busybox/busybox.yaml b/automated/linux/busybox/busybox.yaml
new file mode 100644
index 0000000..4de5169
--- /dev/null
+++ b/automated/linux/busybox/busybox.yaml
@@ -0,0 +1,28 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: busybox
+ description: "Busybox smoke tests."
+ maintainer:
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - centos
+ - fedora
+ - openembedded
+ scope:
+ - functional
+ devices:
+ - hi6220-hikey
+ - apq8016-sbc
+ - mustang
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+run:
+ steps:
+ - cd ./automated/linux/busybox/
+ - ./busybox.sh
+ - ../../utils/send-to-lava.sh ./output/result.txt