diff options
author | Arthur She <arthur.she@linaro.org> | 2020-09-10 09:21:26 -0700 |
---|---|---|
committer | Arthur She <arthur.she@linaro.org> | 2020-09-10 09:21:26 -0700 |
commit | b298b1a75bf07df25425cbb66be8197f94c3c410 (patch) | |
tree | 2ad16c5e1d0bff57ccd3b86d04b703fca2092d1c /automated | |
parent | 057961e263a5ac8083df514e5c042fb0845a97be (diff) | |
parent | 54164a27979de698fd36f1b4da56b2893be2c4a4 (diff) |
Merge remote-tracking branch 'linaro-github/master'
Diffstat (limited to 'automated')
25 files changed, 193 insertions, 66 deletions
diff --git a/automated/android/apk-automation/gearses2eclair.py b/automated/android/apk-automation/gearses2eclair.py index 4a49bc0..c0251f7 100755 --- a/automated/android/apk-automation/gearses2eclair.py +++ b/automated/android/apk-automation/gearses2eclair.py @@ -1,3 +1,4 @@ +import re import sys import time from common import ApkTestRunner @@ -25,34 +26,24 @@ class ApkRunnerImpl(ApkTestRunner): raw_output_file = "%s/logcat-gearses2eclair-itr%s.log" % (self.config['output'], self.config['itr']) self.call_adb('logcat -d > %s' % raw_output_file) - flagwordA = "a3d_GLES_dump" - flagwordB = "fps" - result_collector = [] + # 08-29 01:25:29.491 4704 4728 I a3d : a3d_GLES_dump@566 fps=58 + fps_pattern = re.compile(r'^.*\s+:\s+a3d_GLES_dump@\d+\s+fps=(?P<fps>\d+)\s*$') - logfile = open(raw_output_file, "r") - for line in logfile: - linelist = line.strip("\n").strip("\r").split(" ") - linelist = filter(None, linelist) - for itemA in linelist: - if itemA.find(flagwordA) != -1: - for itemB in linelist: - if itemB.find(flagwordB) != -1: - self.logger.info('linelist: %s' % linelist) - for i in range(0, len(linelist)): - grouplist = linelist[i].split("=") - if len(grouplist) == 2 and grouplist[0] == flagwordB: - result_collector.append(grouplist[1]) - logfile.close() + result_collector = [] + with open(raw_output_file, "r") as logfile: + for line in logfile: + matches = fps_pattern.match(line) + if matches: + result_collector.append(matches.group('fps')) self.logger.info('result_collector: %s' % result_collector) if len(result_collector) > 0: average_fps = sum(float(element) for element in result_collector) / len(result_collector) score_number = average_fps run_result = "pass" - score_unit = flagwordB self.logger.info("The average FPS in this test run is %s" % str(score_number)) else: self.logger.error("The collector is empty, no actual result received!") sys.exit(1) - self.report_result('gearses2eclair', run_result, score_number, score_unit) + self.report_result('gearses2eclair', run_result, score_number, "fps") diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib index 43a54bd..161611f 100755 --- a/automated/lib/sh-test-lib +++ b/automated/lib/sh-test-lib @@ -7,7 +7,7 @@ error_fatal() { # shellcheck disable=SC2039 local msg="$1" [ -z "${msg}" ] && msg="Unknown error" - if which lava-test-raise;then + if command -v lava-test-raise; then lava-test-raise "${msg}" else printf "FATAL ERROR: %s\n" "${msg}" >&2 @@ -565,3 +565,64 @@ format_partitions() { sleep 5 done } + +background_process_start() { + NAME="$1" + shift + if [ -z "$NAME" ]; then + err_msg "Usage: background-process-start NAME --cmd PROCESS" + fi + + while [ $# -gt 0 ]; do + case $1 in + --cmd) + shift + PROCESS="$*" + shift + ;; + *) + err_msg "Unhandled argument" + ;; + esac + done + + if [ -z "${PROCESS}" ]; then + return + fi + + result_dir="${OUTPUT}/results/$NAME" + mkdir -p "${result_dir}" + + cat <<EOF > "${result_dir}/bg_run.sh" +set -e +trap "exit" SIGHUP SIGINT SIGTERM +while true; do + $PROCESS > /dev/null + sleep 1 +done +EOF + + /bin/bash "${result_dir}/bg_run.sh" & + echo $! > "${result_dir}/pid" +} + +background_process_stop() { + NAME="$1" + shift + if [ -z "${NAME}" ]; then + err_msg "Usage: background-process-stop NAME" + fi + + result_dir="${OUTPUT}/results/${NAME}" + + if [ ! -d "${result_dir}" ] ; then + return + fi + + PID=$(cat "${result_dir}/pid") + + if ps -p "${PID}" > /dev/null; + then + kill "${PID}" > /dev/null 2>&1 + fi +} diff --git a/automated/linux/cyclicdeadline/cyclicdeadline.sh b/automated/linux/cyclicdeadline/cyclicdeadline.sh index 2404772..1f6b1b7 100755 --- a/automated/linux/cyclicdeadline/cyclicdeadline.sh +++ b/automated/linux/cyclicdeadline/cyclicdeadline.sh @@ -15,19 +15,21 @@ STEP="500" THREADS="1" DURATION="1m" MAX_LATENCY="50" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-i interval] [-s step] [-t threads] [-D duration ] [-m latency]" 1>&2 + echo "Usage: $0 [-i interval] [-s step] [-t threads] [-D duration ] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":i:s:t:D:m:" opt; do +while getopts ":i:s:t:D:m:w:" opt; do case "${opt}" in i) INTERVAL="${OPTARG}" ;; s) STEP="${STEP}" ;; t) THREADS="${OPTARG}" ;; D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -41,9 +43,14 @@ if ! binary=$(command -v cyclicdeadline); then # shellcheck disable=SC2154 binary="./bin/${abi}/cyclicdeadline" fi + +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -i "${INTERVAL}" -s "${STEP}" -t "${THREADS}" \ -D "${DURATION}" | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py cyclicdeadline "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/cyclicdeadline/cyclicdeadline.yaml b/automated/linux/cyclicdeadline/cyclicdeadline.yaml index 7259c4f..6614054 100644 --- a/automated/linux/cyclicdeadline/cyclicdeadline.yaml +++ b/automated/linux/cyclicdeadline/cyclicdeadline.yaml @@ -39,9 +39,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "50" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/cyclicdeadline/ - - ./cyclicdeadline.sh -i "${INTERVAL}" -s "${STEP}" -t "${THREADS}" -D "${DURATION}" -m "${MAX_LATENCY}" + - ./cyclicdeadline.sh -i "${INTERVAL}" -s "${STEP}" -t "${THREADS}" -D "${DURATION}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/cyclictest/cyclictest.sh b/automated/linux/cyclictest/cyclictest.sh index e1bbcd8..59e45b0 100755 --- a/automated/linux/cyclictest/cyclictest.sh +++ b/automated/linux/cyclictest/cyclictest.sh @@ -16,13 +16,14 @@ THREADS="1" AFFINITY="0" DURATION="1m" MAX_LATENCY="50" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-p priority] [-i interval] [-t threads] [-a affinity] [-D duration ] [-m latency]" 1>&2 + echo "Usage: $0 [-p priority] [-i interval] [-t threads] [-a affinity] [-D duration ] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":p:i:t:a:D:m:" opt; do +while getopts ":p:i:t:a:D:m:w:" opt; do case "${opt}" in p) PRIORITY="${OPTARG}" ;; i) INTERVAL="${OPTARG}" ;; @@ -30,6 +31,7 @@ while getopts ":p:i:t:a:D:m:" opt; do a) AFFINITY="${OPTARG}" ;; D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -38,14 +40,19 @@ done create_out_dir "${OUTPUT}" # Run cyclictest. -if ! binary=$(which cyclictest); then +if ! binary=$(command -v cyclictest); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/cyclictest" fi -"${binary}" -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" \ + +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + +"${binary}" -q -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" \ -D "${DURATION}" -m | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py cyclictest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/cyclictest/cyclictest.yaml b/automated/linux/cyclictest/cyclictest.yaml index 613a963..605eefa 100644 --- a/automated/linux/cyclictest/cyclictest.yaml +++ b/automated/linux/cyclictest/cyclictest.yaml @@ -41,9 +41,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "50" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/cyclictest/ - - ./cyclictest.sh -D "${DURATION}" -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" -m "${MAX_LATENCY}" + - ./cyclictest.sh -D "${DURATION}" -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/glmark2/glmark2.yaml b/automated/linux/glmark2/glmark2.yaml index 02c0e8b..2a1182a 100644 --- a/automated/linux/glmark2/glmark2.yaml +++ b/automated/linux/glmark2/glmark2.yaml @@ -15,11 +15,12 @@ metadata: params: DISPLAY: ":0" + GLMARK_BIN: "glmark2" run: steps: - export DISPLAY=${DISPLAY} - cd ./automated/linux/glmark2 - - glmark2 | tee glmark2.log + - ${GLMARK_BIN} | tee glmark2.log - ./glmark2_lava_parse.py glmark2.log > ./result.txt - ../../utils/send-to-lava.sh ./result.txt diff --git a/automated/linux/hci-smoke/hci-smoke-test.sh b/automated/linux/hci-smoke/hci-smoke-test.sh index 02c56f7..4009245 100755 --- a/automated/linux/hci-smoke/hci-smoke-test.sh +++ b/automated/linux/hci-smoke/hci-smoke-test.sh @@ -99,7 +99,7 @@ test_hcitool_scan() { hcitool -i "${DEVICE}" scan check_return "hciconfig-scan" hcitool -i "${DEVICE}" scan | grep $BADDR_PATTERN - check_return "hciconfig-scan (verify available devices)" + check_return "hciconfig-scan-verify-available-devices" } # Test HCI device inquiry @@ -108,7 +108,7 @@ test_hcitool_inq() { hcitool -i "${DEVICE}" inq check_return "hciconfig-inq" hcitool -i "${DEVICE}" inq | grep $BADDR_PATTERN - check_return "hciconfig-inq (verify available devices)" + check_return "hciconfig-inq-verify-available-devices" } # Test run. @@ -126,6 +126,4 @@ test_hciconfig_up test_hcitool_scan test_hcitool_inq - - - +exit 0 diff --git a/automated/linux/lemp/debian-nginx.conf b/automated/linux/lemp/debian-nginx.conf index 0826a65..c4023e9 100644 --- a/automated/linux/lemp/debian-nginx.conf +++ b/automated/linux/lemp/debian-nginx.conf @@ -12,6 +12,6 @@ server { location ~ \.php$ { include snippets/fastcgi-php.conf; - fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } } diff --git a/automated/linux/lemp/lemp.sh b/automated/linux/lemp/lemp.sh index 2c1ece8..1b3465b 100755 --- a/automated/linux/lemp/lemp.sh +++ b/automated/linux/lemp/lemp.sh @@ -28,7 +28,7 @@ case "${dist}" in cp ./debian-nginx.conf /etc/nginx/sites-available/default systemctl restart nginx systemctl restart mysql - systemctl restart php7.0-fpm + systemctl restart php7.4-fpm ;; centos) # x86_64 nginx package can be installed from epel repo. However, epel diff --git a/automated/linux/pi-stress/pi-stress.sh b/automated/linux/pi-stress/pi-stress.sh index d5e4c1d..637fc96 100755 --- a/automated/linux/pi-stress/pi-stress.sh +++ b/automated/linux/pi-stress/pi-stress.sh @@ -14,17 +14,19 @@ export RESULT_FILE DURATION="5m" MLOCKALL="false" RR="false" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-D runtime] [-m <true|false>] [-r <true|false>]" 1>&2 + echo "Usage: $0 [-D runtime] [-m <true|false>] [-r <true|false>] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":D:m:r:" opt; do +while getopts ":D:m:r:w" opt; do case "${opt}" in D) DURATION="${OPTARG}" ;; m) MLOCKALL="${OPTARG}" ;; r) RR="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -43,15 +45,20 @@ else RR="" fi -if ! binary=$(which pi_stress); then +if ! binary=$(command -v pi_stress); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/pi_stress" fi + +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + # pi_stress will send SIGTERM when test fails. The single will terminate the # test script. Catch and ignore it with trap. trap '' TERM -"${binary}" --duration "${DURATION}" "${MLOCKALL}" "${RR}" | tee "${LOGFILE}" +"${binary}" -q --duration "${DURATION}" "${MLOCKALL}" "${RR}" | tee "${LOGFILE}" + +background_process_stop bgcmd # shellcheck disable=SC2181 if [ "$?" -ne "0" ]; then diff --git a/automated/linux/pi-stress/pi-stress.yaml b/automated/linux/pi-stress/pi-stress.yaml index 314f7c5..da810be 100644 --- a/automated/linux/pi-stress/pi-stress.yaml +++ b/automated/linux/pi-stress/pi-stress.yaml @@ -32,9 +32,11 @@ params: # Set RR to "true" to use SCHED_RR for test threads. # It uses SCHED_FIFO by default. RR: "false" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd automated/linux/pi-stress - - ./pi-stress.sh -D "${DURATION}" -m "${MLOCKALL}" -r "${RR}" + - ./pi-stress.sh -D "${DURATION}" -m "${MLOCKALL}" -r "${RR}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/pmqtest/pmqtest.sh b/automated/linux/pmqtest/pmqtest.sh index c196fd9..9df2161 100755 --- a/automated/linux/pmqtest/pmqtest.sh +++ b/automated/linux/pmqtest/pmqtest.sh @@ -10,16 +10,18 @@ LOGFILE="${OUTPUT}/pmqtest.log" RESULT_FILE="${OUTPUT}/result.txt" DURATION="5m" MAX_LATENCY="100" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-D duration] [-m latency]" 1>&2 + echo "Usage: $0 [-D duration] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":D:m:" opt; do +while getopts ":D:m:w:" opt; do case "${opt}" in D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -30,14 +32,18 @@ done create_out_dir "${OUTPUT}" # Run pmqtest. -if ! binary=$(which pmqtest); then +if ! binary=$(command -v pmqtest); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/pmqtest" fi +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -S -p 98 -D "${DURATION}" | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py pmqtest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/pmqtest/pmqtest.yaml b/automated/linux/pmqtest/pmqtest.yaml index d75cf13..07b59c5 100644 --- a/automated/linux/pmqtest/pmqtest.yaml +++ b/automated/linux/pmqtest/pmqtest.yaml @@ -30,9 +30,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "100" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/pmqtest/ - - ./pmqtest.sh -D "${DURATION}" -m "${MAX_LATENCY}" + - ./pmqtest.sh -D "${DURATION}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/ptsematest/ptsematest.sh b/automated/linux/ptsematest/ptsematest.sh index fd2d53e..6bde712 100755 --- a/automated/linux/ptsematest/ptsematest.sh +++ b/automated/linux/ptsematest/ptsematest.sh @@ -9,16 +9,18 @@ LOGFILE="${OUTPUT}/ptsematest.log" RESULT_FILE="${OUTPUT}/result.txt" DURATION="5m" MAX_LATENCY="100" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-D duration] [-m latency]" 1>&2 + echo "Usage: $0 [-D duration] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":D:m:" opt; do +while getopts ":D:m:w:" opt; do case "${opt}" in D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -35,8 +37,12 @@ if ! binary=$(command -v ptsematest); then binary="./bin/${abi}/ptsematest" fi +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -S -p 98 -D "${DURATION}" | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py ptsematest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/ptsematest/ptsematest.yaml b/automated/linux/ptsematest/ptsematest.yaml index c22f70b..e90a4cd 100644 --- a/automated/linux/ptsematest/ptsematest.yaml +++ b/automated/linux/ptsematest/ptsematest.yaml @@ -32,9 +32,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "100" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/ptsematest/ - - ./ptsematest.sh -D "${DURATION}" -m "${MAX_LATENCY}" + - ./ptsematest.sh -D "${DURATION}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/rt-migrate-test/rt-migrate-test.sh b/automated/linux/rt-migrate-test/rt-migrate-test.sh index d53986e..b967b95 100755 --- a/automated/linux/rt-migrate-test/rt-migrate-test.sh +++ b/automated/linux/rt-migrate-test/rt-migrate-test.sh @@ -7,18 +7,20 @@ OUTPUT="$(pwd)/output" LOGFILE="${OUTPUT}/rt-migrate-test.txt" RESULT_FILE="${OUTPUT}/result.txt" -PRIORITY="96" +PRIORITY="51" DURATION="1m" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-p priority] [-D duration]" 1>&2 + echo "Usage: $0 [-p priority] [-D duration] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":l:p:D:" opt; do +while getopts ":l:p:D:w:" opt; do case "${opt}" in p) PRIORITY="${OPTARG}" ;; D) DURATION="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -27,13 +29,18 @@ done create_out_dir "${OUTPUT}" # Run rt-migrate-test. -if ! binary=$(which rt-migrate-test); then +if ! binary=$(command -v rt-migrate-test); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/rt-migrate-test" fi + +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -p "${PRIORITY}" -D "${DURATION}" -c | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. task_num=$(grep "Task" "${LOGFILE}" | tail -1 | awk '{print $2}') r=$(sed -n 's/Passed!/pass/p; s/Failed!/fail/p' "${LOGFILE}") diff --git a/automated/linux/rt-migrate-test/rt-migrate-test.yaml b/automated/linux/rt-migrate-test/rt-migrate-test.yaml index 715ac6c..c651d67 100644 --- a/automated/linux/rt-migrate-test/rt-migrate-test.yaml +++ b/automated/linux/rt-migrate-test/rt-migrate-test.yaml @@ -25,11 +25,15 @@ metadata: - d05 params: + # Priority of lowest prio thread (3 threads are created). PRIORITY: "96" + # Execute rt-migrate-test for given time DURATION: "5m" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/rt-migrate-test/ - - ./rt-migrate-test.sh -p "${PRIORITY}" -D "${DURATION}" + - ./rt-migrate-test.sh -p "${PRIORITY}" -D "${DURATION}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/signaltest/signaltest.sh b/automated/linux/signaltest/signaltest.sh index 41b6181..1ac2e0c 100755 --- a/automated/linux/signaltest/signaltest.sh +++ b/automated/linux/signaltest/signaltest.sh @@ -12,18 +12,20 @@ PRIORITY="98" THREADS="2" MAX_LATENCY="100" DURATION="1m" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-r runtime] [-p priority] [-t threads] [-m latency]" 1>&2 + echo "Usage: $0 [-r runtime] [-p priority] [-t threads] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":p:t:D:m:" opt; do +while getopts ":p:t:D:m:w:" opt; do case "${opt}" in p) PRIORITY="${OPTARG}" ;; t) THREADS="${OPTARG}" ;; D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -32,15 +34,19 @@ done create_out_dir "${OUTPUT}" # Run signaltest. -if ! binary=$(which signaltest); then +if ! binary=$(command -v signaltest); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/signaltest" fi +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -D "${DURATION}" -m -p "${PRIORITY}" -t "${THREADS}" \ | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py signaltest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/signaltest/signaltest.yaml b/automated/linux/signaltest/signaltest.yaml index 06b1205..f93bc1a 100644 --- a/automated/linux/signaltest/signaltest.yaml +++ b/automated/linux/signaltest/signaltest.yaml @@ -34,9 +34,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "100" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/signaltest - - ./signaltest.sh -D "${DURATION}" -p "${PRIORITY}" -t "${THREADS}" -m "${MAX_LATENCY}" + - ./signaltest.sh -D "${DURATION}" -p "${PRIORITY}" -t "${THREADS}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/sigwaittest/sigwaittest.sh b/automated/linux/sigwaittest/sigwaittest.sh index ac6c2ae..7293e52 100755 --- a/automated/linux/sigwaittest/sigwaittest.sh +++ b/automated/linux/sigwaittest/sigwaittest.sh @@ -11,16 +11,18 @@ LOGFILE="${OUTPUT}/sigwaittest.log" RESULT_FILE="${OUTPUT}/result.txt" DURATION="5m" MAX_LATENCY="100" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-D duration] [-m latency]" 1>&2 + echo "Usage: $0 [-D duration] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":D:m:" opt; do +while getopts ":D:m:w:" opt; do case "${opt}" in D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -37,8 +39,12 @@ if ! binary=$(command -v sigwaittest); then binary="./bin/${abi}/sigwaittest" fi +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -t -a -p 98 -D "${DURATION}" | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py sigwaittest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/sigwaittest/sigwaittest.yaml b/automated/linux/sigwaittest/sigwaittest.yaml index 4074f63..0047bf2 100644 --- a/automated/linux/sigwaittest/sigwaittest.yaml +++ b/automated/linux/sigwaittest/sigwaittest.yaml @@ -33,9 +33,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "100" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/sigwaittest/ - - ./sigwaittest.sh -D "${DURATION}" -m "${MAX_LATENCY}" + - ./sigwaittest.sh -D "${DURATION}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/svsematest/svsematest.sh b/automated/linux/svsematest/svsematest.sh index 8a6326e..ca800b6 100755 --- a/automated/linux/svsematest/svsematest.sh +++ b/automated/linux/svsematest/svsematest.sh @@ -11,16 +11,18 @@ LOGFILE="${OUTPUT}/svsematest.log" RESULT_FILE="${OUTPUT}/result.txt" DURATION="5m" MAX_LATENCY="100" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-D duration] [-m latency]" 1>&2 + echo "Usage: $0 [-D duration] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":D:m:" opt; do +while getopts ":D:m:w:" opt; do case "${opt}" in D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -37,8 +39,12 @@ if ! binary=$(command -v svsematest); then binary="./bin/${abi}/svsematest" fi +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -t -a -p 98 -D "${DURATION}" | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py svsematest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/svsematest/svsematest.yaml b/automated/linux/svsematest/svsematest.yaml index 10b17c6..5c50283 100644 --- a/automated/linux/svsematest/svsematest.yaml +++ b/automated/linux/svsematest/svsematest.yaml @@ -33,9 +33,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "100" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/svsematest - - ./svsematest.sh -D "${DURATION}" -m "${MAX_LATENCY}" + - ./svsematest.sh -D "${DURATION}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt diff --git a/automated/linux/wlan-smoke/wlan-smoke-test.sh b/automated/linux/wlan-smoke/wlan-smoke-test.sh index 8bf028a..57bcdca 100755 --- a/automated/linux/wlan-smoke/wlan-smoke-test.sh +++ b/automated/linux/wlan-smoke/wlan-smoke-test.sh @@ -91,6 +91,4 @@ test_wlan_boot test_wlan_down test_wlan_up - - - +exit 0 |