summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2018-04-25 12:57:16 -0500
committerFathi Boudra <fathi.boudra@linaro.org>2018-04-27 08:07:35 +0000
commitf8840734e67347c357a2884ed907da1050801b7b (patch)
tree0f2e057302447a3c1131427ebb64801ea9b98510
parentdd73c2a754f299c493b30e262bafe2ae84ee4525 (diff)
automated/linux/smoke: Add support to only run certain tests
Openembedded RPB images by default comes with busybox and no LSB support so some tests like lsb_release and lscpu fails. Change-Id: I48000a4fdb5c2ba5bf707f635e48b204345a7ca3 Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
-rwxr-xr-xautomated/linux/smoke/smoke.sh18
-rw-r--r--automated/linux/smoke/smoke.yaml3
2 files changed, 11 insertions, 10 deletions
diff --git a/automated/linux/smoke/smoke.sh b/automated/linux/smoke/smoke.sh
index 39548c7..75db48d 100755
--- a/automated/linux/smoke/smoke.sh
+++ b/automated/linux/smoke/smoke.sh
@@ -5,15 +5,17 @@
OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE
+TESTS="pwd, lsb_release -a, uname -a, ip a, lscpu, vmstat, lsblk"
usage() {
- echo "Usage: $0 [-s <true|false>]" 1>&2
+ echo "Usage: $0 [-s <true|false>] [-t TESTS]" 1>&2
exit 1
}
-while getopts "s:h" o; do
+while getopts "s:t:h" o; do
case "$o" in
s) SKIP_INSTALL="${OPTARG}" ;;
+ t) TESTS="${OPTARG}" ;;
h|*) usage ;;
esac
done
@@ -42,10 +44,8 @@ run() {
create_out_dir "${OUTPUT}"
install
-run "pwd"
-run "lsb_release -a"
-run "uname -a"
-run "ip a"
-run "lscpu"
-run "vmstat"
-run "lsblk"
+while [ -n "${TESTS}" ]; do
+ test_cmd="$(echo "${TESTS}" | awk -F',' '{print $1}')"
+ run "${test_cmd}"
+ TESTS="$(echo "${TESTS}" | sed -r "s/${test_cmd},? *//")"
+done
diff --git a/automated/linux/smoke/smoke.yaml b/automated/linux/smoke/smoke.yaml
index dc2891f..3c043e7 100644
--- a/automated/linux/smoke/smoke.yaml
+++ b/automated/linux/smoke/smoke.yaml
@@ -27,9 +27,10 @@ metadata:
params:
SKIP_INSTALL: "False"
+ TESTS: "pwd, lsb_release -a, uname -a, ip a, lscpu, vmstat, lsblk"
run:
steps:
- cd ./automated/linux/smoke/
- - ./smoke.sh -s "${SKIP_INSTALL}"
+ - ./smoke.sh -s "${SKIP_INSTALL}" -t "${TESTS}"
- ../../utils/send-to-lava.sh ./output/result.txt