Commit 008139c8 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/bdev: Add xnvme support to blockdev.sh setup

parent 367fc7a9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then

		if [[ $SPDK_TEST_XNVME -eq 1 ]]; then
			run_test "nvme_xnvme" test/nvme/xnvme/xnvme.sh
			run_test "blockdev_xnvme" test/bdev/blockdev.sh "xnvme"
		fi
	fi

+23 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ function cleanup() {
			wipefs --all "$gpt_nvme"
		fi
	fi
	if [[ $test_type == xnvme ]]; then
		"$rootdir/scripts/setup.sh"
	fi
}

function start_spdk_tgt() {
@@ -73,6 +76,23 @@ function setup_nvme_conf() {
	"$rpc_py" load_subsystem_config -j "'${json[*]}'"
}

function setup_xnvme_conf() {
	# TODO: Switch to io_uring_cmd when proper CI support is in place
	local io_mechanism=io_uring
	local nvme nvmes

	"$rootdir/scripts/setup.sh" reset
	get_zoned_devs

	for nvme in /dev/nvme*n*; do
		[[ -b $nvme && -z ${zoned_devs["${nvme##*/}"]} ]] || continue
		nvmes+=("bdev_xnvme_create $nvme ${nvme##*/} $io_mechanism")
	done

	((${#nvmes[@]} > 0))
	"$rpc_py" < <(printf '%s\n' "${nvmes[@]}")
}

function setup_gpt_conf() {
	$rootdir/scripts/setup.sh reset
	get_zoned_devs
@@ -530,6 +550,9 @@ case "$test_type" in
	raid5f)
		setup_raid5f_conf
		;;
	xnvme)
		setup_xnvme_conf
		;;
	*)
		echo "invalid test name"
		exit 1