From 4e0eb251f740ff3bca6ca8cdab157bb0de1f5e8a Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Mon, 8 Jun 2020 07:42:52 -0400 Subject: [PATCH] test/cuse: move all nvme-cuse tests under single script This will help with managing the test execution and preparation. Signed-off-by: Tomasz Zawadzki Change-Id: I0bd3612381d031a4015335d162f1296fd6dd213d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2823 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker --- autotest.sh | 7 +------ test/nvme/cuse/nvme_cuse.sh | 19 +++++++++++++++++++ test/nvme/{ => cuse}/nvme_ns_manage_cuse.sh | 2 +- test/nvme/{ => cuse}/spdk_nvme_cli_cuse.sh | 2 +- test/nvme/{ => cuse}/spdk_smartctl_cuse.sh | 2 +- test/nvme/nvme.sh | 3 --- 6 files changed, 23 insertions(+), 12 deletions(-) create mode 100755 test/nvme/cuse/nvme_cuse.sh rename test/nvme/{ => cuse}/nvme_ns_manage_cuse.sh (98%) rename test/nvme/{ => cuse}/spdk_nvme_cli_cuse.sh (98%) rename test/nvme/{ => cuse}/spdk_smartctl_cuse.sh (98%) diff --git a/autotest.sh b/autotest.sh index 2b045a2db..b3cd18f06 100755 --- a/autotest.sh +++ b/autotest.sh @@ -180,12 +180,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then run_test "nvme_cli" test/nvme/spdk_nvme_cli.sh fi if [[ $SPDK_TEST_NVME_CUSE -eq 1 ]]; then - modprobe cuse - run_test "nvme_cuse_rpc" test/nvme/cuse/nvme_cuse_rpc.sh - run_test "nvme_cli_cuse" test/nvme/spdk_nvme_cli_cuse.sh - run_test "nvme_smartctl_cuse" test/nvme/spdk_smartctl_cuse.sh - run_test "nvme_ns_manage_cuse" test/nvme/nvme_ns_manage_cuse.sh - rmmod cuse + run_test "nvme_cuse" test/nvme/cuse/nvme_cuse.sh fi run_test "nvme_rpc" test/nvme/nvme_rpc.sh # Only test hotplug without ASAN enabled. Since if it is diff --git a/test/nvme/cuse/nvme_cuse.sh b/test/nvme/cuse/nvme_cuse.sh new file mode 100755 index 000000000..b28ebf794 --- /dev/null +++ b/test/nvme/cuse/nvme_cuse.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../../..) +source $rootdir/scripts/common.sh +source $rootdir/test/common/autotest_common.sh + +if [[ $(uname) != "Linux" ]]; then + echo "NVMe cuse tests only supported on Linux" + exit 1 +fi + +modprobe cuse +run_test "nvme_cuse_app" $testdir/cuse +run_test "nvme_cuse_rpc" $testdir/nvme_cuse_rpc.sh +run_test "nvme_cli_cuse" $testdir/spdk_nvme_cli_cuse.sh +run_test "nvme_smartctl_cuse" $testdir/spdk_smartctl_cuse.sh +run_test "nvme_ns_manage_cuse" $testdir/nvme_ns_manage_cuse.sh +rmmod cuse diff --git a/test/nvme/nvme_ns_manage_cuse.sh b/test/nvme/cuse/nvme_ns_manage_cuse.sh similarity index 98% rename from test/nvme/nvme_ns_manage_cuse.sh rename to test/nvme/cuse/nvme_ns_manage_cuse.sh index 5974ab80c..ac31403f3 100755 --- a/test/nvme/nvme_ns_manage_cuse.sh +++ b/test/nvme/cuse/nvme_ns_manage_cuse.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash testdir=$(readlink -f $(dirname $0)) -rootdir=$(readlink -f $testdir/../..) +rootdir=$(readlink -f $testdir/../../..) source $rootdir/scripts/common.sh source $rootdir/test/common/autotest_common.sh diff --git a/test/nvme/spdk_nvme_cli_cuse.sh b/test/nvme/cuse/spdk_nvme_cli_cuse.sh similarity index 98% rename from test/nvme/spdk_nvme_cli_cuse.sh rename to test/nvme/cuse/spdk_nvme_cli_cuse.sh index 8c209e8f8..502c17dc6 100755 --- a/test/nvme/spdk_nvme_cli_cuse.sh +++ b/test/nvme/cuse/spdk_nvme_cli_cuse.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash testdir=$(readlink -f $(dirname $0)) -rootdir=$(readlink -f $testdir/../..) +rootdir=$(readlink -f $testdir/../../..) source $rootdir/scripts/common.sh source $rootdir/test/common/autotest_common.sh diff --git a/test/nvme/spdk_smartctl_cuse.sh b/test/nvme/cuse/spdk_smartctl_cuse.sh similarity index 98% rename from test/nvme/spdk_smartctl_cuse.sh rename to test/nvme/cuse/spdk_smartctl_cuse.sh index 4af14a255..585962468 100755 --- a/test/nvme/spdk_smartctl_cuse.sh +++ b/test/nvme/cuse/spdk_smartctl_cuse.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash testdir=$(readlink -f $(dirname $0)) -rootdir=$(readlink -f $testdir/../..) +rootdir=$(readlink -f $testdir/../../..) source $rootdir/scripts/common.sh source $rootdir/test/common/autotest_common.sh diff --git a/test/nvme/nvme.sh b/test/nvme/nvme.sh index 15438790d..9ec865fb7 100755 --- a/test/nvme/nvme.sh +++ b/test/nvme/nvme.sh @@ -116,9 +116,6 @@ run_test "nvme_reserve" $testdir/reserve/reserve run_test "nvme_err_injection" $testdir/err_injection/err_injection run_test "nvme_overhead" $testdir/overhead/overhead -s 4096 -t 1 -H run_test "nvme_arbitration" $SPDK_EXAMPLE_DIR/arbitration -t 3 -i 0 -if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then - run_test "nvme_cuse_app" $testdir/cuse/cuse -fi if [[ $CONFIG_FIO_PLUGIN == y ]]; then run_test "nvme_fio" nvme_fio_test