xfs: fix old fuzz test invocations of xfs_repair
[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
33 _require_scratch
34 _require_xfs_quota
35 _require_xfs_mkfs_crc
36 _require_xfs_crc
37 _require_command "$KILLALL_PROG" killall
38
39 rm -f $seqres.full
40 _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
41
42 _qmount_option "uquota,gquota,pquota"
43
44 QUOTA_DIR=$SCRATCH_MNT/quota_dir
45
46 _exercise()
47 {
48         type=$1
49
50         _qmount
51         mkdir -p $QUOTA_DIR
52
53         $FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >/dev/null 2>&1 &
54         sleep 10
55         xfs_quota -x -c "off -$type" $SCRATCH_DEV
56         sleep 5
57         $KILLALL_PROG -q $FSSTRESS_PROG
58         wait
59 }
60
61 echo "*** turn off group quotas"
62 _exercise g
63 echo "*** done"
64
65 echo "*** turn off project quotas"
66 _exercise p
67 echo "*** done"
68
69 echo "*** turn off group/project quotas"
70 _exercise gp
71 echo "*** done"
72
73 # success, all done
74 status=0
75 exit