diff options
author | Chase Qi <chase.qi@linaro.org> | 2016-08-18 13:18:50 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-08-25 10:06:18 +0000 |
commit | 09edc7f6fcaf627eee88ab4447c749c55ee2100c (patch) | |
tree | 40a54061560828e3c78c9270ed70717f6c1ab893 /automated/linux | |
parent | 706092ca46da3f87ebd6ad70907ea24cbbd3b1ef (diff) |
v2: initial commit
- Added utils, bin, and lib folders and related tools
- Added Linux smoke test case as an example
- Added test plan example that used to test test-runner
Change-Id: I73693108db219cb67afc99525d80cab93f1eb9ea
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/linux')
-rwxr-xr-x | automated/linux/smoke/smoke.sh | 51 | ||||
-rw-r--r-- | automated/linux/smoke/smoke.yaml | 27 |
2 files changed, 78 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" diff --git a/automated/linux/smoke/smoke.yaml b/automated/linux/smoke/smoke.yaml new file mode 100644 index 0000000..f20e6db --- /dev/null +++ b/automated/linux/smoke/smoke.yaml @@ -0,0 +1,27 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: smoke-tests-basic + description: "Run basic smoke tests." + maintainer: + - milosz.wasilewski@linaro.org + - chase.qi@linaro.org + os: + - debian + - fedora + scope: + - functional + devices: + - panda + - panda-es + - juno + - hi6220-hikey + - apq8016-sbc + +params: + SKIP_INSTALL: "False" + +run: + steps: + - cd ./automated/linux/smoke/ + - ./smoke.sh -s "${SKIP_INSTALL}" + - ../../utils/send-to-lava.sh ./output/result.txt |