Skip to content

Commit 05ec46b

Browse files
committed
nvme/032,050: ensure that test target NVME device has PCI transport
The test case nvme/032 sets the value "pci" to the global variable nvme_trtype to ensure that the test case runs only when TEST_DEV is a NVME device using PCI transport. However, this approach was not working as intended since the global variable is not referred to. The test case was run for NVME devices using non-PCI transport, and reported false- positive failures. Commit c634b8a ("nvme/032: skip on non-PCI devices") introduced the helper function _require_test_dev_is_nvme_pci(). This function ensures that the test case nvme/032 is skipped when TEST_DEV is not a NVME device with PCI transport. Despite this improvement, the unused global variable nvme_trtype continued to be set. Remove the unnecessary substitution code. In the same manner, the test case nvme/050 is expected to be run only when TEST_DEV is a NVME device with PCI transport. It also sets the global variable nvme_trtype, but it caused unexpected failure as reported in the Link. Modify the test case to use _require_test_dev_is_nvme_pci() to ensure the requirement. Fixes: c634b8a ("nvme/032: skip on non-PCI devices") Link: linux-blktests#214 Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
1 parent b1b99d1 commit 05ec46b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tests/nvme/032

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
. tests/nvme/rc
1313

14-
#restrict test to nvme-pci only
15-
nvme_trtype=pci
16-
1714
DESCRIPTION="test nvme pci adapter rescan/reset/remove during I/O"
1815
QUICK=1
1916
CAN_BE_ZONED=1

tests/nvme/050

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
DESCRIPTION="test nvme-pci timeout with fio jobs"
1111
CAN_BE_ZONED=1
1212

13-
#restrict test to nvme-pci only
14-
nvme_trtype=pci
15-
1613
requires() {
1714
_have_fio
1815
_nvme_requires
1916
_have_kernel_options FAIL_IO_TIMEOUT FAULT_INJECTION_DEBUG_FS
2017
}
2118

19+
device_requires() {
20+
_require_test_dev_is_nvme_pci
21+
}
22+
2223
test_device() {
2324
local nvme_ns
2425
local pdev

0 commit comments

Comments
 (0)