diff mbox

xfstest: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

Message ID 1377263233-8903-4-git-send-email-sbehrens@giantdisaster.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Stefan Behrens Aug. 23, 2013, 1:07 p.m. UTC
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 <sbehrens@giantdisaster.de>
---
 common/filter.btrfs |  4 ++--
 tests/btrfs/006.out | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

Comments

Josef Bacik Aug. 23, 2013, 6:33 p.m. UTC | #1
On Fri, Aug 23, 2013 at 03:07:13PM +0200, Stefan Behrens wrote:
> 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".
> 

Got 11 devices together and this works

Reviewed-by: Josef Bacik <jbacik@fusionio.com>

Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rich Johnston Aug. 28, 2013, 3:30 p.m. UTC | #2
Thanks for the patch Stefan, it has been committed.

--Rich

commit 0d3bbd18942bfac464d18f88c0a3c100c67a24f2
Author: Stefan Behrens <sbehrens@giantdisaster.de>
Date:   Fri Aug 23 13:07:13 2013 +0000

     xfstests: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 <DEVID>/g"
+	sed -e "s/\(devid\)\s\+[0-9]\+/\1 <DEVID>/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]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
-	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+	sed -e "s/ *$NUMDEVS /<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: <UUID>
 	Total devices <EXACTNUM> FS bytes used <SIZE>
-	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
 
 == Show filesystem by UUID
 Label: 'TestLabel.006'  uuid: <EXACTUUID>
 	Total devices <EXACTNUM> FS bytes used <SIZE>
-	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
 
 == Sync filesystem
 FSSync 'SCRATCH_MNT'
 == Show device stats by mountpoint
-      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
-      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
-      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
-      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
-      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+<NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+<NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+<NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+<NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+<NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
 == Show device stats by first/scratch dev
 [SCRATCH_DEV].corruption_errs <NUM>
 [SCRATCH_DEV].flush_io_errs   <NUM>