summaryrefslogtreecommitdiff
path: root/automated/linux/busybox/busybox.sh
diff options
context:
space:
mode:
Diffstat (limited to 'automated/linux/busybox/busybox.sh')
-rwxr-xr-xautomated/linux/busybox/busybox.sh50
1 files changed, 50 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"