diff mbox

xfstests/btrfs: do not test btrfs/010 with autodefrag

Message ID 1379481475-10842-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Liu Bo Sept. 18, 2013, 5:17 a.m. UTC
btrfs/010 is going to create a fragmented file, however, with autodefrag
this is impossible, so just skip the test when we're with autodefrag.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 tests/btrfs/010 |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Comments

Josef Bacik Sept. 27, 2013, 1:45 p.m. UTC | #1
On Wed, Sep 18, 2013 at 01:17:55PM +0800, Liu Bo wrote:
> btrfs/010 is going to create a fragmented file, however, with autodefrag
> this is impossible, so just skip the test when we're with autodefrag.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

I'd rather you just strip out the autodefrag option if it is there and add it
back once the test is done (or hell just remove it, mount, and add it back).
Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba Oct. 1, 2013, 2:40 p.m. UTC | #2
On Fri, Sep 27, 2013 at 09:45:44AM -0400, Josef Bacik wrote:
> On Wed, Sep 18, 2013 at 01:17:55PM +0800, Liu Bo wrote:
> > btrfs/010 is going to create a fragmented file, however, with autodefrag
> > this is impossible, so just skip the test when we're with autodefrag.
> > 
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> 
> I'd rather you just strip out the autodefrag option if it is there and add it
> back once the test is done (or hell just remove it, mount, and add it back).

I think the test should be skipped if it does not make sense with a
specific mount option rather than temporarily removing it, because then
it looks like the test passes with the option altough it does not.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/btrfs/010 b/tests/btrfs/010
index 371f1b8..608942d 100755
--- a/tests/btrfs/010
+++ b/tests/btrfs/010
@@ -37,6 +37,14 @@  _cleanup()
     rm -f $tmp.*
 }
 
+is_autodefrag_set()
+{
+	case "$MOUNT_OPTIONS" in
+		*autodefrag*) return 0;;
+	esac
+	return 1
+}
+
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -49,6 +57,10 @@  _supported_os Linux
 _require_scratch
 _require_command "/usr/sbin/filefrag"
 
+if is_autodefrag_set; then
+	_notrun "this test makes no sense with autodefrag"
+fi
+
 rm -f $seqres.full
 
 _scratch_mkfs > /dev/null 2>&1