4 # Stress setquota and setinfo handling.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2010 Jan Kara. All Rights Reserved.
10 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
44 echo; echo "### test limits and info setting"
50 echo "Starting test with procs=$procs, idmod=$idmod, and seed=$seed" >>$seqres.full
52 for (( i = 0; i < $procs; i++ )); do
53 ( SETUCOUNT=1; SETGCOUNT=1; SETUIDS[0]=0; SETGIDS[0]=0
54 for (( j = 0; j < $count; j++ )); do
58 if [ $UG -eq 1 ]; then
63 if [ $OP -eq 10 ]; then
64 setquota -t -$type $j $j $SCRATCH_MNT
65 elif [ $OP -lt 5 ]; then
66 ID=$((($RANDOM*32768+$RANDOM)%$idmod))
67 if [ $UG -eq 1 ]; then
68 SETUIDS[$SETUCOUNT]=$ID
69 SETUCOUNT=$(($SETUCOUNT+1))
71 SETGIDS[$SETGCOUNT]=$ID
72 SETGCOUNT=$(($SETGCOUNT+1))
74 setquota -$type $ID $j $j $j $j $SCRATCH_MNT
76 if [ $UG -eq 1 ]; then
77 ID=${SETUIDS[$(($RANDOM%$SETUCOUNT))]}
79 ID=${SETGIDS[$(($RANDOM%$SETGCOUNT))]}
81 setquota -$type $ID 0 0 0 0 $SCRATCH_MNT
86 echo "### done with testing"
89 # real QA test starts here
91 _supported_os Linux #IRIX
95 # real QA test starts here
98 _scratch_mkfs >> $seqres.full 2>&1
99 _scratch_mount "-o usrquota,grpquota"
100 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
101 quotaon -u -g $SCRATCH_MNT 2>/dev/null