blockdev, nvme: Test parsing device exported by NVMe-oF in conf

Change-Id: I9fbb1dc5a487323af099d08ab466fc811f7be79e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/366703
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ziye Yang 2017-06-23 07:56:37 +08:00 committed by Daniel Verkamp
parent 6adaf829c3
commit 7d101fe6c6
2 changed files with 17 additions and 5 deletions

View File

@ -43,6 +43,9 @@ kill_stub
# TODO: enable remote NVMe controllers with multi-process so that
# we can use the stub for this test
run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh
#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
timing_exit iscsi_tgt

View File

@ -22,7 +22,7 @@ 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 &
$rootdir/app/nvmf_tgt/nvmf_tgt -c $rootdir/test/nvmf/nvmf.conf -m 0x2 -p 1 -s 384 &
nvmfpid=$!
echo "NVMf target launched. pid: $nvmfpid"
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
@ -34,8 +34,14 @@ echo "NVMf subsystem created."
timing_enter start_iscsi_tgt
# Start the iSCSI target
$ISCSI_APP -c $testdir/iscsi.conf -m 0x1 -p 0 -s 512 &
cp $testdir/iscsi.conf $testdir/iscsi.conf.tmp
if [ $1 -eq 1 ]; 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
# Start the iSCSI target without using stub
$rootdir/app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf.tmp -m 0x1 -p 0 -s 512 &
iscsipid=$!
echo "iSCSI target launched. pid: $iscsipid"
trap "killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
@ -48,7 +54,9 @@ timing_exit start_iscsi_tgt
echo "Creating an iSCSI target node."
$rpc_py -p 5261 add_portal_group 1 $TARGET_IP:$ISCSI_PORT
$rpc_py -p 5261 add_initiator_group 1 ALL $INITIATOR_IP/32
$rpc_py -p 5261 construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1
if [ $1 -eq 0 ]; then
$rpc_py -p 5261 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 -p 5261 construct_target_node Target1 Target1_alias 'Nvme0n1:0' '1:1' 64 1 0 0 0
sleep 1
@ -66,6 +74,7 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
killprocess $iscsipid
rm -f $testdir/iscsi.conf.tmp
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
killprocess $nvmfpid