diff --git a/fuzz/cycle.sh b/fuzz/cycle.sh new file mode 100755 index 00000000..80bdddf6 --- /dev/null +++ b/fuzz/cycle.sh @@ -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 +