summaryrefslogtreecommitdiff
path: root/src/plugins/fuzz_default.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fuzz_default.sh')
-rwxr-xr-xsrc/plugins/fuzz_default.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/fuzz_default.sh b/src/plugins/fuzz_default.sh
index 8b64539..67292cf 100755
--- a/src/plugins/fuzz_default.sh
+++ b/src/plugins/fuzz_default.sh
@@ -14,6 +14,17 @@ then
bindir="$bindir/bin"
fi
+if test -x `which zzuf`
+then
+ exit 77
+fi
+
+if test -x `which timeout`
+then
+ TIMEOUT=timeout 15
+else
+ TIMEOUT=""
+fi
for file in $testdatadir/test*
do
@@ -26,11 +37,11 @@ do
do
echo "file $file seed $seed"
zzuf -c -s $seed cat "$file" > "$tmpfile"
- if ! "$bindir/extract" -i "$tmpfile" > /dev/null
+ if ! "$TIMEOUT $bindir/extract" -i "$tmpfile" > /dev/null
then
echo "$tmpfile with seed $seed failed"
- mv $tmpfile $tmpfile.keep
- ret=1
+ mv $tmpfile $tmpfile.keep
+ ret=1
fi
seed=`expr $seed + 1`
done