mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-24 15:12:47 +00:00
btrfs-progs: tests: add test for multi-subvolume send from parent
Fixed by "btrfs-progs: send: fix handling of multiple snapshots (-p option)". Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b9ff0190cf
commit
29a1a78aaa
34
tests/cli-tests/004-send-parent-multi-subvol/test.sh
Executable file
34
tests/cli-tests/004-send-parent-multi-subvol/test.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# minimal test for the following syntax: btrfs send -p parent subvol1 subvol2
|
||||
|
||||
source $TOP/tests/common
|
||||
|
||||
check_prereq mkfs.btrfs
|
||||
check_prereq btrfs
|
||||
|
||||
setup_root_helper
|
||||
prepare_test_dev 2g
|
||||
|
||||
run_check $TOP/mkfs.btrfs -f $IMAGE
|
||||
run_check_mount_test_dev
|
||||
|
||||
here=`pwd`
|
||||
cd "$TEST_MNT" || _fail "cannot chdir to TEST_MNT"
|
||||
|
||||
run_check $SUDO_HELPER btrfs subvolume create subv-parent
|
||||
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
||||
run_check $SUDO_HELPER btrfs subvolume snapshot -r subv-parent subv-snap1
|
||||
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
||||
run_check $SUDO_HELPER btrfs subvolume snapshot -r subv-parent subv-snap2
|
||||
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
||||
run_check $SUDO_HELPER btrfs subvolume snapshot -r subv-parent subv-snap3
|
||||
|
||||
run_check truncate -s0 "$here"/send.stream
|
||||
run_check chmod a+w "$here"/send.stream
|
||||
run_check $SUDO_HELPER $TOP/btrfs send -f "$here"/send.stream -p subv-snap1 subv-snap2 subv-snap3
|
||||
|
||||
cd "$here" || _fail "cannot chdir back to test directory"
|
||||
rm send.stream
|
||||
|
||||
run_check_umount_test_dev
|
Loading…
Reference in New Issue
Block a user