test(fuzz): Refactor: avoid moving final restart out of fuzz_write and back

This commit is contained in:
Chris Hennick 2024-06-29 19:10:21 -07:00
parent 2852cc83ba
commit 11db7c83ce
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -41,14 +41,13 @@ echo "$(date): RESTART WITH DICTIONARY AND 0-2 BYTE CORPUS"
tar -xvzf "fuzz/012byte.tar.gz" -C "fuzz/corpus/fuzz_$1"
cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \
-dict=fuzz/fuzz.dict -max_len="$2" -fork="$ncpus" -max_total_time=5100 -runs=100000000
find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_restart_012byte" ';'
echo "$(date): MERGING CORPORA"
for i in $(seq 1 $NORMAL_RESTARTS); do
find "fuzz/corpus/fuzz_$1_restart_${i}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1" ';'
rm -rf "fuzz/corpus/fuzz_$1_restart_${i}"
done
SPECIAL_RESTARTS=("012byte" "dictionaryless_012byte" "dictionaryless")
SPECIAL_RESTARTS=("dictionaryless_012byte" "dictionaryless")
for i in "${SPECIAL_RESTARTS[@]}"; do
find "fuzz/corpus/fuzz_$1_restart_${i}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1" ';'
rm -rf "fuzz/corpus/fuzz_$1_restart_${i}"