4 # Run fsstress to create a reasonably strange file system, make a
5 # snapshot (base) and run more fsstress. Then take another snapshot
6 # (incr) and send both snapshots to a temp file. Remake the file
7 # system and receive from the files. Check both states with fssum.
9 #-----------------------------------------------------------------------
10 # Copyright (C) 2013 STRATO. All rights reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
28 owner=list.btrfs@jan-o-sch.net
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
40 _scratch_unmount 2>/dev/null
43 trap "_cleanup; exit \$status" 0 1 2 3 15
45 # get standard environment, filters and checks
49 # real QA test starts here
55 _require_seek_data_hole
64 _scratch_unmount >/dev/null 2>&1
65 echo "*** mkfs -dsize=$fsz" >>$seqres.full
66 echo "" >>$seqres.full
67 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
68 || _fail "size=$fsz mkfs failed"
69 run_check _scratch_mount "-o noatime"
71 run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
72 "$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
74 _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
76 echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap" \
78 $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap 2>> $seqres.full \
79 || _fail "failed: '$@'"
80 echo "# $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base\
81 $SCRATCH_MNT/incr > $tmp/incr.snap" >> $seqres.full
82 $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base \
83 $SCRATCH_MNT/incr > $tmp/incr.snap 2>> $seqres.full \
84 || _fail "failed: '$@'"
86 run_check $FSSUM_PROG -A -f -w $tmp/base.fssum $SCRATCH_MNT/base
87 run_check $FSSUM_PROG -A -f -w $tmp/incr.fssum -x $SCRATCH_MNT/incr/base \
90 _scratch_unmount >/dev/null 2>&1
91 echo "*** mkfs -dsize=$fsz" >>$seqres.full
92 echo "" >>$seqres.full
93 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
94 || _fail "size=$fsz mkfs failed"
95 run_check _scratch_mount "-o noatime"
97 _run_btrfs_util_prog receive $SCRATCH_MNT < $tmp/base.snap
98 run_check $FSSUM_PROG -r $tmp/base.fssum $SCRATCH_MNT/base
100 _run_btrfs_util_prog receive $SCRATCH_MNT < $tmp/incr.snap
101 run_check $FSSUM_PROG -r $tmp/incr.fssum $SCRATCH_MNT/incr
104 echo "*** test send / receive"
106 fssize=`expr 2000 \* 1024 \* 1024`