File: test.sh

package info (click to toggle)
btrfs-progs 6.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,596 kB
  • sloc: ansic: 127,198; sh: 7,836; python: 1,385; makefile: 900; asm: 296
file content (29 lines) | stat: -rwxr-xr-x 758 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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