Commit aa749442 authored by Liang Yan's avatar Liang Yan Committed by Daniel Verkamp
Browse files

test/iscsi_tgt: merge the two steps of running fio_remote_nvme.sh



Change-Id: Icb98e4628962591da32d169853d0ff14400e1e50
Signed-off-by: default avatarLiang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/406922


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 208748b4
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -49,10 +49,8 @@ kill_stub
if [ $SPDK_TEST_NVMF -eq 1 ]; then
	# TODO: enable remote NVMe controllers with multi-process so that
	#  we can use the stub for this test
	# Test configure remote NVMe device from rpc
	run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh 0
	# Test configure remote NVMe device from conf file
	run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh 1
	# Test configure remote NVMe device from rpc and conf file
	run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh
fi

if [ $RUN_NIGHTLY -eq 1 ]; then
+44 −28
Original line number Diff line number Diff line
@@ -20,24 +20,11 @@ fio_py="python $rootdir/scripts/fio.py"

NVMF_PORT=4420

timing_enter nvme_remote

# Start the NVMf target
$rootdir/app/nvmf_tgt/nvmf_tgt -c $rootdir/test/nvmf/nvmf.conf -m 0x2 -p 1 -s 512 &
nvmfpid=$!
echo "NVMf target launched. pid: $nvmfpid"
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
echo "NVMf target has started."
bdevs=$($rpc_py construct_malloc_bdev 64 512)
$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420" "" -a -s SPDK00000000000001 -n "$bdevs"
echo "NVMf subsystem created."

timing_enter start_iscsi_tgt

function run_nvme_remote() {
	echo "now use $1 method to run iscsi tgt."
	cp $testdir/iscsi.conf $testdir/iscsi.conf.tmp

if [ $1 -eq 1 ]; then
	if [ "$1" = "remote" ]; then
		echo "[NVMe]" >> $testdir/iscsi.conf.tmp
		echo "  TransportID \"trtype:RDMA adrfam:ipv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420 subnqn:nqn.2016-06.io.spdk:cnode1\" Nvme0" >> $testdir/iscsi.conf.tmp
	fi
@@ -55,7 +42,7 @@ timing_exit start_iscsi_tgt
	echo "Creating an iSCSI target node."
	$rpc_py -s "$iscsi_rpc_addr" add_portal_group $PORTAL_TAG $TARGET_IP:$ISCSI_PORT
	$rpc_py -s "$iscsi_rpc_addr" add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK
if [ $1 -eq 0 ]; then
	if [ "$1" = "local" ]; then
		$rpc_py -s "$iscsi_rpc_addr" construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1
	fi
	$rpc_py -s "$iscsi_rpc_addr" construct_target_node Target1 Target1_alias 'Nvme0n1:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d
@@ -64,12 +51,41 @@ sleep 1
	echo "Logging in to iSCSI target."
	iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
	iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
}

timing_enter nvme_remote

# Start the NVMf target
$rootdir/app/nvmf_tgt/nvmf_tgt -c $rootdir/test/nvmf/nvmf.conf -m 0x2 -p 1 -s 512 &
nvmfpid=$!
echo "NVMf target launched. pid: $nvmfpid"
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
echo "NVMf target has started."
bdevs=$($rpc_py construct_malloc_bdev 64 512)
$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420" "" -a -s SPDK00000000000001 -n "$bdevs"
echo "NVMf subsystem created."

timing_enter start_iscsi_tgt

run_nvme_remote "local"

trap "iscsicleanup; killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
sleep 1

echo "Running FIO"
$fio_py 4096 1 randrw 1 verify

rm -f ./local-job0-0-verify.state
iscsicleanup
killprocess $iscsipid
rm -f $testdir/iscsi.conf.tmp

run_nvme_remote "remote"

echo "Running FIO"
$fio_py 4096 1 randrw 1 verify

rm -f ./local-job0-0-verify.state
trap - SIGINT SIGTERM EXIT