1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

test: Fix prepare_scsi_debug_dev.

This commit is contained in:
Petr Rockai 2014-09-30 16:50:31 +02:00
parent 580370bea3
commit c2b7642d4d

View File

@ -334,9 +334,9 @@ prepare_scsi_debug_dev() {
# Create symlink to scsi_debug device in $DM_DEV_DIR # Create symlink to scsi_debug device in $DM_DEV_DIR
SCSI_DEBUG_DEV="$DM_DEV_DIR/$(basename $DEBUG_DEV)" SCSI_DEBUG_DEV="$DM_DEV_DIR/$(basename $DEBUG_DEV)"
echo "$SCSI_DEBUG_DEV" > SCSI_DEBUG_DEV echo "$SCSI_DEBUG_DEV" > SCSI_DEBUG_DEV
echo "$SCSI_DEBUG_DEV" > LOOP echo "$SCSI_DEBUG_DEV" > BACKING_DEV
# Setting $LOOP provides means for prepare_devs() override # Setting $LOOP provides means for prepare_devs() override
test "$LVM_TEST_DEVDIR" = "/dev" || ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV" test "$DEBUG_DEV" = "$SCSI_DEBUG_DEV" || ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV"
} }
cleanup_scsi_debug_dev() { cleanup_scsi_debug_dev() {
@ -345,7 +345,9 @@ cleanup_scsi_debug_dev() {
} }
prepare_backing_dev() { prepare_backing_dev() {
if test -b "$LVM_TEST_BACKING_DEVICE"; then if test -f BACKING_DEV; then
BACKING_DEV=$(< BACKING_DEV)
elif test -b "$LVM_TEST_BACKING_DEVICE"; then
BACKING_DEV="$LVM_TEST_BACKING_DEVICE" BACKING_DEV="$LVM_TEST_BACKING_DEVICE"
echo "$BACKING_DEV" > BACKING_DEV echo "$BACKING_DEV" > BACKING_DEV
else else
@ -374,6 +376,7 @@ prepare_devs() {
test -n "$LVM_TEST_BACKING_DEVICE"; test -n "$LVM_TEST_BACKING_DEVICE";
then # maybe the backing device is too small for this test then # maybe the backing device is too small for this test
LVM_TEST_BACKING_DEVICE= LVM_TEST_BACKING_DEVICE=
rm -f BACKING_DEV
prepare_devs "$@" prepare_devs "$@"
return $? return $?
fi fi