Commit 5883d343 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

test/blockdev: parameterize the nbd test.



This allows us to run the NBD tests on any combination of bdevs
based on the flags passed to the script. Previously we ran the tests
on a specific grouping of bdevs and opted to only free one type (passthru)
over RPC after the test ran. Rather than free all bdev types in the new
implementation, I opted to not free any of them via RPC and rather allow
the application to close them at termination time.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b2235c1f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -92,9 +92,12 @@ function nbd_function_test() {
	if [ $(uname -s) = Linux ] && modprobe -n nbd; then
		local rpc_server=/var/tmp/spdk-nbd.sock
		local conf=$1
		local nbd_num=6
		local nbd_all=($(ls /dev/nbd* | grep -v p))
		local bdev_all=($bdevs_name)
		local nbd_num=${#bdevs_all[@]}
		if [ ${#nbd_all[@]} -le $nbd_num ]; then
			nbd_num=${#nbd_all[@]}
		fi
		local nbd_list=(${nbd_all[@]:0:$nbd_num})
		local bdev_list=(${bdev_all[@]:0:$nbd_num})

@@ -112,8 +115,6 @@ function nbd_function_test() {
		nbd_rpc_start_stop_verify $rpc_server "${bdev_list[*]}"
		nbd_rpc_data_verify $rpc_server "${bdev_list[*]}" "${nbd_list[*]}"

		$rpc_py -s $rpc_server bdev_passthru_delete TestPT

		killprocess $nbd_pid
		trap - SIGINT SIGTERM EXIT
	fi