[PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Due to the unique structure of xfs/279 running _get_scsi_debug_dev from
a backtick from inside subshell, the "could not get scsi_debug device"
checks do not actually stop the test when modprobe scsi_debug fails.

Therefore, check the value of SCSI_DEBUG_DEV from the subshell and
_notrun the test if we couldn't get memory.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 tests/xfs/279 |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/tests/xfs/279 b/tests/xfs/279
index 7ab8bdd5..0ddc6a00 100755
--- a/tests/xfs/279
+++ b/tests/xfs/279
@@ -65,6 +65,7 @@ _check_mkfs()
 echo "==================="
 echo "4k physical 512b logical aligned"
 SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 512 0 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
 # sector size should default to 4k
 _check_mkfs $SCSI_DEBUG_DEV
 # blocksize smaller than physical sectorsize should revert to logical sectorsize
@@ -77,6 +78,7 @@ _put_scsi_debug_dev
 echo "==================="
 echo "4k physical 512b logical unaligned"
 SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 512 1 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
 # should fail on misalignment
 _check_mkfs $SCSI_DEBUG_DEV
 # should fall back to logical sector size with force
@@ -93,6 +95,7 @@ _put_scsi_debug_dev
 echo "==================="
 echo "hard 4k physical / 4k logical"
 SCSI_DEBUG_DEV=`_get_scsi_debug_dev 4096 4096 0 128`
+test -b "$SCSI_DEBUG_DEV" || _notrun "Could not get scsi_debug device"
 # block size smaller than sector size should fail 
 _check_mkfs -b size=2048 $SCSI_DEBUG_DEV
 # sector size smaller than physical sector size should fail




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux