From d7b8e0af204b2e4dee1ac2c87a0f56a1f7cf664f Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Fri, 11 Nov 2016 17:06:50 +0800 Subject: automated: added Linux dsdbench test 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. Test suite source https://github.com/dmcgowan/dsdbench Change-Id: I68a46cb6354fbcaa880b81bb564e761f61309b6d Signed-off-by: Chase Qi --- automated/linux/dsdbench/dsdbench.sh | 63 ++++++++++++++++++++++++++++++++++ automated/linux/dsdbench/dsdbench.yaml | 38 ++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100755 automated/linux/dsdbench/dsdbench.sh create mode 100644 automated/linux/dsdbench/dsdbench.yaml 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 ] [-s ]" 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 -- cgit v1.2.3