fixed qemu persistent mode test case :-)

This commit is contained in:
van Hauser 2020-01-31 18:40:38 +01:00
parent 3386ea2345
commit 4094dcdf88

View File

@ -565,7 +565,7 @@ test -e ../afl-qemu-trace && {
$ECHO "$GREY[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds" $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 export AFL_QEMU_PERSISTENT_GPR=1
../afl-fuzz -V10 -Q -i in -o out -- ./test-instr > /dev/null 2>&1 ../afl-fuzz -V10 -Q -i in -o out -- ./test-instr > /dev/null 2>&1
} >>errors 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" $ECHO "$GREEN[+] afl-fuzz is working correctly with persistent qemu_mode"
RUNTIMEP=`grep execs_done out/fuzzer_stats | awk '{print$3}'` RUNTIMEP=`grep execs_done out/fuzzer_stats | awk '{print$3}'`
test -n "$RUNTIME" -a -n "$RUNTIMEP" && { test -n "$RUNTIME" -a -n "$RUNTIMEP" && {
SLOW=`expr $RUNTIME '*' 103` # persistent mode should be at least 3% faster - minimum! DIFF=`expr $RUNTIMEP / $RUNTIME`
FAST=`expr $RUNTIMEP '*' 100` test "$DIFF" -gt 1 && { # must be at least twice as fast
test "$SLOW" -lt "$FAST" && {
$ECHO "$GREEN[+] persistent qemu_mode was noticeable faster than standard qemu_mode" $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" $ECHO "$YELLOW[-] persistent qemu_mode was not noticeable faster than standard qemu_mode"