fstests: btrfs: subvolume snapshot fix golden output
cover fstests: btrfs: subvolume snapshot fix golden output
Update test cases with the new golden output for the command btrfs subvolume snapshot, further introduce a helper _filter_snapshot() to make it compatible with older btrfs-progs.
Anand Jain (2):
common/filter.btrfs: add a new _filter_snapshot
btrfs: create snapshot fix golden output
common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/001.out | 2 +- tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 4 ++-- tests/btrfs/168 | 6 +++--- tests/btrfs/168.out | 4 ++-- tests/btrfs/202 | 4 ++-- tests/btrfs/202.out | 2 +- tests/btrfs/300.out | 2 +- tests/btrfs/302 | 4 ++-- tests/btrfs/302.out | 2 +- 12 files changed, 29 insertions(+), 19 deletions(-)
Signature · 1 line
2.39.3
PATCH 1/2 common/filter.btrfs: add a new _filter_snapshot
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
--- common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)
common/filter.btrfs +9 -0
@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume: output the + # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to + # work on older btrfs-progs without the above commit. + _filter_scratch | sed -e "s/Create a/Create/g" +} + # make sure this script returns success /bin/true
tests/btrfs/001 +2 -1
@@ -26,7 +26,8 @@ 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 | \ + _filter_snapshot echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"
tests/btrfs/152 +3 -3
@@ -11,7 +11,7 @@ _begin_fstest auto quick metadata qgroup send # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshot 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
tests/btrfs/168 +3 -3
@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -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 + | _filter_snapshot # 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 + | _filter_snapshot # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.
tests/btrfs/202 +2 -2
@@ -8,7 +8,7 @@ . ./common/preamble _begin_fstest auto quick subvol snapshot -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch
@@ -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 + | _filter_snapshot # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/b
tests/btrfs/302 +2 -2
@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick snapshot subvol -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch
@@ -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 | _filter_snapshot # 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).
Signature · 1 line
2.39.3
Re: [PATCH 1/2] common/filter.btrfs: add a new _filter_snapshot
Quoted 6 lines · Anand Jain
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
Signed-off-by Anand Jain <[email protected]>
Can we stop the golden output filter game?
From day one I'm not a big fan of the golden output idea. For snapshot/subvolume creation, we don't really care about what the output is, we only care if there is any error (which would come from stderr).
In that case, why not just redirect the stdout to null?
To me, if we really care something from the stdout, we can still save it and let bash/awk/grep to process it, like what we did for various test cases, and then save the result to seqres.full.
Thanks,
Qu
Quoted 142 lines
--- common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)common/filter.btrfs +9
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume: output the + # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to + # work on older btrfs-progs without the above commit. + _filter_scratch | sed -e "s/Create a/Create/g" +} + # make sure this script returns success /bin/truetests/btrfs/001 +2
-1@@ -26,7 +26,8 @@ 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 | \ + _filter_snapshot echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"tests/btrfs/152 +3
-3@@ -11,7 +11,7 @@ _begin_fstest auto quick metadata qgroup send # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshot 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_scratchtests/btrfs/168 +3
-3@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -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 + | _filter_snapshot # 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 + | _filter_snapshot # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.tests/btrfs/202 +2
-2@@ -8,7 +8,7 @@ . ./common/preamble _begin_fstest auto quick subvol snapshot -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -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 + | _filter_snapshot # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/btests/btrfs/302 +2
-2@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick snapshot subvol -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -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 | _filter_snapshot # 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).
Re: [PATCH 1/2] common/filter.btrfs: add a new _filter_snapshot
Quoted 17 lines · Qu Wenruo
Quoted 6 lines · Anand Jain
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
Signed-off-by Anand Jain <[email protected]>Can we stop the golden output filter game?
From day one I'm not a big fan of the golden output idea.
For snapshot/subvolume creation, we don't really care about what the output is, we only care if there is any error (which would come from stderr).
Quoted 6 lines
In that case, why not just redirect the stdout to null?
To me, if we really care something from the stdout, we can still save it and let bash/awk/grep to process it, like what we did for various test cases, and then save the result to seqres.full.
This is a bug-fix patch; it's not a good idea to change the concept of fstests' golden output. Perhaps an RFC patch about your idea can help to discuss and achieve consensus.
Thanks, Anand
Quoted 149 lines
Thanks,
QuQuoted 147 lines
---
common/filter.btrfs | 9 +++++++++tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit.
+_filter_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} +# make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/152 +0
-0@@ -11,7 +11,7 @@
_begin_fstestauto quick metadata qgroup send# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/152 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshotfor 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_scratchtests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/168 +1
-1@@ -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 + | _filter_snapshot # First do a full send of this snapshot.$FSSUM_PROG -A -f -w $send_files_dir/snap1.fssum $SCRATCH_MNT/snap1
tests/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 + | _filter_snapshot# Temporarily turn the second snapshot to read-write mode and then open a file
# descriptor on its foo file.tests/btrfs/202 +0
-0@@ -8,7 +8,7 @@. ./common/preamble
_begin_fstestauto quick subvol snapshot-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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
+ |_filter_snapshot# Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/b
tests/btrfs/302 +0
-0@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick snapshot subvol-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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 | _filter_snapshot # 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).
Re: [PATCH 1/2] common/filter.btrfs: add a new _filter_snapshot
Quoted 22 lines · Anand Jain
Quoted 19 lines · Qu Wenruo
Quoted 6 lines · Anand Jain
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
Signed-off-by Anand Jain <[email protected]>Can we stop the golden output filter game?
From day one I'm not a big fan of the golden output idea. For snapshot/subvolume creation, we don't really care about what the output is, we only care if there is any error (which would come from stderr).
In that case, why not just redirect the stdout to null?
Quoted 8 lines
Quoted 4 lines
To me, if we really care something from the stdout, we can still save it and let bash/awk/grep to process it, like what we did for various test cases, and then save the result to seqres.full.
This is a bug-fix patch; it's not a good idea to change the concept of fstests' golden output. Perhaps an RFC patch about your idea can help to discuss and achieve consensus.
Even as bug-fix, a simple redirect to seqres.full and remove the corresponding line from golden output is very valid to me.
In fact, introducing a filter looks very over-engineered in this particular case.
Quoted 166 lines
Thanks, Anand
Quoted 161 lines
Thanks,
QuQuoted 159 lines
---
common/filter.btrfs | 9 +++++++++tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for
+ # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit. +_filter_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} +# make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/152 +0
-0@@ -11,7 +11,7 @@
_begin_fstestauto quick metadata qgroup send# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/152 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshotfor 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_scratchtests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/168 +0
-0@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 rofalse
# 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 + | _filter_snapshot# 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 + | _filter_snapshot# Temporarily turn the second snapshot to read-write mode and then open a file
# descriptor on its foo file.tests/btrfs/202 +0
-0@@ -8,7 +8,7 @@. ./common/preamble
_begin_fstestauto quick subvol snapshot-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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
+ |_filter_snapshot# Need the dummy entry created so that we get the invalid removal when we rmdir
ls $SCRATCH_MNT/c/btests/btrfs/302 +0
-0@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick snapshot subvol-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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 accessiblefrom within the
# subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap | _filter_snapshot# 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).
Re: [PATCH 1/2] common/filter.btrfs: add a new _filter_snapshot
Quoted 23 lines · Qu Wenruo
Quoted 20 lines · Anand Jain
Quoted 17 lines · Qu Wenruo
Quoted 6 lines · Anand Jain
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
Signed-off-by Anand Jain <[email protected]>Can we stop the golden output filter game?
From day one I'm not a big fan of the golden output idea. For snapshot/subvolume creation, we don't really care about what the output is, we only care if there is any error (which would come from stderr).
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
In that case, why not just redirect the stdout to null?
To me, if we really care something from the stdout, we can still save it and let bash/awk/grep to process it, like what we did for various test cases, and then save the result to seqres.full.
That sums up what output filters do; I don't understand the objection here...
Quoted 11 lines
Quoted 5 lines
Quoted 1 line
This is a bug-fix patch; it's not a good idea to change the concept of fstests' golden output. Perhaps an RFC patch about your idea can help to discuss and achieve consensus.
Even as bug-fix, a simple redirect to seqres.full and remove the corresponding line from golden output is very valid to me.
In fact, introducing a filter looks very over-engineered in this particular case.
...but having said that , I also dislike overfixation on golden output. Patches welcome. ;)
--D
Quoted 168 lines
Quoted 167 lines
Thanks, Anand
Quoted 161 lines
Thanks,
QuQuoted 159 lines
---
common/filter.btrfs | 9 +++++++++tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for
+ # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit. +_filter_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} +# make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/152 +0
-0@@ -11,7 +11,7 @@
_begin_fstestauto quick metadata qgroup send# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/152 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshotfor 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_scratchtests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/168 +0
-0@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 rofalse
# 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 + | _filter_snapshot# 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 + | _filter_snapshot# Temporarily turn the second snapshot to read-write mode and then open a file
# descriptor on its foo file.tests/btrfs/202 +0
-0@@ -8,7 +8,7 @@. ./common/preamble
_begin_fstestauto quick subvol snapshot-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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
+ |_filter_snapshot# Need the dummy entry created so that we get the invalid removal when we rmdir
ls $SCRATCH_MNT/c/btests/btrfs/302 +0
-0@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick snapshot subvol-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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 accessiblefrom within the
# subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap | _filter_snapshot# 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).
Re: [PATCH 1/2] common/filter.btrfs: add a new _filter_snapshot
Quoted 24 lines · Darrick J. Wong
Quoted 23 lines · Qu Wenruo
Quoted 20 lines · Anand Jain
Quoted 17 lines · Qu Wenruo
Quoted 6 lines · Anand Jain
As the newer btrfs-progs have changed the output of the command "btrfs subvolume snapshot," which is part of the golden output, create a helper filter to ensure the test cases pass on older btrfs-progs.
Signed-off-by Anand Jain <[email protected]>Can we stop the golden output filter game?
From day one I'm not a big fan of the golden output idea.
For snapshot/subvolume creation, we don't really care about what the output is, we only care if there is any error (which would come from stderr).
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
In that case, why not just redirect the stdout to null?
To me, if we really care something from the stdout, we can still save it and let bash/awk/grep to process it, like what we did for various test cases, and then save the result to seqres.full.
That sums up what output filters do; I don't understand the objection here...
Well, I have seen quite some cases where we need to verify the speed of scrub to be inside a reasonable range.
In that case, I do not thing any simple filter is good enough.
And for a lot of cases, we just want to make sure the IO finishes, in that case simply redirect to seqres.full looks more reasonable other than call _xfs_io_filter.
But I guess this is to personal tastes.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
This is a bug-fix patch; it's not a good idea to change the concept of fstests' golden output. Perhaps an RFC patch about your idea can help to discuss and achieve consensus.
Quoted 8 lines
Quoted 5 lines
Even as bug-fix, a simple redirect to seqres.full and remove the corresponding line from golden output is very valid to me.
In fact, introducing a filter looks very over-engineered in this particular case.
...but having said that , I also dislike overfixation on golden output. Patches welcome. ;)
Sure, one simple patch for evaluation.
Thanks,
Qu
Quoted 172 lines
--D
Quoted 168 lines
Quoted 167 lines
Thanks, Anand
Quoted 161 lines
Thanks,
QuQuoted 159 lines
--- common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/152 | 6 +++--- tests/btrfs/168 | 6 +++--- tests/btrfs/202 | 4 ++-- tests/btrfs/302 | 4 ++-- 6 files changed, 21 insertions(+), 11 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for
+ # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit. +_filter_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} + # make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/152 +3
-3@@ -11,7 +11,7 @@ _begin_fstest auto quick metadata qgroup send # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshot 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_scratchtests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 rofalse
# 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 + | _filter_snapshot# 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 + | _filter_snapshot# Temporarily turn the second snapshot to read-write mode and then
open a file# descriptor on its foo file.tests/btrfs/202 +2
-2@@ -8,7 +8,7 @@ . ./common/preamble _begin_fstest auto quick subvol snapshot -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -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 + | _filter_snapshot # Need the dummy entry created so that we get the invalid removalwhen we rmdir
ls $SCRATCH_MNT/c/btests/btrfs/302 +1
-1@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick snapshot subvol -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -46,7 +46,7 @@ $FSSUM_PROG -A -f -w $fssum_file $SCRATCH_MNT/subvol # Now create a snapshot of the subvolume and make it accessiblefrom within the
# subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap | _filter_snapshot# 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).
PATCH 2/2 btrfs: create snapshot fix golden output
In reply to Anand JainBtrfs-progs commit 5f87b467a9e7 ("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.
--- tests/btrfs/001.out | 2 +- tests/btrfs/152.out | 4 ++-- tests/btrfs/168.out | 4 ++-- tests/btrfs/202.out | 2 +- tests/btrfs/300.out | 2 +- tests/btrfs/302.out | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
tests/btrfs/001.out +1 -1
@@ -3,7 +3,7 @@ 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' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot foo snap
tests/btrfs/152.out +2 -2
@@ -5,8 +5,8 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1' +Create readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1' At subvol 1 At subvol 1 At subvol 1
tests/btrfs/168.out +2 -2
@@ -1,9 +1,9 @@ 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' +Create 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' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 At subvol sv1 OK
tests/btrfs/202.out +1 -1
@@ -1,4 +1,4 @@ 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' +Create snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'
tests/btrfs/300.out +1 -1
@@ -1,7 +1,7 @@ QA output created by 300 Create subvolume './subvol' Create subvolume 'subvol/subsubvol' -Create a snapshot of 'subvol' in './snapshot' +Create 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.out +1 -1
@@ -1,4 +1,4 @@ QA output created by 302 Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' +Create readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' OK
Signature · 1 line
2.39.3
Quoted 3 lines · Anand Jain
Update test cases with the new golden output for the command btrfs subvolume snapshot, further introduce a helper
_filter_snapshot()to make it compatible with older btrfs-progs.
BTW, you're missing quite a lot of other test cases.
At least there should be around 20 test cases affected.
Quoted 19 lines
Anand Jain (2):
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden outputcommon/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/001.out | 2 +- tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 4 ++-- tests/btrfs/168 | 6 +++--- tests/btrfs/168.out | 4 ++-- tests/btrfs/202 | 4 ++-- tests/btrfs/202.out | 2 +- tests/btrfs/300.out | 2 +- tests/btrfs/302 | 4 ++-- tests/btrfs/302.out | 2 +- 12 files changed, 29 insertions(+), 19 deletions(-)
Quoted 10 lines · Qu Wenruo
Quoted 3 lines · Anand Jain
Update test cases with the new golden output for the command btrfs subvolume snapshot, further introduce a helper
_filter_snapshot()to make it compatible with older btrfs-progs.BTW, you're missing quite a lot of other test cases.
At least there should be around 20 test cases affected.
Fixed in v2.
Thanks, -Anand
Quoted 20 lines
Quoted 20 lines
Anand Jain (2):
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden outputcommon/filter.btrfs | 9 +++++++++
tests/btrfs/001 | 3 ++-
tests/btrfs/001.out | 2 +-
tests/btrfs/152 | 6 +++---
tests/btrfs/152.out | 4 ++--
tests/btrfs/168 | 6 +++---
tests/btrfs/168.out | 4 ++--
tests/btrfs/202 | 4 ++--
tests/btrfs/202.out | 2 +-
tests/btrfs/300.out | 2 +-
tests/btrfs/302 | 4 ++--
tests/btrfs/302.out | 2 +-12 files changed, 29 insertions(+), 19 deletions(-)
PATCH v2 1/1 common/filter.btrfs: introduce _filter_snapshot
In reply to Anand JainBtrfs-progs commit 5f87b467a9e7 ("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.
Create a helper filter to ensure the test cases pass on older btrfs-progs.
Another option is to remove the 'btrfs subvolume snapshot' command output from the golden output and redirect it to /dev/null, but this strays from the bug-fix objective.
---
v2: The missed testcases included now.
Merged following two patches in v1:
common/filter.btrfs: add a new _filter_snapshot
btrfs: create snapshot fix golden output
common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/001.out | 2 +- tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 4 ++-- tests/btrfs/168 | 6 +++--- tests/btrfs/168.out | 4 ++-- tests/btrfs/169 | 6 +++--- tests/btrfs/169.out | 4 ++-- tests/btrfs/170 | 4 ++-- tests/btrfs/170.out | 2 +- tests/btrfs/187 | 6 +++--- tests/btrfs/187.out | 4 ++-- tests/btrfs/188 | 8 ++++---- tests/btrfs/188.out | 4 ++-- tests/btrfs/189 | 4 ++-- tests/btrfs/189.out | 2 +- tests/btrfs/191 | 6 +++--- tests/btrfs/191.out | 4 ++-- tests/btrfs/200 | 6 +++--- tests/btrfs/200.out | 4 ++-- tests/btrfs/202 | 4 ++-- tests/btrfs/202.out | 2 +- tests/btrfs/203 | 6 +++--- tests/btrfs/203.out | 4 ++-- tests/btrfs/226 | 4 ++-- tests/btrfs/226.out | 2 +- tests/btrfs/276 | 2 +- tests/btrfs/276.out | 2 +- tests/btrfs/280 | 4 ++-- tests/btrfs/280.out | 2 +- tests/btrfs/281 | 4 ++-- tests/btrfs/281.out | 2 +- tests/btrfs/283 | 4 ++-- tests/btrfs/283.out | 2 +- tests/btrfs/287 | 4 ++-- tests/btrfs/287.out | 4 ++-- tests/btrfs/293 | 4 ++-- tests/btrfs/293.out | 4 ++-- tests/btrfs/300 | 2 +- tests/btrfs/300.out | 2 +- tests/btrfs/302 | 4 ++-- tests/btrfs/302.out | 2 +- tests/btrfs/314 | 2 +- tests/btrfs/314.out | 4 ++-- 45 files changed, 92 insertions(+), 82 deletions(-)
common/filter.btrfs +9 -0
@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume: output the + # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to + # work on older btrfs-progs without the above commit. + _filter_testdir_and_scratch | sed -e "s/Create a/Create/g" +} + # make sure this script returns success /bin/true
tests/btrfs/001 +2 -1
@@ -26,7 +26,8 @@ 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 | \ + _filter_snapshot echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"
tests/btrfs/001.out +1 -1
@@ -3,7 +3,7 @@ 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' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot foo snap
tests/btrfs/152 +3 -3
@@ -11,7 +11,7 @@ _begin_fstest auto quick metadata qgroup send # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshot 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
tests/btrfs/152.out +2 -2
@@ -5,8 +5,8 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1' +Create readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1' At subvol 1 At subvol 1 At subvol 1
tests/btrfs/168 +3 -3
@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -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 + | _filter_snapshot # 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 + | _filter_snapshot # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.
tests/btrfs/168.out +2 -2
@@ -1,9 +1,9 @@ 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' +Create 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' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 At subvol sv1 OK
tests/btrfs/169 +3 -3
@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -44,7 +44,7 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \ $SCRATCH_MNT/foobar | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \ - | _filter_scratch + | _filter_snapshot $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 + | _filter_snapshot $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 +2 -2
@@ -1,9 +1,9 @@ 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' +Create 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' +Create 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 +2 -2
@@ -12,7 +12,7 @@ _begin_fstest auto quick snapshot prealloc # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -46,7 +46,7 @@ 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 + | _filter_snapshot # Cleanly unmount the filesystem. _scratch_unmount
tests/btrfs/170.out +1 -1
@@ -3,6 +3,6 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File digest after mounting the filesystem again: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobar
tests/btrfs/187 +3 -3
@@ -17,7 +17,7 @@ _begin_fstest auto send dedupe clone balance # Import common functions. . ./common/attr -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here
@@ -152,7 +152,7 @@ done wait ${create_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + | _filter_snapshot # 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 + | _filter_snapshot full_send_loop 5 & full_send_pid=$!
tests/btrfs/187.out +2 -2
@@ -1,3 +1,3 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'
tests/btrfs/188 +4 -4
@@ -21,7 +21,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs
@@ -45,16 +45,16 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch + | _filter_snapshot # Now punch a hole that drops all the extents within the file's size. $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 + | _filter_snapshot $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 +2 -2
@@ -1,9 +1,9 @@ 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' +Create 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' +Create 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 +2 -2
@@ -23,7 +23,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here
@@ -46,7 +46,7 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
tests/btrfs/189.out +1 -1
@@ -7,7 +7,7 @@ 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' +Create 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)
tests/btrfs/191 +3 -3
@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here
@@ -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 + | _filter_snapshot $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 + | _filter_snapshot # Now before creating the incremental send stream: #
tests/btrfs/191.out +2 -2
@@ -3,11 +3,11 @@ 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' +Create 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' +Create 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 +3 -3
@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch
@@ -52,7 +52,7 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -64,7 +64,7 @@ $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 + | _filter_snapshot $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 +2 -2
@@ -5,11 +5,11 @@ 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' +Create 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incr
tests/btrfs/202 +2 -2
@@ -8,7 +8,7 @@ . ./common/preamble _begin_fstest auto quick subvol snapshot -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch
@@ -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 + | _filter_snapshot # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/b
tests/btrfs/202.out +1 -1
@@ -1,4 +1,4 @@ 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' +Create snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'
tests/btrfs/203 +3 -3
@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here
@@ -44,7 +44,7 @@ _scratch_mount $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch
@@ -70,7 +70,7 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \ $SCRATCH_MNT/foobar | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch + | _filter_snapshot $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 +2 -2
@@ -1,7 +1,7 @@ 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' +Create 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 +15,7 @@ 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' +Create 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 +2 -2
@@ -11,7 +11,7 @@ _begin_fstest auto quick rw snapshot clone prealloc punch # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here
@@ -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 + | _filter_snapshot # Write into the range of the first extent so that that range no longer has a # shared extent.
tests/btrfs/226.out +1 -1
@@ -13,7 +13,7 @@ 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' +Create 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 | _filter_snapshot # 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 +1 -1
@@ -1,6 +1,6 @@ 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' +Create 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 -2
@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick compress snapshot fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/punch # for _filter_fiemap_flags _supported_fs btrfs
@@ -37,7 +37,7 @@ _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 | _filter_snapshot echo echo "File foo fiemap before COWing extent:"
tests/btrfs/280.out +1 -1
@@ -1,7 +1,7 @@ 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' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File foo fiemap before COWing extent:
tests/btrfs/281 +2 -2
@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick send compress clone fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch # for _filter_fiemap_flags
@@ -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 + | _filter_snapshot $BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \ | _filter_scratch
tests/btrfs/281.out +1 -1
@@ -6,7 +6,7 @@ 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' +Create 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 +2 -2
@@ -11,7 +11,7 @@ . ./common/preamble _begin_fstest auto quick send clone fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch # for _filter_fiemap_flags
@@ -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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 | _filter_scratch
tests/btrfs/283.out +1 -1
@@ -4,7 +4,7 @@ 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' +Create 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 + | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + | _filter_snapshot snap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)
tests/btrfs/287.out +2 -2
@@ -41,8 +41,8 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create 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 +2 -2
@@ -32,9 +32,9 @@ 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 | _filter_snapshot 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 | _filter_snapshot echo "Activating swap file... (should fail due to snapshots)" _swapon_file $swap_file 2>&1 | _filter_scratch
tests/btrfs/293.out +2 -2
@@ -1,8 +1,8 @@ QA output created by 293 Creating first snapshot... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Creating second snapshot... -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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 | sed -e 's/Create a/Create/g'; " find $test_dir/. -printf "%M %u %g ./%P\n"
tests/btrfs/300.out +1 -1
@@ -1,7 +1,7 @@ QA output created by 300 Create subvolume './subvol' Create subvolume 'subvol/subsubvol' -Create a snapshot of 'subvol' in './snapshot' +Create 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 +2 -2
@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick snapshot subvol -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch
@@ -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 | _filter_snapshot # 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 +1 -1
@@ -1,4 +1,4 @@ QA output created by 302 Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' +Create 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 + _filter_snapshot echo Send ${src} | _filter_testdir_and_scratch $BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \
tests/btrfs/314.out +2 -2
@@ -3,7 +3,7 @@ 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' +Create 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 +14,7 @@ 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' +Create 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.41.0
Re: [PATCH v2] common/filter.btrfs: introduce _filter_snapshot
Quoted 10 lines · Anand Jain
Btrfs-progs commit
5f87b467a9e7("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.Create a helper filter to ensure the test cases pass on older btrfs-progs.
Another option is to remove the 'btrfs subvolume snapshot' command output from the golden output and redirect it to
/dev/null, but this strays from the bug-fix objective.
Quoted 6 lines
Signed-off-by Anand Jain <[email protected]>---
v2: The missed testcases included now.
Merged following two patches in v1:
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden output
I think retaining the golden output makes sense for this.
Re: [PATCH v2] common/filter.btrfs: introduce _filter_snapshot
In reply to Anand JainQuoted 10 lines · Anand Jain
Btrfs-progs commit
5f87b467a9e7("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.Create a helper filter to ensure the test cases pass on older btrfs-progs.
Another option is to remove the 'btrfs subvolume snapshot' command output from the golden output and redirect it to
/dev/null, but this strays from the bug-fix objective.
Quoted 6 lines
Signed-off-by Anand Jain <[email protected]>---
v2: The missed testcases included now.
Merged following two patches in v1:
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden output
Still I do not think this is correct way to go.
3 points for my objection:
- Most test cases are already doing the redirection for "btrfs subvolume" command group
Check my patch's commit message, overall the touched ones are less than 25% of all the "btrfs subvolume snapshot" calls.
- Missing handling for "btrfs subvolume delete"
Sure you can add new filters, but I do not think it's worthy just a new filter.
- How to enforce the filters for the future test cases?
Good luck if you're really pushing everyone to use the new filter. On the other hand, it's pretty instintive to just redirect the output.
Quoted 890 lines
common/filter.btrfs | 9 +++++++++ tests/btrfs/001 | 3 ++- tests/btrfs/001.out | 2 +- tests/btrfs/152 | 6 +++--- tests/btrfs/152.out | 4 ++-- tests/btrfs/168 | 6 +++--- tests/btrfs/168.out | 4 ++-- tests/btrfs/169 | 6 +++--- tests/btrfs/169.out | 4 ++-- tests/btrfs/170 | 4 ++-- tests/btrfs/170.out | 2 +- tests/btrfs/187 | 6 +++--- tests/btrfs/187.out | 4 ++-- tests/btrfs/188 | 8 ++++---- tests/btrfs/188.out | 4 ++-- tests/btrfs/189 | 4 ++-- tests/btrfs/189.out | 2 +- tests/btrfs/191 | 6 +++--- tests/btrfs/191.out | 4 ++-- tests/btrfs/200 | 6 +++--- tests/btrfs/200.out | 4 ++-- tests/btrfs/202 | 4 ++-- tests/btrfs/202.out | 2 +- tests/btrfs/203 | 6 +++--- tests/btrfs/203.out | 4 ++-- tests/btrfs/226 | 4 ++-- tests/btrfs/226.out | 2 +- tests/btrfs/276 | 2 +- tests/btrfs/276.out | 2 +- tests/btrfs/280 | 4 ++-- tests/btrfs/280.out | 2 +- tests/btrfs/281 | 4 ++-- tests/btrfs/281.out | 2 +- tests/btrfs/283 | 4 ++-- tests/btrfs/283.out | 2 +- tests/btrfs/287 | 4 ++-- tests/btrfs/287.out | 4 ++-- tests/btrfs/293 | 4 ++-- tests/btrfs/293.out | 4 ++-- tests/btrfs/300 | 2 +- tests/btrfs/300.out | 2 +- tests/btrfs/302 | 4 ++-- tests/btrfs/302.out | 2 +- tests/btrfs/314 | 2 +- tests/btrfs/314.out | 4 ++-- 45 files changed, 92 insertions(+), 82 deletions(-)common/filter.btrfs +9
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume: output the + # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to + # work on older btrfs-progs without the above commit. + _filter_testdir_and_scratch | sed -e "s/Create a/Create/g" +} + # make sure this script returns success /bin/truetests/btrfs/001 +2
-1@@ -26,7 +26,8 @@ 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 | \ + _filter_snapshot echo "List root dir after snapshot" ls $SCRATCH_MNT echo "List snapshot dir"tests/btrfs/001.out +1
-1@@ -3,7 +3,7 @@ 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' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' List root dir after snapshot foo snaptests/btrfs/152 +3
-3@@ -11,7 +11,7 @@ _begin_fstest auto quick metadata qgroup send # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshot 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_scratchtests/btrfs/152.out +2
-2@@ -5,8 +5,8 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1' +Create readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1' At subvol 1 At subvol 1 At subvol 1tests/btrfs/168 +3
-3@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -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 + | _filter_snapshot # 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 + | _filter_snapshot # Temporarily turn the second snapshot to read-write mode and then open a file # descriptor on its foo file.tests/btrfs/168.out +2
-2@@ -1,9 +1,9 @@ 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' +Create 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' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' At subvol SCRATCH_MNT/snap2 At subvol sv1 OKtests/btrfs/169 +3
-3@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -44,7 +44,7 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \ $SCRATCH_MNT/foobar | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \ - | _filter_scratch + | _filter_snapshot $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/snap1 -f $send_files_dir/2.snap \ $SCRATCH_MNT/snap2 2>&1 | _filter_scratchtests/btrfs/169.out +2
-2@@ -1,9 +1,9 @@ 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' +Create 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' +Create 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 +2
-2@@ -12,7 +12,7 @@ _begin_fstest auto quick snapshot prealloc # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -46,7 +46,7 @@ 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 + | _filter_snapshot # Cleanly unmount the filesystem. _scratch_unmounttests/btrfs/170.out +1
-1@@ -3,6 +3,6 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File digest after mounting the filesystem again: 85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobartests/btrfs/187 +3
-3@@ -17,7 +17,7 @@ _begin_fstest auto send dedupe clone balance # Import common functions. . ./common/attr -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here@@ -152,7 +152,7 @@ done wait ${create_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + | _filter_snapshot # 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 + | _filter_snapshot full_send_loop 5 & full_send_pid=$!tests/btrfs/187.out +2
-2@@ -1,3 +1,3 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'tests/btrfs/188 +4
-4@@ -21,7 +21,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here _supported_fs btrfs@@ -45,16 +45,16 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ - | _filter_scratch + | _filter_snapshot # Now punch a hole that drops all the extents within the file's size. $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/188.out +2
-2@@ -1,9 +1,9 @@ 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' +Create 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' +Create 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 +2
-2@@ -23,7 +23,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here@@ -46,7 +46,7 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratchtests/btrfs/189.out +1
-1@@ -7,7 +7,7 @@ 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' +Create 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)tests/btrfs/191 +3
-3@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here@@ -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 + | _filter_snapshot $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 + | _filter_snapshot # Now before creating the incremental send stream: #tests/btrfs/191.out +2
-2@@ -3,11 +3,11 @@ 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' +Create 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' +Create 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 +3
-3@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch@@ -52,7 +52,7 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -64,7 +64,7 @@ $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/200.out +2
-2@@ -5,11 +5,11 @@ 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' +Create 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr At subvol base At snapshot incrtests/btrfs/202 +2
-2@@ -8,7 +8,7 @@ . ./common/preamble _begin_fstest auto quick subvol snapshot -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -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 + | _filter_snapshot # Need the dummy entry created so that we get the invalid removal when we rmdir ls $SCRATCH_MNT/c/btests/btrfs/202.out +1
-1@@ -1,4 +1,4 @@ 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' +Create snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'tests/btrfs/203 +3
-3@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here@@ -44,7 +44,7 @@ _scratch_mount $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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \ | _filter_scratch@@ -70,7 +70,7 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \ $SCRATCH_MNT/foobar | _filter_xfs_io $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \ - | _filter_scratch + | _filter_snapshot $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base -f $send_files_dir/2.snap \ $SCRATCH_MNT/incr 2>&1 | _filter_scratchtests/btrfs/203.out +2
-2@@ -1,7 +1,7 @@ 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' +Create 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 +15,7 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' At subvol SCRATCH_MNT/incr File foobar digest in the original filesystem: 2b76b23b62fdbbbcae1ee37eec84fd7dtests/btrfs/226 +2
-2@@ -11,7 +11,7 @@ _begin_fstest auto quick rw snapshot clone prealloc punch # Import common functions. -. ./common/filter +. ./common/filter.btrfs . ./common/reflink # real QA test starts here@@ -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 + | _filter_snapshot # Write into the range of the first extent so that that range no longer has a # shared extent.tests/btrfs/226.out +1
-1@@ -13,7 +13,7 @@ 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' +Create 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 | _filter_snapshot # 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 +1
-1@@ -1,6 +1,6 @@ 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' +Create 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
-2@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick compress snapshot fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/punch # for _filter_fiemap_flags _supported_fs btrfs@@ -37,7 +37,7 @@ _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 | _filter_snapshot echo echo "File foo fiemap before COWing extent:"tests/btrfs/280.out +1
-1@@ -1,7 +1,7 @@ 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' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' File foo fiemap before COWing extent:tests/btrfs/281 +2
-2@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick send compress clone fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch # for _filter_fiemap_flags@@ -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 + | _filter_snapshot $BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \ | _filter_scratchtests/btrfs/281.out +1
-1@@ -6,7 +6,7 @@ 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' +Create 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 +2
-2@@ -11,7 +11,7 @@ . ./common/preamble _begin_fstest auto quick send clone fiemap -. ./common/filter +. ./common/filter.btrfs . ./common/reflink . ./common/punch # for _filter_fiemap_flags@@ -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 + | _filter_snapshot $BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 | _filter_scratchtests/btrfs/283.out +1
-1@@ -4,7 +4,7 @@ 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' +Create 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 + | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + | _filter_snapshot snap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)tests/btrfs/287.out +2
-2@@ -41,8 +41,8 @@ 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' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' resolve first extent: inode 257 offset 16777216 snap2 inode 257 offset 8388608 snap2tests/btrfs/293 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot 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 | _filter_snapshot echo "Activating swap file... (should fail due to snapshots)" _swapon_file $swap_file 2>&1 | _filter_scratchtests/btrfs/293.out +2
-2@@ -1,8 +1,8 @@ QA output created by 293 Creating first snapshot... -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' Creating second snapshot... -Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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 | sed -e 's/Create a/Create/g'; " find $test_dir/. -printf "%M %u %g ./%P\n"tests/btrfs/300.out +1
-1@@ -1,7 +1,7 @@ QA output created by 300 Create subvolume './subvol' Create subvolume 'subvol/subsubvol' -Create a snapshot of 'subvol' in './snapshot' +Create 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 +2
-2@@ -15,7 +15,7 @@ . ./common/preamble _begin_fstest auto quick snapshot subvol -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _require_scratch@@ -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 | _filter_snapshot # 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 +1
-1@@ -1,4 +1,4 @@ QA output created by 302 Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap' +Create 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 + _filter_snapshot echo Send ${src} | _filter_testdir_and_scratch $BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \tests/btrfs/314.out +2
-2@@ -3,7 +3,7 @@ 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' +Create 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 +14,7 @@ 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' +Create 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
Re: [PATCH v2] common/filter.btrfs: introduce _filter_snapshot
Quoted 20 lines · Qu Wenruo
Quoted 10 lines · Anand Jain
Btrfs-progs commit
5f87b467a9e7("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.Create a helper filter to ensure the test cases pass on older btrfs-progs.
Another option is to remove the 'btrfs subvolume snapshot' command output from the golden output and redirect it to
/dev/null, but this strays from the bug-fix objective.Quoted 6 lines
Signed-off-by Anand Jain <[email protected]>---
v2: The missed testcases included now. Merged following two patches in v1:
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden output
Quoted 9 lines
Still I do not think this is correct way to go.
3 points for my objection:
- Most test cases are already doing the redirection for "btrfs subvolume" command group
Check my patch's commit message, overall the touched ones are less than 25% of all the "btrfs subvolume snapshot" calls.
I observed that. However, as I mentioned in the change log, the objective of this patch is to make test cases work with both the older and newer versions of btrfs-progs only. So, not a good idea to remove the golden output completely.
Quoted 2 lines
- Missing handling for "btrfs subvolume delete"
Sure you can add new filters, but I do not think it's worthy just a > new filter.
Sorry, but test cases using 'btrfs subvolume delete' (without redirection) aren't failing. Also, there is no change in the output of 'btrfs subvolume delete'.
Or perhaps I didn't understand what you meant.
Quoted 4 lines
- How to enforce the filters for the future test cases?
Good luck if you're really pushing everyone to use the new filter. On the other hand, it's pretty instintive to just redirect the output.
Unfortunately, that has been the core fundamental design in fstests, and I don't intend to change it in a patch meant to fix a bug.
It seems that we need to maintain the golden output fundamentals until we find a better alternative or one that is reasonable enough to not verify the output on a per-command basis, which I believe is your point of view. I understand that. Also, commented, we could use '_run_btrfs_util_prog subvolume xxx'. This would mean no golden output. But as I mentioned, let's not address that objective within this bug fix.
Thanks, -Anand
Quoted 924 lines
Quoted 924 lines
common/filter.btrfs | 9 +++++++++
tests/btrfs/001 | 3 ++-
tests/btrfs/001.out | 2 +-
tests/btrfs/152 | 6 +++---
tests/btrfs/152.out | 4 ++--
tests/btrfs/168 | 6 +++---
tests/btrfs/168.out | 4 ++--
tests/btrfs/169 | 6 +++---
tests/btrfs/169.out | 4 ++--
tests/btrfs/170 | 4 ++--
tests/btrfs/170.out | 2 +-
tests/btrfs/187 | 6 +++---
tests/btrfs/187.out | 4 ++--
tests/btrfs/188 | 8 ++++----
tests/btrfs/188.out | 4 ++--
tests/btrfs/189 | 4 ++--
tests/btrfs/189.out | 2 +-
tests/btrfs/191 | 6 +++---
tests/btrfs/191.out | 4 ++--
tests/btrfs/200 | 6 +++---
tests/btrfs/200.out | 4 ++--
tests/btrfs/202 | 4 ++--
tests/btrfs/202.out | 2 +-
tests/btrfs/203 | 6 +++---
tests/btrfs/203.out | 4 ++--
tests/btrfs/226 | 4 ++--
tests/btrfs/226.out | 2 +-
tests/btrfs/276 | 2 +-
tests/btrfs/276.out | 2 +-
tests/btrfs/280 | 4 ++--
tests/btrfs/280.out | 2 +-
tests/btrfs/281 | 4 ++--
tests/btrfs/281.out | 2 +-
tests/btrfs/283 | 4 ++--
tests/btrfs/283.out | 2 +-
tests/btrfs/287 | 4 ++--
tests/btrfs/287.out | 4 ++--
tests/btrfs/293 | 4 ++--
tests/btrfs/293.out | 4 ++--
tests/btrfs/300 | 2 +-
tests/btrfs/300.out | 2 +-
tests/btrfs/302 | 4 ++--
tests/btrfs/302.out | 2 +-
tests/btrfs/314 | 2 +-
tests/btrfs/314.out | 4 ++--45 files changed, 92 insertions(+), 82 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for + # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit.
+_filter_testdir_and_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} +# make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/001.out +0
-0@@ -3,7 +3,7 @@ Creating file foo in root dirList root dir
foo
Creating snapshot of root dirtests/btrfs/001.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'List root dir after snapshot
foo
snaptests/btrfs/152 +0
-0@@ -11,7 +11,7 @@
_begin_fstestauto quick metadata qgroup send# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/152 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshotfor 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_scratchtests/btrfs/152.out +0
-0@@ -5,8 +5,8 @@ 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'
+Create readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1'
+Create readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1'
At subvol 1
At subvol 1
At subvol 1tests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/168 +1
-1@@ -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 + | _filter_snapshot # First do a full send of this snapshot.$FSSUM_PROG -A -f -w $send_files_dir/snap1.fssum $SCRATCH_MNT/snap1
tests/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 + | _filter_snapshot# 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,9 @@QA output created by 168
Create subvolume 'SCRATCH_MNT/sv1'
At subvol SCRATCH_MNT/sv1tests/btrfs/168.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1'At subvol SCRATCH_MNT/snap1
tests/btrfs/168.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2'At subvol SCRATCH_MNT/snap2
At subvol sv1
OKtests/btrfs/169 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/169 +0
-0@@ -44,7 +44,7 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \$SCRATCH_MNT/foobar |
_filter_xfs_io$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \
- |_filter_scratch
+ |_filter_snapshot
$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
+ |_filter_snapshot
$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,9 @@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)tests/btrfs/169.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'At subvol SCRATCH_MNT/snap1
tests/btrfs/169.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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@@ -12,7 +12,7 @@
_begin_fstestauto quick snapshot prealloc# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/170 +1
-1@@ -46,7 +46,7 @@ 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 + | _filter_snapshot # Cleanly unmount the filesystem.
_scratch_unmounttests/btrfs/170.out +0
-0@@ -3,6 +3,6 @@ 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/foobartests/btrfs/170.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'File digest after mounting the filesystem again:
85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobartests/btrfs/187 +0
-0@@ -17,7 +17,7 @@ _begin_fstest auto send dedupe clone balance # Import common functions.. ./common/attr
-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink# real QA test starts heretests/btrfs/187 +2
-2@@ -152,7 +152,7 @@ done wait ${create_pids[@]} $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 \ - | _filter_scratch + | _filter_snapshot # 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 + | _filter_snapshot
full_send_loop5 &
full_send_pid=$!tests/btrfs/187.out +0
-0@@ -1,3 +1,3 @@QA output created by 187
tests/btrfs/187.out +2
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'tests/btrfs/188 +1
-1@@ -21,7 +21,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/188 +0
-0@@ -45,16 +45,16 @@ $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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+ |_filter_snapshot# Now punch a hole that drops all the extents within the file's size. $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
+ |_filter_snapshot$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,9 @@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)tests/btrfs/188.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base'At subvol SCRATCH_MNT/base
tests/btrfs/188.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create 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 +1
-1@@ -23,7 +23,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/btrfs/189 +0
-0@@ -46,7 +46,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0x4d 0 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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/189.out +0
-0@@ -7,7 +7,7 @@ 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)tests/btrfs/189.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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)tests/btrfs/191 +1
-1@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/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
+ |_filter_snapshot$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 + | _filter_snapshot# Now before creating the incremental send stream:
#tests/btrfs/191.out +0
-0@@ -3,11 +3,11 @@ 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)tests/btrfs/191.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1' +Create 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)tests/btrfs/191.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2' +Create 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 +1
-1@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
. ./common/punchtests/btrfs/200 +0
-0@@ -52,7 +52,7 @@ $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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/200 +0
-0@@ -64,7 +64,7 @@ $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
+ |_filter_snapshot$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,11 @@ 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)tests/btrfs/200.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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)tests/btrfs/200.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr'At subvol SCRATCH_MNT/incr
At subvol base
At snapshot incrtests/btrfs/202 +0
-0@@ -8,7 +8,7 @@. ./common/preamble
_begin_fstestauto quick subvol snapshot-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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
+ |_filter_snapshot# 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
-0@@ -1,4 +1,4 @@QA output created by 202
Create subvolume 'SCRATCH_MNT/a'
Create subvolume 'SCRATCH_MNT/a/b'tests/btrfs/202.out +1
-1-Create a snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c' +Create snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'tests/btrfs/203 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/btrfs/203 +0
-0@@ -44,7 +44,7 @@ _scratch_mount$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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/203 +0
-0@@ -70,7 +70,7 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \$SCRATCH_MNT/foobar |
_filter_xfs_io$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+ |_filter_snapshot$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,7 @@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)tests/btrfs/203.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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 +15,7 @@ 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)tests/btrfs/203.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create 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@@ -11,7 +11,7 @@
_begin_fstestauto quick rw snapshot clone prealloc punch# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink# real QA test starts heretests/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
+ |_filter_snapshot# 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,7 @@ 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)tests/btrfs/226.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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 |_filter_snapshot# 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,6 @@QA output created by 276
Number of non-shared extents in the whole file: 2000tests/btrfs/276.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick compress snapshot fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/punch # for_filter_fiemap_flags
_supported_fsbtrfstests/btrfs/280 +0
-0@@ -37,7 +37,7 @@ _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 |_filter_snapshotecho
echo "File foo fiemap before COWing extent:"tests/btrfs/280.out +0
-0@@ -1,7 +1,7 @@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)tests/btrfs/280.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'File foo fiemap before COWing extent:
tests/btrfs/281 +0
-0@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick send compress clone fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink
. ./common/punch # for_filter_fiemap_flagstests/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
+ |_filter_snapshot
$BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \
|_filter_scratchtests/btrfs/281.out +0
-0@@ -6,7 +6,7 @@ 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...tests/btrfs/281.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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@@ -11,7 +11,7 @@. ./common/preamble
_begin_fstestauto quick send clone fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink
. ./common/punch # for_filter_fiemap_flagstests/btrfs/283 +0
-0@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "pwrite -S 0xcd -b 64K 64K 64K"$SCRATCH_MNT/foo |
_filter_xfs_iecho "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \
- |_filter_scratch
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 |
_filter_scratchtests/btrfs/283.out +0
-0@@ -4,7 +4,7 @@ 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...tests/btrfs/283.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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 + | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ - | _filter_scratch + | _filter_snapshot 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,8 @@ 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 +2
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create 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,9 @@ swap_file="$SCRATCH_MNT/swapfile"
_format_swapfile$swap_file $(($(_get_page_size) * 64)) >> $seqres.fullecho "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 |_filter_snapshot
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 |_filter_snapshotecho "Activating swap file... (should fail due to snapshots)"
_swapon_file$swap_file 2>&1 |_filter_scratchtests/btrfs/293.out +0
-0@@ -1,8 +1,8 @@QA output created by 293
Creating first snapshot...tests/btrfs/293.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'Creating second snapshot...
tests/btrfs/293.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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 | sed -e 's/Create a/Create/g';"
find $test_dir/. -printf "%M %u %g ./%P\n"
tests/btrfs/300.out +0
-0@@ -1,7 +1,7 @@QA output created by 300
Create subvolume './subvol'
Create subvolume 'subvol/subsubvol'tests/btrfs/300.out +1
-1-Create a snapshot of 'subvol' in './snapshot' +Create 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@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick snapshot subvol-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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 | _filter_snapshot # 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,4 @@QA output created by 302
Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap'
+Create 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
+_filter_snapshotecho 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,7 @@ 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)tests/btrfs/314.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'Send
SCRATCH_MNT
At subvol SCRATCH_MNT/snap1
Receive TEST_DIR/314/tempfsid_mnttests/btrfs/314.out +0
-0@@ -14,7 +14,7 @@ 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'
+Create 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
Re: [PATCH v2] common/filter.btrfs: introduce _filter_snapshot
Quoted 36 lines · Anand Jain
Quoted 23 lines · Qu Wenruo
Quoted 13 lines · Anand Jain
Btrfs-progs commit
5f87b467a9e7("subvolume: output the prompt line only when the ioctl succeeded") changed the output for snapshot command, updating the golden outputs.Create a helper filter to ensure the test cases pass on older btrfs-progs.
Another option is to remove the 'btrfs subvolume snapshot' command output
from the golden output and redirect it to/dev/null, but this strays from
the bug-fix objective.Quoted 6 lines
Signed-off-by Anand Jain <[email protected]>---
v2: The missed testcases included now. Merged following two patches in v1:
common/filter.btrfs: add a new_filter_snapshot
btrfs: create snapshot fix golden outputQuoted 9 lines
Still I do not think this is correct way to go.
3 points for my objection:
- Most test cases are already doing the redirection for "btrfs subvolume" command group
Check my patch's commit message, overall the touched ones are less than 25% of all the "btrfs subvolume snapshot" calls.
Quoted 4 lines
I observed that. However, as I mentioned in the change log, the objective of this patch is to make test cases work with both the older and newer versions of btrfs-progs only. So, not a good idea to remove the golden output completely.
So you're saying it's a good idea to maintain something that would soon be utilized by new test case?
Quoted 7 lines
Quoted 4 lines
- Missing handling for "btrfs subvolume delete"
Sure you can add new filters, but I do not think it's worthy just aQuoted 1 line
new filter.
Sorry, but test cases using 'btrfs subvolume delete' (without redirection) aren't failing.
My bad, my fstest is not uptodate, the latest for-next has another filter you introduced to filter the "subvolume delete" output change.
But good luck keeping add new filters just for those trival changes.
Quoted 9 lines
Quoted 5 lines
- How to enforce the filters for the future test cases?
Good luck if you're really pushing everyone to use the new filter. On the other hand, it's pretty instintive to just redirect the output.Unfortunately, that has been the core fundamental design in fstests, and I don't intend to change it in a patch meant to fix a bug.
Quoted 7 lines
It seems that we need to maintain the golden output fundamentals until we find a better alternative or one that is reasonable enough to not verify the output on a per-command basis, which I believe is your point of view. I understand that. Also, commented, we could use '
_run_btrfs_util_progsubvolume xxx'. This would mean no golden output. But as I mentioned, let's not address that objective within this bug fix.
Firstly, the remaining 25% is already the minority. 75% is already doing the redirection instead.
I see no point arguing whether it's the fstest policy, as majority of our tests are not following already.
Secondly, unlike xfs_io which can sometimes report short read/writes and need to be caught, "btrfs subvolume" output (except "subvolume list") really are informative output, no complexity like "xfs_io".
If you really want to blindly following some policy without thinking if it really fits the situation, then good luck.
Quoted 976 lines
Thanks, -Anand
Quoted 973 lines
Quoted 973 lines
common/filter.btrfs | 9 +++++++++
tests/btrfs/001 | 3 ++-
tests/btrfs/001.out | 2 +-
tests/btrfs/152 | 6 +++---
tests/btrfs/152.out | 4 ++--
tests/btrfs/168 | 6 +++---
tests/btrfs/168.out | 4 ++--
tests/btrfs/169 | 6 +++---
tests/btrfs/169.out | 4 ++--
tests/btrfs/170 | 4 ++--
tests/btrfs/170.out | 2 +-
tests/btrfs/187 | 6 +++---
tests/btrfs/187.out | 4 ++--
tests/btrfs/188 | 8 ++++----
tests/btrfs/188.out | 4 ++--
tests/btrfs/189 | 4 ++--
tests/btrfs/189.out | 2 +-
tests/btrfs/191 | 6 +++---
tests/btrfs/191.out | 4 ++--
tests/btrfs/200 | 6 +++---
tests/btrfs/200.out | 4 ++--
tests/btrfs/202 | 4 ++--
tests/btrfs/202.out | 2 +-
tests/btrfs/203 | 6 +++---
tests/btrfs/203.out | 4 ++--
tests/btrfs/226 | 4 ++--
tests/btrfs/226.out | 2 +-
tests/btrfs/276 | 2 +-
tests/btrfs/276.out | 2 +-
tests/btrfs/280 | 4 ++--
tests/btrfs/280.out | 2 +-
tests/btrfs/281 | 4 ++--
tests/btrfs/281.out | 2 +-
tests/btrfs/283 | 4 ++--
tests/btrfs/283.out | 2 +-
tests/btrfs/287 | 4 ++--
tests/btrfs/287.out | 4 ++--
tests/btrfs/293 | 4 ++--
tests/btrfs/293.out | 4 ++--
tests/btrfs/300 | 2 +-
tests/btrfs/300.out | 2 +-
tests/btrfs/302 | 4 ++--
tests/btrfs/302.out | 2 +-
tests/btrfs/314 | 2 +-
tests/btrfs/314.out | 4 ++--45 files changed, 92 insertions(+), 82 deletions(-)common/filter.btrfs +3
-0@@ -156,5 +156,14 @@ _filter_device_add() } +_filter_snapshot() +{ + # btrfs-progs commit 5f87b467a9e7 ("btrfs-progs: subvolume:output the
+ # prompt line only when the ioctl succeeded") changed the output for
+ # btrfs subvolume snapshot, ensure that the latest fstests continue to
+ # work on older btrfs-progs without the above commit. +_filter_testdir_and_scratch| sed -e "s/Create a/Create/g"common/filter.btrfs +2
-0+} +# make sure this script returns success /bin/truetests/btrfs/001 +0
-0@@ -26,7 +26,8 @@ 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 | \
+_filter_snapshot
echo "List root dir after snapshot"
ls $SCRATCH_MNT
echo "List snapshot dir"tests/btrfs/001.out +0
-0@@ -3,7 +3,7 @@ Creating file foo in root dirList root dir
foo
Creating snapshot of root dirtests/btrfs/001.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'List root dir after snapshot
foo
snaptests/btrfs/152 +0
-0@@ -11,7 +11,7 @@
_begin_fstestauto quick metadata qgroup send# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/152 +2
-2@@ -32,9 +32,9 @@ 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 | _filter_snapshot $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol2 \ - $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_scratch + $SCRATCH_MNT/subvol2/.snapshots/1 | _filter_snapshotfor 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_scratchtests/btrfs/152.out +0
-0@@ -5,8 +5,8 @@ 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'
+Create readonly snapshot of 'SCRATCH_MNT/subvol1' in 'SCRATCH_MNT/subvol1/.snapshots/1'
+Create readonly snapshot of 'SCRATCH_MNT/subvol2' in 'SCRATCH_MNT/subvol2/.snapshots/1'
At subvol 1
At subvol 1
At subvol 1tests/btrfs/168 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/168 +0
-0@@ -74,7 +74,7 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 rofalse
# 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 + | _filter_snapshot# 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 + | _filter_snapshot# 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,9 @@QA output created by 168
Create subvolume 'SCRATCH_MNT/sv1'
At subvol SCRATCH_MNT/sv1tests/btrfs/168.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap1'At subvol SCRATCH_MNT/snap1
tests/btrfs/168.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT/sv1' in 'SCRATCH_MNT/snap2'At subvol SCRATCH_MNT/snap2
At subvol sv1
OKtests/btrfs/169 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/169 +0
-0@@ -44,7 +44,7 @@ $XFS_IO_PROG -f -c "falloc -k 0 4M" \$SCRATCH_MNT/foobar |
_filter_xfs_io$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 2>&1 \
- |_filter_scratch
+ |_filter_snapshot$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
+ |_filter_snapshot$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,9 @@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)tests/btrfs/169.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'At subvol SCRATCH_MNT/snap1
tests/btrfs/169.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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@@ -12,7 +12,7 @@
_begin_fstestauto quick snapshot prealloc# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs# real QA test starts here _supported_fs btrfstests/btrfs/170 +0
-0@@ -46,7 +46,7 @@ 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
+ |_filter_snapshot# Cleanly unmount the filesystem.
_scratch_unmounttests/btrfs/170.out +0
-0@@ -3,6 +3,6 @@ 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/foobartests/btrfs/170.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'File digest after mounting the filesystem again:
85054e9e74bc3ae186d693890106b71f SCRATCH_MNT/foobartests/btrfs/187 +0
-0@@ -17,7 +17,7 @@ _begin_fstest auto send dedupe clone balance # Import common functions.. ./common/attr
-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink# real QA test starts heretests/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
+ |_filter_snapshot# 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
+ |_filter_snapshot
full_send_loop5 &
full_send_pid=$!tests/btrfs/187.out +0
-0@@ -1,3 +1,3 @@QA output created by 187
tests/btrfs/187.out +2
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'tests/btrfs/188 +1
-1@@ -21,7 +21,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs # real QA test starts here
_supported_fsbtrfstests/btrfs/188 +0
-0@@ -45,16 +45,16 @@ $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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
- |_filter_scratch
+ |_filter_snapshot# Now punch a hole that drops all the extents within the file's size. $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
+ |_filter_snapshot$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,9 @@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)tests/btrfs/188.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base'At subvol SCRATCH_MNT/base
tests/btrfs/188.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create 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 +1
-1@@ -23,7 +23,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/btrfs/189 +0
-0@@ -46,7 +46,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0x4d 0 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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/189.out +0
-0@@ -7,7 +7,7 @@ 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)tests/btrfs/189.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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)tests/btrfs/191 +1
-1@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/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
+ |_filter_snapshot$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 + | _filter_snapshot# Now before creating the incremental send stream:
#tests/btrfs/191.out +0
-0@@ -3,11 +3,11 @@ 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)tests/btrfs/191.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap1' +Create 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)tests/btrfs/191.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/mysnap2' +Create 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 +1
-1@@ -19,7 +19,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
. ./common/punchtests/btrfs/200 +0
-0@@ -52,7 +52,7 @@ $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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/200 +0
-0@@ -64,7 +64,7 @@ $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
+ |_filter_snapshot$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,11 @@ 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)tests/btrfs/200.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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)tests/btrfs/200.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr'At subvol SCRATCH_MNT/incr
At subvol base
At snapshot incrtests/btrfs/202 +0
-0@@ -8,7 +8,7 @@. ./common/preamble
_begin_fstestauto quick subvol snapshot-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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
+ |_filter_snapshot# 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,4 @@QA output created by 202
Create subvolume 'SCRATCH_MNT/a'
Create subvolume 'SCRATCH_MNT/a/b'tests/btrfs/202.out +1
-1-Create a snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c' +Create snapshot of 'SCRATCH_MNT/a' in 'SCRATCH_MNT/c'tests/btrfs/203 +1
-1@@ -20,7 +20,7 @@ _cleanup() } # Import common functions. -. ./common/filter +. ./common/filter.btrfs. ./common/reflink
# real QA test starts heretests/btrfs/203 +0
-0@@ -44,7 +44,7 @@ _scratch_mount$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
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_files_dir/1.snap $SCRATCH_MNT/base 2>&1 \
|_filter_scratchtests/btrfs/203 +0
-0@@ -70,7 +70,7 @@ $XFS_IO_PROG -c "pwrite -S 0xab 512K 64K" \$SCRATCH_MNT/foobar |
_filter_xfs_io$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr 2>&1 \
- |_filter_scratch
+ |_filter_snapshot$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,7 @@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)tests/btrfs/203.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base' +Create 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 +15,7 @@ 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)tests/btrfs/203.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr' +Create 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@@ -11,7 +11,7 @@
_begin_fstestauto quick rw snapshot clone prealloc punch# Import common functions.
-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink# real QA test starts heretests/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
+ |_filter_snapshot# 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,7 @@ 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)tests/btrfs/226.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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 |_filter_snapshot# 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,6 @@QA output created by 276
Number of non-shared extents in the whole file: 2000tests/btrfs/276.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick compress snapshot fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/punch # for_filter_fiemap_flags
_supported_fsbtrfstests/btrfs/280 +0
-0@@ -37,7 +37,7 @@ _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 |_filter_snapshotecho
echo "File foo fiemap before COWing extent:"tests/btrfs/280.out +0
-0@@ -1,7 +1,7 @@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)tests/btrfs/280.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'File foo fiemap before COWing extent:
tests/btrfs/281 +0
-0@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick send compress clone fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink
. ./common/punch # for_filter_fiemap_flagstests/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
+ |_filter_snapshot
$BTRFS_UTIL_PROG send --compressed-data -f $send_stream $SCRATCH_MNT/snap 2>&1 \
|_filter_scratchtests/btrfs/281.out +0
-0@@ -6,7 +6,7 @@ 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...tests/btrfs/281.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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@@ -11,7 +11,7 @@. ./common/preamble
_begin_fstestauto quick send clone fiemap-. ./common/filter
+. ./common/filter.btrfs
. ./common/reflink
. ./common/punch # for_filter_fiemap_flagstests/btrfs/283 +0
-0@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "pwrite -S 0xcd -b 64K 64K 64K"$SCRATCH_MNT/foo |
_filter_xfs_iecho "Creating snapshot and a send stream for it..." $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap \
- |_filter_scratch
+ |_filter_snapshot$BTRFS_UTIL_PROG send -f $send_stream $SCRATCH_MNT/snap 2>&1 |
_filter_scratchtests/btrfs/283.out +0
-0@@ -4,7 +4,7 @@ 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...tests/btrfs/283.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +Create 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
+ |_filter_snapshot
$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \
- |_filter_scratch
+ |_filter_snapshotsnap1_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap1) snap2_id=$(_btrfs_get_subvolid $SCRATCH_MNT snap2)
tests/btrfs/287.out +0
-0@@ -41,8 +41,8 @@ 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 +2
-2-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' -Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create 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,9 @@ swap_file="$SCRATCH_MNT/swapfile"
_format_swapfile$swap_file $(($(_get_page_size) * 64)) >> $seqres.fullecho "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 |_filter_snapshot
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 |_filter_snapshotecho "Activating swap file... (should fail due to snapshots)"
_swapon_file$swap_file 2>&1 |_filter_scratchtests/btrfs/293.out +0
-0@@ -1,8 +1,8 @@QA output created by 293
Creating first snapshot...tests/btrfs/293.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'Creating second snapshot...
tests/btrfs/293.out +1
-1-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' +Create 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 | sed -e 's/Create a/Create/g';"
find $test_dir/. -printf "%M %u %g ./%P\n"
tests/btrfs/300.out +0
-0@@ -1,7 +1,7 @@QA output created by 300
Create subvolume './subvol'
Create subvolume 'subvol/subsubvol'tests/btrfs/300.out +1
-1-Create a snapshot of 'subvol' in './snapshot' +Create 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@@ -15,7 +15,7 @@. ./common/preamble
_begin_fstestauto quick snapshot subvol-. ./common/filter
+. ./common/filter.btrfs
_supported_fsbtrfs
_require_scratchtests/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 accessiblefrom within the
# subvolume. $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT/subvol \ - $SCRATCH_MNT/subvol/snap | _filter_scratch + $SCRATCH_MNT/subvol/snap | _filter_snapshot# 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,4 @@QA output created by 302
Create subvolume 'SCRATCH_MNT/subvol' -Create a readonly snapshot of 'SCRATCH_MNT/subvol' in 'SCRATCH_MNT/subvol/snap'
+Create 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
+_filter_snapshotecho 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,7 @@ 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)tests/btrfs/314.out +1
-1-Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Create readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'Send
SCRATCH_MNT
At subvol SCRATCH_MNT/snap1
Receive TEST_DIR/314/tempfsid_mnttests/btrfs/314.out +0
-0@@ -14,7 +14,7 @@ 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'
+Create 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