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