From patchwork Fri Aug 23 13:07:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Behrens X-Patchwork-Id: 2848808 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 AD73DBF546 for ; Fri, 23 Aug 2013 13:07:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE692203C4 for ; Fri, 23 Aug 2013 13:07:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5599203E6 for ; Fri, 23 Aug 2013 13:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755529Ab3HWNHX (ORCPT ); Fri, 23 Aug 2013 09:07:23 -0400 Received: from xp-ob.rzone.de ([81.169.146.137]:20034 "EHLO xp-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755105Ab3HWNHO (ORCPT ); Fri, 23 Aug 2013 09:07:14 -0400 X-RZG-CLASS-ID: xp Received: from pizpot.store ([192.168.43.236]) by josoe.store (RZmta 31.45 OK) with ESMTP id g055a0p7N9DRbT ; Fri, 23 Aug 2013 15:07:13 +0200 (CEST) From: Stefan Behrens To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] xfstest: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL Date: Fri, 23 Aug 2013 15:07:13 +0200 Message-Id: <1377263233-8903-4-git-send-email-sbehrens@giantdisaster.de> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1377263233-8903-1-git-send-email-sbehrens@giantdisaster.de> References: <1377263233-8903-1-git-send-email-sbehrens@giantdisaster.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 One problem was the output of "uniq -c" which added spaces depending on the size of the count value (e.g. one space less for 10+ devices). The second problem was that "btrfs fi show" was doing the same: "devid %4llu size %s used %s path %s". Signed-off-by: Stefan Behrens Reviewed-by: Josef Bacik --- common/filter.btrfs | 4 ++-- tests/btrfs/006.out | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/filter.btrfs b/common/filter.btrfs index e9a2bc2..29512cd 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -10,7 +10,7 @@ _filter_btrfs_version() _filter_devid() { - sed -e "s/\(devid\s\+\)[0-9]\+/\1 /g" + sed -e "s/\(devid\)\s\+[0-9]\+/\1 /g" } # If passed a number as first arg, filter that number of devices @@ -53,7 +53,7 @@ _filter_btrfs_device_stats() _filter_scratch | _filter_scratch_pool | \ sed -e "s/[0-9]\+$//g" | sort | uniq $UNIQ_OPT | \ - sed -e "s/$NUMDEVS / /g" + sed -e "s/ *$NUMDEVS / /g" } # make sure this script returns success diff --git a/tests/btrfs/006.out b/tests/btrfs/006.out index ab33b7e..22bcb77 100644 --- a/tests/btrfs/006.out +++ b/tests/btrfs/006.out @@ -6,21 +6,21 @@ TestLabel.006 == Show filesystem by label Label: 'TestLabel.006' uuid: Total devices FS bytes used - devid size used path SCRATCH_DEV + devid size used path SCRATCH_DEV == Show filesystem by UUID Label: 'TestLabel.006' uuid: Total devices FS bytes used - devid size used path SCRATCH_DEV + devid size used path SCRATCH_DEV == Sync filesystem FSSync 'SCRATCH_MNT' == Show device stats by mountpoint - [SCRATCH_DEV].corruption_errs - [SCRATCH_DEV].flush_io_errs - [SCRATCH_DEV].generation_errs - [SCRATCH_DEV].read_io_errs - [SCRATCH_DEV].write_io_errs + [SCRATCH_DEV].corruption_errs + [SCRATCH_DEV].flush_io_errs + [SCRATCH_DEV].generation_errs + [SCRATCH_DEV].read_io_errs + [SCRATCH_DEV].write_io_errs == Show device stats by first/scratch dev [SCRATCH_DEV].corruption_errs [SCRATCH_DEV].flush_io_errs