aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-12-16 10:47:50 +0100
committerGitHub <noreply@github.com>2019-12-16 10:47:50 +0100
commit2b9ad9acb616dfa3103955f8bb969d85028f74eb (patch)
tree6e9a0a9ad4f35118fb9f9217b022bbdf78c60a6d /test
parent17d364c8a0d7c685e21def7bd56465a930f64559 (diff)
parent6ccfc2df56f89d1370c9ece16b76cfac5c3d91a2 (diff)
downloadafl++-2b9ad9acb616dfa3103955f8bb969d85028f74eb.tar.gz
Merge pull request #138 from domenukk/unicornafl
Moved unicorn_mode to unicornafl
Diffstat (limited to 'test')
-rwxr-xr-xtest/test.sh70
1 files changed, 38 insertions, 32 deletions
diff --git a/test/test.sh b/test/test.sh
index ee497298..a75f991d 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -550,44 +550,50 @@ test -d ../unicorn_mode/unicorn && {
test -e ../unicorn_mode/samples/simple/simple_target.bin -a -e ../unicorn_mode/samples/compcov_x64/compcov_target.bin && {
{
# travis workaround
- PY=`which python2.7`
- test "$PY" = "/opt/pyenv/shims/python2.7" -a -x /usr/bin/python2.7 && PY=/usr/bin/python2.7
+ PY=`which python`
+ test "$PY" = "/opt/pyenv/shims/python" -a -x /usr/bin/python && PY=/usr/bin/python
mkdir -p in
echo 0 > in/in
$ECHO "$GREY[*] Using python binary $PY"
- $ECHO "$GREY[*] running afl-fuzz for unicorn_mode, this will take approx 25 seconds"
+ if ! $PY -c 'import unicornafl' 2> /dev/null ; then
+ $ECHO "$YELLOW[-] we cannot test unicorn_mode because it is not present"
+ else
{
- ../afl-fuzz -V25 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/simple/simple_test_harness.py @@ >>errors 2>&1
- } >>errors 2>&1
- test -n "$( ls out/queue/id:000002* 2> /dev/null )" && {
- $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode"
- } || {
- echo CUT------------------------------------------------------------------CUT
- cat errors
- echo CUT------------------------------------------------------------------CUT
- $ECHO "$RED[!] afl-fuzz is not working correctly with unicorn_mode"
- CODE=1
- }
- rm -f errors
+ $ECHO "$GREY[*] running afl-fuzz for unicorn_mode, this will take approx 25 seconds"
+ {
+ ../afl-fuzz -V25 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/simple/simple_test_harness.py @@ >>errors 2>&1
+ } >>errors 2>&1
+ test -n "$( ls out/queue/id:000002* 2> /dev/null )" && {
+ $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode"
+ } || {
+ echo CUT------------------------------------------------------------------CUT
+ cat errors
+ echo CUT------------------------------------------------------------------CUT
+ $ECHO "$RED[!] afl-fuzz is not working correctly with unicorn_mode"
+ CODE=1
+ }
+ rm -f errors
- printf '\x01\x01' > in/in
- # This seed is close to the first byte of the comparison.
- # If CompCov works, a new tuple will appear in the map => new input in queue
- $ECHO "$GREY[*] running afl-fuzz for unicorn_mode compcov, this will take approx 35 seconds"
- {
- export AFL_COMPCOV_LEVEL=2
- ../afl-fuzz -V35 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/compcov_x64/compcov_test_harness.py @@ >>errors 2>&1
- } >>errors 2>&1
- test -n "$( ls out/queue/id:000001* 2> /dev/null )" && {
- $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode compcov"
- } || {
- echo CUT------------------------------------------------------------------CUT
- cat errors
- echo CUT------------------------------------------------------------------CUT
- $ECHO "$RED[!] afl-fuzz is not working correctly with unicorn_mode compcov"
- CODE=1
+ printf '\x01\x01' > in/in
+ # This seed is close to the first byte of the comparison.
+ # If CompCov works, a new tuple will appear in the map => new input in queue
+ $ECHO "$GREY[*] running afl-fuzz for unicorn_mode compcov, this will take approx 35 seconds"
+ {
+ export AFL_COMPCOV_LEVEL=2
+ ../afl-fuzz -V35 -U -i in -o out -d -- "$PY" ../unicorn_mode/samples/compcov_x64/compcov_test_harness.py @@ >>errors 2>&1
+ } >>errors 2>&1
+ test -n "$( ls out/queue/id:000001* 2> /dev/null )" && {
+ $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode compcov"
+ } || {
+ echo CUT------------------------------------------------------------------CUT
+ cat errors
+ echo CUT------------------------------------------------------------------CUT
+ $ECHO "$RED[!] afl-fuzz is not working correctly with unicorn_mode compcov"
+ CODE=1
+ }
+ rm -rf in out errors
}
- rm -rf in out errors
+ fi
}
} || {
$ECHO "$RED[-] missing sample binaries in unicorn_mode/samples/ - what is going on??"