aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-01-31 18:40:38 +0100
committervan Hauser <vh@thc.org>2020-01-31 18:40:38 +0100
commit4094dcdf888b03144bf918eb1ca2f9ad50764bc8 (patch)
tree32bee266a879e564e98705d4fbb43539fe4578b8
parent3386ea2345686efdac8434e3859441f48c0da646 (diff)
downloadafl++-4094dcdf888b03144bf918eb1ca2f9ad50764bc8.tar.gz
fixed qemu persistent mode test case :-)
-rwxr-xr-xtest/test.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh
index 9676d22d..f848ff03 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -565,7 +565,7 @@ test -e ../afl-qemu-trace && {
$ECHO "$GREY[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds"
{
- export AFL_QEMU_PERSISTENT_ADDR=0x$(nm test-instr | grep "T main" | awk '{ print $1 }')
+ export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4$(nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.......//')`
export AFL_QEMU_PERSISTENT_GPR=1
../afl-fuzz -V10 -Q -i in -o out -- ./test-instr > /dev/null 2>&1
} >>errors 2>&1
@@ -573,9 +573,8 @@ test -e ../afl-qemu-trace && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with persistent qemu_mode"
RUNTIMEP=`grep execs_done out/fuzzer_stats | awk '{print$3}'`
test -n "$RUNTIME" -a -n "$RUNTIMEP" && {
- SLOW=`expr $RUNTIME '*' 103` # persistent mode should be at least 3% faster - minimum!
- FAST=`expr $RUNTIMEP '*' 100`
- test "$SLOW" -lt "$FAST" && {
+ DIFF=`expr $RUNTIMEP / $RUNTIME`
+ test "$DIFF" -gt 1 && { # must be at least twice as fast
$ECHO "$GREEN[+] persistent qemu_mode was noticeable faster than standard qemu_mode"
} || {
$ECHO "$YELLOW[-] persistent qemu_mode was not noticeable faster than standard qemu_mode"