diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/test/nvme/cuse/nvme_cuse.sh | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/test/nvme/cuse/nvme_cuse.sh')
-rwxr-xr-x | src/spdk/test/nvme/cuse/nvme_cuse.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/spdk/test/nvme/cuse/nvme_cuse.sh b/src/spdk/test/nvme/cuse/nvme_cuse.sh new file mode 100755 index 000000000..699cd5ac8 --- /dev/null +++ b/src/spdk/test/nvme/cuse/nvme_cuse.sh @@ -0,0 +1,46 @@ +#!/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 + +# Only run Namespace managment test case when such device is present +bdfs=$(get_nvme_bdfs) + +$rootdir/scripts/setup.sh reset +sleep 1 + +# Find bdf that supports Namespace managment +for bdf in $bdfs; do + nvme_name=$(get_nvme_ctrlr_from_bdf ${bdf}) + if [[ -z "$nvme_name" ]]; then + continue + fi + + # Check Optional Admin Command Support for Namespace Management + oacs=$(nvme id-ctrl /dev/${nvme_name} | grep oacs | cut -d: -f2) + oacs_ns_manage=$((oacs & 0x8)) + + if [[ "$oacs_ns_manage" -ne 0 ]]; then + break + fi +done + +if [[ "$oacs_ns_manage" -ne 0 ]]; then + run_test "nvme_ns_manage_cuse" $testdir/nvme_ns_manage_cuse.sh +fi +$rootdir/scripts/setup.sh + +rmmod cuse |