From patchwork Tue Feb 11 10:06:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3626021 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3CCC9BF418 for ; Tue, 11 Feb 2014 10:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73BF0201FE for ; Tue, 11 Feb 2014 10:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6732B20160 for ; Tue, 11 Feb 2014 10:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbaBKKIo (ORCPT ); Tue, 11 Feb 2014 05:08:44 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:35597 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751492AbaBKKIl (ORCPT ); Tue, 11 Feb 2014 05:08:41 -0500 X-IronPort-AV: E=Sophos;i="4.95,824,1384272000"; d="scan'208";a="9506442" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 11 Feb 2014 18:04:33 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s1BA8K1w000723; Tue, 11 Feb 2014 18:08:21 +0800 Received: from wangs.fnst.cn.fujitsu.com ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014021118062474-1734895 ; Tue, 11 Feb 2014 18:06:24 +0800 From: Wang Shilong 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 Message-Id: <1392113204-29237-1-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/02/11 18:06:24, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/02/11 18:06:25, Serialize complete at 2014/02/11 18:06:25 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Josef Bacik --- 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 '#'