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>
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
}
test() {
- local ublk_prog="src/miniublk"
+ local UBLK_PROG="src/miniublk"
echo "Running ${TEST_NAME}"
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
. 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