about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-05-12 20:59:48 +0200
committerhexcoder- <heiko@hexco.de>2020-05-12 20:59:48 +0200
commit6224ae1c6004d52b230aa6dd6694c7d57dc49627 (patch)
treed1261d4ac8cf8c740caf1a4fbd56126c5ab0bfe8
parent72f4a9f678bea33826a40c1586a79b7ef7a6da15 (diff)
downloadafl++-6224ae1c6004d52b230aa6dd6694c7d57dc49627.tar.gz
test/test.sh: prefer python3 over python for unicornafl, avoid realpath and readlink dependencies
-rwxr-xr-xtest/test.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/test.sh b/test/test.sh
index 1d06780b..8e6c277f 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -883,7 +883,7 @@ test -d ../unicorn_mode/unicornafl && {
   test -e ../unicorn_mode/samples/simple/simple_target.bin -a -e ../unicorn_mode/samples/compcov_x64/compcov_target.bin && {
     {
       # travis workaround
-      PY=`command -v python`
+      PY=`command -v python3 || command -v python`
       test "$PY" = "/opt/pyenv/shims/python" -a -x /usr/bin/python && PY=/usr/bin/python
       mkdir -p in
       echo 0 > in/in
@@ -942,11 +942,8 @@ test -d ../unicorn_mode/unicornafl && {
 
 $ECHO "$BLUE[*] Testing: custom mutator"
 test "1" = "`../afl-fuzz | grep -i 'without python' >/dev/null; echo $?`" && {
-  test `uname -s` = 'Darwin' && {
-    CUSTOM_MUTATOR_PATH=$( realpath ../examples/custom_mutators )
-  } || {
-    CUSTOM_MUTATOR_PATH=$( readlink -f ../examples/custom_mutators )
-  }
+  # normalize path
+  CUSTOM_MUTATOR_PATH=$(cd $(pwd)/../examples/custom_mutators;pwd)
   test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUSTOM_MUTATOR_PATH}/example.py && {
     unset AFL_CC
     # Compile the vulnerable program for single mutator