Add script to launch fuzzing continuosly

This commit is contained in:
Riccardo Casatta 2022-10-07 11:56:09 +02:00
parent f6d838076e
commit 9eca3c58c5
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 23 additions and 0 deletions

23
fuzz/cycle.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Continuosly cycle over fuzz targets running each for 1 hour.
# It uses chrt SCHED_IDLE so that other process takes priority.
#
# For hfuzz options see https://github.com/google/honggfuzz/blob/master/docs/USAGE.md
export HFUZZ_BUILD_ARGS='--features honggfuzz_fuzz'
while :
do
for FILE in fuzz_targets/*;
do
TARGET=$(echo $FILE | cut -c 14- | cut -f 1 -d '.')
# fuzz for one hour
HFUZZ_RUN_ARGS='--run_time 3600' chrt -i 0 cargo hfuzz run $TARGET
# minimize the corpus
HFUZZ_RUN_ARGS="-i hfuzz_workspace/$TARGET/input/ -P -M" chrt -i 0 cargo hfuzz run $TARGET
done
done