Provide generic function for checking quota usage

Provide generic function _check_quota_usage for checking whether quota usage
matches the space used and use it in proper tests.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Jan Kara
2010-07-21 18:50:51 +02:00
committed by Christoph Hellwig
parent 37b7b5a9e1
commit 176002236e
7 changed files with 51 additions and 41 deletions
+1 -13
View File
@@ -50,18 +50,6 @@ s,$SCRATCH_DEV,[SCR_DEV],;
print;"
}
check_usage()
{
quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
sort >$tmp.orig
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
sort >$tmp.checked
quotaon -u -g $SCRATCH_MNT 2>/dev/null
diff $tmp.orig $tmp.checked
}
_filter_num()
{
tee -a $here/$seq.full |\
@@ -113,7 +101,7 @@ if ! _fsstress; then
exit
fi
if ! check_usage; then
if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit