fuzz_multi.sh 827 B

12345678910111213141516171819202122232425262728293031323334
  1. MEMLIMIT_BYTES=21990500990976
  2. N_CPUS=1
  3. if [ $# -ge 1 ]; then
  4. N_CPUS="$1"
  5. shift
  6. fi
  7. FILTER=echo
  8. for i in `seq -w "$N_CPUS"`; do
  9. if [ "$i" -eq 1 ]; then
  10. if [ "$N_CPUS" -eq 1 ]; then
  11. INSTANCE=""
  12. NUMBER=""
  13. else
  14. INSTANCE="-M"
  15. NUMBER="$i"
  16. fi
  17. else
  18. INSTANCE="-S"
  19. NUMBER="$i"
  20. fi
  21. # use whatever remains on the command-line to prefix the fuzzer command
  22. # you have to copy and paste and run these commands yourself
  23. "$FILTER" "$@" \
  24. ../afl/afl-fuzz \
  25. -i src/test/fuzz/fuzz_dir_testcase \
  26. -o src/test/fuzz/fuzz_dir_findings \
  27. -x src/test/fuzz/fuzz_dir_dictionary/fuzz_dir_http_header.dct \
  28. -m "$MEMLIMIT_BYTES" \
  29. "$INSTANCE" "$NUMBER" \
  30. -- src/test/fuzz_dir
  31. done