-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs-progs: tests: add case for recursive subvolume deletion printin…
…g child subvolumes Signed-off-by: David Sterba <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
tests/misc-tests/068-subvol-delete-recursive-show-child/test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |