summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-16 10:24:36 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-30 08:37:24 -0500
commit83e9918107dba1b969a226b79e1d37a852339e45 (patch)
tree64704299bd8ff1b8c4b185f011d12773565c1828 /src
parent301eff0e90a727005d364ebc2e9a7ffaecd0a3ef (diff)
downloadtor-83e9918107dba1b969a226b79e1d37a852339e45.tar.gz
tor-83e9918107dba1b969a226b79e1d37a852339e45.zip
Tools for working with directories of fuzzed stuff.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/test/fuzz/fixup_filenames.sh19
-rwxr-xr-xsrc/test/fuzz/minimize.sh14
2 files changed, 33 insertions, 0 deletions
diff --git a/src/test/fuzz/fixup_filenames.sh b/src/test/fuzz/fixup_filenames.sh
new file mode 100755
index 0000000000..68efc1abc5
--- /dev/null
+++ b/src/test/fuzz/fixup_filenames.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+if [ ! -d "$1" ] ; then
+ echo "I need a directory"
+ exit 1
+fi
+
+for fn in "$1"/* ; do
+ prev=`basename "$fn"`
+ post=`sha256sum "$fn" | sed -e 's/ .*//;'`
+ if [ "$prev" == "$post" ] ; then
+ echo "OK $prev"
+ else
+ echo "mv $prev $post"
+ mv "$fn" "$1/$post"
+ fi
+done
diff --git a/src/test/fuzz/minimize.sh b/src/test/fuzz/minimize.sh
new file mode 100755
index 0000000000..87d3dda13c
--- /dev/null
+++ b/src/test/fuzz/minimize.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ ! -d "$1" ] ; then
+ echo "I need a directory"
+ exit 1
+fi
+
+which=`basename "$1"`
+
+mkdir "$1.out"
+afl-cmin -i "$1" -o "$1.out" -m none "./src/test/fuzz/fuzz-${which}"
+