btrfs/012: check free size of scratch device before copying files
[xfstests-dev.git] / tests / xfs / 371
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 371
6 #
7 # Populate a XFS filesystem and fuzz every rmapbt key/pointer field.
8 # Use xfs_scrub to fix the corruption.
9 # Use xfs_scrub to repair the problems.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 7 15
19
20 _cleanup()
21 {
22         cd /
23         rm -rf $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29 . ./common/populate
30 . ./common/fuzzy
31
32 # real QA test starts here
33 _supported_fs xfs
34 _require_xfs_scratch_rmapbt
35 _require_scratch_xfs_fuzz_fields
36
37 echo "Format and populate"
38 _scratch_populate_cached nofill > $seqres.full 2>&1
39
40 echo "Fuzz rmapbt keyptr"
41 _scratch_xfs_fuzz_metadata '' 'online' 'agf 0' 'addr rmaproot' >> $seqres.full
42 echo "Done fuzzing rmapbt keyptr"
43
44 # success, all done
45 status=0
46 exit