xfs/029: filter out "extended-header: cycle: 1" from output
[xfstests-dev.git] / tests / xfs / 305
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 305
6 #
7 # Test to verify that turn group/project quotas off while fstress and
8 # user quotas are left on.
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 # Modify as appropriate.
31 _supported_fs xfs
32 _supported_os Linux
33
34 _require_scratch
35 _require_xfs_quota
36 _require_xfs_mkfs_crc
37 _require_xfs_crc
38 _require_command "$KILLALL_PROG" killall
39
40 rm -f $seqres.full
41 _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
42
43 _qmount_option "uquota,gquota,pquota"
44
45 QUOTA_DIR=$SCRATCH_MNT/quota_dir
46
47 _exercise()
48 {
49         type=$1
50
51         _qmount
52         mkdir -p $QUOTA_DIR
53
54         $FSSTRESS_PROG -d $QUOTA_DIR -n 1000 -p 100 $FSSTRESS_AVOID >/dev/null 2>&1 &
55         sleep 10
56         xfs_quota -x -c "off -$type" $SCRATCH_DEV
57         sleep 5
58         $KILLALL_PROG -q $FSSTRESS_PROG
59         wait
60 }
61
62 echo "*** turn off group quotas"
63 _exercise g
64 echo "*** done"
65
66 echo "*** turn off project quotas"
67 _exercise p
68 echo "*** done"
69
70 echo "*** turn off group/project quotas"
71 _exercise gp
72 echo "*** done"
73
74 # success, all done
75 status=0
76 exit