diff options
author | Arthur She <arthur.she@linaro.org> | 2014-10-27 06:46:20 -0700 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-11-12 15:02:01 +0000 |
commit | f3c243168ded8b65e2126e48f2d64888642f4743 (patch) | |
tree | 4cc605c327cd37ce92d3f0dbef4866be4e2ea6e6 /common | |
parent | 252f24d1a061f03708c2bc22e66c3edfeead7951 (diff) |
sysbench: Add sysbench.yaml for both ubuntu & OE
Run sysbench in loop and increase the number of thread after each
iteration
Change-Id: I40db577fb2312da6efb79ccca8b7b697cb117741
Diffstat (limited to 'common')
-rwxr-xr-x | common/scripts/sysbench.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/common/scripts/sysbench.sh b/common/scripts/sysbench.sh new file mode 100755 index 0000000..3401c2b --- /dev/null +++ b/common/scripts/sysbench.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +TIMES=${1-8} +TEST=${2-cpu} +MAX_REQUESTS=${3-50000} +DURATION=${4-20} +FILE_TEST_MODE=${5-seqrewr} + +if [ ! `which sysbench` ]; then + echo "Error! the command 'sysbench' doesn't exist!" + lava-test-case sysbench --result fail + exit 1 +fi + +for i in $(seq 1 ${TIMES}); +do + t=$((${i} * 2)); + log_file="${TEST}-test-${t}-threads.log"; + opt="--test=${TEST} --max-requests=${MAX_REQUESTS} --num-threads=${t} --max-time=${DURATION}" + [ "${TEST}" = "threadsR" ] && opt="${opt} --thread-locks=$((${t}/2))" + [ "${TEST}" = "fileio" ] && opt="${opt} --file-test-mode=${FILE_TEST_MODE}" + echo "Running sysbench ${opt} run" | tee ${log_file}; + sysbench ${opt} run | tee -a ${log_file}; + lava-test-run-attach ${log_file}; + + # parse log file & submit to test result + sed -n -e '/Test execution summary\|General statistics/,/^$/p' ${log_file} | while read line; + do + id=$(echo ${line}|awk -F':' '{print $1}') + val=$(echo ${line}|awk -F':' '{print $2}') + if [ -n "${val}" ]; then + u=$(echo ${val}|sed 's/[0-9\.]*//') + v=$(echo ${val}|sed 's/\([0-9\.]*\)[a-zA-Z]*/\1/') + # let 's' to be the default unit for time measurement + [ -n "$(echo ${id}|grep 'time')" ] && [ -z "${u}" ] && u=s + [ -n "${u}" ] && o="--units ${u} --measurement ${v}" || o="--measurement ${val}" + lava-test-case "${id}-${t}-threads" --result pass ${o} + fi + done +done |