fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / xfs / 500
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
3 # Copyright (c) 2019 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 500
6 #
7 # Make sure we can't format a filesystem with insane extent hints.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12 tmp=/tmp/$$
13 status=1        # failure is the default!
14 testfile=$TEST_DIR/$seq.txt
15 trap "_cleanup; exit \$status" 0 1 2 3 15
16
17 _cleanup()
18 {
19         cd /
20         rm -f $tmp.*
21 }
22
23 # get standard environment, filters and checks
24 . ./common/rc
25
26 # real QA test starts here
27 _supported_fs xfs
28 _require_scratch_nocheck
29
30 rm -f $seqres.full
31
32 # Try regular extent size hint
33 echo extszinherit >> $seqres.full
34 _scratch_mkfs -d extszinherit=8388608 >> $seqres.full 2>&1
35 test $? -eq 1 || echo "should have failed extszinherit"
36
37 # Try cow extent size hint if supported
38 if _scratch_mkfs_xfs_supported -m crc=1,reflink=1 >> $seqres.full 2>&1; then
39         echo cowextsize >> $seqres.full
40         _scratch_mkfs -m reflink=1,crc=1 -d cowextsize=8388608 >> $seqres.full 2>&1
41         test $? -eq 1 || echo "should have failed cowextsize"
42 fi
43
44 echo silence is golden
45 status=0
46 exit