summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-12-13 16:23:12 +1100
committerNick Mathewson <nickm@torproject.org>2017-01-30 08:37:23 -0500
commit0fb1156e9f0ee62e9b704e9e56ebae3c8d436218 (patch)
tree9db47c187370c57e2a66cd19e0475fa32f78341e /src/test
parent416e2f6b283801190f087445d295b391e08cc902 (diff)
downloadtor-0fb1156e9f0ee62e9b704e9e56ebae3c8d436218.tar.gz
tor-0fb1156e9f0ee62e9b704e9e56ebae3c8d436218.zip
Add a script for running multiple fuzzing sessions on multiple cores
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/fuzz_multi.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/fuzz_multi.sh b/src/test/fuzz_multi.sh
new file mode 100755
index 0000000000..b4a17ed8cb
--- /dev/null
+++ b/src/test/fuzz_multi.sh
@@ -0,0 +1,34 @@
+MEMLIMIT_BYTES=21990500990976
+
+N_CPUS=1
+if [ $# -ge 1 ]; then
+ N_CPUS="$1"
+ shift
+fi
+
+FILTER=echo
+
+for i in `seq -w "$N_CPUS"`; do
+ if [ "$i" -eq 1 ]; then
+ if [ "$N_CPUS" -eq 1 ]; then
+ INSTANCE=""
+ NUMBER=""
+ else
+ INSTANCE="-M"
+ NUMBER="$i"
+ fi
+ else
+ INSTANCE="-S"
+ NUMBER="$i"
+ fi
+ # use whatever remains on the command-line to prefix the fuzzer command
+ # you have to copy and paste and run these commands yourself
+ "$FILTER" "$@" \
+ ../afl/afl-fuzz \
+ -i src/test/fuzz/fuzz_dir_testcase \
+ -o src/test/fuzz/fuzz_dir_findings \
+ -x src/test/fuzz/fuzz_dir_dictionary/fuzz_dir_http_header.dct \
+ -m "$MEMLIMIT_BYTES" \
+ "$INSTANCE" "$NUMBER" \
+ -- src/test/fuzz_dir
+done