diff mbox series

[6/7] generic/108: skip test if we can't initialize scsi_debug

Message ID 157915147326.2374854.964133120890777930.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes | expand

Commit Message

Darrick J. Wong Jan. 16, 2020, 5:11 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Correct the logic in this test that detects failed scsi_debug
initializations.  Downgrade the reaction to _notrun since the filesystem
under test did not fail, just our mockup disk.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/generic/108 |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Christoph Hellwig Jan. 16, 2020, 9:25 a.m. UTC | #1
On Wed, Jan 15, 2020 at 09:11:13PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Correct the logic in this test that detects failed scsi_debug
> initializations.  Downgrade the reaction to _notrun since the filesystem
> under test did not fail, just our mockup disk.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/tests/generic/108 b/tests/generic/108
index 9b4fe60f..ab6101f2 100755
--- a/tests/generic/108
+++ b/tests/generic/108
@@ -49,9 +49,7 @@  rm -f $seqres.full
 
 # _get_scsi_debug_dev returns a scsi debug device with 128M in size by default
 SCSI_DEBUG_DEV=`_get_scsi_debug_dev 512 512 0 300`
-if [ "$SCSI_DEBUG_DEV" == "/dev/" ]; then
-	_fail "Failed to initialize scsi debug device"
-fi
+test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
 echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
 
 # create striped volume with 4MB stripe size