summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-11-04 18:38:30 +0800
committerChase Qi <chase.qi@linaro.org>2016-11-04 22:01:02 +0800
commitbe6a4b54f5cef21e4ba48b2fc8048e1720b257ac (patch)
tree9d0fedbebe8d7fe7ac41a3a23e8acd239114b589
parentfce2e1d9e70d74220ee1db8d56936fc90d78c441 (diff)
automated: linux: add blogbench test
Change-Id: I25d1d36064ac9f486713e32f734d816b04d433ee Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rw-r--r--automated/linux/blogbench/bin/COPYING15
-rw-r--r--automated/linux/blogbench/bin/README4
-rwxr-xr-xautomated/linux/blogbench/bin/arm64/blogbenchbin0 -> 963688 bytes
-rwxr-xr-xautomated/linux/blogbench/bin/armeabi/blogbenchbin0 -> 741440 bytes
-rwxr-xr-xautomated/linux/blogbench/blogbench.sh51
-rw-r--r--automated/linux/blogbench/blogbench.yaml34
6 files changed, 104 insertions, 0 deletions
diff --git a/automated/linux/blogbench/bin/COPYING b/automated/linux/blogbench/bin/COPYING
new file mode 100644
index 0000000..aaaaab3
--- /dev/null
+++ b/automated/linux/blogbench/bin/COPYING
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2005-2010 Frank Denis <j at pureftpd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
diff --git a/automated/linux/blogbench/bin/README b/automated/linux/blogbench/bin/README
new file mode 100644
index 0000000..f64f033
--- /dev/null
+++ b/automated/linux/blogbench/bin/README
@@ -0,0 +1,4 @@
+The binaries are provided under the terms listed in COPYING file.
+
+The binaries were built from blogbench-1.1. The source can be viewed here:
+https://download.pureftpd.org/pub/blogbench/
diff --git a/automated/linux/blogbench/bin/arm64/blogbench b/automated/linux/blogbench/bin/arm64/blogbench
new file mode 100755
index 0000000..f802b5e
--- /dev/null
+++ b/automated/linux/blogbench/bin/arm64/blogbench
Binary files differ
diff --git a/automated/linux/blogbench/bin/armeabi/blogbench b/automated/linux/blogbench/bin/armeabi/blogbench
new file mode 100755
index 0000000..863869a
--- /dev/null
+++ b/automated/linux/blogbench/bin/armeabi/blogbench
Binary files differ
diff --git a/automated/linux/blogbench/blogbench.sh b/automated/linux/blogbench/blogbench.sh
new file mode 100755
index 0000000..b07d9f9
--- /dev/null
+++ b/automated/linux/blogbench/blogbench.sh
@@ -0,0 +1,51 @@
+#!/bin/sh -e
+
+. ../../lib/sh-test-lib
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOG_FILE="${OUTPUT}/blogbench.txt"
+ITERATION="30"
+PARTITION=""
+
+usage() {
+ echo "Usage: $0 [-i <iterations>] [-p </dev/sda1>]" 1>&2
+ exit 1
+}
+
+while getopts "i:p:h" o; do
+ case "$o" in
+ i) ITERATION="${OPTARG}" ;;
+ p) PARTITION="${OPTARG}" ;;
+ h|*) usage ;;
+ esac
+done
+
+! 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}"
+
+# Set the directory for blogbench test.
+if [ -n "${PARTITION}" ]; then
+ if mount | grep -q "${PARTITION}"; then
+ mount "${PARTITION}" /mnt
+ cd /mnt/
+ else
+ mount_point=$(mount | grep "${PARTITION}" | awk '{print $3}')
+ cd "${mount_point}"
+ fi
+fi
+mkdir ./bench
+
+# Run blogbench test.
+detect_abi
+# shellcheck disable=SC2154
+./bin/"${abi}"/blogbench -i "${ITERATION}" -d ./bench 2>&1 | tee "${LOG_FILE}"
+
+# Parse test result.
+for i in writes reads; do
+ grep "Final score for $i" "${LOG_FILE}" \
+ | awk -v i="$i" '{printf("blogbench-%s pass %s blogs\n", i, $NF)}' \
+ | tee -a "${RESULT_FILE}"
+done
+
+rm -rf ./bench
diff --git a/automated/linux/blogbench/blogbench.yaml b/automated/linux/blogbench/blogbench.yaml
new file mode 100644
index 0000000..bc10b6d
--- /dev/null
+++ b/automated/linux/blogbench/blogbench.yaml
@@ -0,0 +1,34 @@
+metadata:
+ name: blogbench
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Blogbench is a portable filesystem benchmark that tries to
+ reproduce the load of a real-world busy file server."
+ maintainer:
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - fedora
+ - centos
+ scope:
+ - performance
+ devices:
+ - mustang
+ - overdrive
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+params:
+ # Blogbench run 30 iterations by default.
+ ITERATION: 30
+ # Specify a local disk partition for nfsrootfs boot.
+ # For example: /dev/sda1
+ PARTITION: ''
+
+run:
+ steps:
+ - cd ./automated/linux/blogbench/
+ - ./blogbench.sh -i "${ITERATION}" -p "${PARTITION}"
+ - ../../utils/send-to-lava.sh ./output/result.txt