@@ -10,7 +10,8 @@
DESCRIPTION="create many subsystems and test discovery"
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -11,7 +11,8 @@ DESCRIPTION="test if we're sending keep-alives to a discovery controller"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -12,7 +12,8 @@ DESCRIPTION="test nvme and nvmet UUID NS descriptors"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -11,9 +11,9 @@ DESCRIPTION="reset local loopback target"
QUICK=1
requires() {
- _have_modules loop nvme-core nvme-loop nvmet && \
- _have_module_param_value nvme_core multipath Y && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop && \
+ _have_module_param_value nvme_core multipath Y
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="create an NVMeOF target with a block device-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,7 +10,7 @@ DESCRIPTION="create an NVMeOF target with a file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="create an NVMeOF host with a block device-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,7 +10,7 @@ DESCRIPTION="create an NVMeOF host with a file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="run data verification fio job on NVMeOF block device-backed ns"
TIMED=1
requires() {
- _have_program nvme && _have_fio && \
- _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_fio _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="run data verification fio job on NVMeOF file-backed ns"
TIMED=1
requires() {
- _have_program nvme && _have_fio && _have_configfs && \
- _have_modules nvme-loop nvmet
+ _nvme_requires
+ _have_fio
}
test() {
@@ -10,8 +10,9 @@ DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backe
TIMED=1
requires() {
- _have_program nvme && _have_program mkfs.xfs && _have_program fio && \
- _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_program mkfs.xfs && _have_program fio && \
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns"
TIMED=1
requires() {
- _have_program nvme && _have_program mkfs.xfs && _have_fio && \
- _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_program mkfs.xfs && _have_fio
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="flush a NVMeOF block device-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,7 +10,8 @@ DESCRIPTION="unit test for NVMe flush for file backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -9,7 +9,7 @@
DESCRIPTION="create/delete many NVMeOF block device-backed ns and test discovery"
requires() {
- _have_program nvme && _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
}
test() {
@@ -9,7 +9,7 @@
DESCRIPTION="create/delete many file-ns and test discovery"
requires() {
- _have_program nvme && _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
}
test() {
@@ -11,8 +11,8 @@ DESCRIPTION="unit test NVMe-oF out of range access on a file backend"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe DSM Discard command on NVMeOF block-device ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,7 +10,7 @@ DESCRIPTION="test NVMe DSM Discard command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules nvme-loop nvmet && _have_configfs
+ _nvme_requires
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe list command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe reset command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe smart-log command on NVMeOF block-device ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe smart-log command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe effects-log command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe ns-descs command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe ns-rescan command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -10,8 +10,8 @@ DESCRIPTION="test NVMe list-subsys command on NVMeOF file-backed ns"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -11,8 +11,8 @@ DESCRIPTION="test userspace IO via nvme-cli read/write interface"
QUICK=1
requires() {
- _have_program nvme && _have_modules loop nvme-loop nvmet && \
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test_user_io()
@@ -10,9 +10,8 @@ DESCRIPTION="ensure the discovery generation counter is updated appropriately"
QUICK=1
requires() {
- _have_program nvme &&
- _have_modules loop nvme-loop nvmet &&
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
@@ -18,9 +18,8 @@ DESCRIPTION="test deletion of NVMeOF controllers immediately after setup"
QUICK=1
requires() {
- _have_program nvme &&
- _have_modules loop nvme-loop nvmet &&
- _have_configfs
+ _nvme_requires
+ _have_modules loop
}
test() {
@@ -11,11 +11,15 @@
. tests/nvme/rc
+#restrict test to nvme-pci only
+nvme_trtype=pci
+
DESCRIPTION="test nvme pci adapter rescan/reset/remove during I/O"
QUICK=1
CAN_BE_ZONED=1
requires() {
+ _nvme_requires
_have_fio
}
@@ -6,6 +6,25 @@
. common/rc
+nvme_trtype=${nvme_trtype:-"loop"}
+
+_nvme_requires() {
+ _have_program nvme
+ case ${nvme_trtype} in
+ loop)
+ _have_modules nvmet nvme-core nvme-loop
+ _have_configfs
+ ;;
+ pci)
+ _have_modules nvme nvme-core
+ ;;
+ *)
+ SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}"
+ return 1
+ esac
+ return 0
+}
+
group_requires() {
_have_root
}
Right now, only pci and loop have tests, hence these are the only ones that are allowed. The user can pass an env variable nvme_trtype and check for the necessary modules. This allows prepares us to support other transport types. Note that test 031 is designed to run only with nvme, hence it overrides the environment variable to nvme_trtype=pci. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> --- tests/nvme/002 | 3 ++- tests/nvme/003 | 3 ++- tests/nvme/004 | 3 ++- tests/nvme/005 | 6 +++--- tests/nvme/006 | 4 ++-- tests/nvme/007 | 2 +- tests/nvme/008 | 4 ++-- tests/nvme/009 | 2 +- tests/nvme/010 | 4 ++-- tests/nvme/011 | 4 ++-- tests/nvme/012 | 5 +++-- tests/nvme/013 | 4 ++-- tests/nvme/014 | 4 ++-- tests/nvme/015 | 3 ++- tests/nvme/016 | 2 +- tests/nvme/017 | 2 +- tests/nvme/018 | 4 ++-- tests/nvme/019 | 4 ++-- tests/nvme/020 | 2 +- tests/nvme/021 | 4 ++-- tests/nvme/022 | 4 ++-- tests/nvme/023 | 4 ++-- tests/nvme/024 | 4 ++-- tests/nvme/025 | 4 ++-- tests/nvme/026 | 4 ++-- tests/nvme/027 | 4 ++-- tests/nvme/028 | 4 ++-- tests/nvme/029 | 4 ++-- tests/nvme/030 | 5 ++--- tests/nvme/031 | 5 ++--- tests/nvme/032 | 4 ++++ tests/nvme/rc | 19 +++++++++++++++++++ 32 files changed, 80 insertions(+), 54 deletions(-)