From patchwork Fri Aug 16 17:02:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Behrens X-Patchwork-Id: 2845721 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC8F59F239 for ; Fri, 16 Aug 2013 17:02:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C59DF202BA for ; Fri, 16 Aug 2013 17:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D6E820295 for ; Fri, 16 Aug 2013 17:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752971Ab3HPRCt (ORCPT ); Fri, 16 Aug 2013 13:02:49 -0400 Received: from xp-ob.rzone.de ([81.169.146.136]:44937 "EHLO xp-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125Ab3HPRCt (ORCPT ); Fri, 16 Aug 2013 13:02:49 -0400 X-RZG-CLASS-ID: xp Received: from pizpot.store ([192.168.43.236]) by jored.store (RZmta 31.40 OK) with ESMTP id 600c92p7FELHPS ; Fri, 16 Aug 2013 19:02:46 +0200 (CEST) From: Stefan Behrens To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] xfstests: update filters and output of btrfs/006 Date: Fri, 16 Aug 2013 19:02:46 +0200 Message-Id: <1376672566-5446-1-git-send-email-sbehrens@giantdisaster.de> X-Mailer: git-send-email 1.8.3.4 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.6 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 The btrfs-progs tools changed the output: - 100GiB instead of 100GB - The number of spaces was changed Signed-off-by: Stefan Behrens Reviewed-by: Eric Sandeen --- common/filter | 2 +- common/filter.btrfs | 3 ++- tests/btrfs/006 | 6 +++--- tests/btrfs/006.out | 36 ++++++++++++++++++------------------ 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/common/filter b/common/filter index dbb1674..ee738ca 100644 --- a/common/filter +++ b/common/filter @@ -262,7 +262,7 @@ _filter_uuid() # Filter out sizes like 6.14MB etc _filter_size() { - sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?//ig" + sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][i]\?[b]\?//ig" } # Convert string read from stdin like 128K to bytes and print it to stdout diff --git a/common/filter.btrfs b/common/filter.btrfs index e9a2bc2..1584596 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -33,6 +33,7 @@ _filter_btrfs_filesystem_show() # the uniq collapses all device lines into 1 _filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \ _filter_size | _filter_btrfs_version | _filter_devid | \ + _filter_spaces | \ sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \ uniq } @@ -51,7 +52,7 @@ _filter_btrfs_device_stats() UNIQ_OPT="" fi - _filter_scratch | _filter_scratch_pool | \ + _filter_scratch | _filter_scratch_pool | _filter_spaces | \ sed -e "s/[0-9]\+$//g" | sort | uniq $UNIQ_OPT | \ sed -e "s/$NUMDEVS / /g" } diff --git a/tests/btrfs/006 b/tests/btrfs/006 index 9f7beff..f323cc4 100755 --- a/tests/btrfs/006 +++ b/tests/btrfs/006 @@ -82,13 +82,13 @@ echo "== Sync filesystem" $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch echo "== Show device stats by mountpoint" -$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS | _filter_spaces echo "== Show device stats by first/scratch dev" $BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats echo "== Show device stats by second dev" -$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g" +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g" | _filter_spaces echo "== Show device stats by last dev" -$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g" +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g" | _filter_spaces # success, all done status=0 diff --git a/tests/btrfs/006.out b/tests/btrfs/006.out index ab33b7e..413a5a8 100644 --- a/tests/btrfs/006.out +++ b/tests/btrfs/006.out @@ -4,38 +4,38 @@ TestLabel.006 == Mount. == Show filesystem by label -Label: 'TestLabel.006' uuid: +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: +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 +[SCRATCH_DEV].flush_io_errs [SCRATCH_DEV].generation_errs -[SCRATCH_DEV].read_io_errs -[SCRATCH_DEV].write_io_errs +[SCRATCH_DEV].read_io_errs +[SCRATCH_DEV].write_io_errs == Show device stats by second dev -[FIRST_POOL_DEV].write_io_errs 0 -[FIRST_POOL_DEV].read_io_errs 0 -[FIRST_POOL_DEV].flush_io_errs 0 +[FIRST_POOL_DEV].write_io_errs 0 +[FIRST_POOL_DEV].read_io_errs 0 +[FIRST_POOL_DEV].flush_io_errs 0 [FIRST_POOL_DEV].corruption_errs 0 [FIRST_POOL_DEV].generation_errs 0 == Show device stats by last dev -[LAST_POOL_DEV].write_io_errs 0 -[LAST_POOL_DEV].read_io_errs 0 -[LAST_POOL_DEV].flush_io_errs 0 +[LAST_POOL_DEV].write_io_errs 0 +[LAST_POOL_DEV].read_io_errs 0 +[LAST_POOL_DEV].flush_io_errs 0 [LAST_POOL_DEV].corruption_errs 0 [LAST_POOL_DEV].generation_errs 0