* [PATCH v2] xfstests: btrfs/004: fix to make test really work
@ 2014-02-11 10:06 Wang Shilong
2014-02-11 13:25 ` Josef Bacik
0 siblings, 1 reply; 2+ messages in thread
From: Wang Shilong @ 2014-02-11 10:06 UTC (permalink / raw)
To: xfs; +Cc: linux-btrfs
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] xfstests: btrfs/004: fix to make test really work
2014-02-11 10:06 [PATCH v2] xfstests: btrfs/004: fix to make test really work Wang Shilong
@ 2014-02-11 13:25 ` Josef Bacik
0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2014-02-11 13:25 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
On 02/11/2014 05:06 AM, Wang Shilong wrote:
> 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>
> ---
This works for me, you can add
Reviewed-by: Josef Bacik <jbacik@fb.com>
Thanks,
Josef
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-11 13:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 10:06 [PATCH v2] xfstests: btrfs/004: fix to make test really work Wang Shilong
2014-02-11 13:25 ` Josef Bacik
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).