[test suite] support AFL resume operations

This commit is contained in:
Michael Rash 2014-11-23 22:39:25 -05:00
parent 28abc276fe
commit 00ffe198e8
5 changed files with 34 additions and 11 deletions

View File

@ -6,10 +6,9 @@
. ./fuzzing-wrappers/fcns
TOP_DIR="fuzzing-output"
FDIR="client-rc.out"
ARCHIVE_DIR="$TOP_DIR/archive"
OUT_DIR="$TOP_DIR/$FDIR"
PREV_OUT_DIR=''
IN_DIR="test-cases/client-rc"
### build up our afl-fuzz text banner
@ -19,7 +18,13 @@ git_banner GIT_STR
BANNER="$TSTR$GIT_STR"
### set up directories
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR PREV_OUT_DIR
### support resuming from a previous run
if [ $@ ] && [ "$1" = "resume" ]
then
IN_DIR=$PREV_OUT_DIR
fi
### make sure the client can handle the rc file
./fuzzing-wrappers/helpers/fwknop-rc-test.sh || \

View File

@ -1,6 +1,6 @@
TOP_DIR="fuzzing-output"
ARCHIVE_DIR="$TOP_DIR/archive"
SERVER="../../server/.libs/fwknopd"
CLIENT="../../client/.libs/fwknop"
LIB_DIR="../../lib/.libs"
@ -16,6 +16,7 @@ git_banner() {
dir_init() {
[ ! -d $1 ] && mkdir -p $1
TS=`date +"%m%d%y%H%M%S"`
eval "$4=$1/$2-$TS"
[ -d $3 ] && mv $3 "$1/$2-$TS"
mkdir $3
}

View File

@ -7,8 +7,8 @@
. ./fuzzing-wrappers/fcns
FDIR="server-access.out"
ARCHIVE_DIR="$TOP_DIR/archive"
OUT_DIR="$TOP_DIR/$FDIR"
PREV_OUT_DIR=''
IN_DIR="test-cases/server-access"
### build up our afl-fuzz text banner
@ -18,11 +18,17 @@ git_banner GIT_STR
BANNER="$TSTR$GIT_STR"
### set up directories
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR PREV_OUT_DIR
### make sure that parsing the access.conf file works
./fuzzing-wrappers/helpers/fwknopd-parse-access.sh || exit $?
### support resuming from a previous run
if [ $@ ] && [ "$1" = "resume" ]
then
IN_DIR=$PREV_OUT_DIR
fi
### run afl-fuzz
LD_LIBRARY_PATH=$LIB_DIR afl-fuzz -T $BANNER -t 1000 -i $IN_DIR -o $OUT_DIR -f $OUT_DIR/afl_access.conf $SERVER -c ../conf/ipt_snat_fwknopd.conf -a $OUT_DIR/afl_access.conf -A -f -t --exit-parse-config -D

View File

@ -6,10 +6,9 @@
. ./fuzzing-wrappers/fcns
TOP_DIR="fuzzing-output"
FDIR="server-conf.out"
ARCHIVE_DIR="$TOP_DIR/archive"
OUT_DIR="$TOP_DIR/$FDIR"
PREV_OUT_DIR=''
IN_DIR="test-cases/server-conf"
### build up our afl-fuzz text banner
@ -19,7 +18,13 @@ git_banner GIT_STR
BANNER="$TSTR$GIT_STR"
### set up directories
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR PREV_OUT_DIR
### support resuming from a previous run
if [ $@ ] && [ "$1" = "resume" ]
then
IN_DIR=$PREV_OUT_DIR
fi
### make sure that parsing the fwknopd.conf file works
./fuzzing-wrappers/helpers/fwknopd-parse-conf.sh || exit $?

View File

@ -7,8 +7,8 @@
. ./fuzzing-wrappers/fcns
FDIR="spa-pkts.out"
ARCHIVE_DIR="$TOP_DIR/archive"
OUT_DIR="$TOP_DIR/$FDIR"
PREV_OUT_DIR=''
IN_DIR="test-cases/spa-pkts"
### build up our afl-fuzz text banner
@ -18,7 +18,13 @@ git_banner GIT_STR
BANNER="$TSTR$GIT_STR"
### set up directories
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR
dir_init $ARCHIVE_DIR $FDIR $OUT_DIR PREV_OUT_DIR
### support resuming from a previous run
if [ $@ ] && [ "$1" = "resume" ]
then
IN_DIR=$PREV_OUT_DIR
fi
### make sure that a basic SPA packet to stdin in fwknopd -A mode works
./fuzzing-wrappers/helpers/fwknopd-stdin-test.sh || exit $?