mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 20:08:07 +00:00
add test case
This commit is contained in:
@ -67,11 +67,8 @@ static u8* get_libradamsa_path(u8* own_loc) {
|
|||||||
SAYF("\n" cLRD "[-] " cRST
|
SAYF("\n" cLRD "[-] " cRST
|
||||||
"Oops, unable to find the 'libradamsa.so' binary. The binary must be "
|
"Oops, unable to find the 'libradamsa.so' binary. The binary must be "
|
||||||
"built\n"
|
"built\n"
|
||||||
" separately using 'make radamsa'."
|
" separately using 'make radamsa'. If you already have the binary "
|
||||||
"If you\n"
|
"installed,\n you may need to specify AFL_PATH in the environment.\n");
|
||||||
" already have the binary installed, you may need to specify "
|
|
||||||
"AFL_PATH in the\n"
|
|
||||||
" environment.\n");
|
|
||||||
|
|
||||||
FATAL("Failed to locate 'libradamsa.so'.");
|
FATAL("Failed to locate 'libradamsa.so'.");
|
||||||
|
|
||||||
|
25
test/test.sh
25
test/test.sh
@ -379,6 +379,31 @@ test -e ../libdislocator.so && {
|
|||||||
rm -f test.out core test-compcov.core core.test-compcov
|
rm -f test.out core test-compcov.core core.test-compcov
|
||||||
} || $ECHO "$YELLOW[-] libdislocator is not compiled, cannot test"
|
} || $ECHO "$YELLOW[-] libdislocator is not compiled, cannot test"
|
||||||
rm -f test-compcov
|
rm -f test-compcov
|
||||||
|
test -e ../libradamsa.so && {
|
||||||
|
test -e test-instr.plain || ../afl-clang-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1
|
||||||
|
test -e test-instr.plain || ../afl-gcc-fast -o test-instr.plain ../test-instr.c > /dev/null 2>&1
|
||||||
|
test -e test-instr.plain || ../afl-gcc -o test-instr.plain ../test-instr.c > /dev/null 2>&1
|
||||||
|
test -e test-instr.plain && {
|
||||||
|
mkdir -p in
|
||||||
|
echo 0 > in/in
|
||||||
|
$ECHO "$GREY[*] running afl-fuzz with radamsa, this will take approx 10 seconds"
|
||||||
|
{
|
||||||
|
../afl-fuzz -RR -V10 -m ${MEM_LIMIT} -i in -o out -- ./test-instr.plain >>errors 2>&1
|
||||||
|
} >>errors 2>&1
|
||||||
|
test -n "$( ls out/queue/id:000002* 2> /dev/null )" && {
|
||||||
|
$ECHO "$GREEN[+] libradamsa performs good - and very slow - mutations"
|
||||||
|
} || {
|
||||||
|
echo CUT------------------------------------------------------------------CUT
|
||||||
|
cat errors
|
||||||
|
echo CUT------------------------------------------------------------------CUT
|
||||||
|
$ECHO "$RED[!] libradamsa failed"
|
||||||
|
CODE=1
|
||||||
|
}
|
||||||
|
rm -rf in out errors test-instr.plain
|
||||||
|
} || {
|
||||||
|
$ECHO "$YELLOW[-] compilation of test target failed, cannot test libradamsa"
|
||||||
|
}
|
||||||
|
} || $ECHO "$YELLOW[-] libradamsa is not compiled, cannot test"
|
||||||
|
|
||||||
$ECHO "$BLUE[*] Testing: qemu_mode"
|
$ECHO "$BLUE[*] Testing: qemu_mode"
|
||||||
test -e ../afl-qemu-trace && {
|
test -e ../afl-qemu-trace && {
|
||||||
|
Reference in New Issue
Block a user