From 0d3bbd18942bfac464d18f88c0a3c100c67a24f2 Mon Sep 17 00:00:00 2001 From: Stefan Behrens Date: Fri, 23 Aug 2013 13:07:13 +0000 Subject: [PATCH] xfstests: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL 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 Signed-off-by: Rich Johnston --- 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 e9a2bc24..29512cd3 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 ab33b7e8..22bcb777 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 -- 2.39.5