diff --git a/test/fuzz/autofuzz.sh b/test/fuzz/autofuzz.sh index 27559d1620..bde591979c 100755 --- a/test/fuzz/autofuzz.sh +++ b/test/fuzz/autofuzz.sh @@ -5,18 +5,23 @@ rootdir=$(readlink -f $testdir/../..) source "$rootdir/test/common/autotest_common.sh" +TEST_TIMEOUT=1200 + # The term transport is used a bit loosely for vhost tests. allowed_nvme_transports=("rdma" "tcp") allowed_vhost_transports=("scsi" "blk" "all") bad_transport=true config_params="--enable-asan --enable-ubsan --enable-debug --without-isal" -# This argument is used in addition to the test arguments in autotest_common.sh +# These arguments are used in addition to the test arguments in autotest_common.sh for i in "$@"; do case "$i" in --module=*) TEST_MODULE="${i#*=}" ;; + --timeout=*) + TEST_TIMEOUT="${i#*=}" + ;; esac done @@ -55,11 +60,11 @@ timing_exit make # supply --iso to each test module so that it can run setup.sh. timing_enter fuzz_module if [ "$TEST_MODULE" == "nvmf" ]; then - sudo $testdir/autofuzz_nvmf.sh --iso --transport=$TEST_TRANSPORT + sudo $testdir/autofuzz_nvmf.sh --iso --transport=$TEST_TRANSPORT --timeout=$TEST_TIMEOUT fi if [ "$TEST_MODULE" == "vhost" ]; then - sudo $testdir/autofuzz_vhost.sh --iso --transport=$TEST_TRANSPORT + sudo $testdir/autofuzz_vhost.sh --iso --transport=$TEST_TRANSPORT --timeout=$TEST_TIMEOUT fi timing_exit fuzz_module timing_exit autofuzz diff --git a/test/fuzz/autofuzz_nvmf.sh b/test/fuzz/autofuzz_nvmf.sh index 246f2a87df..640463dda0 100755 --- a/test/fuzz/autofuzz_nvmf.sh +++ b/test/fuzz/autofuzz_nvmf.sh @@ -7,6 +7,16 @@ source $rootdir/test/nvmf/common.sh rpc_py="$rootdir/scripts/rpc.py" +TEST_TIMEOUT=1200 + +# This argument is used in addition to the test arguments in autotest_common.sh +for i in "$@"; do + case "$i" in + --timeout=*) + TEST_TIMEOUT="${i#*=}" + esac +done + nvmftestinit timing_enter nvmf_fuzz_test @@ -29,7 +39,7 @@ $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT # Note that we chose a consistent seed to ensure that this test is consistent in nightly builds. -$rootdir/test/app/fuzz/nvme_fuzz/nvme_fuzz -m 0xF0 -r "/var/tmp/nvme_fuzz" -t 12 -C $testdir/nvmf_fuzz.conf -N -a 2>$output_dir/nvmf_autofuzz_logs.txt +$rootdir/test/app/fuzz/nvme_fuzz/nvme_fuzz -m 0xF0 -r "/var/tmp/nvme_fuzz" -t $TEST_TIMEOUT -C $testdir/nvmf_fuzz.conf -N -a 2>$output_dir/nvmf_autofuzz_logs.txt rm -f $testdir/nvmf_fuzz.conf $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 diff --git a/test/fuzz/autofuzz_vhost.sh b/test/fuzz/autofuzz_vhost.sh index 7150715544..ad9984ecb9 100755 --- a/test/fuzz/autofuzz_vhost.sh +++ b/test/fuzz/autofuzz_vhost.sh @@ -4,6 +4,8 @@ rootdir=$(readlink -f $(dirname $0))/../.. source $rootdir/test/common/autotest_common.sh source "$rootdir/scripts/common.sh" +TEST_TIMEOUT=1200 + VHOST_APP="$rootdir/app/vhost/vhost -p 0" FUZZ_RPC_SOCK="/var/tmp/spdk_fuzz.sock" FUZZ_APP="$rootdir/test/app/fuzz/vhost_fuzz/vhost_fuzz -r $FUZZ_RPC_SOCK --wait-for-rpc" @@ -12,6 +14,14 @@ vhost_rpc_py="$rootdir/scripts/rpc.py" fuzz_generic_rpc_py="$rootdir/scripts/rpc.py -s $FUZZ_RPC_SOCK" fuzz_specific_rpc_py="$rootdir/test/app/fuzz/common/fuzz_rpc.py -s $FUZZ_RPC_SOCK" +# This argument is used in addition to the test arguments in autotest_common.sh +for i in "$@"; do + case "$i" in + --timeout=*) + TEST_TIMEOUT="${i#*=}" + esac +done + timing_enter vhost_fuzz_test #todo refactor this to use the vhosttestinit function when it becomes available. @@ -25,7 +35,7 @@ waitforlisten $vhostpid trap "killprocess $vhostpid; exit 1" SIGINT SIGTERM exit -$FUZZ_APP -t 1200 2>$output_dir/vhost_autofuzz_output1.txt & +$FUZZ_APP -t $TEST_TIMEOUT 2>$output_dir/vhost_autofuzz_output1.txt & fuzzpid=$! waitforlisten $fuzzpid $FUZZ_RPC_SOCK @@ -60,7 +70,9 @@ $fuzz_generic_rpc_py start_subsystem_init wait $fuzzpid trap - SIGINT SIGTERM exit - +set +e killprocess $vhostpid +echo $? +set -e killprocess $fuzzpid timing_exit vhost_fuzz_test