about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-16 13:11:44 +0200
committervan Hauser <vh@thc.org>2020-04-16 13:11:44 +0200
commitdcc889a26462949d99e9aa2785d2607e1d677a3a (patch)
tree0e17cf1844709d6ed5a1a3a5327b57194b0b962f
parentf3789801f2ea8fd4914c1f9a6d802140cdf13c84 (diff)
downloadafl++-dcc889a26462949d99e9aa2785d2607e1d677a3a.tar.gz
fix travis for cmpcov
-rwxr-xr-xtest/test.sh50
1 files changed, 21 insertions, 29 deletions
diff --git a/test/test.sh b/test/test.sh
index 4295d36b..d72dd355 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -711,13 +711,11 @@ test -e ../afl-qemu-trace && {
 
       test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
         test -e ../libcompcov.so && {
+         export AFL_PRELOAD=../libcompcov.so
+         export AFL_COMPCOV_LEVEL=2
           $ECHO "$GREY[*] running afl-fuzz for qemu_mode compcov, this will take approx 10 seconds"
           {
-            export AFL_PRELOAD=../libcompcov.so
-            export AFL_COMPCOV_LEVEL=2
             ../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-compcov >>errors 2>&1
-            unset AFL_PRELOAD
-            unset AFL_COMPCOV_LEVEL
           } >>errors 2>&1
           test -n "$( ls out/queue/id:000001* 2>/dev/null )" && {
             $ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode compcov"
@@ -728,35 +726,29 @@ test -e ../afl-qemu-trace && {
             $ECHO "$RED[!] afl-fuzz is not working correctly with qemu_mode compcov"
             CODE=1
           }
+          rm -f errors
+      
+          $ECHO "$GREY[*] running afl-fuzz for qemu_mode cmplog, this will take approx 10 seconds"
+          {
+            ../afl-fuzz -m none -V10 -Q -c 0 -i in -o out -- ./test-compcov >>errors 2>&1
+          } >>errors 2>&1
+          unset AFL_PRELOAD
+          unset AFL_COMPCOV_LEVEL
+          test -n "$( ls out/queue/id:000001* 2>/dev/null )" && {
+            $ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode cmplog"
+          } || {
+            echo CUT------------------------------------------------------------------CUT
+            cat errors
+            echo CUT------------------------------------------------------------------CUT
+            $ECHO "$RED[!] afl-fuzz is not working correctly with qemu_mode cmplog"
+            CODE=1
+          }
+          rm -f errors
         } || {
           $ECHO "$YELLOW[-] we cannot test qemu_mode compcov because it is not present"
           INCOMPLETE=1
         }
-        rm -f errors
-      } || {
-       $ECHO "$YELLOW[-] not an intel or arm platform, cannot test qemu_mode compcov"
-      }
-      
-      test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
-        $ECHO "$GREY[*] running afl-fuzz for qemu_mode cmplog, this will take approx 10 seconds"
-        {
-          ../afl-fuzz -m none -V10 -Q -c 0 -i in -o out -- ./test-compcov >>errors 2>&1
-        } >>errors 2>&1
-        test -n "$( ls out/queue/id:000001* 2>/dev/null )" && {
-          $ECHO "$GREEN[+] afl-fuzz is working correctly with qemu_mode cmplog"
-        } || {
-          echo CUT------------------------------------------------------------------CUT
-          cat errors
-          echo CUT------------------------------------------------------------------CUT
-          $ECHO "$RED[!] afl-fuzz is not working correctly with qemu_mode cmplog"
-          CODE=1
-        }
-        rm -f errors
-      } || {
-       $ECHO "$YELLOW[-] not an intel or arm platform, cannot test qemu_mode cmplog"
-      }
 
-      test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
         $ECHO "$GREY[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds"
         {
           export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4$(nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.......//' )`
@@ -790,7 +782,7 @@ test -e ../afl-qemu-trace && {
         }
         rm -rf in out errors
       } || {
-       $ECHO "$YELLOW[-] not an intel or arm platform, cannot test persistent qemu_mode"
+       $ECHO "$YELLOW[-] not an intel or arm platform, cannot test qemu_mode cmplog/cmpcov/persistent"
       }
 
       test -e ../qemu_mode/unsigaction/unsigaction32.so && {