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 14NVMF_SUBSYS=11 15 16nvmftestinit 17nvmfappstart -m 0xF 18 19$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 20 21for i in $(seq 1 $NVMF_SUBSYS); do 22 $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc$i 23 $rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode$i -a -s SPDK$i 24 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode$i Malloc$i 25 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode$i -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT 26done 27 28for i in $(seq 1 $NVMF_SUBSYS); do 29 $NVME_CONNECT "${NVME_HOST[@]}" -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" 30 waitforserial SPDK$i 31done 32 33$rootdir/scripts/fio-wrapper -p nvmf -i 262144 -d 64 -t read -r 10 34$rootdir/scripts/fio-wrapper -p nvmf -i 262144 -d 64 -t randwrite -r 10 35 36sync 37for i in $(seq 1 $NVMF_SUBSYS); do 38 nvme disconnect -n "nqn.2016-06.io.spdk:cnode${i}" 39 waitforserial_disconnect SPDK$i 40 $rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode${i} 41done 42 43rm -f ./local-job0-0-verify.state 44 45trap - SIGINT SIGTERM EXIT 46 47nvmftestfini 48