Commit 2df7e3a2 authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

test/nvmf: make modprobe calls symmetric.



By moving the modprobe and modprobe -r calls into nvmftestinit and
nvmftestfini respectively, we can make these calls symmetric in all
cases The previous format where nvmfappstart was adding modules and
nvmfcleanup was being called independently to remove them started to
cause issues when we added the tcp transport.

I think this fixes #846

Change-Id: I68d18e0be5a2d4d2ea83a5a34f0aa2da268209fe
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460396


Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 0b8e0d81
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -181,6 +181,13 @@ function nvmftestinit()
	elif [ "$TEST_TRANSPORT" == "tcp" ]; then
		NVMF_FIRST_TARGET_IP=127.0.0.1
	fi

	# currently we run the host/perf test for TCP even on systems without kernel nvme-tcp
	#  support; that's fine since the host/perf test uses the SPDK initiator
	# maybe later we will enforce modprobe to succeed once we have systems in the test pool
	#  with nvme-tcp kernel support - but until then let this pass so we can still run the
	#  host/perf test with the tcp transport
	modprobe nvme-$TEST_TRANSPORT || true
}

function nvmfappstart()
@@ -190,17 +197,12 @@ function nvmfappstart()
	nvmfpid=$!
	trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT
	waitforlisten $nvmfpid
	# currently we run the host/perf test for TCP even on systems without kernel nvme-tcp
	#  support; that's fine since the host/perf test uses the SPDK initiator
	# maybe later we will enforce modprobe to succeed once we have systems in the test pool
	#  with nvme-tcp kernel support - but until then let this pass so we can still run the
	#  host/perf test with the tcp transport
	modprobe nvme-$TEST_TRANSPORT || true
	timing_exit start_nvmf_tgt
}

function nvmftestfini()
{
	nvmfcleanup
	killprocess $nvmfpid
	if [ "$TEST_MODE" == "iso" ]; then
		$rootdir/scripts/setup.sh reset
+0 −1
Original line number Diff line number Diff line
@@ -48,6 +48,5 @@ $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1

trap - SIGINT SIGTERM EXIT

nvmfcleanup
nvmftestfini
timing_exit aer
+0 −1
Original line number Diff line number Diff line
@@ -46,6 +46,5 @@ $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1

trap - SIGINT SIGTERM EXIT

nvmfcleanup
nvmftestfini
timing_exit bdev_io_wait
+0 −1
Original line number Diff line number Diff line
@@ -30,6 +30,5 @@ $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1

trap - SIGINT SIGTERM EXIT

nvmfcleanup
nvmftestfini
timing_exit bdev_io_wait
+0 −1
Original line number Diff line number Diff line
@@ -41,6 +41,5 @@ set -x

trap - SIGINT SIGTERM EXIT

nvmfcleanup
nvmftestfini
timing_exit connect_disconnect
Loading