2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2013 STRATO. All rights reserved.
7 # Run fsstress to create a reasonably strange file system, make a
8 # snapshot (base) and run more fsstress. Then take another snapshot
9 # (incr) and send both snapshots to a temp file. Remake the file
10 # system and receive from the files. Check both states with fssum.
13 owner=list.btrfs@jan-o-sch.net
16 seqres=$RESULT_DIR/$seq
17 echo "QA output created by $seq"
25 _scratch_unmount 2>/dev/null
28 trap "_cleanup; exit \$status" 0 1 2 3 15
30 # get standard environment, filters and checks
34 # real QA test starts here
39 _require_seek_data_hole
48 _scratch_unmount >/dev/null 2>&1
49 echo "*** mkfs -dsize=$fsz" >>$seqres.full
50 echo "" >>$seqres.full
51 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
52 || _fail "size=$fsz mkfs failed"
53 _scratch_mount "-o noatime"
55 run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
56 "$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
58 _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
60 echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap" \
62 $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap 2>> $seqres.full \
63 || _fail "failed: '$@'"
64 echo "# $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base\
65 $SCRATCH_MNT/incr > $tmp/incr.snap" >> $seqres.full
66 $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base \
67 $SCRATCH_MNT/incr > $tmp/incr.snap 2>> $seqres.full \
68 || _fail "failed: '$@'"
70 run_check $FSSUM_PROG -A -f -w $tmp/base.fssum $SCRATCH_MNT/base
71 run_check $FSSUM_PROG -A -f -w $tmp/incr.fssum -x $SCRATCH_MNT/incr/base \
74 _scratch_unmount >/dev/null 2>&1
75 echo "*** mkfs -dsize=$fsz" >>$seqres.full
76 echo "" >>$seqres.full
77 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
78 || _fail "size=$fsz mkfs failed"
79 _scratch_mount "-o noatime"
81 _run_btrfs_util_prog receive $SCRATCH_MNT < $tmp/base.snap
82 run_check $FSSUM_PROG -r $tmp/base.fssum $SCRATCH_MNT/base
84 _run_btrfs_util_prog receive $SCRATCH_MNT < $tmp/incr.snap
85 run_check $FSSUM_PROG -r $tmp/incr.fssum $SCRATCH_MNT/incr
88 echo "*** test send / receive"
90 fssize=`expr 2000 \* 1024 \* 1024`