]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs: update some tests to be able to run with btrfs-progs v6.11
authorFilipe Manana <fdmanana@suse.com>
Mon, 7 Oct 2024 11:32:50 +0000 (12:32 +0100)
committerZorro Lang <zlang@kernel.org>
Sat, 12 Oct 2024 14:06:30 +0000 (22:06 +0800)
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>
common/filter.btrfs
tests/btrfs/006.out
tests/btrfs/100.out
tests/btrfs/101.out
tests/btrfs/218.out
tests/btrfs/254.out

index 5a944aeb0c2b5ce096c65602c67977007ad7b321..bc9146428f42169a18a361f672544b677cb8806a 100644 (file)
@@ -30,7 +30,10 @@ _filter_btrfs_filesystem_show()
                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 | \
index b7f29f9683ceb688bb2002dd7969d0c273471902..97d44f13881e68c659b4ec084f73f3819c6bff30 100644 (file)
@@ -7,12 +7,10 @@ TestLabel.006
 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>
index aa4929197f8d139a03034cd52d89eba5c84b90f1..1fe3c0de3c69643aaab2ba0f3539f945391aba00 100644 (file)
@@ -3,9 +3,7 @@ Label: none  uuid: <UUID>
        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
index e1b88c2dbe7dd4550695994632012ca031b5e0c5..c2359c7cb5efcfd23c435f5b64e814e144c2a5b8 100644 (file)
@@ -3,9 +3,7 @@ Label: none  uuid: <UUID>
        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
index 7ccf13e996a5345fa8f4a7be326d65ad5fcc6af7..be11074c4588a67d6795c1de9bbe1e3c65c7f15c 100644 (file)
@@ -2,7 +2,6 @@ QA output created by 218
 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
index 20819cf5140ca3c45f92c0c92881cff23045b349..86089ee33501de85232112ce8f3bf41df250d35c 100644 (file)
@@ -3,4 +3,3 @@ Label: none  uuid: <UUID>
        Total devices <NUM> FS bytes used <SIZE>
        devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
        *** Some devices missing
-