Skip to content

Commit

Permalink
Merge pull request #138 from yizhang/dev-240426-ublk-fix
Browse files Browse the repository at this point in the history
block/033 fix
  • Loading branch information
kawasaki committed Apr 23, 2024
2 parents 89bdb5d + 3618665 commit c4d647b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 6 additions & 0 deletions common/ublk
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions tests/block/033
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ requires() {
}

test() {
local ublk_prog="src/miniublk"
local UBLK_PROG="src/miniublk"

echo "Running ${TEST_NAME}"

if ! _init_ublk; then
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

Expand Down
7 changes: 0 additions & 7 deletions tests/ublk/rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c4d647b

Please sign in to comment.