[build] Add a helper to run multiple fuzzers easily

This commit is contained in:
Romain Goyet
2019-09-24 12:02:14 +02:00
committed by LeaNumworks
parent 259eb35cf4
commit a3b3951eee

21
build/scenario/afl.py Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python
import subprocess
NUMBER_OF_FUZZERS=8
def afl_command(name):
return ["afl-fuzz", "-t", "10000", "-i", "scenari", "-o", "afl_out", "-M", "epsilon-fuzz-" + name, "./epsilon.bin"]
def run_afl(commands, name):
# Launch the fuzzer
subprocess.run(["tmux"] + commands + [" ".join(afl_command(name))])
# Re-tile the window (so more fuzzers can be added)
subprocess.run(["tmux", "select-layout", "tiled"])
# Clean up the "afl_out" folder
subprocess.run(["rm", "-rf", "afl_out"])
# Launch fuzzers
run_afl(["new", "-d"], "master")
for i in range(NUMBER_OF_FUZZERS-1):
run_afl(["split-window"], "slave-"+str(i))