]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nvme/{021,022,025,026,027,028}: do not hard code target blkdev type
authorDaniel Wagner <dwagner@suse.de>
Sat, 4 May 2024 08:14:45 +0000 (17:14 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 9 May 2024 07:37:06 +0000 (16:37 +0900)
There is no need to hardcode the target blkdev type. This allows
the user to select different blkdev types via the nvmet_blkdev_type
environment variable. Also modify set_conditions() hooks to cover
combinations of NVMET_TRTYPES and NVMET_BLKDEV_TYPES.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
[Shin'ichiro: modified set_conditions()]
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nvme/021
tests/nvme/022
tests/nvme/025
tests/nvme/026
tests/nvme/027
tests/nvme/028

index 270d90e4c1870122fe40577e53d7db5b8b26bb89..43d85e60c9b6fbdb7848b9f5696dfbb53db06677 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe list command on NVMeOF with a file-backed ns.
+# Test NVMe list command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe list command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe list command"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -26,7 +26,7 @@ test() {
 
        local ns
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys
 
index adaa76529a8b0b4244bce785a7789f002da2ab37..6b3a8fbdd93c6d0a20cdd1b2901e5baae2d54e5a 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe reset command on NVMeOF with a file-backed ns.
+# Test NVMe reset command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe reset command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe reset command"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -26,7 +26,7 @@ test() {
 
        local nvmedev
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys
 
index 224492b7ae789b0cc4c1d5e0684106f682f17232..529fd0bd7a537d7229da8635460f6b452335368b 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe effects-log command on NVMeOF with a file-backed ns.
+# Test NVMe effects-log command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe effects-log command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe effects-log"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -26,7 +26,7 @@ test() {
 
        local ns
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys
 
index 6ee6a51b8a929cb5ca7fa6a3c1185ae3e11e4562..6dfb9e54939bb7b9c1e53e5f7c59e325056fcdb4 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe ns-descs command on NVMeOF with a file-backed ns.
+# Test NVMe ns-descs command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe ns-descs command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe ns-descs"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -26,7 +26,7 @@ test() {
 
        local ns
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys
 
index a63e42b4561a7aa80aea4745795f5f958bedb6ae..06fccab4ec9bbbc823b9af5fd57e0fd0813cc513 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe ns-rescan command on NVMeOF with a file-backed ns.
+# Test NVMe ns-rescan command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe ns-rescan command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe ns-rescan command"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -26,7 +26,7 @@ test() {
 
        local nvmedev
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys
 
index 65c52a944171c40cbd99be26a9d1b6886ec3afe0..c35d0acd533b0c3fb77cfe5ed8373183e6403d3a 100755 (executable)
@@ -2,11 +2,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
 #
-# Test NVMe list-subsys command on NVMeOF with a file-backed ns.
+# Test NVMe list-subsys command.
 
 . tests/nvme/rc
 
-DESCRIPTION="test NVMe list-subsys command on NVMeOF file-backed ns"
+DESCRIPTION="test NVMe list-subsys"
 QUICK=1
 
 requires() {
@@ -16,7 +16,7 @@ requires() {
 }
 
 set_conditions() {
-       _set_nvme_trtype "$@"
+       _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@"
 }
 
 test() {
@@ -24,7 +24,7 @@ test() {
 
        _setup_nvmet
 
-       _nvmet_target_setup --blkdev file
+       _nvmet_target_setup
 
        _nvme_connect_subsys