diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-06-25 17:13:16 +0200 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-06-25 17:13:16 +0200 |
commit | 3a62bb68e0867ceb920761bc19c96f5ca1992003 (patch) | |
tree | 2f403d0b9911002f4b5d8c2edd09a6b1117c93d1 /test | |
parent | aad433e11efa4a8350a264313c66db8ef6d17088 (diff) | |
parent | 8178f4dfddfb51f7a3e2f94e67bb9cf7332c7ef1 (diff) | |
download | afl++-3a62bb68e0867ceb920761bc19c96f5ca1992003.tar.gz |
updated unicornafl
Diffstat (limited to 'test')
-rwxr-xr-x | test/test.sh | 107 |
1 files changed, 53 insertions, 54 deletions
diff --git a/test/test.sh b/test/test.sh index fd3f182c..a7d9fc49 100755 --- a/test/test.sh +++ b/test/test.sh @@ -23,7 +23,7 @@ else fi test_compcov_binary_functionality() { - RUN="../afl-showmap -o /dev/null -- $1" + RUN="../afl-showmap -m ${MEM_LIMIT} -o /dev/null -- $1" $RUN 'LIBTOKENCAP' | grep 'your string was LIBTOKENCAP' \ && $RUN 'BUGMENOT' | grep 'your string was BUGMENOT' \ && $RUN 'BANANA' | grep 'your string started with BAN' \ @@ -459,24 +459,23 @@ test -e ../afl-clang-lto -a -e ../afl-llvm-lto-instrumentation.so && { } rm -f test-instr.plain -# Disabled whitelist until I have a different solution -mh -# echo foobar.c > whitelist.txt -# AFL_LLVM_WHITELIST=whitelist.txt ../afl-clang-lto -o test-compcov test-compcov.c > test.out 2>&1 -# test -e test-compcov && { -# grep -q "No instrumentation targets found" test.out && { -# $ECHO "$GREEN[+] llvm_mode LTO whitelist feature works correctly" -# } || { -# $ECHO "$RED[!] llvm_mode LTO whitelist feature failed" -# CODE=1 -# } -# } || { -# $ECHO "$RED[!] llvm_mode LTO whitelist feature compilation failed" -# CODE=1 -# } -# rm -f test-compcov test.out whitelist.txt + echo foobar.c > whitelist.txt + AFL_DEBUG=1 AFL_LLVM_WHITELIST=whitelist.txt ../afl-clang-lto -o test-compcov test-compcov.c > test.out 2>&1 + test -e test-compcov && { + grep -q "No instrumentation targets found" test.out && { + $ECHO "$GREEN[+] llvm_mode LTO whitelist feature works correctly" + } || { + $ECHO "$RED[!] llvm_mode LTO whitelist feature failed" + CODE=1 + } + } || { + $ECHO "$RED[!] llvm_mode LTO whitelist feature compilation failed" + CODE=1 + } + rm -f test-compcov test.out whitelist.txt ../afl-clang-lto -o test-persistent ../examples/persistent_demo/persistent_demo.c > /dev/null 2>&1 test -e test-persistent && { - echo foo | ../afl-showmap -o /dev/null -q -r ./test-persistent && { + echo foo | ../afl-showmap -m none -o /dev/null -q -r ./test-persistent && { $ECHO "$GREEN[+] llvm_mode LTO persistent mode feature works correctly" } || { $ECHO "$RED[!] llvm_mode LTO persistent mode feature failed to work" @@ -638,43 +637,43 @@ test -e ../libdislocator.so && { INCOMPLETE=1 } rm -f test-compcov -test -e ../libradamsa.so && { - # on FreeBSD need to set AFL_CC - test `uname -s` = 'FreeBSD' && { - if type clang >/dev/null; then - export AFL_CC=`command -v clang` - else - export AFL_CC=`$LLVM_CONFIG --bindir`/clang - fi - } - test -e test-instr.plain || ../afl-clang-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1 - test -e test-instr.plain || ../afl-gcc-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1 - test -e test-instr.plain || ../${AFL_GCC} -o test-instr.plain ../test-instr.c > /dev/null 2>&1 - test -e test-instr.plain && { - mkdir -p in - printf 1 > in/in - $ECHO "$GREY[*] running afl-fuzz with radamsa, this will take approx 10 seconds" - { - ../afl-fuzz -RR -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain - } >>errors 2>&1 - test -n "$( ls out/queue/id:000001* 2>/dev/null )" && { - $ECHO "$GREEN[+] libradamsa performs good - and very slow - mutations" - } || { - echo CUT------------------------------------------------------------------CUT - cat errors - echo CUT------------------------------------------------------------------CUT - $ECHO "$RED[!] libradamsa failed" - CODE=1 - } - rm -rf in out errors test-instr.plain - } || { - $ECHO "$YELLOW[-] compilation of test target failed, cannot test libradamsa" - INCOMPLETE=1 - } -} || { - $ECHO "$YELLOW[-] libradamsa is not compiled, cannot test" - INCOMPLETE=1 -} +#test -e ../libradamsa.so && { +# # on FreeBSD need to set AFL_CC +# test `uname -s` = 'FreeBSD' && { +# if type clang >/dev/null; then +# export AFL_CC=`command -v clang` +# else +# export AFL_CC=`$LLVM_CONFIG --bindir`/clang +# fi +# } +# test -e test-instr.plain || ../afl-clang-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1 +# test -e test-instr.plain || ../afl-gcc-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1 +# test -e test-instr.plain || ../${AFL_GCC} -o test-instr.plain ../test-instr.c > /dev/null 2>&1 +# test -e test-instr.plain && { +# mkdir -p in +# printf 1 > in/in +# $ECHO "$GREY[*] running afl-fuzz with radamsa, this will take approx 10 seconds" +# { +# ../afl-fuzz -RR -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain +# } >>errors 2>&1 +# test -n "$( ls out/queue/id:000001* 2>/dev/null )" && { +# $ECHO "$GREEN[+] libradamsa performs good - and very slow - mutations" +# } || { +# echo CUT------------------------------------------------------------------CUT +# cat errors +# echo CUT------------------------------------------------------------------CUT +# $ECHO "$RED[!] libradamsa failed" +# CODE=1 +# } +# rm -rf in out errors test-instr.plain +# } || { +# $ECHO "$YELLOW[-] compilation of test target failed, cannot test libradamsa" +# INCOMPLETE=1 +# } +#} || { +# $ECHO "$YELLOW[-] libradamsa is not compiled, cannot test" +# INCOMPLETE=1 +#} test -z "$AFL_CC" && { if type gcc >/dev/null; then |