From f3c243168ded8b65e2126e48f2d64888642f4743 Mon Sep 17 00:00:00 2001 From: Arthur She Date: Mon, 27 Oct 2014 06:46:20 -0700 Subject: sysbench: Add sysbench.yaml for both ubuntu & OE Run sysbench in loop and increase the number of thread after each iteration Change-Id: I40db577fb2312da6efb79ccca8b7b697cb117741 --- common/scripts/sysbench.sh | 40 ++++++++++++++++++++++++++++++++++++++++ openembedded/sysbench.yaml | 37 +++++++++++++++++++++++++++++++++++++ ubuntu/sysbench.yaml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100755 common/scripts/sysbench.sh create mode 100644 openembedded/sysbench.yaml create mode 100644 ubuntu/sysbench.yaml 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 diff --git a/openembedded/sysbench.yaml b/openembedded/sysbench.yaml new file mode 100644 index 0000000..5f72995 --- /dev/null +++ b/openembedded/sysbench.yaml @@ -0,0 +1,37 @@ +metadata: + name: sysbench + format: "Lava-Test-Shell Test Definition 1.0" + description: + "Run sysbench test in loop and increase the number of thread after each iteration" + maintainer: + - arthur.she@linaro.org + os: + - openembedded + devices: + - arndale + - beaglebone-black + - rtsm_fvp_base-aemv8a + scope: + - performance + - preempt-rt + +install: + bzr-repos: + - lp:sysbench + steps: + - 'cd sysbench' + - 'find . | xargs touch' + - './autogen.sh' + - './configure --without-mysql' + - 'make all install' + +params: + TIMES: 8 # The number of times 'sysbench' will be run + TEST: cpu # Could be cpu, threads, fileio, memory or mutex + MAX_REQUESTS: 50000 # Limit for total number of requests + DURATION: 20 # Limit for total execution time in seconds + FILE_TEST_MODE: seqrewr # Possible values: seqwr, seqrewr, seqrd, rndrd, rndwr, rndwr + +run: + steps: + - './common/scripts/sysbench.sh ${TIMES} ${TEST} ${MAX_REQUESTS} ${DURATION} ${FILE_TEST_MODE}' diff --git a/ubuntu/sysbench.yaml b/ubuntu/sysbench.yaml new file mode 100644 index 0000000..0ee8427 --- /dev/null +++ b/ubuntu/sysbench.yaml @@ -0,0 +1,31 @@ +metadata: + name: sysbench + format: "Lava-Test-Shell Test Definition 1.0" + description: + "Run sysbench test in loop and increase the number of thread after each iteration" + maintainer: + - arthur.she@linaro.org + os: + - ubuntu + devices: + - arndale + - beaglebone-black + - rtsm_fvp_base-aemv8a + scope: + - performance + - preempt-rt + +install: + deps: + - sysbench + +params: + TIMES: 8 # The number of times 'sysbench' will be run + TEST: cpu # Could be cpu, threads, fileio, memory or mutex + MAX_REQUESTS: 50000 # Limit for total number of requests + DURATION: 20 # Limit for total execution time in seconds + FILE_TEST_MODE: seqrewr # Possible values: seqwr, seqrewr, seqrd, rndrd, rndwr, rndwr + +run: + steps: + - './common/scripts/sysbench.sh ${TIMES} ${TEST} ${MAX_REQUESTS} ${DURATION} ${FILE_TEST_MODE}' -- cgit v1.2.3