summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-01-20 16:12:24 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-01-24 09:08:43 +0000
commit594cd924125ae7b02a4cbb2fa0a77936fbda00c6 (patch)
tree93afc1194b26810b052cf0e51616635b52313bae
parentf6c4c21172f9ecb16aa0e32aac13032e53eba1d4 (diff)
automated: linux: add rt-migrate-test
Change-Id: I03da01b64b5cded668c86feab952e9d5731d30da Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rw-r--r--automated/linux/rt-migrate-test/bin/README6
-rwxr-xr-xautomated/linux/rt-migrate-test/bin/arm64/rt-migrate-testbin0 -> 591832 bytes
-rwxr-xr-xautomated/linux/rt-migrate-test/bin/armeabi/rt-migrate-testbin0 -> 419776 bytes
-rwxr-xr-xautomated/linux/rt-migrate-test/rt-migrate-test.sh42
-rw-r--r--automated/linux/rt-migrate-test/rt-migrate-test.yaml35
5 files changed, 83 insertions, 0 deletions
diff --git a/automated/linux/rt-migrate-test/bin/README b/automated/linux/rt-migrate-test/bin/README
new file mode 100644
index 0000000..cf96841
--- /dev/null
+++ b/automated/linux/rt-migrate-test/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/rt-migrate-test/bin/arm64/rt-migrate-test b/automated/linux/rt-migrate-test/bin/arm64/rt-migrate-test
new file mode 100755
index 0000000..6ebcd1a
--- /dev/null
+++ b/automated/linux/rt-migrate-test/bin/arm64/rt-migrate-test
Binary files differ
diff --git a/automated/linux/rt-migrate-test/bin/armeabi/rt-migrate-test b/automated/linux/rt-migrate-test/bin/armeabi/rt-migrate-test
new file mode 100755
index 0000000..e3c7c77
--- /dev/null
+++ b/automated/linux/rt-migrate-test/bin/armeabi/rt-migrate-test
Binary files differ
diff --git a/automated/linux/rt-migrate-test/rt-migrate-test.sh b/automated/linux/rt-migrate-test/rt-migrate-test.sh
new file mode 100755
index 0000000..aec379e
--- /dev/null
+++ b/automated/linux/rt-migrate-test/rt-migrate-test.sh
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+# rt-migrate-test verifies the RT threads scheduler balancing.
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+
+OUTPUT="$(pwd)/output"
+LOGFILE="${OUTPUT}/rt-migrate-test.txt"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOOPS="100"
+
+usage() {
+ echo "Usage: $0 [-l loops]" 1>&2
+ exit 1
+}
+
+while getopts ":l:" opt; do
+ case "${opt}" in
+ l) LOOPS="${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}"
+
+# Run rt-migrate-test.
+detect_abi
+# shellcheck disable=SC2154
+./bin/"${abi}"/rt-migrate-test -l "${LOOPS}" | tee "${LOGFILE}"
+
+# Parse test log.
+task_num=$(grep "Task" "${LOGFILE}" | tail -1 | awk '{print $2}')
+for t in $(seq 0 "${task_num}"); do
+ # Get the priority of the task.
+ p=$(grep "Task $t" "${LOGFILE}" | awk '{print substr($4,1,length($4)-1)}')
+ sed -n "/Task $t/,/Avg/p" "${LOGFILE}" \
+ | grep -v "Task" \
+ | awk -v t="$t" -v p="$p" '{printf("t%s-p%s-%s pass %s %s\n",t,p,tolower(substr($1, 1, length($1)-1)),$2,$3)}' \
+ | tee -a "${RESULT_FILE}"
+done
diff --git a/automated/linux/rt-migrate-test/rt-migrate-test.yaml b/automated/linux/rt-migrate-test/rt-migrate-test.yaml
new file mode 100644
index 0000000..473d2b2
--- /dev/null
+++ b/automated/linux/rt-migrate-test/rt-migrate-test.yaml
@@ -0,0 +1,35 @@
+metadata:
+ name: rt-migrate-test
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "rt-migrate-test verifies the RT threads scheduler balancing."
+ maintainer:
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - fedora
+ - centos
+ - openembedded
+ scope:
+ - performance
+ - preempt-rt
+ environment:
+ - lava-test-shell
+ devices:
+ - hi6220-hikey
+ - apq8016-sbc
+ - mustang
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+params:
+ # Number of loops.
+ LOOPS: "100"
+
+run:
+ steps:
+ - cd ./automated/linux/rt-migrate-test/
+ - ./rt-migrate-test.sh -l "${LOOPS}"
+ - ../../utils/send-to-lava.sh ./output/result.txt