]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/fuzz/autofuzz_nvmf.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / test / fuzz / autofuzz_nvmf.sh
1 #!/usr/bin/env bash
2
3 testdir=$(readlink -f $(dirname $0))
4 rootdir=$(readlink -f $testdir/../..)
5 source $rootdir/test/common/autotest_common.sh
6 source $rootdir/test/nvmf/common.sh
7
8 rpc_py="$rootdir/scripts/rpc.py"
9
10 TEST_TIMEOUT=1200
11
12 # This argument is used in addition to the test arguments in autotest_common.sh
13 for i in "$@"; do
14 case "$i" in
15 --timeout=*)
16 TEST_TIMEOUT="${i#*=}"
17 ;;
18 esac
19 done
20
21 nvmftestinit
22
23 timing_enter nvmf_fuzz_test
24
25 echo "[Nvme]" > $testdir/nvmf_fuzz.conf
26 echo " TransportID \"trtype:$TEST_TRANSPORT adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode1 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT\" Nvme0" >> $testdir/nvmf_fuzz.conf
27
28 "${NVMF_APP[@]}" -m 0xF &> "$output_dir/nvmf_autofuzz_tgt_output.txt" &
29 nvmfpid=$!
30
31 trap 'process_shm --id $NVMF_APP_SHM_ID; rm -f $testdir/nvmf_fuzz.conf; killprocess $nvmfpid; nvmftestfini $1; exit 1' SIGINT SIGTERM EXIT
32
33 waitforlisten $nvmfpid
34 $rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192
35
36 $rpc_py bdev_malloc_create -b Malloc0 64 512
37
38 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
39 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0
40 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
41
42 # Note that we chose a consistent seed to ensure that this test is consistent in nightly builds.
43 $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
44
45 rm -f $testdir/nvmf_fuzz.conf
46 $rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1
47
48 trap - SIGINT SIGTERM EXIT
49
50 nvmfcleanup
51 nvmftestfini
52 timing_exit nvmf_fuzz_test