Skip to content

Commit

Permalink
btrfs-progs: tests: add case for recursive subvolume deletion printin…
Browse files Browse the repository at this point in the history
…g child subvolumes

Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Feb 20, 2025
1 parent 158b898 commit 09eb6d9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/misc-tests/068-subvol-delete-recursive-show-child/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# Print all nested subvolume paths as they're getting deleted

source "$TEST_TOP/common" || exit

setup_root_helper
prepare_test_dev

run_check_mkfs_test_dev
run_check_mount_test_dev
for path in \
"subvol1" \
"subvol1/subvol2" \
"subvol1/subvol2/subvol3" \
"subvol1/subvol2/subvol3/subvol4" \
"subvol1/subvol2/subvol3/subvol4/subvol5"; do

run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/$path"
done

run_mustfail "deleted non-empty subvolume" \
$SUDO_HELPER "$TOP/btrfs" subvolume delete "$TEST_MNT/subvol1"

if ! run_check_stdout $SUDO_HELPER "$TOP/btrfs" subvolume delete --recursive "$TEST_MNT/subvol1" |
grep -q 'subvol[2345]'; then
_fail "nested subvolumes not printed"
fi

run_check_umount_test_dev

0 comments on commit 09eb6d9

Please sign in to comment.