diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/plugins/fuzz_default.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/fuzz_default.sh b/src/plugins/fuzz_default.sh index 67292cf..c404723 100755 --- a/src/plugins/fuzz_default.sh +++ b/src/plugins/fuzz_default.sh | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -eu | ||
4 | |||
3 | ZZSTARTSEED=0 | 5 | ZZSTARTSEED=0 |
4 | ZZSTOPSEED=100 | 6 | ZZSTOPSEED=100 |
5 | ret=0 | 7 | ret=0 |
@@ -14,15 +16,17 @@ then | |||
14 | bindir="$bindir/bin" | 16 | bindir="$bindir/bin" |
15 | fi | 17 | fi |
16 | 18 | ||
17 | if test -x `which zzuf` | 19 | if test ! -x `which zzuf` |
18 | then | 20 | then |
21 | echo "zzuf not available, not running the test" | ||
19 | exit 77 | 22 | exit 77 |
20 | fi | 23 | fi |
21 | 24 | ||
22 | if test -x `which timeout` | 25 | if test -x `which timeout` |
23 | then | 26 | then |
24 | TIMEOUT=timeout 15 | 27 | TIMEOUT="timeout 15" |
25 | else | 28 | else |
29 | echo "timeout command not found, will not auto-timeout (may cause hang)" | ||
26 | TIMEOUT="" | 30 | TIMEOUT="" |
27 | fi | 31 | fi |
28 | 32 | ||
@@ -37,7 +41,7 @@ do | |||
37 | do | 41 | do |
38 | echo "file $file seed $seed" | 42 | echo "file $file seed $seed" |
39 | zzuf -c -s $seed cat "$file" > "$tmpfile" | 43 | zzuf -c -s $seed cat "$file" > "$tmpfile" |
40 | if ! "$TIMEOUT $bindir/extract" -i "$tmpfile" > /dev/null | 44 | if ! $TIMEOUT $bindir/extract -i "$tmpfile" > /dev/null |
41 | then | 45 | then |
42 | echo "$tmpfile with seed $seed failed" | 46 | echo "$tmpfile with seed $seed failed" |
43 | mv $tmpfile $tmpfile.keep | 47 | mv $tmpfile $tmpfile.keep |