2016-11-02 12:07:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# minimal test for the following syntax: btrfs send -p parent subvol1 subvol2
|
|
|
|
|
2023-04-19 15:08:41 +00:00
|
|
|
source "$TEST_TOP/common" || exit
|
2016-11-02 12:07:15 +00:00
|
|
|
|
|
|
|
check_prereq mkfs.btrfs
|
|
|
|
check_prereq btrfs
|
|
|
|
|
|
|
|
setup_root_helper
|
2017-10-27 13:50:34 +00:00
|
|
|
prepare_test_dev
|
2016-11-02 12:07:15 +00:00
|
|
|
|
2019-06-05 17:09:38 +00:00
|
|
|
run_check_mkfs_test_dev
|
2016-11-02 12:07:15 +00:00
|
|
|
run_check_mount_test_dev
|
|
|
|
|
2024-06-17 22:11:11 +00:00
|
|
|
here=$(pwd)
|
2016-11-02 12:07:15 +00:00
|
|
|
cd "$TEST_MNT" || _fail "cannot chdir to TEST_MNT"
|
|
|
|
|
2017-01-24 17:19:27 +00:00
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create subv-parent
|
2016-11-02 12:07:15 +00:00
|
|
|
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
2017-01-24 17:19:27 +00:00
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap1
|
2016-11-02 12:07:15 +00:00
|
|
|
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
2017-01-24 17:19:27 +00:00
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap2
|
2016-11-02 12:07:15 +00:00
|
|
|
run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
|
2017-01-24 17:19:27 +00:00
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap3
|
2016-11-02 12:07:15 +00:00
|
|
|
|
2022-09-15 14:01:35 +00:00
|
|
|
stream=$(_mktemp)
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" send -f "$stream" -p subv-snap1 subv-snap2 subv-snap3
|
2016-11-02 12:07:15 +00:00
|
|
|
|
|
|
|
cd "$here" || _fail "cannot chdir back to test directory"
|
2022-09-15 14:01:35 +00:00
|
|
|
rm "$stream"
|
2016-11-02 12:07:15 +00:00
|
|
|
|
|
|
|
run_check_umount_test_dev
|