fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 518
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Copyright (c) 2020, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 518
6 #
7 # Make sure that the quota default grace period and maximum warning limits
8 # survive quotacheck.
9
10 . ./common/preamble
11 _begin_fstest auto quick quota
12
13 # Import common functions.
14 . ./common/filter
15 . ./common/quota
16
17 # real QA test starts here
18 _supported_fs xfs
19 _require_scratch
20 _require_quota
21
22 # Format filesystem and set up quota limits
23 _scratch_mkfs > $seqres.full
24 _qmount_option "usrquota"
25 _scratch_mount >> $seqres.full
26
27 $XFS_QUOTA_PROG -x -c 'timer -u 300m' $SCRATCH_MNT
28 $XFS_QUOTA_PROG -x -c 'state -u' $SCRATCH_MNT | grep 'grace time'
29 _scratch_unmount
30
31 # Remount and check the limits
32 _scratch_mount >> $seqres.full
33 $XFS_QUOTA_PROG -x -c 'state -u' $SCRATCH_MNT | grep 'grace time'
34 _scratch_unmount
35
36 # Run repair to force quota check
37 _scratch_xfs_repair >> $seqres.full 2>&1
38
39 # Remount (this time to run quotacheck) and check the limits.  There's a bug
40 # in quotacheck where we would reset the ondisk default grace period to zero
41 # while the incore copy stays at whatever was read in prior to quotacheck.
42 # This will show up after the /next/ remount.
43 _scratch_mount >> $seqres.full
44 $XFS_QUOTA_PROG -x -c 'state -u' $SCRATCH_MNT | grep 'grace time'
45 _scratch_unmount
46
47 # Remount and check the limits
48 _scratch_mount >> $seqres.full
49 $XFS_QUOTA_PROG -x -c 'state -u' $SCRATCH_MNT | grep 'grace time'
50 _scratch_unmount
51
52 # success, all done
53 status=0
54 exit