2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Run fsx with quotas enabled and verify accounted quotas in the end
9 # Derived from test 127
11 _begin_fstest auto quota
13 # Import common functions.
17 FSX_FILE_SIZE=64000000
18 FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -N 20000"
23 echo "=== FSX Standard Mode, Memory Mapping, $tasks Tasks ==="
24 for (( i = 1; i <= $tasks; i++ )); do
26 echo "ltp/fsx $FSX_ARGS -S $SEED $SCRATCH_MNT/fsx_file$i" >>$seqres.full
27 su $qa_user -c "ltp/fsx $FSX_ARGS -S $SEED \
28 $FSX_AVOID $SCRATCH_MNT/fsx_file$i" >$tmp.output$i 2>&1 &
31 for (( i = 1; i <= $tasks; i++ )); do
33 cat $tmp.output$i | tee -a $seqres.full
37 $XFS_IO_PROG -c 'fsync' $SCRATCH_MNT/fsx_file$i
38 cat $tmp.output$i | tee -a $seqres.full
43 # real QA test starts here
49 _scratch_mkfs >> $seqres.full 2>&1
50 _scratch_mount "-o usrquota,grpquota"
51 chmod 777 $SCRATCH_MNT
52 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
53 quotaon -u -g $SCRATCH_MNT 2>/dev/null
56 _scratch_unmount 2>/dev/null
61 if ! _check_quota_usage; then
62 _scratch_unmount 2>/dev/null
68 _scratch_unmount 2>/dev/null
73 if ! _check_quota_usage; then
74 _scratch_unmount 2>/dev/null
79 #flush cache after write
80 FSX_ARGS="-f $FSX_ARGS"
82 _scratch_unmount 2>/dev/null
87 if ! _check_quota_usage; then
88 _scratch_unmount 2>/dev/null
93 _scratch_unmount 2>/dev/null