fstests: check for filesystem FS_IOC_FSSETXATTR support
[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 _supported_os Linux
29 _require_scratch_nocheck
30
31 rm -f $seqres.full
32
33 # Try regular extent size hint
34 echo extszinherit >> $seqres.full
35 _scratch_mkfs -d extszinherit=8388608 >> $seqres.full 2>&1
36 test $? -eq 1 || echo "should have failed extszinherit"
37
38 # Try cow extent size hint if supported
39 if _scratch_mkfs_xfs_supported -m crc=1,reflink=1 >> $seqres.full 2>&1; then
40         echo cowextsize >> $seqres.full
41         _scratch_mkfs -m reflink=1,crc=1 -d cowextsize=8388608 >> $seqres.full 2>&1
42         test $? -eq 1 || echo "should have failed cowextsize"
43 fi
44
45 echo silence is golden
46 status=0
47 exit