]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
block/033: fix the output when ublk prog not avaiable
authorYi Zhang <yi.zhang@redhat.com>
Tue, 16 Apr 2024 08:22:12 +0000 (16:22 +0800)
committerYi Zhang <yi.zhang@redhat.com>
Fri, 19 Apr 2024 08:31:00 +0000 (04:31 -0400)
UBLK_PROG was not defined when calling _have_ublk, move the defination
to common/ublk.
Replace ublk_prog with UBLK_PROG in block/033.
common/fio already included in common/rc, so remove the dup inclusion.

$ ./check block/033
block/033 (add & delete ublk device and test if gendisk is leaked) [not run]
    driver ublk_drv is not available
     is not available

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
common/ublk
tests/block/033
tests/ublk/rc

index c4d1e34042adb3680ef0ba63c7aa624f459011ae..c065db21aaddc59587b6c8654f71917e243b7719 100644 (file)
@@ -40,3 +40,9 @@ _exit_ublk() {
        udevadm settle
        modprobe -r -q ublk_drv
 }
+
+if which rublk > /dev/null 2>&1; then
+       export UBLK_PROG="src/rublk_wrapper.sh"
+else
+       export UBLK_PROG="src/miniublk"
+fi
index 762f606b833e5d77a22a0d0651cd07a8032053d7..510e1c56edd71c5a1a48d451984bbf9c1baf38be 100755 (executable)
@@ -17,7 +17,7 @@ requires() {
 }
 
 test() {
-       local ublk_prog="src/miniublk"
+       local UBLK_PROG="src/miniublk"
 
        echo "Running ${TEST_NAME}"
 
@@ -25,15 +25,15 @@ test() {
                return 1
        fi
 
-       ${ublk_prog} add -t null -n 0 > "$FULL"
+       ${UBLK_PROG} add -t null -n 0 > "$FULL"
        udevadm settle
-       if ! ${ublk_prog} list -n 0 >> "$FULL"; then
+       if ! ${UBLK_PROG} list -n 0 >> "$FULL"; then
                echo "fail to list dev"
        fi
        if ! dd if=/dev/ublkb0 iflag=direct of=/dev/null bs=1M count=512 >> "$FULL" 2>&1; then
                echo "fail io"
        fi
-       ${ublk_prog} del -n 0 >> "$FULL"
+       ${UBLK_PROG} del -n 0 >> "$FULL"
 
        _exit_ublk
 
index 5fbf8613ee8501047291338dffe046a0e2440d77..530b09778d3a685d913ef3dfee78492862211f67 100644 (file)
@@ -6,16 +6,9 @@
 
 . common/rc
 . common/ublk
-. common/fio
 
 group_requires() {
        _have_root
        _have_ublk
        _have_fio
 }
-
-if which rublk > /dev/null 2>&1; then
-       export UBLK_PROG="src/rublk_wrapper.sh"
-else
-       export UBLK_PROG="src/miniublk"
-fi