btrfs/012: check free size of scratch device before copying files
[xfstests-dev.git] / tests / ext4 / 023
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. 023
6 #
7 # Ensure that the populate helpers actually /can/ populate a ext4
8 # filesystem with all types of metadata and create an image of the
9 # metadata.  Check that fsck is happy with the resulting fs.
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 ext4
34 _require_scratch
35
36 echo "Format and populate"
37 _scratch_populate_cached > $seqres.full 2>&1
38
39 echo "Mount"
40 _scratch_mount >> $seqres.full 2>&1
41
42 # success, all done
43 status=0
44 exit