From 008139c8de95b4316345647bf69965f3ec1b6fd5 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 14 Oct 2022 23:20:54 +0200 Subject: [PATCH] test/bdev: Add xnvme support to blockdev.sh setup Signed-off-by: Michal Berger Change-Id: I86ffc7d35243560bcfedc31bf21630b2381d8c18 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14995 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Pawel Piatek Reviewed-by: Kamil Godzwon Reviewed-by: Jim Harris --- autotest.sh | 1 + test/bdev/blockdev.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/autotest.sh b/autotest.sh index bdd8a11ae..4536afa79 100755 --- a/autotest.sh +++ b/autotest.sh @@ -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 diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index 7b4bd1c14..30daaf290 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.sh @@ -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