fstests: move test group info to test files
[xfstests-dev.git] / tests / generic / 082
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 No. 082
6 #
7 # Test quota handling on remount ro failure
8 #
9 . ./common/preamble
10 _begin_fstest auto quick quota
11
12 filter_project_quota_line()
13 {
14         grep -v "^project quota on"
15 }
16
17 # Import common functions.
18 . ./common/filter
19 . ./common/quota
20
21 # real QA test starts here
22 _supported_fs generic
23 _require_test
24 _require_scratch
25 _require_quota
26
27 _scratch_mkfs >>$seqres.full 2>&1
28 _scratch_mount "-o usrquota,grpquota"
29
30 # xfs doesn't need these setups and quotacheck even fails on xfs, so just
31 # redirect the output to $seqres.full for debug purpose and ignore the results,
32 # as we check the quota status later anyway.
33 quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1
34 quotaon $SCRATCH_MNT >>$seqres.full 2>&1
35
36 # first remount ro with a bad option, a failed remount ro should not disable
37 # quota, but currently xfs doesn't fail in this case, the unknown option is
38 # just ignored, but quota is still on. This may change in future, let's
39 # re-consider the case then.
40 _try_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
41 quotaon -p $SCRATCH_MNT | _filter_scratch | filter_project_quota_line
42 # second remount should succeed, no oops or hang expected
43 _try_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"
44
45 # success, all done
46 status=0
47 exit