tests: remove udf/101
[xfstests-dev.git] / tests / generic / 405
1 #! /bin/bash
2 # FS QA Test 405
3 #
4 # Test mkfs against thin provision device, which has very small backing size,
5 # mkfs should return error when it hits EIO.
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2016 Red Hat Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #-----------------------------------------------------------------------
23 #
24
25 seq=`basename $0`
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 status=1        # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # Initialize dmthin device with very small backing size & very big virtual
35 # size, with the hope that mkfs hit EIO at mkfs time
36 BACKING_SIZE=$((1 * 1024 * 1024 / 512))                 # 1M
37 VIRTUAL_SIZE=$((1 * 1024 * 1024 * 1024 * 1024 / 512))   # 1T
38
39 _cleanup()
40 {
41         _dmthin_cleanup
42         cd /
43         rm -f $tmp.*
44 }
45
46 # get standard environment, filters and checks
47 . ./common/rc
48 . ./common/filter
49 . ./common/dmthin
50
51 # remove previous $seqres.full before test
52 rm -f $seqres.full
53
54 # real QA test starts here
55 _supported_fs generic
56 _supported_os Linux
57 # $SCRATCH_DEV won't be directly created filesystem on, so fsck isn't required
58 _require_scratch_nocheck
59 _require_dm_target thin-pool
60
61 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
62
63 # try mkfs on dmthin device, expect mkfs failure if 1M isn't big enough to hold
64 # all the metadata. But if mkfs returns success, we expect the filesystem is
65 # consistent, make sure it doesn't currupt silently.
66 $MKFS_PROG -t $FSTYP $DMTHIN_VOL_DEV >>$seqres.full 2>&1
67 if [ $? -eq 0 ]; then
68         _dmthin_check_fs
69 fi
70
71 echo "Silence is golden"
72 status=0
73 exit