summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur She <arthur.she@linaro.org>2014-07-14 10:30:20 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-07-15 09:43:28 +0000
commit3e0090591f55d1f86e2ce1e4f0c726851b2b7425 (patch)
tree71e99200f452d6691d909bf69b7fd78d30c22565
parent02f82936089d5aa48381bdba70d067eba84c4c1b (diff)
Trinity test: Add openembedded/trinity.yaml
Add trinity test. It will test syscalls randomly with random arguments. Change-Id: Iba3da90fa708ad043bd1e9b007d45d972ad0b9d0
-rwxr-xr-xopenembedded/scripts/fuzz-test.sh28
-rw-r--r--openembedded/trinity.yaml33
2 files changed, 61 insertions, 0 deletions
diff --git a/openembedded/scripts/fuzz-test.sh b/openembedded/scripts/fuzz-test.sh
new file mode 100755
index 0000000..386d2a8
--- /dev/null
+++ b/openembedded/scripts/fuzz-test.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#set -x
+
+DURATION=$1
+LOGFILE=$2
+RESULT_PASS_FILE="./trinity-result-pass"
+
+if [ -f ${RESULT_PASS_FILE} ]; then
+ rm -f ${RESULT_PASS_FILE}
+fi
+if [ -f zip_log ]; then
+ rm -f zip_log
+fi
+mkfifo zip_log
+(gzip -c < zip_log > ${LOGFILE}) &
+
+echo -e "DURATION: ${DURATION}"
+# Send SIGKILL to trinity processes after DURATION seconds
+(sleep ${DURATION} ; for p in `pgrep trinity`;do [ ! -f ${RESULT_PASS_FILE} ] && touch ${RESULT_PASS_FILE} ; kill -9 $p; done) &
+# Remove non-printable ASCII characters by tr
+./trinity/trinity -m --dangerous | tr -cd '\11\12\15\40-\176' | tee zip_log
+
+if [ -f ${RESULT_PASS_FILE} ]; then
+ exit 0
+else
+ exit 1
+fi
diff --git a/openembedded/trinity.yaml b/openembedded/trinity.yaml
new file mode 100644
index 0000000..71d87b7
--- /dev/null
+++ b/openembedded/trinity.yaml
@@ -0,0 +1,33 @@
+metadata:
+ name: trinity
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description:
+ "Trinity Test (http://codemonkey.org.uk/projects/trinity/)
+ It will test syscalls randomly with random arguments.
+ We will run the test for DURATION seconds. If the kernel
+ didn't crash or taint, it passes the test, otherwise, it failed.
+ IT MIGHT DAMAGE THE PLATFORM, SO IT'S BETTER TO RUN IT ON EMULATOR."
+ maintainer:
+ - arthur.she@linaro.org
+ os:
+ - openembedded
+ devices:
+ - rtsm_fvp_base-aemv8a
+ scope:
+ - functional
+
+install:
+ git-repos:
+ - https://github.com/kernelslacker/trinity.git
+
+params:
+ DURATION: 3600 # 1 hour
+
+run:
+ steps:
+ - 'cd trinity'
+ - './configure.sh'
+ - 'make'
+ - 'cd ..'
+ - 'lava-test-case trinity --shell ./openembedded/scripts/fuzz-test.sh $DURATION trinity.log.gz'
+ - 'lava-test-case-attach trinity trinity.log.gz'