blob: 5b9a887b58d88c279b31c0e328494fd96bd849af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2013 STRATO. All rights reserved.
#
# FSQA Test No. 007
#
# Run fsstress to create a reasonably strange file system, make a
# snapshot (base) and run more fsstress. Then take another snapshot
# (incr) and send both snapshots to a temp file. Remake the file
# system and receive from the files. Check both states with fssum.
#
# creator
owner=list.btrfs@jan-o-sch.net
. ./common/preamble
_begin_fstest auto quick rw metadata send seek
# Override the default cleanup function.
_cleanup()
{
cd /
rm -f $tmp.*
rm -fr $send_files_dir
}
. ./common/filter
_supported_fs btrfs
_require_scratch
_require_fssum
_require_seek_data_hole
send_files_dir=$TEST_DIR/btrfs-test-$seq
rm -fr $send_files_dir
mkdir $send_files_dir
workout()
{
fsz=$1
ops=$2
_scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount "-o noatime"
run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
"$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
_btrfs subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > ${send_files_dir}/base.snap" \
>> $seqres.full
$BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $send_files_dir/base.snap 2>> $seqres.full \
|| _fail "failed: '$@'"
echo "# $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base\
$SCRATCH_MNT/incr > ${send_files_dir}/incr.snap" >> $seqres.full
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base \
$SCRATCH_MNT/incr > $send_files_dir/incr.snap 2>> $seqres.full \
|| _fail "failed: '$@'"
run_check $FSSUM_PROG -A -f -w $send_files_dir/base.fssum \
$SCRATCH_MNT/base
run_check $FSSUM_PROG -A -f -w $send_files_dir/incr.fssum \
-x $SCRATCH_MNT/incr/base $SCRATCH_MNT/incr
_scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount "-o noatime"
_btrfs receive $SCRATCH_MNT < $send_files_dir/base.snap
run_check $FSSUM_PROG -r $send_files_dir/base.fssum $SCRATCH_MNT/base
_btrfs receive $SCRATCH_MNT < $send_files_dir/incr.snap
run_check $FSSUM_PROG -r $send_files_dir/incr.fssum $SCRATCH_MNT/incr
}
echo "*** test send / receive"
fssize=`expr 2000 \* 1024 \* 1024`
ops=200
workout $fssize $ops
echo "*** done"
status=0
exit
|