diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-11-16 11:27:13 +0000 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2016-11-16 11:27:13 +0000 |
commit | 735537d9ea4a869915a4871261d98008a5a10774 (patch) | |
tree | 742fd2bf5da82df8e92c47197f18c1a6e66d2a59 | |
parent | 3c4cd13b177176270f5d916b1f2156e7dfdfff72 (diff) | |
parent | d7b8e0af204b2e4dee1ac2c87a0f56a1f7cf664f (diff) |
Merge "automated: added Linux dsdbench test"
-rwxr-xr-x | automated/linux/dsdbench/dsdbench.sh | 63 | ||||
-rw-r--r-- | automated/linux/dsdbench/dsdbench.yaml | 38 |
2 files changed, 101 insertions, 0 deletions
diff --git a/automated/linux/dsdbench/dsdbench.sh b/automated/linux/dsdbench/dsdbench.sh new file mode 100755 index 0000000..df6510a --- /dev/null +++ b/automated/linux/dsdbench/dsdbench.sh @@ -0,0 +1,63 @@ +#!/bin/sh -e + +# This test script run docker storage driver benchmarks and tests. +# Test suite source https://github.com/dmcgowan/dsdbench + +# shellcheck disable=SC1091 +. ../../lib/sh-test-lib +OUTPUT="$(pwd)/output" +TEST_SUITE="BENCHMARKS" +RESULT_FILE="${OUTPUT}/result.txt" +LOG_FILE="${OUTPUT}/dsbench.txt" + +usage() { + echo "Usage: $0 [-t <benchmarks|tests>] [-s <true|false>]" 1>&2 + exit 1 +} + +while getopts "t:s:h" o; do + case "$o" in + t) TEST_SUITE="${OPTARG}" ;; + s) SKIP_INSTALL="${OPTARG}" ;; + h|*) usage ;; + esac +done + +dist_name +# shellcheck disable=SC2154 +case "${dist}" in + Debian|Ubuntu) pkgs="git golang libdevmapper-dev" ;; + Fedora|CentOS) pkgs="git golang device-mapper-devel" ;; +esac +install_deps "${pkgs}" "${SKIP_INSTALL}" + +! check_root && error_msg "You need to be root to run this script." +[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)" +mkdir -p "${OUTPUT}/golang" +cd "${OUTPUT}" +export GOPATH="${OUTPUT}/golang" +git clone https://github.com/dmcgowan/dsdbench +cd dsdbench +cp -r vendor/ "${GOPATH}/src" + +if [ "${TEST_SUITE}" = "BENCHMARKS" ]; then + # Run benchmarks. + DOCKER_GRAPHDRIVER=overlay2 go test -run=NONE -v -bench . 2>&1 \ + | tee "${LOG_FILE}" + + # Parse log file. + egrep "^Benchmark.*op$" "${LOG_FILE}" \ + | awk '{printf("%s pass %s %s\n", $1,$3,$4)}' \ + | tee -a "${RESULT_FILE}" +elif [ "${TEST_SUITE}" = "TESTS" ]; then + # Run tests. + DOCKER_GRAPHDRIVER=overlay2 go test -v . 2>&1 \ + | tee "${LOG_FILE}" + + # Parse log file. + for result in PASS FAIL SKIP; do + grep "\-\-\- ${result}" "${LOG_FILE}" \ + | awk -v result="${result}" '{printf("%s %s\n", $3,result)}' \ + | tee -a "${RESULT_FILE}" + done +fi diff --git a/automated/linux/dsdbench/dsdbench.yaml b/automated/linux/dsdbench/dsdbench.yaml new file mode 100644 index 0000000..5787481 --- /dev/null +++ b/automated/linux/dsdbench/dsdbench.yaml @@ -0,0 +1,38 @@ +metadata: + name: dsdbench + format: "Lava-Test-Shell Test Definition 1.0" + description: "dsdbench runs benchmarks and tests for storage driver + configurations to help figure out how the configuration will + perform and which known issues the daemon may be affected by + in this configuration." + maintainer: + - chase.qi@linaro.org + os: + - debian + - ubuntu + - fedora + - centos + scope: + - performance + - functional + environment: + - lava-test-shell + devices: + - hi6220-hikey + - apq8016-sbc + - mustang + - moonshot + - thunderX + - d03 + - d05 + +params: + # Available test suite: BENCHMARKS, TESTS + TEST_SUITE: "BENCHMARKS" + SKIP_INSTALL: "False" + +run: + steps: + - cd ./automated/linux/dsdbench/ + - ./dsdbench.sh -t "${TEST_SUITE}" -s "${SKIP_INSTALL}" + - ../../utils/send-to-lava.sh ./output/result.txt |