2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Jan Kara. All Rights Reserved.
4 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
8 # Stress setquota and setinfo handling.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 # get standard environment, filters and checks
26 echo; echo "### test limits and info setting"
32 echo "Starting test with procs=$procs, idmod=$idmod, and seed=$seed" >>$seqres.full
34 for (( i = 0; i < $procs; i++ )); do
35 ( SETUCOUNT=1; SETGCOUNT=1; SETUIDS[0]=0; SETGIDS[0]=0
36 for (( j = 0; j < $count; j++ )); do
40 if [ $UG -eq 1 ]; then
45 if [ $OP -eq 10 ]; then
46 setquota -t -$type $j $j $SCRATCH_MNT
47 elif [ $OP -lt 5 ]; then
48 ID=$((($RANDOM*32768+$RANDOM)%$idmod))
49 if [ $UG -eq 1 ]; then
50 SETUIDS[$SETUCOUNT]=$ID
51 SETUCOUNT=$(($SETUCOUNT+1))
53 SETGIDS[$SETGCOUNT]=$ID
54 SETGCOUNT=$(($SETGCOUNT+1))
56 setquota -$type $ID $j $j $j $j $SCRATCH_MNT
58 if [ $UG -eq 1 ]; then
59 ID=${SETUIDS[$(($RANDOM%$SETUCOUNT))]}
61 ID=${SETGIDS[$(($RANDOM%$SETGCOUNT))]}
63 setquota -$type $ID 0 0 0 0 $SCRATCH_MNT
68 echo "### done with testing"
71 # real QA test starts here
76 # real QA test starts here
79 _scratch_mkfs >> $seqres.full 2>&1
80 _scratch_mount "-o usrquota,grpquota"
81 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
82 quotaon -u -g $SCRATCH_MNT 2>/dev/null