fstests: check for filesystem FS_IOC_FSSETXATTR support
[xfstests-dev.git] / tests / xfs / 075
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 075
6 #
7 # Commit bbe051c8 disallows ro->rw remount on norecovery mount
8 # This test makes sure the behavior is correct.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21         cd /
22         rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/quota
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os Linux
33 _require_scratch
34
35 # norecovery mounts do not succeed with quotas eanbled, so shut them off
36 _qmount_option "defaults"
37
38 echo "Silence is golden"
39 _scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full
40
41 # first ro mount with norecovery
42 _try_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \
43         || _fail "First ro mount failed"
44 # make sure a following remount,rw fails
45 _try_scratch_mount "-o remount,rw" >>$seqres.full 2>&1 \
46         && _fail "Second rw remount succeeded"
47
48 # success, all done
49 status=0
50 exit