diff mbox

[12/16] xfstests: remove dependency on /proc/partitions for generic/312

Message ID 1455385269-26319-13-git-send-email-tytso@mit.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Theodore Ts'o Feb. 13, 2016, 5:41 p.m. UTC
From: Hugh Dickins <hughd@google.com>

This allows this test to work with tmpfs, if the system has at least
5G of free memory.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/generic/312 | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig Feb. 17, 2016, 10:06 a.m. UTC | #1
> +# We don't need to do this check for tmpfs because _scratch_mkfs_size
> +# will validate the size against the available memory
> +if [ "$FSTYP" != "tmpfs" ]; then
> +   _scratch_mkfs
> +   _scratch_mount
> +   _require_fs_space $SCRATCH_MNT $(($fssize / 1024))
> +   _scratch_unmount
> +fi
>  rm -f $seqres.full
>  _scratch_mkfs_sized $fssize >>$seqres.full 2>&1

_scratch_mkfs_size also validates the available space for other
block based file systems, so I think we should just remove this
code entirely (assuming I didn't miss something important)
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan Feb. 17, 2016, 10:36 a.m. UTC | #2
On Wed, Feb 17, 2016 at 02:06:03AM -0800, Christoph Hellwig wrote:
> > +# We don't need to do this check for tmpfs because _scratch_mkfs_size
> > +# will validate the size against the available memory
> > +if [ "$FSTYP" != "tmpfs" ]; then
> > +   _scratch_mkfs
> > +   _scratch_mount
> > +   _require_fs_space $SCRATCH_MNT $(($fssize / 1024))
> > +   _scratch_unmount
> > +fi
> >  rm -f $seqres.full
> >  _scratch_mkfs_sized $fssize >>$seqres.full 2>&1
> 
> _scratch_mkfs_size also validates the available space for other
> block based file systems, so I think we should just remove this
> code entirely (assuming I didn't miss something important)

I agreed, not sure why I wrote this check in the first place..

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/generic/312 b/tests/generic/312
index b570814..639eb57 100755
--- a/tests/generic/312
+++ b/tests/generic/312
@@ -51,12 +51,15 @@  _require_scratch
 
 # 5G in byte
 fssize=$((2**30 * 5))
-required_blocks=$(($fssize / 1024))
-dev_blocks=$(grep -w $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}')
-if [ $required_blocks -gt $dev_blocks ];then
-	_notrun "this test requires \$SCRATCH_DEV has ${fssize}B space"
-fi
 
+# We don't need to do this check for tmpfs because _scratch_mkfs_size
+# will validate the size against the available memory
+if [ "$FSTYP" != "tmpfs" ]; then
+   _scratch_mkfs
+   _scratch_mount
+   _require_fs_space $SCRATCH_MNT $(($fssize / 1024))
+   _scratch_unmount
+fi
 rm -f $seqres.full
 _scratch_mkfs_sized $fssize >>$seqres.full 2>&1
 _scratch_mount >>$seqres.full 2>&1