FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: fstests@vger.kernel.org
Subject: [PATCH 2/4] xfs: don't output mkfs sector sizes into golden output
Date: Tue, 24 Feb 2015 18:20:33 +1100	[thread overview]
Message-ID: <1424762435-3237-3-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1424762435-3237-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

The mkfs sector sizes are dependent on the underlying device in use,
and so is not fixed. hence it needs to be filtered from any golden
output file, otherwise tests that just differ by sector size will
fail.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 tests/xfs/096 |  5 +++--
 tests/xfs/206 | 33 +++++++++++++++------------------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/tests/xfs/096 b/tests/xfs/096
index 0ecf88f..d216aa2 100755
--- a/tests/xfs/096
+++ b/tests/xfs/096
@@ -63,7 +63,7 @@ _cleanup()
 #           =                       sunit=0 blks
 #  realtime =none                   extsz=65536  blocks=N, rtextents=N
 #
-_mkfs_filter()
+mkfs_filter()
 {
    tee -a $seqres.full | \
    sed \
@@ -80,6 +80,7 @@ _mkfs_filter()
 	-e '/ *= *mmr=[0-9][0-9]* *$/d' \
 	-e 's/ *mixed-case=[YN]//' \
 	-e 's/ *ascii-ci=[01]//' \
+	-e "s/\(sunit=\)\([0-9]* blks,\)/\11 blks,/" \
 	-e 's/sectsz=[0-9][0-9]* *//' \
 	-e 's/, lazy-count.*//' \
 	-e '/inode-paths/d' \
@@ -145,7 +146,7 @@ do
     fi
     echo "--- mkfs=$mkfs ---"
     export MKFS_OPTIONS="$mkfs"
-    _scratch_mkfs_xfs 2>&1 | _mkfs_filter
+    _scratch_mkfs_xfs 2>&1 | mkfs_filter
     echo ""
     echo ""
 done
diff --git a/tests/xfs/206 b/tests/xfs/206
index f6dcca6..198e413 100755
--- a/tests/xfs/206
+++ b/tests/xfs/206
@@ -73,34 +73,31 @@ echo "=== truncate file ==="
 dd if=/dev/zero of=$tmpfile bs=1 seek=19998630180864 count=1 >/dev/null 2>&1 \
 	|| _fail "!!! failed to truncate loopback file to correct size"
 
+mkfs_filter()
+{
+	sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
+	    -e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
+	    -e "s/, projid32bit=[0-9]//" \
+	    -e "s/ ftype=[0-9]//" \
+	    -e "s/\(sectsz\)\(=[0-9]* *\)/\1=512   /" \
+	    -e "s/\(sunit=\)\([0-9]* blks,\)/\10 blks,/" \
+	    -e "/.*crc=/d"
+}
+
 # mkfs slightly smaller than that
 echo "=== mkfs.xfs ==="
-mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b -llazy-count=0 $tmpfile \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
-		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
-		-e "s/, projid32bit=[0-9]//" \
-		-e "s/ ftype=[0-9]//" \
-		-e "/.*crc=/d"
+mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b \
+	 -llazy-count=0 $tmpfile  | mkfs_filter
 
 mount -o loop $tmpfile $tmpdir || _fail "!!! failed to loopback mount"
 
 # see what happens when we growfs it
 echo "=== xfs_growfs ==="
-xfs_growfs $tmpdir \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
-		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
-		-e "s/, projid32bit=[0-9]//" \
-		-e "s/ ftype=[0-9]//" \
-		-e "/.*crc=/d"
+xfs_growfs $tmpdir  | mkfs_filter
 
 # and double-check the new geometry
 echo "=== xfs_info ==="
-xfs_info $tmpdir \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
-		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/" \
-		-e "s/, projid32bit=[0-9]//" \
-		-e "s/ ftype=[0-9]//" \
-		-e "/.*crc=/d"
+xfs_info $tmpdir | mkfs_filter
 
 # _cleanup cleans up for us
 
-- 
2.0.0


  parent reply	other threads:[~2015-02-24  7:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  7:20 [PATCH 0/4] fstests: sector size fixes and whiteouts Dave Chinner
2015-02-24  7:20 ` [PATCH 1/4] xfs/104: log size too small for 4k sector drives Dave Chinner
2015-02-24  7:20 ` Dave Chinner [this message]
2015-02-24  7:20 ` [PATCH 3/4] xfs/049: umount -d fails when kernel wins teardown race Dave Chinner
2015-02-24  7:20 ` [PATCH 4/4] generic: Add rudimetary RENAME_WHITEOUT test Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2015-02-24 22:54 [PATCH v2 0/4] fstests: sector size fixes and whiteouts Dave Chinner
2015-02-24 22:54 ` [PATCH 2/4] xfs: don't output mkfs sector sizes into golden output Dave Chinner
2015-02-27 18:56   ` Brian Foster

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=1424762435-3237-3-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=fstests@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox