summaryrefslogtreecommitdiff
path: root/openembedded/scripts
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 /openembedded/scripts
parent02f82936089d5aa48381bdba70d067eba84c4c1b (diff)
Trinity test: Add openembedded/trinity.yaml
Add trinity test. It will test syscalls randomly with random arguments. Change-Id: Iba3da90fa708ad043bd1e9b007d45d972ad0b9d0
Diffstat (limited to 'openembedded/scripts')
-rwxr-xr-xopenembedded/scripts/fuzz-test.sh28
1 files changed, 28 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