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

Change-Id: Icb98e4628962591da32d169853d0ff14400e1e50
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/406922
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Liang Yan 2018-04-09 10:19:56 +08:00 committed by Daniel Verkamp
parent 208748b423
commit aa749442cb
2 changed files with 46 additions and 32 deletions

View File

@ -49,10 +49,8 @@ kill_stub
if [ $SPDK_TEST_NVMF -eq 1 ]; then if [ $SPDK_TEST_NVMF -eq 1 ]; then
# TODO: enable remote NVMe controllers with multi-process so that # TODO: enable remote NVMe controllers with multi-process so that
# we can use the stub for this test # we can use the stub for this test
# Test configure remote NVMe device from rpc # Test configure remote NVMe device from rpc and conf file
run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh 0 run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh
# Test configure remote NVMe device from conf file
run_test ./test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh 1
fi fi
if [ $RUN_NIGHTLY -eq 1 ]; then if [ $RUN_NIGHTLY -eq 1 ]; then

View File

@ -20,24 +20,11 @@ fio_py="python $rootdir/scripts/fio.py"
NVMF_PORT=4420 NVMF_PORT=4420
timing_enter nvme_remote function run_nvme_remote() {
echo "now use $1 method to run iscsi tgt."
# 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
cp $testdir/iscsi.conf $testdir/iscsi.conf.tmp cp $testdir/iscsi.conf $testdir/iscsi.conf.tmp
if [ $1 -eq 1 ]; then if [ "$1" = "remote" ]; then
echo "[NVMe]" >> $testdir/iscsi.conf.tmp 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 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 fi
@ -55,7 +42,7 @@ timing_exit start_iscsi_tgt
echo "Creating an iSCSI target node." 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_portal_group $PORTAL_TAG $TARGET_IP:$ISCSI_PORT
$rpc_py -s "$iscsi_rpc_addr" add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK $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 $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 fi
$rpc_py -s "$iscsi_rpc_addr" construct_target_node Target1 Target1_alias 'Nvme0n1:0' $PORTAL_TAG:$INITIATOR_TAG 64 -d $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." echo "Logging in to iSCSI target."
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -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 trap "iscsicleanup; killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
sleep 1 sleep 1
echo "Running FIO" echo "Running FIO"
$fio_py 4096 1 randrw 1 verify $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 rm -f ./local-job0-0-verify.state
trap - SIGINT SIGTERM EXIT trap - SIGINT SIGTERM EXIT