From ca8cb23bd0137dd8a6ad8dcf0ba0a9157fc78d2f Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Thu, 19 Jan 2017 16:36:46 +0800 Subject: automated: linux: add rt pi stress test Change-Id: Ie6d3a7e0a7095d1602bc9648ed4fac9e4a539bdb Signed-off-by: Chase Qi --- automated/linux/pi-stress/bin/README | 6 +++ automated/linux/pi-stress/bin/arm64/pi_stress | Bin 0 -> 611952 bytes automated/linux/pi-stress/bin/armeabi/pi_stress | Bin 0 -> 433444 bytes automated/linux/pi-stress/pi-stress.sh | 52 ++++++++++++++++++++++++ automated/linux/pi-stress/pi-stress.yaml | 40 ++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 automated/linux/pi-stress/bin/README create mode 100755 automated/linux/pi-stress/bin/arm64/pi_stress create mode 100755 automated/linux/pi-stress/bin/armeabi/pi_stress create mode 100755 automated/linux/pi-stress/pi-stress.sh create mode 100644 automated/linux/pi-stress/pi-stress.yaml (limited to 'automated') diff --git a/automated/linux/pi-stress/bin/README b/automated/linux/pi-stress/bin/README new file mode 100644 index 0000000..cf96841 --- /dev/null +++ b/automated/linux/pi-stress/bin/README @@ -0,0 +1,6 @@ +The binaries are provided under the terms of the GNU General Public License, +Version 2. The source can be viewed here: + +https://git.kernel.org/cgit/utils/rt-tests/rt-tests.git/ + +The binaries were built from branch: stable/v1.0 diff --git a/automated/linux/pi-stress/bin/arm64/pi_stress b/automated/linux/pi-stress/bin/arm64/pi_stress new file mode 100755 index 0000000..c88802d Binary files /dev/null and b/automated/linux/pi-stress/bin/arm64/pi_stress differ diff --git a/automated/linux/pi-stress/bin/armeabi/pi_stress b/automated/linux/pi-stress/bin/armeabi/pi_stress new file mode 100755 index 0000000..374076c Binary files /dev/null and b/automated/linux/pi-stress/bin/armeabi/pi_stress differ diff --git a/automated/linux/pi-stress/pi-stress.sh b/automated/linux/pi-stress/pi-stress.sh new file mode 100755 index 0000000..ed99e7c --- /dev/null +++ b/automated/linux/pi-stress/pi-stress.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# pi_stress checks Priority Inheritence Mutexes and their ability to avoid +# Priority Inversion from occuring by running groups of threads that cause +# Priority Inversions. + +# shellcheck disable=SC1091 +. ../../lib/sh-test-lib + +OUTPUT="$(pwd)/output" +RESULT_FILE="${OUTPUT}/result.txt" +export RESULT_FILE + +DURATION="300" +MLOCKALL="false" +RR="false" + +usage() { + echo "Usage: $0 [-d duration] [-m ] [-r ]" 1>&2 + exit 1 +} + +while getopts ":d:m:r:" opt; do + case "${opt}" in + d) DURATION="${OPTARG}" ;; + m) MLOCKALL="${OPTARG}" ;; + r) RR="${OPTARG}" ;; + *) usage ;; + esac +done + +! check_root && error_msg "Please run this script as root." +[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)" +mkdir -p "${OUTPUT}" + +if "${MLOCKALL}"; then + MLOCKALL="--mlockall" +else + MLOCKALL="" +fi +if "${RR}"; then + RR="--rr" +else + RR="" +fi + +detect_abi +# pi_stress will send SIGTERM when test fails. The single will terminate the +# test script. Catch and ignore it with trap. +trap '' TERM +# shellcheck disable=SC2154 +./bin/"${abi}"/pi_stress --duration "${DURATION}" "${MLOCKALL}" "${RR}" +check_return 'pi-stress' diff --git a/automated/linux/pi-stress/pi-stress.yaml b/automated/linux/pi-stress/pi-stress.yaml new file mode 100644 index 0000000..28d4bff --- /dev/null +++ b/automated/linux/pi-stress/pi-stress.yaml @@ -0,0 +1,40 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: pi-stress + description: "pi_stress checks Priority Inheritence Mutexes and their + ability to avoid Priority Inversion from occuring by running + groups of threads that cause Priority Inversions." + maintainer: + - chase.qi@linaro.org + os: + - debian + - ubuntu + - fedora + - centos + - openembedded + scope: + - functional + - preempt-rt + devices: + - hi6220-hikey + - apq8016-sbc + - mustang + - moonshot + - thunderX + - d03 + - d05 + +params: + # Length of the test run in seconds + DURATION: 300 + # Set MLOCKALL to "true" to lock current and future memory + MLOCKALL: "false" + # Set RR to "true" to use SCHED_RR for test threads. + # It uses SCHED_FIFO by default. + RR: "false" + +run: + steps: + - cd automated/linux/pi-stress + - ./pi-stress.sh -d "$DURATION" -m "${MLOCKALL}" -r "${RR}" + - ../../utils/send-to-lava.sh ./output/result.txt -- cgit v1.2.3