]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/006: Fix false alert due to output change
authorSu Yue <suy.fnst@cn.fujitsu.com>
Tue, 3 Jan 2017 03:16:17 +0000 (22:16 -0500)
committerEryu Guan <eguan@redhat.com>
Tue, 3 Jan 2017 03:41:36 +0000 (11:41 +0800)
Btrfs-progs v4.9 changed "device status" output by adding one more
space, which differs from golden output.

Fix it by using filter '_filter_spaces' to convert multi space into
one.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/filter
tests/btrfs/006
tests/btrfs/006.out

index 397b456f6449a0bba87300a1ef7794cfba74e9d2..98eff57333579e5b2a41308578832c9057ab6cff 100644 (file)
@@ -299,7 +299,7 @@ _filter_scratch_pool()
 
 _filter_spaces()
 {
-       sed -e 's/ [ ]*/ /g'
+       sed -e "s/\s\+/ /g"
 }
 
 _filter_quota()
index 0863394011534097baa7fac79308302b23488725..d84dfcbd23faad69a15a47e8e6d3a208b93a9ae6 100755 (executable)
@@ -82,13 +82,21 @@ echo "== Sync filesystem"
 $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT > /dev/null
 
 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
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | \
+    _filter_btrfs_device_stats | \
+    _filter_spaces
 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
index 05b9ac0207372bb31399d2ee5be8edf4b2638eab..a976972101c8aad6ec0524cc1dc8cbe3d3e11572 100644 (file)
@@ -16,25 +16,25 @@ Label: 'TestLabel.006'  uuid: <EXACTUUID>
 == Sync filesystem
 == Show device stats by mountpoint
 <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
-<NUMDEVS> [SCRATCH_DEV].flush_io_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].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>
+[SCRATCH_DEV].flush_io_errs <NUM>
 [SCRATCH_DEV].generation_errs <NUM>
-[SCRATCH_DEV].read_io_errs    <NUM>
-[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs <NUM>
+[SCRATCH_DEV].write_io_errs <NUM>
 == 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