"Fossies" - the Fresh Open Source Software Archive

Member "btrfs-progs-v5.4/tests/cli-tests/004-send-parent-multi-subvol/test.sh" (3 Dec 2019, 1137 Bytes) of package /linux/misc/btrfs-progs-v5.4.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 #
    3 # minimal test for the following syntax: btrfs send -p parent subvol1 subvol2
    4 
    5 source "$TEST_TOP/common"
    6 
    7 check_prereq mkfs.btrfs
    8 check_prereq btrfs
    9 
   10 setup_root_helper
   11 prepare_test_dev
   12 
   13 run_check_mkfs_test_dev
   14 run_check_mount_test_dev
   15 
   16 here=`pwd`
   17 cd "$TEST_MNT" || _fail "cannot chdir to TEST_MNT"
   18 
   19 run_check $SUDO_HELPER "$TOP/btrfs" subvolume create subv-parent
   20 run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
   21 run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap1
   22 run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
   23 run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap2
   24 run_check $SUDO_HELPER dd if=/dev/urandom of=subv-parent/file bs=1M count=10
   25 run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r subv-parent subv-snap3
   26 
   27 run_check truncate -s0 "$here"/send.stream
   28 run_check chmod a+w "$here"/send.stream
   29 run_check $SUDO_HELPER "$TOP/btrfs" send -f "$here"/send.stream -p subv-snap1 subv-snap2 subv-snap3
   30 
   31 cd "$here" || _fail "cannot chdir back to test directory"
   32 rm send.stream
   33 
   34 run_check_umount_test_dev