mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 01:58:17 +00:00
afl-fuzz: add usage info when no python support is there, use it in test.sh
This commit is contained in:
@ -198,6 +198,8 @@ static void usage(afl_state_t *afl, u8 *argv0, int more_help) {
|
||||
#ifdef USE_PYTHON
|
||||
SAYF("Compiled with %s module support, see docs/custom_mutator.md\n",
|
||||
(char *)PYTHON_VERSION);
|
||||
#else
|
||||
SAYF("Compiled without python module support\n");
|
||||
#endif
|
||||
|
||||
SAYF("For additional help please consult %s/README.md\n\n", doc_path);
|
||||
|
22
test/test.sh
22
test/test.sh
@ -471,8 +471,9 @@ test -e ../afl-clang-lto -a -e ../afl-llvm-lto-instrumentation.so && {
|
||||
}
|
||||
|
||||
$ECHO "$BLUE[*] Testing: gcc_plugin"
|
||||
export AFL_CC=`command -v gcc`
|
||||
test -e ../afl-gcc-fast -a -e ../afl-gcc-rt.o && {
|
||||
SAVE_AFL_CC=${AFL_CC}
|
||||
export AFL_CC=`command -v gcc`
|
||||
../afl-gcc-fast -o test-instr.plain.gccpi ../test-instr.c > /dev/null 2>&1
|
||||
AFL_HARDEN=1 ../afl-gcc-fast -o test-compcov.harden.gccpi test-compcov.c > /dev/null 2>&1
|
||||
test -e test-instr.plain.gccpi && {
|
||||
@ -574,6 +575,7 @@ test -e ../afl-gcc-fast -a -e ../afl-gcc-rt.o && {
|
||||
CODE=1
|
||||
}
|
||||
rm -f test-persistent
|
||||
export AFL_CC=${SAVE_AFL_CC} # restore the default compiler
|
||||
} || {
|
||||
$ECHO "$YELLOW[-] gcc_plugin not compiled, cannot test"
|
||||
INCOMPLETE=1
|
||||
@ -894,13 +896,13 @@ test -d ../unicorn_mode/unicornafl && {
|
||||
}
|
||||
|
||||
$ECHO "$BLUE[*] Testing: custom mutator"
|
||||
unset AFL_CC # Test case "gcc_plugin" sets AFL_CC to "gcc". We reset it to use the default compiler
|
||||
test `uname -s` = 'Darwin' && {
|
||||
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 )
|
||||
}
|
||||
test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUSTOM_MUTATOR_PATH}/example.py && {
|
||||
}
|
||||
test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUSTOM_MUTATOR_PATH}/example.py && {
|
||||
# Compile the vulnerable program
|
||||
../afl-clang-fast -o test-custom-mutator test-custom-mutator.c > /dev/null 2>&1
|
||||
# Compile the custom mutator
|
||||
@ -965,11 +967,15 @@ test -e test-custom-mutator.c -a -e ${CUSTOM_MUTATOR_PATH}/example.c -a -e ${CUS
|
||||
|
||||
make -C ../examples/custom_mutators clean > /dev/null 2>&1
|
||||
rm -f test-custom-mutator
|
||||
} || {
|
||||
} || {
|
||||
$ECHO "$YELLOW[-] no custom mutators in $CUSTOM_MUTATOR_PATH, cannot test"
|
||||
INCOMPLETE=1
|
||||
}
|
||||
unset CUSTOM_MUTATOR_PATH
|
||||
} || {
|
||||
$ECHO "$YELLOW[-] no python support in afl-fuzz, cannot test"
|
||||
INCOMPLETE=1
|
||||
}
|
||||
unset CUSTOM_MUTATOR_PATH
|
||||
|
||||
$ECHO "$BLUE[*] Execution cmocka Unit-Tests $GREY"
|
||||
unset AFL_CC
|
||||
|
Reference in New Issue
Block a user