2018-10-31 21:53:50 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2018 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2018-10-31 21:53:50 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
|
|
|
nvmftestinit
|
|
|
|
|
2021-10-04 22:44:05 +00:00
|
|
|
"${NVMF_APP[@]}" -m 0x1 > $output_dir/nvmf_fuzz_tgt_output.txt 2>&1 &
|
2018-10-31 21:53:50 +00:00
|
|
|
nvmfpid=$!
|
|
|
|
|
2021-09-23 16:25:49 +00:00
|
|
|
trap 'process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1' SIGINT SIGTERM EXIT
|
2018-10-31 21:53:50 +00:00
|
|
|
|
|
|
|
waitforlisten $nvmfpid
|
2019-07-15 04:42:41 +00:00
|
|
|
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192
|
2018-10-31 21:53:50 +00:00
|
|
|
|
2019-08-09 11:15:35 +00:00
|
|
|
$rpc_py bdev_malloc_create -b Malloc0 64 512
|
2018-10-31 21:53:50 +00:00
|
|
|
|
2019-09-20 10:22:44 +00:00
|
|
|
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
|
2018-10-31 21:53:50 +00:00
|
|
|
$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
|
|
|
|
|
2021-09-23 16:25:49 +00:00
|
|
|
trid="trtype:$TEST_TRANSPORT adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode1 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
|
2018-10-31 21:53:50 +00:00
|
|
|
|
|
|
|
# Note that we chose a consistent seed to ensure that this test is consistent in nightly builds.
|
2021-10-04 22:44:05 +00:00
|
|
|
$rootdir/test/app/fuzz/nvme_fuzz/nvme_fuzz -m 0x2 -r "/var/tmp/nvme_fuzz" -t 30 -S 123456 -F "$trid" -N -a 2> $output_dir/nvmf_fuzz_logs1.txt
|
2018-10-31 21:53:50 +00:00
|
|
|
# We don't specify a seed for this test. Instead we run a static list of commands from example.json.
|
2021-10-04 22:44:05 +00:00
|
|
|
$rootdir/test/app/fuzz/nvme_fuzz/nvme_fuzz -m 0x2 -r "/var/tmp/nvme_fuzz" -F "$trid" -j $rootdir/test/app/fuzz/nvme_fuzz/example.json -a 2> $output_dir/nvmf_fuzz_logs2.txt
|
2018-10-31 21:53:50 +00:00
|
|
|
|
2019-09-23 10:17:30 +00:00
|
|
|
$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1
|
2018-10-31 21:53:50 +00:00
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
nvmftestfini
|
2022-10-18 08:29:53 +00:00
|
|
|
rm "$output_dir/"nvmf_fuzz_logs*.txt
|