4 # Simple quota accounting test for direct/buffered/mmap IO.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # get standard environment, filters and checks
29 s,$SCRATCH_MNT,[SCR_MNT],;
30 s,$SCRATCH_DEV,[SCR_DEV],;
34 # real QA test starts here
36 _supported_os Linux #IRIX
43 echo; echo "### create files, setting up ownership (type=$type)"
44 rm -f $SCRATCH_MNT/{buffer,direct,mmap}
45 $XFS_IO_PROG -fc "chproj $prid" $SCRATCH_MNT/{buffer,direct,mmap}
46 chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
47 chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
48 for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
49 $here/src/lstat64 $file | head -3 | filter_scratch
50 $XFS_IO_PROG -c lsproj $file
56 echo "### some controlled buffered, direct and mmapd IO (type=$type)"
57 echo "--- initiating parallel IO..." >>$seq.full
58 $XFS_IO_PROG -c 'pwrite -b 1m 0 16m' -c 'fsync' \
59 $SCRATCH_MNT/buffer >>$seq.full 2>&1 &
60 $XFS_IO_PROG -c 'pwrite -b 1m 0 16m' -d \
61 $SCRATCH_MNT/direct >>$seq.full 2>&1 &
62 $XFS_IO_PROG -c 't 16m' -c 'mm -rw 0 16m' -c 'mw 0 16m' -c 'ms -s' \
63 $SCRATCH_MNT/mmap >>$seq.full 2>&1 &
65 echo "--- completed parallel IO ($type)" >>$seq.full
67 for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
68 $here/src/lstat64 $file | head -3 | filter_scratch
70 xfs_quota -c "quota -hnb -$type $id" $QARGS | filter_scratch
71 xfs_quota -c "quota -hni -$type $id" $QARGS | filter_scratch
72 xfs_quota -c "quota -hnr -$type $id" $QARGS | filter_scratch
75 # real QA test starts here
76 rm -f $tmp.projects $seq.full
77 umount $SCRATCH_DEV 2>/dev/null
78 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
79 cat $tmp.mkfs >>$seq.full
85 export QARGS="-x -D /dev/null -P /dev/null $SCRATCH_MNT"
88 echo; echo "### test user accounting"
89 export MOUNT_OPTIONS="-ouquota"
95 umount $SCRATCH_DEV 2>/dev/null
97 echo; echo "### test group accounting"
98 export MOUNT_OPTIONS="-ogquota"
104 umount $SCRATCH_DEV 2>/dev/null
106 #echo; echo "### test project accounting"
107 export MOUNT_OPTIONS="-opquota"
113 umount $SCRATCH_DEV 2>/dev/null