1#!/usr/bin/env bash 2 3testdir=$(readlink -f $(dirname $0)) 4rootdir=$(readlink -f $testdir/../../..) 5source $rootdir/test/common/autotest_common.sh 6source $rootdir/test/nvmf/common.sh 7 8MALLOC_BDEV_SIZE=64 9MALLOC_BLOCK_SIZE=512 10 11function tgt_init() { 12 nvmfappstart -m 0xE 13 14 $rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 15 $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0 16 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 17 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 18 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT 19} 20 21nvmftestinit 22tgt_init 23 24"$rootdir/build/examples/bdevperf" --json <(gen_nvmf_target_json) -q 128 -o 4096 -w verify -t 1 25 26"$rootdir/build/examples/bdevperf" --json <(gen_nvmf_target_json) -q 128 -o 4096 -w verify -t 15 -f & 27bdevperfpid=$! 28 29sleep 3 30kill -9 $nvmfpid 31 32sleep 3 33tgt_init 34 35wait $bdevperfpid 36sync 37$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1 38 39trap - SIGINT SIGTERM EXIT 40 41nvmftestfini 42