summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-01-19 16:36:46 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-01-19 12:02:54 +0000
commitca8cb23bd0137dd8a6ad8dcf0ba0a9157fc78d2f (patch)
treee9cda057cce11db1eb45a2a70bdd617867ee196c /automated
parentdc409a3ba962d1dca98f1cae6ab8c87627a68cd9 (diff)
automated: linux: add rt pi stress test
Change-Id: Ie6d3a7e0a7095d1602bc9648ed4fac9e4a539bdb Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rw-r--r--automated/linux/pi-stress/bin/README6
-rwxr-xr-xautomated/linux/pi-stress/bin/arm64/pi_stressbin0 -> 611952 bytes
-rwxr-xr-xautomated/linux/pi-stress/bin/armeabi/pi_stressbin0 -> 433444 bytes
-rwxr-xr-xautomated/linux/pi-stress/pi-stress.sh52
-rw-r--r--automated/linux/pi-stress/pi-stress.yaml40
5 files changed, 98 insertions, 0 deletions
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
--- /dev/null
+++ b/automated/linux/pi-stress/bin/arm64/pi_stress
Binary files 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
--- /dev/null
+++ b/automated/linux/pi-stress/bin/armeabi/pi_stress
Binary files 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 <true|false>] [-r <true|false>]" 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