llvm_vfio_fuzz: keep corpus files
Keep corpus directory that trigers new code coverage. Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Change-Id: I2a5154472588669fddd87c97cc952da1a92ae0ee Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15105 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
3d1d5452e0
commit
5303e1bd54
@ -10,6 +10,8 @@ source "$rootdir/test/common/autotest_common.sh"
|
||||
|
||||
fuzzers=($(get_fuzzer_targets))
|
||||
|
||||
mkdir -p $rootdir/../corpus/
|
||||
|
||||
for fuzzer in "${fuzzers[@]}"; do
|
||||
case "$fuzzer" in
|
||||
nvmf) run_test "nvmf_fuzz" "$testdir/llvm/$fuzzer/run.sh" ;;
|
||||
|
@ -25,9 +25,18 @@ mkdir -p $VFIOUSER_IO_DIR
|
||||
function start_llvm_fuzz() {
|
||||
local fuzzer_type=$1
|
||||
local corpus_dir
|
||||
corpus_dir=/tmp/llvm_fuzz$fuzzer_type
|
||||
|
||||
corpus_dir=$rootdir/../corpus/llvm_vfio_$fuzzer_type
|
||||
mkdir -p $corpus_dir
|
||||
$rootdir/test/app/fuzz/llvm_vfio_fuzz/llvm_vfio_fuzz -m 0x1 -i 0 -F $VFIOUSER_DIR -c $testdir/fuzz_vfio_json.conf -t $TIME -D $corpus_dir -Y $VFIOUSER_IO_DIR -Z $fuzzer_type
|
||||
|
||||
$rootdir/test/app/fuzz/llvm_vfio_fuzz/llvm_vfio_fuzz -m 0x1 \
|
||||
-i 0 \
|
||||
-F $VFIOUSER_DIR \
|
||||
-c $testdir/fuzz_vfio_json.conf \
|
||||
-t $TIME \
|
||||
-D $corpus_dir \
|
||||
-Y $VFIOUSER_IO_DIR \
|
||||
-Z $fuzzer_type
|
||||
}
|
||||
|
||||
function run_fuzz() {
|
||||
@ -59,7 +68,7 @@ fuzzfile=$rootdir/test/app/fuzz/llvm_vfio_fuzz/llvm_vfio_fuzz.c
|
||||
fuzz_num=$(($(grep -c "fn =" $fuzzfile) - 1))
|
||||
[[ $fuzz_num -ne 0 ]]
|
||||
|
||||
trap 'process_shm --id 0; rm -rf /tmp/llvm_fuzz* $VFIOUSER_DIR $VFIOUSER_IO_DIR; exit 1' SIGINT SIGTERM EXIT
|
||||
trap 'process_shm --id 0; rm -rf $VFIOUSER_DIR $VFIOUSER_IO_DIR; exit 1' SIGINT SIGTERM EXIT
|
||||
|
||||
if [[ $SPDK_TEST_FUZZER_SHORT -eq 1 ]]; then
|
||||
for ((i = 0; i < fuzz_num; i++)); do
|
||||
@ -71,5 +80,5 @@ else
|
||||
start_llvm_fuzz $1
|
||||
fi
|
||||
|
||||
rm -rf /tmp/llvm_fuzz* $VFIOUSER_DIR $VFIOUSER_IO_DIR
|
||||
rm -rf $VFIOUSER_DIR $VFIOUSER_IO_DIR
|
||||
trap - SIGINT SIGTERM EXIT
|
||||
|
Loading…
Reference in New Issue
Block a user