test(fuzz): Bug fix? Make recursive-fuzz-cmin.sh clean up more conservatively
This commit is contained in:
parent
1140f71a88
commit
2f53dca454
1 changed files with 7 additions and 4 deletions
|
@ -1,19 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
i=0
|
i=0
|
||||||
find fuzz/corpus -iname "fuzz_$1_iter_*" -exec rm -r {} +
|
rm -rf "fuzz/corpus/fuzz_$1_iter_0" || true
|
||||||
cp -r "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_iter_0"
|
mkdir "fuzz/corpus/fuzz_$1_iter_0"
|
||||||
|
find "fuzz/corpus/fuzz_$1" -exec mv '{}' "fuzz/corpus/fuzz_$1_iter_0" ';'
|
||||||
while true; do
|
while true; do
|
||||||
j=$((i + 1))
|
j=$((i + 1))
|
||||||
|
rm -rf "fuzz/corpus/fuzz_$1_iter_${i}.bak" || true
|
||||||
cp -r "fuzz/corpus/fuzz_$1_iter_${i}" "fuzz/corpus/fuzz_$1_iter_${i}.bak"
|
cp -r "fuzz/corpus/fuzz_$1_iter_${i}" "fuzz/corpus/fuzz_$1_iter_${i}.bak"
|
||||||
|
rm -rf "fuzz/corpus/fuzz_$1_iter_${j}" || true
|
||||||
mkdir "fuzz/corpus/fuzz_$1_iter_${j}"
|
mkdir "fuzz/corpus/fuzz_$1_iter_${j}"
|
||||||
cargo fuzz cmin --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1_iter_${i}" -- \
|
cargo fuzz cmin --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1_iter_${i}" -- \
|
||||||
-dict=fuzz/fuzz.dict -max_len="$2" -rss_limit_mb=8192 -timeout=30 "fuzz/corpus/fuzz_$1_iter_${j}"
|
-dict=fuzz/fuzz.dict -max_len="$2" -rss_limit_mb=8192 -timeout=30 "fuzz/corpus/fuzz_$1_iter_${j}"
|
||||||
if diff "fuzz/corpus/fuzz_$1_iter_${i}.bak" "fuzz/corpus/fuzz_$1_iter_${j}"; then
|
if diff "fuzz/corpus/fuzz_$1_iter_${i}.bak" "fuzz/corpus/fuzz_$1_iter_${j}"; then
|
||||||
# Last iteration made no difference, so we're done
|
# Last iteration made no difference, so we're done
|
||||||
rm -r "fuzz/corpus/fuzz_$1"
|
rm -rf "fuzz/corpus/fuzz_$1"
|
||||||
mkdir "fuzz/corpus/fuzz_$1"
|
mkdir "fuzz/corpus/fuzz_$1"
|
||||||
find "fuzz/corpus/fuzz_$1_iter_${j}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1" ';'
|
find "fuzz/corpus/fuzz_$1_iter_${j}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1" ';'
|
||||||
find fuzz/corpus -iname "fuzz_$1_iter_*" -exec rm -r {} +
|
rm -rf "fuzz/corpus/fuzz_$1_iter_${i}.bak"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
i=$j
|
i=$j
|
||||||
|
|
Loading…
Add table
Reference in a new issue