summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-11-11 17:06:50 +0800
committerChase Qi <chase.qi@linaro.org>2016-11-16 19:04:00 +0800
commitd7b8e0af204b2e4dee1ac2c87a0f56a1f7cf664f (patch)
tree4fcac86b1616c827e54ab63b2854d710fdd651e4
parent65d6f0ef02ffcfcce25625718fdff398460746b1 (diff)
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 <chase.qi@linaro.org>
-rwxr-xr-xautomated/linux/dsdbench/dsdbench.sh63
-rw-r--r--automated/linux/dsdbench/dsdbench.yaml38
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