From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: xfs@oss.sgi.com
Cc: linux-btrfs@vger.kernel.org
Subject: [PATCH v2] xfstests: btrfs/004: fix to make test really work
Date: Tue, 11 Feb 2014 18:06:44 +0800 [thread overview]
Message-ID: <1392113204-29237-1-git-send-email-wangsl.fnst@cn.fujitsu.com> (raw)
So i was wondering why test 004 could pass my previous wrong
kernel patch while it defenitely should not.
By some debugging, i found here perl script is wrong, we did not
filter out anything and this unit test did not work acutally.so
it came out we will never fail this test.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
Changelog v1->v2:
format perl script to make it more readable(thanks to Dave Chinner)
---
tests/btrfs/004 | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/tests/btrfs/004 b/tests/btrfs/004
index 14da9f1..1d608db 100755
--- a/tests/btrfs/004
+++ b/tests/btrfs/004
@@ -57,11 +57,17 @@ _require_command "/usr/sbin/filefrag"
rm -f $seqres.full
-FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
-'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
-'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
-'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
-'$length * $blocksize, "#", $logical * $blocksize, " "'
+FILEFRAG_FILTER='
+ if (/blocks of (\d+) bytes/) {
+ $blocksize = $1;
+ next
+ }
+ ($ext, $logical, $physical, $length) =
+ (/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+ or next;
+ print $physical * $blocksize, "#",
+ $length * $blocksize, "#",
+ $logical * $blocksize, " "'
# this makes filefrag output script readable by using a perl helper.
# output is one extent per line, with three numbers separated by '#'
--
1.8.3.1
next reply other threads:[~2014-02-11 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 10:06 Wang Shilong [this message]
2014-02-11 13:25 ` [PATCH v2] xfstests: btrfs/004: fix to make test really work Josef Bacik
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=1392113204-29237-1-git-send-email-wangsl.fnst@cn.fujitsu.com \
--to=wangsl.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/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;
as well as URLs for NNTP newsgroup(s).