All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device
Date: Wed, 15 Jan 2020 21:11:00 -0800	[thread overview]
Message-ID: <157915146054.2374854.14308605711454193767.stgit@magnolia> (raw)
In-Reply-To: <157915143549.2374854.7759901526137960493.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

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@oracle.com>
---
 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


  parent reply	other threads:[~2020-01-16  5:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
2020-01-16  5:10 ` [PATCH 1/7] xfs/449: filter out "Discarding..." from output Darrick J. Wong
2020-01-16  9:23   ` Christoph Hellwig
2020-01-16  5:10 ` [PATCH 2/7] xfs/122: add disk dquot structure to the list Darrick J. Wong
2020-01-16  9:23   ` Christoph Hellwig
2020-01-16  5:10 ` [PATCH 3/7] xfs/507: skip if we can't create a large sparse file for testing Darrick J. Wong
2020-01-16  9:24   ` Christoph Hellwig
2020-01-16  5:11 ` Darrick J. Wong [this message]
2020-01-16  9:24   ` [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device Christoph Hellwig
2020-01-16  5:11 ` [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms Darrick J. Wong
2020-01-16  9:25   ` Christoph Hellwig
2020-01-16  5:11 ` [PATCH 6/7] generic/108: skip test if we can't initialize scsi_debug Darrick J. Wong
2020-01-16  9:25   ` Christoph Hellwig
2020-01-16  5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
2020-01-16  9:25   ` Christoph Hellwig
2020-02-02 19:54   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157915146054.2374854.14308605711454193767.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.