]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: btrfs: use proper filter for subvolume deletion v2023.12.25
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 22 Dec 2023 02:56:22 +0000 (11:56 +0900)
committerZorro Lang <zlang@kernel.org>
Sat, 23 Dec 2023 19:14:21 +0000 (03:14 +0800)
Test cases btrfs/208, 233, 276 does not use _filter_btrfs_subvol_delete()
to process "btrfs subvolume delete" command's output. So, the following
diff occurs even with a previous fix.

btrfs/208       - output mismatch (see /host/btrfs/208.out.bad)
    --- tests/btrfs/208.out     2023-12-22 02:09:18.000000000 +0000
    +++ /host/btrfs/208.out.bad 2023-12-22 02:21:40.697036486 +0000
    @@ -6,12 +6,12 @@
     subvol1
     subvol2
     subvol3
    -Delete subvolume (no-commit): 'SCRATCH_MNT/subvol1'
    +Delete subvolume 256 (no-commit): 'SCRATCH_MNT/subvol1'
     After deleting one subvolume:
     subvol2
    ...

Let them use the filter and fix the output accordingly.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/208
tests/btrfs/208.out
tests/btrfs/233
tests/btrfs/233.out
tests/btrfs/276
tests/btrfs/276.out

index 909f9fa40803e6c089f6059bd51d3f8d45b4ff55..d58803e2f801a073a0307a2042b615fcd46f6e87 100755 (executable)
@@ -28,7 +28,7 @@ _delete_and_list()
        local msg="$2"
 
        SUBVOLID=$(_btrfs_get_subvolid $SCRATCH_MNT "$subvol_name")
-       $BTRFS_UTIL_PROG subvolume delete --subvolid $SUBVOLID $SCRATCH_MNT | _filter_scratch
+       $BTRFS_UTIL_PROG subvolume delete --subvolid $SUBVOLID $SCRATCH_MNT | _filter_btrfs_subvol_delete
 
        echo "$msg"
        $BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | $AWK_PROG '{ print $NF }'
index 9b660699a4b2a2b44465f1e208ee4e2af4b5141b..dc5761ba1c87125d6e61145f15492c7fbb18e8f4 100644 (file)
@@ -6,12 +6,12 @@ Current subvolume ids:
 subvol1
 subvol2
 subvol3
-Delete subvolume (no-commit): 'SCRATCH_MNT/subvol1'
+Delete subvolume 'SCRATCH_MNT/subvol1'
 After deleting one subvolume:
 subvol2
 subvol3
-Delete subvolume (no-commit): 'SCRATCH_MNT/subvol3'
+Delete subvolume 'SCRATCH_MNT/subvol3'
 Last remaining subvolume:
 subvol2
-Delete subvolume (no-commit): 'SCRATCH_MNT/subvol2'
+Delete subvolume 'SCRATCH_MNT/subvol2'
 All subvolumes removed.
index 2b94a9c6befee67ae3c5e90a6848463eabaa8413..f2c1eba090be6ed35451e1b181c13d3f6099684b 100755 (executable)
@@ -21,6 +21,7 @@ _cleanup()
 
 # Import common functions.
 . ./common/filter
+. ./common/filter.btrfs
 . ./common/dmflakey
 
 # real QA test starts here
@@ -77,7 +78,7 @@ create_subvol_with_orphan()
        # open, delete the subvolume, then 'sync' to durably persist the orphan
        # item for the subvolume.
        exec 73< $SCRATCH_MNT/testsv/foobar
-       $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/testsv | _filter_scratch
+       $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/testsv | _filter_btrfs_subvol_delete
        sync
 
        # Now silently drop writes on the device, close the file descriptor and
index 492e959d895c74da1a15bde8572075a63ca7e7a0..2754e900834eecc93921f6b1134a7a1c71ae8f1a 100644 (file)
@@ -1,5 +1,5 @@
 QA output created by 233
 Create subvolume 'SCRATCH_MNT/testsv'
-Delete subvolume (no-commit): 'SCRATCH_MNT/testsv'
+Delete subvolume 'SCRATCH_MNT/testsv'
 Create subvolume 'SCRATCH_MNT/testsv'
-Delete subvolume (no-commit): 'SCRATCH_MNT/testsv'
+Delete subvolume 'SCRATCH_MNT/testsv'
index 6470a2f6e62ed5e9a4c71d97f7ca79bef7f33e34..f15f2082435021ae575a3dbdecb52c1122590b6f 100755 (executable)
@@ -12,6 +12,7 @@
 _begin_fstest auto snapshot fiemap remount
 
 . ./common/filter
+. ./common/filter.btrfs
 . ./common/attr
 
 _supported_fs btrfs
@@ -130,7 +131,7 @@ echo "Number of non-shared extents in range [512K, 512K + 64K): $(count_not_shar
 echo "Number of non-shared extents in range [249M, 249M + 64K): $(count_not_shared_extents 249M 64K)"
 
 # Now delete the snapshot.
-$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap | _filter_scratch
+$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap | _filter_btrfs_subvol_delete
 
 # We deleted the snapshot and committed the transaction used to delete it (-c),
 # but all its extents (both metadata and data) are actually only deleted in the
index 197d8edc62ac460eb28053ffd90e02c58a017545..352e06b4d4b212770d87aafe1940351c8fe0bddf 100644 (file)
@@ -10,5 +10,5 @@ Number of non-shared extents in the whole file: 2
 Number of shared extents in the whole file: 1998
 Number of non-shared extents in range [512K, 512K + 64K): 1
 Number of non-shared extents in range [249M, 249M + 64K): 1
-Delete subvolume (commit): 'SCRATCH_MNT/snap'
+Delete subvolume 'SCRATCH_MNT/snap'
 Number of non-shared extents in the whole file: 2000