fstests: btrfs: redirect stdout of "btrfs subvolume snapshot" to fix output change
PATCH v2 1/1 fstests: btrfs: redirect stdout of "btrfs subvolume snapshot" to fix output change
[BUG]
All the touched test cases would fail after btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.
[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".
Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.
This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
---
This is just a quick fix for the test failures, if accepted, further cleanup would be done for unnecessary golden output for "btrfs subvolume" subgroup.
v2:
- Revert the change of btrfs/208.out
That was part of the later cleanup, wrongly included in the fix.
--- tests/btrfs/001 | 2 +- tests/btrfs/001.out | 1 - tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 2 -- tests/btrfs/168 | 4 ++-- tests/btrfs/168.out | 2 -- tests/btrfs/169 | 6 +++--- tests/btrfs/169.out | 2 -- tests/btrfs/170 | 3 +-- tests/btrfs/170.out | 1 - tests/btrfs/187 | 5 +++-- tests/btrfs/187.out | 3 +-- tests/btrfs/188 | 6 +++--- tests/btrfs/188.out | 2 -- tests/btrfs/189 | 9 +++++---- tests/btrfs/189.out | 2 -- tests/btrfs/191 | 4 ++-- tests/btrfs/191.out | 2 -- tests/btrfs/200 | 8 ++++---- tests/btrfs/200.out | 2 -- tests/btrfs/202 | 2 +- tests/btrfs/202.out | 1 - tests/btrfs/203 | 8 ++++---- tests/btrfs/203.out | 2 -- tests/btrfs/226 | 2 +- tests/btrfs/226.out | 1 - tests/btrfs/276 | 2 +- tests/btrfs/276.out | 1 - tests/btrfs/280 | 3 ++- tests/btrfs/280.out | 1 - tests/btrfs/281 | 2 +- tests/btrfs/281.out | 1 - tests/btrfs/283 | 2 +- tests/btrfs/283.out | 1 - tests/btrfs/287 | 4 ++-- tests/btrfs/287.out | 2 -- tests/btrfs/293 | 6 ++++-- tests/btrfs/293.out | 2 -- tests/btrfs/300 | 2 +- tests/btrfs/300.out | 1 - tests/btrfs/302 | 2 +- tests/btrfs/302.out | 1 - tests/btrfs/314 | 2 +- tests/btrfs/314.out | 2 -- 44 files changed, 48 insertions(+), 77 deletions(-)
tests/btrfs/001 +1 -1
@@ -26,7 +26,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &> /dev/null echo "List root dir" ls $SCRATCH_MNT echo "Creating snapshot of root dir" -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"
tests/btrfs/001.out +0 -1
@@ -3,7 +3,6 @@ Creating file foo in root dir List root dir foo Creating snapshot of root dir -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot foo snap
tests/btrfs/152 +3 -3
@@ -32,12 +32,12 @@ touch $SCRATCH_MNT/subvol{1,2}/foo # Create base snapshots and send them $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol1 \ - $SCRATCH_MNT/subvol1/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol1/.snapshots/1 >> $seqres.full $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 >> $seqres.full for recv in recv1_1 recv1_2 recv2_1 recv2_2; do $BTRFS_UTIL_PROG send $SCRATCH_MNT/subvol1/.snapshots/1 2> /dev/null | \ - $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} | _filter_scratch + $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} >> $seqres.full done # Now do 10 loops of concurrent incremental send/receives
tests/btrfs/152.out +0 -2
@@ -5,8 +5,6 @@ Create subvolume 'SCRATCH_MNT/recv1_1' Create subvolume 'SCRATCH_MNT/recv1_2' Create subvolume 'SCRATCH_MNT/recv2_1' Create subvolume 'SCRATCH_MNT/recv2_2' -Create a readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1' -Create a readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1' At subvol 1 At subvol 1 At subvol 1
tests/btrfs/168 +2 -2
@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro false # Create a snapshot of the subvolume, to be used later as the parent snapshot # for an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full # First do a full send of this snapshot. $FSSUM_PROG -A -f -w $send_files_dir/snap1.fssum $SCRATCH_MNT/snap1
@@ -88,7 +88,7 @@ $XFS_IO_PROG -c "pwrite -S 0x19 4K 8K" $SCRATCH_MNT/sv1/baz >>$seqres.full # Create a second snapshot of the subvolume, to be used later as the send # snapshot of an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.
tests/btrfs/168.out +0 -2
@@ -1,9 +1,7 @@ QA output created by 168 Create subvolume 'SCRATCH_MNT/sv1' At subvol SCRATCH_MNT/sv1 -Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1 -Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 At subvol sv1 OK
tests/btrfs/169 +3 -3
@@ -43,8 +43,8 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \ -c "pwrite -S 0xea 0 1M" \ $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \ | _filter_scratch
@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \ $XFS_IO_PROG -c "fpunch 1M 2M" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 2>&1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/snap1 -f $send_files_dir/2.snap \ $SCRATCH_MNT/snap2 2>&1 | _filter_scratch
tests/btrfs/169.out +0 -2
@@ -1,9 +1,7 @@ QA output created by 169 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 File digest in the original filesystem: d31659e82e87798acd4669a1e0a19d4f SCRATCH_MNT/snap2/foobar
tests/btrfs/170 +1 -2
@@ -45,8 +45,7 @@ echo "File digest after write:" md5sum $SCRATCH_MNT/foobar | _filter_scratch # Create a snapshot of the subvolume where our file is. -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 >> $seqres.full # Cleanly unmount the filesystem. _scratch_unmount
tests/btrfs/170.out +0 -1
@@ -3,6 +3,5 @@ wrote 131072/131072 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) File digest after write: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobar -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File digest after mounting the filesystem again: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobar
tests/btrfs/187 +3 -2
@@ -152,7 +152,7 @@ done wait ${create_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full # Add some more files, so that that are substantial differences between the # two test snapshots used for an incremental send later.
@@ -184,7 +184,7 @@ done wait ${setxattr_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full full_send_loop 5 & full_send_pid=$!
@@ -221,5 +221,6 @@ wait $balance_pid # _dmesg_since_test_start | grep -E -e '\bBTRFS error \(device .*?\):' +echo "Silence is golden" status=0 exit
tests/btrfs/187.out +1 -2
@@ -1,3 +1,2 @@ QA output created by 187 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Silence is golden
tests/btrfs/188 +3 -3
@@ -44,8 +44,8 @@ _scratch_mount $XFS_IO_PROG -f -c "pwrite -S 0xab 0 500K" $SCRATCH_MNT/foobar | _filter_xfs_io $XFS_IO_PROG -c "falloc -k 1200K 800K" $SCRATCH_MNT/foobar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ $XFS_IO_PROG -c "fpunch 0 500K" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratch
tests/btrfs/188.out +0 -2
@@ -1,9 +1,7 @@ QA output created by 188 wrote 512000/512000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr File digest in the original filesystem: 816df6f64deba63b029ca19d880ee10a SCRATCH_MNT/incr/foobar
tests/btrfs/189 +5 -4
@@ -45,8 +45,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0xc7 0 2M" $SCRATCH_MNT/bar | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0x4d 0 2M" $SCRATCH_MNT/baz | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0xe2 0 2M" $SCRATCH_MNT/zoo | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full + $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -70,8 +71,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 1600K 0 128K" $SCRATCH_MNT/zoo \ # operations. $XFS_IO_PROG -c "truncate 710K" $SCRATCH_MNT/bar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratch
tests/btrfs/189.out +0 -2
@@ -7,13 +7,11 @@ wrote 2097152/2097152 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 2097152/2097152 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base linked 131072/131072 bytes at offset 655360 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 131072/131072 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incr
tests/btrfs/191 +2 -2
@@ -44,7 +44,7 @@ $XFS_IO_PROG -c "pwrite -S 0xb8 512K 512K" $SCRATCH_MNT/foo | _filter_xfs_io # Create the base snapshot and the parent send stream from it. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/mysnap1 2>&1 \ | _filter_scratch
@@ -55,7 +55,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xb8 0 1M" $SCRATCH_MNT/bar | _filter_xfs_io # Create the second snapshot, used for the incremental send, before doing the # file deduplication. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2 \ - | _filter_scratch + >> $seqres.full # Now before creating the incremental send stream: #
tests/btrfs/191.out +0 -2
@@ -3,11 +3,9 @@ wrote 524288/524288 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 524288/524288 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1' At subvol SCRATCH_MNT/mysnap1 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2' deduped 524288/524288 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) deduped 524288/524288 bytes at offset 524288
tests/btrfs/200 +4 -4
@@ -51,8 +51,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/foo 0 64K 64K" $SCRATCH_MNT/foo \ $XFS_IO_PROG -f -c "pwrite -S 0xc7 -b 64K 0 64K" $SCRATCH_MNT/bar \ | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -63,8 +63,8 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 64K 64K" $SCRATCH_MNT/bar \ | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratch
tests/btrfs/200.out +0 -2
@@ -5,11 +5,9 @@ linked 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base linked 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incr
tests/btrfs/202 +1 -1
@@ -28,7 +28,7 @@ _scratch_mount $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a | _filter_scratch $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a/b | _filter_scratch $BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT/a $SCRATCH_MNT/c \ - | _filter_scratch + >> $seqres.full # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/b
tests/btrfs/202.out +0 -1
@@ -1,4 +1,3 @@ QA output created by 202 Create subvolume 'SCRATCH_MNT/a' Create subvolume 'SCRATCH_MNT/a/b' -Create a snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'
tests/btrfs/203 +4 -4
@@ -43,8 +43,8 @@ _scratch_mount # file in the parent snapshot. $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 64K" $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -69,8 +69,8 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \ -c "reflink $SCRATCH_MNT/foobar 448K 192K 192K" \ $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratch
tests/btrfs/203.out +0 -2
@@ -1,7 +1,6 @@ QA output created by 203 wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base wrote 65536/65536 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -15,7 +14,6 @@ wrote 65536/65536 bytes at offset 786432 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 196608/196608 bytes at offset 196608 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr File foobar digest in the original filesystem: 2b76b23b62fdbbbcae1ee37eec84fd7d
tests/btrfs/226 +1 -1
@@ -51,7 +51,7 @@ $XFS_IO_PROG -s -c "pwrite -S 0xab 0 64K" \ $SCRATCH_MNT/f2 | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full # Write into the range of the first extent so that that range no longer has a # shared extent.
tests/btrfs/226.out +0 -1
@@ -13,7 +13,6 @@ wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) pwrite: Resource temporarily unavailable
tests/btrfs/276 +1 -1
@@ -105,7 +105,7 @@ sync echo "Number of non-shared extents in the whole file: $(count_not_shared_extents)" # Creating a snapshot. -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full # We have a snapshot, so now all extents should be reported as shared. echo "Number of shared extents in the whole file: $(count_shared_extents)"
tests/btrfs/276.out +0 -1
@@ -1,6 +1,5 @@ QA output created by 276 Number of non-shared extents in the whole file: 2000 -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' Number of shared extents in the whole file: 2000 wrote 65536/65536 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/btrfs/280 +2 -1
@@ -37,7 +37,8 @@ _scratch_mount -o compress $XFS_IO_PROG -f -c "pwrite -b 1M 0 128M" $SCRATCH_MNT/foo | _filter_xfs_io # Create a RW snapshot of the default subvolume. -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \ + >> $seqres.full echo echo "File foo fiemap before COWing extent:"
tests/btrfs/280.out +0 -1
@@ -1,7 +1,6 @@ QA output created by 280 wrote 134217728/134217728 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File foo fiemap before COWing extent:
tests/btrfs/281 +1 -1
@@ -53,7 +53,7 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 0 64K" $SCRATCH_MNT/foo \ echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \ | _filter_scratch
tests/btrfs/281.out +0 -1
@@ -6,7 +6,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap Creating a new filesystem to receive the send stream... At subvol snap
tests/btrfs/283 +1 -1
@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "pwrite -S 0xcd -b 64K 64K 64K" $SCRATCH_MNT/foo | _filter_xfs_i echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 | _filter_scratch
tests/btrfs/283.out +0 -1
@@ -4,7 +4,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap Creating a new filesystem to receive the send stream... At subvol snap
tests/btrfs/287 +2 -2
@@ -112,9 +112,9 @@ query_logical_ino -o $bytenr # Now create two snapshots and then do some queries. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full snap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)
tests/btrfs/287.out +0 -2
@@ -41,8 +41,6 @@ resolve first extent +3M offset with ignore offset option: inode 257 offset 16777216 root 5 inode 257 offset 8388608 root 5 inode 257 offset 2097152 root 5 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' resolve first extent: inode 257 offset 16777216 snap2 inode 257 offset 8388608 snap2
tests/btrfs/293 +4 -2
@@ -32,9 +32,11 @@ swap_file="$SCRATCH_MNT/swapfile" _format_swapfile $swap_file $(($(_get_page_size) * 64)) >> $seqres.full echo "Creating first snapshot..." -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ + >> $seqres.full echo "Creating second snapshot..." -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 \ + >> $seqres.full echo "Activating swap file... (should fail due to snapshots)" _swapon_file $swap_file 2>&1 | _filter_scratch
tests/btrfs/293.out +0 -2
@@ -1,8 +1,6 @@ QA output created by 293 Creating first snapshot... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Creating second snapshot... -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' Activating swap file... (should fail due to snapshots) swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument Deleting first snapshot...
tests/btrfs/300 +1 -1
@@ -43,7 +43,7 @@ $BTRFS_UTIL_PROG subvolume create subvol; touch subvol/{1,2,3}; $BTRFS_UTIL_PROG subvolume create subvol/subsubvol; touch subvol/subsubvol/{4,5,6}; -$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot; +$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot > /dev/null; " find $test_dir/. -printf "%M %u %g ./%P\n"
tests/btrfs/300.out +0 -1
@@ -1,7 +1,6 @@ QA output created by 300 Create subvolume './subvol' Create subvolume 'subvol/subsubvol' -Create a snapshot of 'subvol' in './snapshot' drwxr-xr-x fsgqa fsgqa ./ drwxr-xr-x fsgqa fsgqa ./subvol -rw-r--r-- fsgqa fsgqa ./subvol/1
tests/btrfs/302 +1 -1
@@ -46,7 +46,7 @@ $FSSUM_PROG -A -f -w $fssum_file $SCRATCH_MNT/subvol # Now create a snapshot of the subvolume and make it accessible from within the # subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap >> $seqres.full # Now unmount and mount again the fs. We want to verify we are able to read all # metadata for the snapshot from disk (no IO failures, etc).
tests/btrfs/302.out +0 -1
@@ -1,4 +1,3 @@ QA output created by 302 Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' OK
tests/btrfs/314 +1 -1
@@ -43,7 +43,7 @@ send_receive_tempfsid() $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' ${src}/foo | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r ${src} ${src}/snap1 | \ - _filter_testdir_and_scratch + >> $seqres.full echo Send ${src} | _filter_testdir_and_scratch $BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \
tests/btrfs/314.out +0 -2
@@ -3,7 +3,6 @@ QA output created by 314 From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt wrote 9000/9000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Send SCRATCH_MNT At subvol SCRATCH_MNT/snap1 Receive TEST_DIR/314/tempfsid_mnt
@@ -14,7 +13,6 @@ Recv: 42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/314/tempfsid_mnt/snap1/foo From tempfsid TEST_DIR/314/tempfsid_mnt to non-tempfsid SCRATCH_MNT wrote 9000/9000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'TEST_DIR/314/tempfsid_mnt' in 'TEST_DIR/314/tempfsid_mnt/snap1' Send TEST_DIR/314/tempfsid_mnt At subvol TEST_DIR/314/tempfsid_mnt/snap1 Receive SCRATCH_MNT
Signature · 1 line
2.44.0
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.
Quoted 7 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
While golden output is better verification method in terms of accuracy, but, it falls short in verifying command exit codes. I personally think the run_btrfs_progs approach is better for 'btrfs subvolume snapshot'. It allows us to verify the command status without relying on the stdout.
But, past discussions favored the golden output verification method instead of run_btrfs_progs.
Thanks, Anand
Quoted 749 lines
Signed-off-by Qu Wenruo <[email protected]>---
This is just a quick fix for the test failures, if accepted, further cleanup would be done for unnecessary golden output for "btrfs subvolume" subgroup.v2:
- Revert the change of btrfs/208.out
That was part of the later cleanup, wrongly included in the fix.
---tests/btrfs/001 | 2 +- tests/btrfs/001.out | 1 - tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 2 -- tests/btrfs/168 | 4 ++-- tests/btrfs/168.out | 2 -- tests/btrfs/169 | 6 +++--- tests/btrfs/169.out | 2 -- tests/btrfs/170 | 3 +-- tests/btrfs/170.out | 1 - tests/btrfs/187 | 5 +++-- tests/btrfs/187.out | 3 +-- tests/btrfs/188 | 6 +++--- tests/btrfs/188.out | 2 -- tests/btrfs/189 | 9 +++++---- tests/btrfs/189.out | 2 -- tests/btrfs/191 | 4 ++-- tests/btrfs/191.out | 2 -- tests/btrfs/200 | 8 ++++---- tests/btrfs/200.out | 2 -- tests/btrfs/202 | 2 +- tests/btrfs/202.out | 1 - tests/btrfs/203 | 8 ++++---- tests/btrfs/203.out | 2 -- tests/btrfs/226 | 2 +- tests/btrfs/226.out | 1 - tests/btrfs/276 | 2 +- tests/btrfs/276.out | 1 - tests/btrfs/280 | 3 ++- tests/btrfs/280.out | 1 - tests/btrfs/281 | 2 +- tests/btrfs/281.out | 1 - tests/btrfs/283 | 2 +- tests/btrfs/283.out | 1 - tests/btrfs/287 | 4 ++-- tests/btrfs/287.out | 2 -- tests/btrfs/293 | 6 ++++-- tests/btrfs/293.out | 2 -- tests/btrfs/300 | 2 +- tests/btrfs/300.out | 1 - tests/btrfs/302 | 2 +- tests/btrfs/302.out | 1 - tests/btrfs/314 | 2 +- tests/btrfs/314.out | 2 -- 44 files changed, 48 insertions(+), 77 deletions(-)tests/btrfs/001 +1
-1@@ -26,7 +26,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &> /dev/null echo "List root dir" ls $SCRATCH_MNT echo "Creating snapshot of root dir" -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"tests/btrfs/001.out +0
-1@@ -3,7 +3,6 @@ Creating file foo in root dir List root dir foo Creating snapshot of root dir -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot foo snaptests/btrfs/152 +3
-3@@ -32,12 +32,12 @@ touch $SCRATCH_MNT/subvol{1,2}/foo # Create base snapshots and send them $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol1 \ - $SCRATCH_MNT/subvol1/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol1/.snapshots/1 >> $seqres.full $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 >> $seqres.full for recv in recv1_1 recv1_2 recv2_1 recv2_2; do $BTRFS_UTIL_PROG send $SCRATCH_MNT/subvol1/.snapshots/1 2> /dev/null | \ - $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} | _filter_scratch + $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} >> $seqres.full done # Now do 10 loops of concurrent incremental send/receivestests/btrfs/152.out +0
-2@@ -5,8 +5,6 @@ Create subvolume 'SCRATCH_MNT/recv1_1' Create subvolume 'SCRATCH_MNT/recv1_2' Create subvolume 'SCRATCH_MNT/recv2_1' Create subvolume 'SCRATCH_MNT/recv2_2' -Create a readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1' -Create a readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1' At subvol 1 At subvol 1 At subvol 1tests/btrfs/168 +2
-2@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro false # Create a snapshot of the subvolume, to be used later as the parent snapshot # for an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full # First do a full send of this snapshot. $FSSUM_PROG -A -f -w $send_files_dir/snap1.fssum $SCRATCH_MNT/snap1@@ -88,7 +88,7 @@ $XFS_IO_PROG -c "pwrite -S 0x19 4K 8K" $SCRATCH_MNT/sv1/baz >>$seqres.full # Create a second snapshot of the subvolume, to be used later as the send # snapshot of an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.tests/btrfs/168.out +0
-2@@ -1,9 +1,7 @@ QA output created by 168 Create subvolume 'SCRATCH_MNT/sv1' At subvol SCRATCH_MNT/sv1 -Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1 -Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 At subvol sv1 OKtests/btrfs/169 +3
-3@@ -43,8 +43,8 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \ -c "pwrite -S 0xea 0 1M" \ $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \ | _filter_scratch@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \ $XFS_IO_PROG -c "fpunch 1M 2M" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 2>&1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/snap1 -f $send_files_dir/2.snap \ $SCRATCH_MNT/snap2 2>&1 | _filter_scratchtests/btrfs/169.out +0
-2@@ -1,9 +1,7 @@ QA output created by 169 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 File digest in the original filesystem: d31659e82e87798acd4669a1e0a19d4f SCRATCH_MNT/snap2/foobartests/btrfs/170 +1
-2@@ -45,8 +45,7 @@ echo "File digest after write:" md5sum $SCRATCH_MNT/foobar | _filter_scratch # Create a snapshot of the subvolume where our file is. -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 >> $seqres.full # Cleanly unmount the filesystem. _scratch_unmounttests/btrfs/170.out +0
-1@@ -3,6 +3,5 @@ wrote 131072/131072 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) File digest after write: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobar -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File digest after mounting the filesystem again: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobartests/btrfs/187 +3
-2@@ -152,7 +152,7 @@ done wait ${create_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full # Add some more files, so that that are substantial differences between the # two test snapshots used for an incremental send later.@@ -184,7 +184,7 @@ done wait ${setxattr_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full full_send_loop 5 & full_send_pid=$!@@ -221,5 +221,6 @@ wait $balance_pid # _dmesg_since_test_start | grep -E -e '\bBTRFS error \(device .*?\):' +echo "Silence is golden" status=0 exittests/btrfs/187.out +1
-2@@ -1,3 +1,2 @@ QA output created by 187 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Silence is goldentests/btrfs/188 +3
-3@@ -44,8 +44,8 @@ _scratch_mount $XFS_IO_PROG -f -c "pwrite -S 0xab 0 500K" $SCRATCH_MNT/foobar | _filter_xfs_io $XFS_IO_PROG -c "falloc -k 1200K 800K" $SCRATCH_MNT/foobar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ $XFS_IO_PROG -c "fpunch 0 500K" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/188.out +0
-2@@ -1,9 +1,7 @@ QA output created by 188 wrote 512000/512000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr File digest in the original filesystem: 816df6f64deba63b029ca19d880ee10a SCRATCH_MNT/incr/foobartests/btrfs/189 +5
-4@@ -45,8 +45,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0xc7 0 2M" $SCRATCH_MNT/bar | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0x4d 0 2M" $SCRATCH_MNT/baz | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0xe2 0 2M" $SCRATCH_MNT/zoo | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full + $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -70,8 +71,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 1600K 0 128K" $SCRATCH_MNT/zoo \ # operations. $XFS_IO_PROG -c "truncate 710K" $SCRATCH_MNT/bar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/189.out +0
-2@@ -7,13 +7,11 @@ wrote 2097152/2097152 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 2097152/2097152 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base linked 131072/131072 bytes at offset 655360 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 131072/131072 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incrtests/btrfs/191 +2
-2@@ -44,7 +44,7 @@ $XFS_IO_PROG -c "pwrite -S 0xb8 512K 512K" $SCRATCH_MNT/foo | _filter_xfs_io # Create the base snapshot and the parent send stream from it. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/mysnap1 2>&1 \ | _filter_scratch@@ -55,7 +55,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xb8 0 1M" $SCRATCH_MNT/bar | _filter_xfs_io # Create the second snapshot, used for the incremental send, before doing the # file deduplication. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2 \ - | _filter_scratch + >> $seqres.full # Now before creating the incremental send stream: #tests/btrfs/191.out +0
-2@@ -3,11 +3,9 @@ wrote 524288/524288 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 524288/524288 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1' At subvol SCRATCH_MNT/mysnap1 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2' deduped 524288/524288 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) deduped 524288/524288 bytes at offset 524288tests/btrfs/200 +4
-4@@ -51,8 +51,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/foo 0 64K 64K" $SCRATCH_MNT/foo \ $XFS_IO_PROG -f -c "pwrite -S 0xc7 -b 64K 0 64K" $SCRATCH_MNT/bar \ | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -63,8 +63,8 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 64K 64K" $SCRATCH_MNT/bar \ | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/200.out +0
-2@@ -5,11 +5,9 @@ linked 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base linked 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incrtests/btrfs/202 +1
-1@@ -28,7 +28,7 @@ _scratch_mount $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a | _filter_scratch $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a/b | _filter_scratch $BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT/a $SCRATCH_MNT/c \ - | _filter_scratch + >> $seqres.full # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/btests/btrfs/202.out +0
-1@@ -1,4 +1,3 @@ QA output created by 202 Create subvolume 'SCRATCH_MNT/a' Create subvolume 'SCRATCH_MNT/a/b' -Create a snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'tests/btrfs/203 +4
-4@@ -43,8 +43,8 @@ _scratch_mount # file in the parent snapshot. $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 64K" $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \ + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -69,8 +69,8 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \ -c "reflink $SCRATCH_MNT/foobar 448K 192K 192K" \ $SCRATCH_MNT/foobar | _filter_xfs_io -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \ + >> $seqres.full $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/203.out +0
-2@@ -1,7 +1,6 @@ QA output created by 203 wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base wrote 65536/65536 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)@@ -15,7 +14,6 @@ wrote 65536/65536 bytes at offset 786432 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 196608/196608 bytes at offset 196608 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr File foobar digest in the original filesystem: 2b76b23b62fdbbbcae1ee37eec84fd7dtests/btrfs/226 +1
-1@@ -51,7 +51,7 @@ $XFS_IO_PROG -s -c "pwrite -S 0xab 0 64K" \ $SCRATCH_MNT/f2 | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full # Write into the range of the first extent so that that range no longer has a # shared extent.tests/btrfs/226.out +0
-1@@ -13,7 +13,6 @@ wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) pwrite: Resource temporarily unavailabletests/btrfs/276 +1
-1@@ -105,7 +105,7 @@ sync echo "Number of non-shared extents in the whole file: $(count_not_shared_extents)" # Creating a snapshot. -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full # We have a snapshot, so now all extents should be reported as shared. echo "Number of shared extents in the whole file: $(count_shared_extents)"tests/btrfs/276.out +0
-1@@ -1,6 +1,5 @@ QA output created by 276 Number of non-shared extents in the whole file: 2000 -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' Number of shared extents in the whole file: 2000 wrote 65536/65536 bytes at offset 524288 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)tests/btrfs/280 +2
-1@@ -37,7 +37,8 @@ _scratch_mount -o compress $XFS_IO_PROG -f -c "pwrite -b 1M 0 128M" $SCRATCH_MNT/foo | _filter_xfs_io # Create a RW snapshot of the default subvolume. -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \ + >> $seqres.full echo echo "File foo fiemap before COWing extent:"tests/btrfs/280.out +0
-1@@ -1,7 +1,6 @@ QA output created by 280 wrote 134217728/134217728 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File foo fiemap before COWing extent:tests/btrfs/281 +1
-1@@ -53,7 +53,7 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 0 64K" $SCRATCH_MNT/foo \ echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \ | _filter_scratchtests/btrfs/281.out +0
-1@@ -6,7 +6,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap Creating a new filesystem to receive the send stream... At subvol snaptests/btrfs/283 +1
-1@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "pwrite -S 0xcd -b 64K 64K 64K" $SCRATCH_MNT/foo | _filter_xfs_i echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 | _filter_scratchtests/btrfs/283.out +0
-1@@ -4,7 +4,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap Creating a new filesystem to receive the send stream... At subvol snaptests/btrfs/287 +2
-2@@ -112,9 +112,9 @@ query_logical_ino -o $bytenr # Now create two snapshots and then do some queries. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full snap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)tests/btrfs/287.out +0
-2@@ -41,8 +41,6 @@ resolve first extent +3M offset with ignore offset option: inode 257 offset 16777216 root 5 inode 257 offset 8388608 root 5 inode 257 offset 2097152 root 5 -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' resolve first extent: inode 257 offset 16777216 snap2 inode 257 offset 8388608 snap2tests/btrfs/293 +4
-2@@ -32,9 +32,11 @@ swap_file="$SCRATCH_MNT/swapfile" _format_swapfile $swap_file $(($(_get_page_size) * 64)) >> $seqres.full echo "Creating first snapshot..." -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ + >> $seqres.full echo "Creating second snapshot..." -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 | _filter_scratch +$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 \ + >> $seqres.full echo "Activating swap file... (should fail due to snapshots)" _swapon_file $swap_file 2>&1 | _filter_scratchtests/btrfs/293.out +0
-2@@ -1,8 +1,6 @@ QA output created by 293 Creating first snapshot... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Creating second snapshot... -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' Activating swap file... (should fail due to snapshots) swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument Deleting first snapshot...tests/btrfs/300 +1
-1@@ -43,7 +43,7 @@ $BTRFS_UTIL_PROG subvolume create subvol; touch subvol/{1,2,3}; $BTRFS_UTIL_PROG subvolume create subvol/subsubvol; touch subvol/subsubvol/{4,5,6}; -$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot; +$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot > /dev/null; " find $test_dir/. -printf "%M %u %g ./%P\n"tests/btrfs/300.out +0
-1@@ -1,7 +1,6 @@ QA output created by 300 Create subvolume './subvol' Create subvolume 'subvol/subsubvol' -Create a snapshot of 'subvol' in './snapshot' drwxr-xr-x fsgqa fsgqa ./ drwxr-xr-x fsgqa fsgqa ./subvol -rw-r--r-- fsgqa fsgqa ./subvol/1tests/btrfs/302 +1
-1@@ -46,7 +46,7 @@ $FSSUM_PROG -A -f -w $fssum_file $SCRATCH_MNT/subvol # Now create a snapshot of the subvolume and make it accessible from within the # subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap >> $seqres.full # Now unmount and mount again the fs. We want to verify we are able to read all # metadata for the snapshot from disk (no IO failures, etc).tests/btrfs/302.out +0
-1@@ -1,4 +1,3 @@ QA output created by 302 Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' OKtests/btrfs/314 +1
-1@@ -43,7 +43,7 @@ send_receive_tempfsid() $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' ${src}/foo | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r ${src} ${src}/snap1 | \ - _filter_testdir_and_scratch + >> $seqres.full echo Send ${src} | _filter_testdir_and_scratch $BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \tests/btrfs/314.out +0
-2@@ -3,7 +3,6 @@ QA output created by 314 From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt wrote 9000/9000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Send SCRATCH_MNT At subvol SCRATCH_MNT/snap1 Receive TEST_DIR/314/tempfsid_mnt@@ -14,7 +13,6 @@ Recv: 42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/314/tempfsid_mnt/snap1/foo From tempfsid TEST_DIR/314/tempfsid_mnt to non-tempfsid SCRATCH_MNT wrote 9000/9000 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'TEST_DIR/314/tempfsid_mnt' in 'TEST_DIR/314/tempfsid_mnt/snap1' Send TEST_DIR/314/tempfsid_mnt At subvol TEST_DIR/314/tempfsid_mnt/snap1 Receive SCRATCH_MNT
Quoted 31 lines · Anand Jain
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.Quoted 8 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the
existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).Thus majority of the snapshot/subvolume creation is not populating golden output already.
Quoted 7 lines
While golden output is better verification method in terms of accuracy, but, it falls short in verifying command exit codes. I personally think the
run_btrfs_progsapproach is better for 'btrfs subvolume snapshot'. It allows us to verify the command status without relying on the stdout.
But, past discussions favored the golden output verification method instead ofrun_btrfs_progs.
I do no think the old conclusion is really fitting "btrfs subvolume" command group.
Quoted 772 lines
Thanks, Anand
Quoted 766 lines
Signed-off-by Qu Wenruo <[email protected]>---
This is just a quick fix for the test failures, if accepted, further cleanup would be done for unnecessary golden output for "btrfs subvolume" subgroup.v2:
- Revert the change of btrfs/208.out
That was part of the later cleanup, wrongly included in the fix.
---tests/btrfs/001 | 2 +-
tests/btrfs/001.out | 1 -
tests/btrfs/152 | 6 +++---
tests/btrfs/152.out | 2 --
tests/btrfs/168 | 4 ++--
tests/btrfs/168.out | 2 --
tests/btrfs/169 | 6 +++---
tests/btrfs/169.out | 2 --
tests/btrfs/170 | 3 +--
tests/btrfs/170.out | 1 -
tests/btrfs/187 | 5 +++--
tests/btrfs/187.out | 3 +--
tests/btrfs/188 | 6 +++---
tests/btrfs/188.out | 2 --
tests/btrfs/189 | 9 +++++----
tests/btrfs/189.out | 2 --
tests/btrfs/191 | 4 ++--
tests/btrfs/191.out | 2 --
tests/btrfs/200 | 8 ++++----
tests/btrfs/200.out | 2 --
tests/btrfs/202 | 2 +-
tests/btrfs/202.out | 1 -
tests/btrfs/203 | 8 ++++----
tests/btrfs/203.out | 2 --
tests/btrfs/226 | 2 +-
tests/btrfs/226.out | 1 -
tests/btrfs/276 | 2 +-
tests/btrfs/276.out | 1 -
tests/btrfs/280 | 3 ++-
tests/btrfs/280.out | 1 -
tests/btrfs/281 | 2 +-
tests/btrfs/281.out | 1 -
tests/btrfs/283 | 2 +-
tests/btrfs/283.out | 1 -
tests/btrfs/287 | 4 ++--
tests/btrfs/287.out | 2 --
tests/btrfs/293 | 6 ++++--
tests/btrfs/293.out | 2 --
tests/btrfs/300 | 2 +-
tests/btrfs/300.out | 1 -
tests/btrfs/302 | 2 +-
tests/btrfs/302.out | 1 -
tests/btrfs/314 | 2 +-
tests/btrfs/314.out | 2 --44 files changed, 48 insertions(+), 77 deletions(-)tests/btrfs/001 +0
-0@@ -26,7 +26,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &>
/dev/null
echo "List root dir"
ls $SCRATCH_MNT
echo "Creating snapshot of root dir"
-$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/001.out +0
-0@@ -3,7 +3,6 @@ Creating file foo in root dirList root dir
foo
Creating snapshot of root dir
-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot
foo
snaptests/btrfs/152 +2
-2@@ -32,12 +32,12 @@ touch $SCRATCH_MNT/subvol{1,2}/foo # Create base snapshots and send them $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol1 \ - $SCRATCH_MNT/subvol1/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol1/.snapshots/1 >> $seqres.full $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 >> $seqres.fullfor recv in
recv1_1recv1_2recv2_1recv2_2; do $BTRFS_UTIL_PROG send $SCRATCH_MNT/subvol1/.snapshots/1 2>/dev/null| \
- $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} |_filter_scratch+ $BTRFS_UTIL_PROG receive $SCRATCH_MNT/${recv} >> $seqres.full done
# Now do 10 loops of concurrent incremental send/receivestests/btrfs/152.out +0
-0@@ -5,8 +5,6 @@ Create subvolume 'SCRATCH_MNT/recv1_1'Create subvolume 'SCRATCH_MNT/recv1_2' Create subvolume 'SCRATCH_MNT/recv2_1' Create subvolume 'SCRATCH_MNT/recv2_2' -Create a readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1'
-Create a readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1'
At subvol 1
At subvol 1
At subvol 1tests/btrfs/168 +0
-0@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro false # Create a snapshot of the subvolume, to be used later as the parentsnapshot
# for an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap1 \ - | _filter_scratch + >> $seqres.full # First do a full send of this snapshot. $FSSUM_PROG -A -f -w $send_files_dir/snap1.fssum $SCRATCH_MNT/snap1tests/btrfs/168 +0
-0@@ -88,7 +88,7 @@ $XFS_IO_PROG -c "pwrite -S 0x19 4K 8K"$SCRATCH_MNT/sv1/baz >>$seqres.full
# Create a second snapshot of the subvolume, to be used later as the send# snapshot of an incremental send operation. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/sv1 $SCRATCH_MNT/snap2 \ - | _filter_scratch + >> $seqres.full # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.tests/btrfs/168.out +0
-0@@ -1,9 +1,7 @@QA output created by 168
Create subvolume 'SCRATCH_MNT/sv1'
At subvol SCRATCH_MNT/sv1
-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1
-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2
At subvol sv1
OKtests/btrfs/169 +0
-0@@ -43,8 +43,8 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \ -c "pwrite -S 0xea 0 1M" \$SCRATCH_MNT/foobar |
_filter_xfs_io-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \
|_filter_scratchtests/btrfs/169 +0
-0@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/snap1 2>&1 \$XFS_IO_PROG -c "fpunch 1M 2M" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 2>&1 \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/snap1 -f $send_files_dir/2.snap \
$SCRATCH_MNT/snap2 2>&1 |_filter_scratchtests/btrfs/169.out +0
-0@@ -1,9 +1,7 @@QA output created by 169
wrote 1048576/1048576 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' At subvol SCRATCH_MNT/snap1
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2
File digest in the original filesystem:
d31659e82e87798acd4669a1e0a19d4f SCRATCH_MNT/snap2/foobartests/btrfs/170 +0
-0@@ -45,8 +45,7 @@ echo "File digest after write:"md5sum $SCRATCH_MNT/foobar |
_filter_scratch
# Create a snapshot of the subvolume where our file is. -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap 2>&1 >> $seqres.full
# Cleanly unmount the filesystem.
_scratch_unmounttests/btrfs/170.out +0
-0@@ -3,6 +3,5 @@ wrote 131072/131072 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)File digest after write:
85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobar -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File digest after mounting the filesystem again:
85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobartests/btrfs/187 +0
-0@@ -152,7 +152,7 @@ done wait ${create_pids[@]}$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \
- |_filter_scratch
+ >> $seqres.full
# Add some more files, so that that are substantial differences between the# two test snapshots used for an incremental send later.tests/btrfs/187 +0
-0@@ -184,7 +184,7 @@ done wait ${setxattr_pids[@]}$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \
- |_filter_scratch
+ >> $seqres.full
full_send_loop5 &
full_send_pid=$!tests/btrfs/187 +0
-0@@ -221,5 +221,6 @@ wait $balance_pid #
_dmesg_since_test_start| grep -E -e '\bBTRFS error \(device .*?\):' +echo "Silence is golden"
status=0
exittests/btrfs/187.out +0
-0@@ -1,3 +1,2 @@QA output created by 187
tests/btrfs/187.out +1
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Silence is goldentests/btrfs/188 +0
-0@@ -44,8 +44,8 @@ _scratch_mount$XFS_IO_PROG -f -c "pwrite -S
0xab0 500K" $SCRATCH_MNT/foobar |_filter_xfs_io
$XFS_IO_PROG -c "falloc -k 1200K 800K" $SCRATCH_MNT/foobar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/188 +0
-0@@ -54,7 +54,7 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \$XFS_IO_PROG -c "fpunch 0 500K" $SCRATCH_MNT/foobar $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \
$SCRATCH_MNT/incr 2>&1 |_filter_scratchtests/btrfs/188.out +0
-0@@ -1,9 +1,7 @@QA output created by 188
wrote 512000/512000 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr
File digest in the original filesystem:
816df6f64deba63b029ca19d880ee10a SCRATCH_MNT/incr/foobartests/btrfs/189 +0
-0@@ -45,8 +45,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0xc7 0 2M"$SCRATCH_MNT/bar |
_filter_xfs_io
$XFS_IO_PROG -f -c "pwrite -S0x4d0 2M" $SCRATCH_MNT/baz |_filter_xfs_io
$XFS_IO_PROG -f -c "pwrite -S0xe20 2M" $SCRATCH_MNT/zoo |_filter_xfs_io
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \
+ >> $seqres.full
+
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/189 +0
-0@@ -70,8 +71,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 1600K 0 128K" $SCRATCH_MNT/zoo \ # operations.$XFS_IO_PROG -c "truncate 710K" $SCRATCH_MNT/bar -$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \
$SCRATCH_MNT/incr 2>&1 |_filter_scratchtests/btrfs/189.out +0
-0@@ -7,13 +7,11 @@ wrote 2097152/2097152 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)wrote 2097152/2097152 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base
linked 131072/131072 bytes at offset 655360
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) linked 131072/131072 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr
At subvol base
At snapshot incrtests/btrfs/191 +0
-0@@ -44,7 +44,7 @@ $XFS_IO_PROG -c "pwrite -S 0xb8 512K 512K"$SCRATCH_MNT/foo |
_filter_xfs_io
# Create the base snapshot and the parent send stream from it. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1 \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/mysnap1 2>&1 \
|_filter_scratchtests/btrfs/191 +0
-0@@ -55,7 +55,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xb8 0 1M"$SCRATCH_MNT/bar |
_filter_xfs_io
# Create the second snapshot, used for the incremental send, before doing the# file deduplication. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2 \ - | _filter_scratch + >> $seqres.full # Now before creating the incremental send stream: #tests/btrfs/191.out +0
-0@@ -3,11 +3,9 @@ wrote 524288/524288 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)wrote 524288/524288 bytes at offset 524288
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1' At subvol SCRATCH_MNT/mysnap1
wrote 1048576/1048576 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2' deduped 524288/524288 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) deduped 524288/524288 bytes at offset 524288tests/btrfs/200 +0
-0@@ -51,8 +51,8 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/foo 0 64K 64K" $SCRATCH_MNT/foo \ $XFS_IO_PROG -f -c "pwrite -S 0xc7 -b 64K 0 64K" $SCRATCH_MNT/bar \|
_filter_xfs_io
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/200 +0
-0@@ -63,8 +63,8 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 64K 64K" $SCRATCH_MNT/bar \|
_filter_xfs_io
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \
$SCRATCH_MNT/incr 2>&1 |_filter_scratchtests/btrfs/200.out +0
-0@@ -5,11 +5,9 @@ linked 65536/65536 bytes at offset 65536 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)wrote 65536/65536 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base
linked 65536/65536 bytes at offset 65536
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr
At subvol base
At snapshot incrtests/btrfs/202 +0
-0@@ -28,7 +28,7 @@ _scratch_mount$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a |
_filter_scratch$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a/b |_filter_scratch$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT/a $SCRATCH_MNT/c \
- |_filter_scratch
+ >> $seqres.full
# Need the dummy entry created so that we get the invalid removal when we rmdir
ls $SCRATCH_MNT/c/btests/btrfs/202.out +0
-0@@ -1,4 +1,3 @@QA output created by 202
Create subvolume 'SCRATCH_MNT/a'
Create subvolume 'SCRATCH_MNT/a/b'tests/btrfs/202.out +0
-1-Create a snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'tests/btrfs/203 +0
-0@@ -43,8 +43,8 @@ _scratch_mount # file in the parent snapshot.$XFS_IO_PROG -f -c "pwrite -S
0xf10 64K" $SCRATCH_MNT/foobar |_filter_xfs_io
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/203 +0
-0@@ -69,8 +69,8 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \ -c "reflink $SCRATCH_MNT/foobar 448K 192K 192K" \$SCRATCH_MNT/foobar |
_filter_xfs_io-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr \
+ >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \
$SCRATCH_MNT/incr 2>&1 |_filter_scratchtests/btrfs/203.out +0
-0@@ -1,7 +1,6 @@QA output created by 203
wrote 65536/65536 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' At subvol SCRATCH_MNT/base
wrote 65536/65536 bytes at offset 524288
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)tests/btrfs/203.out +0
-0@@ -15,7 +14,6 @@ wrote 65536/65536 bytes at offset 786432 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)linked 196608/196608 bytes at offset 196608
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr
File foobar digest in the original filesystem:
2b76b23b62fdbbbcae1ee37eec84fd7dtests/btrfs/226 +0
-0@@ -51,7 +51,7 @@ $XFS_IO_PROG -s -c "pwrite -S 0xab 0 64K" \$SCRATCH_MNT/f2 |
_filter_xfs_io$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \
- |_filter_scratch
+ >> $seqres.full
# Write into the range of the first extent so that that range no longer has a# shared extent.tests/btrfs/226.out +0
-0@@ -13,7 +13,6 @@ wrote 65536/65536 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)wrote 65536/65536 bytes at offset 65536
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' wrote 65536/65536 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
pwrite: Resource temporarily unavailabletests/btrfs/276 +0
-0@@ -105,7 +105,7 @@ syncecho "Number of non-shared extents in the whole file:
$(count_not_shared_extents)"
# Creating a snapshot.
-$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full
# We have a snapshot, so now all extents should be reported as shared. echo "Number of shared extents in the whole file:
$(count_shared_extents)"tests/btrfs/276.out +0
-0@@ -1,6 +1,5 @@QA output created by 276
Number of non-shared extents in the whole file: 2000 -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' Number of shared extents in the whole file: 2000 wrote 65536/65536 bytes at offset 524288
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)tests/btrfs/280 +0
-0@@ -37,7 +37,8 @@ _scratch_mount -o compress$XFS_IO_PROG -f -c "pwrite -b 1M 0 128M" $SCRATCH_MNT/foo |
_filter_xfs_io
# Create a RW snapshot of the default subvolume. -$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap \
+ >> $seqres.full
echo
echo "File foo fiemap before COWing extent:"tests/btrfs/280.out +0
-0@@ -1,7 +1,6 @@QA output created by 280
wrote 134217728/134217728 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File foo fiemap before COWing extent:tests/btrfs/281 +0
-0@@ -53,7 +53,7 @@ $XFS_IO_PROG -c "reflink $SCRATCH_MNT/bar 0 0 64K" $SCRATCH_MNT/foo \echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \
|_filter_scratchtests/btrfs/281.out +0
-0@@ -6,7 +6,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)linked 65536/65536 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it...
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap
Creating a new filesystem to receive the send stream... At subvol snaptests/btrfs/283 +0
-0@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "pwrite -S 0xcd -b 64K 64K 64K"$SCRATCH_MNT/foo |
_filter_xfs_i
echo "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 |_filter_scratchtests/btrfs/283.out +0
-0@@ -4,7 +4,6 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)wrote 65536/65536 bytes at offset 65536
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating snapshot and a send stream for it...
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' At subvol SCRATCH_MNT/snap
Creating a new filesystem to receive the send stream... At subvol snaptests/btrfs/287 +0
-0@@ -112,9 +112,9 @@ query_logical_ino -o $bytenr # Now create two snapshots and then do some queries.$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \
- |_filter_scratch
+ >> $seqres.full
$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \
- |_filter_scratch
+ >> $seqres.full snap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)tests/btrfs/287.out +0
-0@@ -41,8 +41,6 @@ resolve first extent +3M offset with ignore offsetoption:
inode 257 offset 16777216 root 5
inode 257 offset 8388608 root 5
inode 257 offset 2097152 root 5tests/btrfs/287.out +0
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'resolve first extent:
inode 257 offset 16777216 snap2
inode 257 offset 8388608 snap2tests/btrfs/293 +0
-0@@ -32,9 +32,11 @@ swap_file="$SCRATCH_MNT/swapfile"
_format_swapfile$swap_file $(($(_get_page_size) * 64)) >> $seqres.full echo "Creating first snapshot..."
-$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \
+ >> $seqres.full
echo "Creating second snapshot..."
-$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 |_filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap2 \
+ >> $seqres.full
echo "Activating swap file... (should fail due to snapshots)"_swapon_file$swap_file 2>&1 |_filter_scratchtests/btrfs/293.out +0
-0@@ -1,8 +1,6 @@QA output created by 293
Creating first snapshot...
-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Creating second snapshot...
-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' Activating swap file... (should fail due to snapshots)
swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument Deleting first snapshot...tests/btrfs/300 +1
-1@@ -43,7 +43,7 @@ $BTRFS_UTIL_PROG subvolume create subvol; touch subvol/{1,2,3}; $BTRFS_UTIL_PROG subvolume create subvol/subsubvol; touch subvol/subsubvol/{4,5,6}; -$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot; +$BTRFS_UTIL_PROG subvolume snapshot subvol snapshot > /dev/null;"
find $test_dir/. -printf "%M %u %g ./%P\n"tests/btrfs/300.out +0
-0@@ -1,7 +1,6 @@QA output created by 300
Create subvolume './subvol'
Create subvolume 'subvol/subsubvol'
-Create a snapshot of 'subvol' in './snapshot'
drwxr-xr-x fsgqa fsgqa ./
drwxr-xr-x fsgqa fsgqa ./subvol
-rw-r--r-- fsgqa fsgqa ./subvol/1tests/btrfs/302 +0
-0@@ -46,7 +46,7 @@ $FSSUM_PROG -A -f -w $fssum_file $SCRATCH_MNT/subvol # Now create a snapshot of the subvolume and make it accessible fromwithin the
# subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap >> $seqres.full # Now unmount and mount again the fs. We want to verify we are able to read all # metadata for the snapshot from disk (no IO failures, etc).tests/btrfs/302.out +0
-0@@ -1,4 +1,3 @@QA output created by 302
Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap'
OKtests/btrfs/314 +0
-0@@ -43,7 +43,7 @@ send_receive_tempfsid()$XFS_IO_PROG -fc 'pwrite -S
0x610 9000' ${src}/foo |_filter_xfs_io
$BTRFS_UTIL_PROG subvolume snapshot -r ${src} ${src}/snap1 | \
-_filter_testdir_and_scratch
+ >> $seqres.full
echo Send ${src} |_filter_testdir_and_scratch$BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \tests/btrfs/314.out +0
-0@@ -3,7 +3,6 @@ QA output created by 314From non-tempfsid
SCRATCH_MNTto tempfsid TEST_DIR/314/tempfsid_mnt wrote 9000/9000 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' SendSCRATCH_MNT
At subvol SCRATCH_MNT/snap1
Receive TEST_DIR/314/tempfsid_mnttests/btrfs/314.out +0
-0@@ -14,7 +13,6 @@ Recv: 42d69d1a6d333a7ebdf64792a555e392TEST_DIR/314/tempfsid_mnt/snap1/foo
From tempfsid TEST_DIR/314/tempfsid_mnt to non-tempfsidSCRATCH_MNTwrote 9000/9000 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Create a readonly snapshot of 'TEST_DIR/314/tempfsid_mnt' in 'TEST_DIR/314/tempfsid_mnt/snap1'
Send TEST_DIR/314/tempfsid_mnt
At subvol TEST_DIR/314/tempfsid_mnt/snap1
ReceiveSCRATCH_MNT
Quoted 30 lines · Anand Jain
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.Quoted 7 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
Quoted 7 lines
While golden output is better verification method in terms of accuracy, but, it falls short in verifying command exit codes. I personally think the
run_btrfs_progsapproach is better for 'btrfs subvolume snapshot'. It allows us to verify the command status without relying on the stdout.
But, past discussions favored the golden output verification method instead ofrun_btrfs_progs.
I thought the whole point here was to depart from the golden output, at least in selected cases, and only in btrfs/ subdirectory so it does not accidentally break other filesystems' testing.
What past discussions favored does not seem to satisfy our needs and as btrfs-progs are evolving we're hitting random test breakage just because some message has changed. The testsuite should verify what matters, ie. return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.
Quoted 43 lines · David Sterba
Quoted 30 lines · Anand Jain
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.Quoted 7 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
Quoted 7 lines
While golden output is better verification method in terms of accuracy, but, it falls short in verifying command exit codes. I personally think the
run_btrfs_progsapproach is better for 'btrfs subvolume snapshot'. It allows us to verify the command status without relying on the stdout.
But, past discussions favored the golden output verification method instead ofrun_btrfs_progs.I thought the whole point here was to depart from the golden output, at least in selected cases, and only in btrfs/ subdirectory so it does not accidentally break other filesystems' testing.
Quoted 6 lines
What past discussions favored does not seem to satisfy our needs and as btrfs-progs are evolving we're hitting random test breakage just because some message has changed. The testsuite should verify what matters, ie. return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.
Agreed. So, why don't we use _run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?
Thanks, Anand
Quoted 53 lines · Anand Jain
Quoted 43 lines · David Sterba
Quoted 30 lines · Anand Jain
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.Quoted 7 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
Quoted 7 lines
While golden output is better verification method in terms of accuracy, but, it falls short in verifying command exit codes. I personally think the
run_btrfs_progsapproach is better for 'btrfs subvolume snapshot'. It allows us to verify the command status without relying on the stdout.
But, past discussions favored the golden output verification method instead ofrun_btrfs_progs.I thought the whole point here was to depart from the golden output, at least in selected cases, and only in btrfs/ subdirectory so it does not accidentally break other filesystems' testing.
Quoted 6 lines
What past discussions favored does not seem to satisfy our needs and as btrfs-progs are evolving we're hitting random test breakage just because some message has changed. The testsuite should verify what matters, ie. return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.
Quoted 3 lines
Agreed. So, why don't we use
_run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?
For _run_btrfs_util_prog, the only thing I do not like is the name itself.
I also do not like how fstests always go $BTRFS_UTIL_PROG neither, however I understand it's there to make sure we do not got weird bash function name like "btrfs()" overriding the real "btrfs".
If we can make the name shorter like _btrfs or something like it, I'm totally fine with that, and would be happy to move to the new interface.
In fact, _run_btrfs_util_prog is pretty helpful to generate a debug friendly seqres.full, which is another good point.
Thanks,
Qu
Quoted 2 lines
Thanks, Anand
Quoted 17 lines · Qu Wenruo
Quoted 10 lines
Quoted 6 lines
What past discussions favored does not seem to satisfy our needs and as btrfs-progs are evolving we're hitting random test breakage just because some message has changed. The testsuite should verify what matters, ie. return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.
Agreed. So, why don't we use
_run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?For
_run_btrfs_util_prog, the only thing I do not like is the name itself.I also do not like how fstests always go $BTRFS_UTIL_PROG neither, however I understand it's there to make sure we do not got weird bash function name like "
btrfs()" overriding the real "btrfs".
Quoted 5 lines
If we can make the name shorter like
_btrfsor something like it, I'm totally fine with that, and would be happy to move to the new interface.In fact,
_run_btrfs_util_progis pretty helpful to generate a debug friendly seqres.full, which is another good point.
I did not realize the _run_btrfs_util_prog helper was there and actually the run_check as well. I vaguely remember this from many years ago and this somehow landed in btrfs-progs testsuite but fstests was against it. Using such helpers sounds like a plan to me (with renames etc).
Quoted 21 lines · David Sterba
Quoted 20 lines · Qu Wenruo
Quoted 10 lines
Quoted 6 lines
What past discussions favored does not seem to satisfy our needs and as btrfs-progs are evolving we're hitting random test breakage just because some message has changed. The testsuite should verify what matters, ie. return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.
Agreed. So, why don't we use
_run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?For
_run_btrfs_util_prog, the only thing I do not like is the name itself.I also do not like how fstests always go $BTRFS_UTIL_PROG neither, however I understand it's there to make sure we do not got weird bash function name like "
btrfs()" overriding the real "btrfs".If we can make the name shorter like
_btrfsor something like it, I'm totally fine with that, and would be happy to move to the new interface.
Quoted 7 lines
Quoted 2 lines
In fact,
_run_btrfs_util_progis pretty helpful to generate a debug friendly seqres.full, which is another good point.I did not realize the
_run_btrfs_util_proghelper was there and actually therun_checkas well. I vaguely remember this from many years ago and this somehow landed in btrfs-progs testsuite but fstests was against it. Using such helpers sounds like a plan to me (with renames etc).
We can do the renaming part in the separate patch. Qu, are you sending the revised patch?
I use run command in some of my local test scripts it help debug, switch on / off the output easily and verifies the success return code.
Thanks, Anand
Quoted 31 lines · Anand Jain
Quoted 28 lines · David Sterba
Quoted 26 lines · Qu Wenruo
Quoted 10 lines
Quoted 9 lines
What past discussions favored does not seem to satisfy our needs and as
btrfs-progs are evolving we're hitting random test breakage just because
some message has changed. The testsuite should verify what matters, ie.
return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.Quoted 3 lines
Agreed. So, why don't we use
_run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?For
_run_btrfs_util_prog, the only thing I do not like is the name itself.I also do not like how fstests always go $BTRFS_UTIL_PROG neither, however I understand it's there to make sure we do not got weird bash function name like "
btrfs()" overriding the real "btrfs".If we can make the name shorter like
_btrfsor something like it, I'm totally fine with that, and would be happy to move to the new interface.In fact,
_run_btrfs_util_progis pretty helpful to generate a debug friendly seqres.full, which is another good point.
Quoted 7 lines
Quoted 4 lines
I did not realize the
_run_btrfs_util_proghelper was there and actually therun_checkas well. I vaguely remember this from many years ago and this somehow landed in btrfs-progs testsuite but fstests was against it. Using such helpers sounds like a plan to me (with renames etc).We can do the renaming part in the separate patch. Qu, are you sending the revised patch?
Sure, I can prepare them pretty soon.
Just to be noticed, if we really determine to rename _run_btrfs_util_prog, it would be pretty large as there are tons of such calls still there.
And I really hope we can get a good naming before doing the conversion. Updating it again and again for a different name may not be a good use of time.
My candidate is _btrfs or _run_btrfs. Any good candidates?
Thanks,
Qu
Quoted 9 lines
I use run command in some of my local test scripts it help debug, switch on / off the output easily and verifies the success return code.
Thanks, Anand
Quoted 48 lines · Qu Wenruo
Quoted 31 lines · Anand Jain
Quoted 28 lines · David Sterba
Quoted 26 lines · Qu Wenruo
Quoted 10 lines
Quoted 9 lines
What past discussions favored does not seem to satisfy our needs and as
btrfs-progs are evolving we're hitting random test breakage just because
some message has changed. The testsuite should verify what matters, ie.
return code, state of the filesystem etc, not exact command output. There's high correlation between output and correctness, yes, but this is too fragile.Quoted 3 lines
Agreed. So, why don't we use
_run_btrfs_util_prog subvolume snapshot, which makes it consistent with the rest of the test cases, and also remove the golden output for this command?For
_run_btrfs_util_prog, the only thing I do not like is the name itself.I also do not like how fstests always go $BTRFS_UTIL_PROG neither, however I understand it's there to make sure we do not got weird bash function name like "
btrfs()" overriding the real "btrfs".If we can make the name shorter like
_btrfsor something like it, I'm totally fine with that, and would be happy to move to the new interface.In fact,
_run_btrfs_util_progis pretty helpful to generate a debug friendly seqres.full, which is another good point.Quoted 7 lines
Quoted 4 lines
I did not realize the
_run_btrfs_util_proghelper was there and actually therun_checkas well. I vaguely remember this from many years ago and this somehow landed in btrfs-progs testsuite but fstests was against it. Using such helpers sounds like a plan to me (with renames etc).We can do the renaming part in the separate patch. Qu, are you sending the revised patch?
Sure, I can prepare them pretty soon.
Just to be noticed, if we really determine to rename
_run_btrfs_util_prog, it would be pretty large as there are tons of such calls still there.
Quoted 5 lines
And I really hope we can get a good naming before doing the conversion. Updating it again and again for a different name may not be a good use of time.
My candidate is
_btrfsor_run_btrfs. Any good candidates?
I'd use the one with prefix.
Quoted 21 lines · Qu Wenruo
[BUG]
All the touched test cases would fail after btrfs-progs commit5f87b467a9e7("btrfs-progs: subvolume: output the prompt line only when the ioctl succeeded") due to golden output mismatch.[CAUSE]
Although the patch I sent to the mail list doesn't change the output at all but only a timing change, David uses this patch to unify the output of "btrfs subvolume create" and "btrfs subvolume snapshot".Unfortunately this changes the output and causes mismatch with golden output.
[FIX]
Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full. Any error from "btrfs subvolume" subgroup would lead to error messages into stderr, and cause golden output mismatch.This can be comprehensively greped by
'grep -IR "Create a" tests/btrfs/*.out' command.
Quoted 6 lines
In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the existing test cases, meanwhile only around 61 calls are populating golden output (22 for subvolume creation, and 39 for snapshot creation).
Thus majority of the snapshot/subvolume creation is not populating golden output already.
That's an interesting find, so we actually already do prefer not to use golden output. There are recent tests that do use it though, so it's not done consistently.
Quoted 5 lines
Signed-off-by Qu Wenruo <[email protected]>---
This is just a quick fix for the test failures, if accepted, further cleanup would be done for unnecessary golden output for "btrfs subvolume" subgroup.
I like it and this looks like the direction we can take for more commands, thanks.