fstests: renumber tests after merge
[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 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_quota
34
35 rm -f $seqres.full
36
37 # Format filesystem and set up quota limits
38 _scratch_mkfs > $seqres.full
39 _qmount_option "usrquota"
40 _scratch_mount >> $seqres.full
41
42 $XFS_QUOTA_PROG -x -c 'timer -u 300m' $SCRATCH_MNT
43 $XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time'
44 _scratch_unmount
45
46 # Remount and check the limits
47 _scratch_mount >> $seqres.full
48 $XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time'
49 _scratch_unmount
50
51 # Run repair to force quota check
52 _scratch_xfs_repair >> $seqres.full 2>&1
53
54 # Remount (this time to run quotacheck) and check the limits.  There's a bug
55 # in quotacheck where we would reset the ondisk default grace period to zero
56 # while the incore copy stays at whatever was read in prior to quotacheck.
57 # This will show up after the /next/ remount.
58 _scratch_mount >> $seqres.full
59 $XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time'
60 _scratch_unmount
61
62 # Remount and check the limits
63 _scratch_mount >> $seqres.full
64 $XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time'
65 _scratch_unmount
66
67 # success, all done
68 status=0
69 exit