Commit 913f5858 authored by Jim Harris's avatar Jim Harris
Browse files

test/nvmf: simplify "iso" parameter



Pull this parameter when sourcing common.sh 
and set a RUN_IN_ISOLATION flag if it was specified.
This reduces the overall code a bit plus avoids having to
pass the "iso" parameter to nvmftestinit and nvmftestfini.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Idbbe27bfb7b62857500176cdb5d90e381fce4ffc

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454814


Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 3f81bcaf
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ NVMF_TCP_IP_ADDRESS="127.0.0.1"

have_pci_nics=0

NVMF_TEST_MODE=$1

function load_ib_rdma_modules()
{
	if [ `uname` != Linux ]; then
@@ -157,7 +159,7 @@ function nvmfcleanup()

function nvmftestinit()
{
	if [ "$1" == "iso" ]; then
	if [ "$NVMF_TEST_MODE" == "iso" ]; then
		$rootdir/scripts/setup.sh
		rdma_device_init
	fi
@@ -165,7 +167,7 @@ function nvmftestinit()

function nvmftestfini()
{
	if [ "$1" == "iso" ]; then
	if [ "$NVMF_TEST_MODE" == "iso" ]; then
		$rootdir/scripts/setup.sh reset
		rdma_device_init
	fi
+3 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ set -e

# pass the parameter 'iso' to this script when running it in isolation to trigger rdma device initialization.
# e.g. sudo ./aer.sh iso
nvmftestinit $1
nvmftestinit

RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
@@ -26,7 +26,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF &
nvmfpid=$!

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; killprocess $nvmfpid; nvmftestfini; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py nvmf_create_transport -t RDMA -u 8192 -p 4
@@ -83,5 +83,5 @@ trap - SIGINT SIGTERM EXIT

nvmfcleanup
killprocess $nvmfpid
nvmftestfini $1
nvmftestfini
timing_exit aer
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ set -e

# pass the parameter 'iso' to this script when running it in isolation to trigger rdma device initialization.
# e.g. sudo ./bdevperf.sh iso
nvmftestinit $1
nvmftestinit

RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
@@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF &
nvmfpid=$!

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; killprocess $nvmfpid;  nvmftestfini; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py nvmf_create_transport -t RDMA -u 8192 -p 4
@@ -50,5 +50,5 @@ $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
trap - SIGINT SIGTERM EXIT

killprocess $nvmfpid
nvmftestfini $1
nvmftestfini
timing_exit bdevperf
+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ set -e

# pass the parameter 'iso' to this script when running it in isolation to trigger rdma device initialization.
# e.g. sudo ./fio.sh iso
nvmftestinit $1
nvmftestinit

RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
@@ -32,7 +32,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF &
nvmfpid=$!

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; killprocess $nvmfpid;  nvmftestfini; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py nvmf_create_transport -t RDMA -u 8192 -p 4
@@ -92,5 +92,5 @@ trap - SIGINT SIGTERM EXIT

rm -f ./local-test-0-verify.state
killprocess $nvmfpid
nvmftestfini $1
nvmftestfini
timing_exit fio
+3 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ rpc_py="$rootdir/scripts/rpc.py"
set -e
# pass the parameter 'iso' to this script when running it in isolation to trigger rdma device initialization.
# e.g. sudo ./identify.sh iso
nvmftestinit $1
nvmftestinit

RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
@@ -27,7 +27,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF &
nvmfpid=$!

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; killprocess $nvmfpid; nvmftestfini; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py nvmf_create_transport -t RDMA -u 8192 -p 4
@@ -62,5 +62,5 @@ $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
trap - SIGINT SIGTERM EXIT

killprocess $nvmfpid
nvmftestfini $1
nvmftestfini
timing_exit identify
Loading