summaryrefslogtreecommitdiff
path: root/automated/linux/smoke/smoke.sh
diff options
context:
space:
mode:
Diffstat (limited to 'automated/linux/smoke/smoke.sh')
-rwxr-xr-xautomated/linux/smoke/smoke.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/automated/linux/smoke/smoke.sh b/automated/linux/smoke/smoke.sh
new file mode 100755
index 0000000..42d4c90
--- /dev/null
+++ b/automated/linux/smoke/smoke.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+. ../../lib/sh-test-lib
+OUTPUT="$(pwd)/output"
+mkdir -p "${OUTPUT}"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+
+usage() {
+ echo "Usage: $0 [-s <true|false>]" 1>&2
+ exit 1
+}
+
+while getopts "s:" o; do
+ case "$o" in
+ s) SKIP_INSTALL="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+install() {
+ dist_name
+ case "${dist}" in
+ Debian|Ubuntu) pkgs="lsb-release" ;;
+ Fedora|CentOS) pkgs="redhat-lsb-core" ;;
+ esac
+
+ install_deps "${pkgs}" "${SKIP_INSTALL}"
+}
+
+run() {
+ local test="$1"
+ test_case_id="$(echo "${test}" | awk '{print $1}')"
+ echo
+ info_msg "Running ${test_case_id} test..."
+ eval "${test}"
+ check_return "${test_case_id}"
+}
+
+# Test run.
+[ -f "${OUTPUT}" ] && \
+mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+
+install
+run "pwd"
+run "lsb_release -a"
+run "uname -a"
+run "ip a"
+run "lscpu"
+run "vmstat"
+run "lsblk"