In btrfs-progs v6.11 the output of the "filesystem show" command changed
so that it no longers prints blank lines. This happened with commit
4331bfb011bd ("btrfs-progs: fi show: remove stray newline in filesystem
show").
We have some tests that expect the blank lines in their golden output,
and therefore they fail with btrfs-progs v6.11.
So update the filter _filter_btrfs_filesystem_show to remove blank lines
and change the golden output of the tests to not expect the blank lines,
making the tests work with btrfs-progs v6.11 and older versions.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
UUID=$2
fi
- # the uniq collapses all device lines into 1
+ # Before btrfs-progs v6.11 we had some blank lines in the output, so
+ # delete them.
+ # The uniq collapses all device lines into 1.
+ sed -e "/^\s*$/d" | \
_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
_filter_size | _filter_btrfs_version | _filter_devid | \
_filter_zero_size | \
Label: 'TestLabel.006' uuid: <UUID>
Total devices <EXACTNUM> FS bytes used <SIZE>
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
-
== Sync filesystem
== Show device stats by mountpoint
<NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
devid <DEVID> size <SIZE> used <SIZE> path /dev/mapper/error-test
-
Label: none uuid: <UUID>
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-
=== device replace completed
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
devid <DEVID> size <SIZE> used <SIZE> path /dev/mapper/error-test
-
Label: none uuid: <UUID>
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-
=== device delete completed
Label: none uuid: <UUID>
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-
[SCRATCH_DEV].write_io_errs 0
[SCRATCH_DEV].read_io_errs 0
[SCRATCH_DEV].flush_io_errs 0
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
*** Some devices missing
-