[test suite] integrate afl-cov with afl-fuzz wrapper scripts
Here is an example for the client-rc.sh wrapper script to have it also generate code coverage results for afl-fuzz (afl-cov is enabled via two environmental variables AFL_COV and CODE_DIR). $ cd /tmp/afl-ramdisk/fwknop.git/test/afl/ $ AFL_COV=1 CODE_DIR=/home/mbr/git/fwknop.git ./fuzzing-wrappers/client-rc.sh
This commit is contained in:
@@ -20,6 +20,22 @@ BANNER="$TSTR$GIT_STR"
|
||||
### set up directories
|
||||
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR PREV_OUT_DIR
|
||||
|
||||
### see if we're going to enable code coverage with afl-cov
|
||||
if [ "$AFL_COV" != "" ]
|
||||
then
|
||||
echo "[+] Enabling afl-cov coverage mode..."
|
||||
if [ "$CODE_DIR" = "" ]
|
||||
then
|
||||
echo "[*] Must set CODE_DIR with path to gcov compiled code"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### kick off afl-cov in --background mode
|
||||
afl-cov -d $OUT_DIR --live --background --sleep 10 --coverage-cmd \
|
||||
"LD_LIBRARY_PATH=$CODE_DIR/test/afl/$LIB_DIR $CODE_DIR/test/afl/$CLIENT --rc-file AFL_FILE -T -a 1.1.1.1 -n testhost2.com" \
|
||||
--code-dir $CODE_DIR
|
||||
fi
|
||||
|
||||
### make sure the client rc file can be parsed (a failure
|
||||
### exit status is expected though)
|
||||
./fuzzing-wrappers/helpers/fwknop-rc-test.sh && exit $?
|
||||
|
||||
Reference in New Issue
Block a user