test/nvmf: update nvmf_vhost test

This script was developed in parallel to some of the
script infrastructure improvements.  So fix it up to
match the more recent changes - including leveraging
the common setup of the NVMF_FIRST_TARGET_IP, and removing
the parameters to nvmftestinit/nvmftestfini.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6cc4ef30325961822014e2835e575a950c53ecc0

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456665
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2019-06-03 09:37:06 -07:00 committed by Ben Walker
parent d0201cb1f3
commit 61b44c9fcd

View File

@ -22,22 +22,15 @@ if [ ! -d $QEMU_PREFIX ]; then
exit 0 exit 0
fi fi
nvmftestinit $1
RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
if [ -z $NVMF_FIRST_TARGET_IP ]; then
echo "no NIC for nvmf test"
exit 0
fi
timing_enter nvmf_vhost timing_enter nvmf_vhost
nvmftestinit
# Start Apps # Start Apps
$NVMF_APP -r $NVMF_SOCK & $NVMF_APP -r $NVMF_SOCK &
nvmfpid=$! nvmfpid=$!
waitforlisten $nvmfpid $NVMF_SOCK waitforlisten $nvmfpid $NVMF_SOCK
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT
mkdir -p "$(get_vhost_dir 3)" mkdir -p "$(get_vhost_dir 3)"
@ -45,7 +38,7 @@ $VHOST_APP -S "$(get_vhost_dir 3)" &
vhostpid=$! vhostpid=$!
waitforlisten $vhostpid $NVMF_SOCK waitforlisten $vhostpid $NVMF_SOCK
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; killprocess $vhostpid nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $vhostpid nvmftestfini; exit 1" SIGINT SIGTERM EXIT
# Configure NVMF tgt on host machine # Configure NVMF tgt on host machine
malloc_bdev="$($NVMF_RPC construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)" malloc_bdev="$($NVMF_RPC construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
@ -76,6 +69,5 @@ trap - SIGINT SIGTERM EXIT
nvmfcleanup nvmfcleanup
killprocess $vhostpid killprocess $vhostpid
killprocess $nvmfpid nvmftestfini
nvmftestfini $1
timing_exit nvmf_vhost timing_exit nvmf_vhost