]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nvme/rc: Add parametric transport required check
authorDaniel Wagner <dwagner@suse.de>
Wed, 29 Mar 2023 09:02:01 +0000 (11:02 +0200)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 12 Apr 2023 10:40:27 +0000 (19:40 +0900)
Not all transport support the same features thus we need to be able to
express this. Add a transport require check which can be runtime
parameterized.

While at it also update the existing helpers to test for trtype to with
an explicit list of transport types.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nvme/rc

index c1bb08be511aee572bf1d4bbe68d474ed082f8f2..a3c9b42d91e6c73bfe5de050783efcca40b2ac53 100644 (file)
@@ -93,17 +93,26 @@ _require_test_dev_is_nvme() {
        return 0
 }
 
+_require_nvme_trtype() {
+       local trtype
+       for trtype in "$@"; do
+               if [[ "${nvme_trtype}" == "$trtype" ]]; then
+                       return 0
+               fi
+       done
+       SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+       return 1
+}
+
 _require_nvme_trtype_is_loop() {
-       if [[ "${nvme_trtype}" != "loop" ]]; then
-               SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+       if ! _require_nvme_trtype loop; then
                return 1
        fi
        return 0
 }
 
 _require_nvme_trtype_is_fabrics() {
-       if [[ "${nvme_trtype}" == "pci" ]]; then
-               SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+       if ! _require_nvme_trtype loop fc rdma tcp; then
                return 1
        fi
        return 0