* [PATCH v3] xfstests: Improve test 219 to work with different filesystems
@ 2011-06-29 16:04 Jan Kara
2011-07-15 15:39 ` Alex Elder
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2011-06-29 16:04 UTC (permalink / raw)
To: xfs; +Cc: Jan Kara
Different filesystems account different amount of metadata in quota. Thus it is
impractical to check for a particular amount of space occupied by a file
because there is no right value. Change the test to verify whether the amount
of space is between the expected amount of space and the expected amount +5%.
The number of files is checked exactly as previously.
Signed-off-by: Jan Kara <jack@suse.cz>
---
219 | 25 +++++++++++++++++++++++--
219.out | 18 ++----------------
2 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/219 b/219
index 836d703..ad4e64d 100755
--- a/219
+++ b/219
@@ -58,6 +58,23 @@ test_files()
done
}
+check_usage()
+{
+ wroteblocks=$1
+ wrotefiles=$2
+ read id exceed blocks bsoft bhard inodes isoft ihard
+ if [ "$blocks" -lt "$wroteblocks" ]; then
+ echo "Too few blocks used (type=$type)"
+ # Save 5% for overhead of metadata or different block size
+ elif [ "$blocks" -gt $((wroteblocks+wroteblocks/20)) ]; then
+ echo "Too many blocks used (type=$type)"
+ elif [ "$inodes" != "$wrotefiles" ]; then
+ echo "Bad number of inodes used (type=$type)"
+ else
+ echo "Usage OK (type=$type)"
+ fi
+}
+
test_accounting()
{
echo "### some controlled buffered, direct and mmapd IO (type=$type)"
@@ -77,8 +94,12 @@ test_accounting()
$here/src/lstat64 $file | head -3 | _filter_scratch
done
- repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | _filter_scratch |
- awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ if [ $type == 'u' ]; then
+ id=$uid
+ else
+ id=$gid
+ fi
+ repquota -$type -n $SCRATCH_MNT | grep "^#$id" | check_usage 144 3
}
# real QA test starts here
diff --git a/219.out b/219.out
index fadfafc..23ec57c 100644
--- a/219.out
+++ b/219.out
@@ -22,14 +22,7 @@ QA output created by 219
File: "SCRATCH_MNT/mmap"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
-*** Report for user quotas on device SCRATCH_DEV
-Block grace time: 7days; Inode grace time: 7days
- Block limits File limits
-User used soft hard grace used soft hard grace
-----------------------------------------------------------------------
-#1 -- 144 0 0 3 0 0
-
-
+Usage OK (type=u)
### test group accounting
@@ -53,11 +46,4 @@ User used soft hard grace used soft hard grace
File: "SCRATCH_MNT/mmap"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
-*** Report for group quotas on device SCRATCH_DEV
-Block grace time: 7days; Inode grace time: 7days
- Block limits File limits
-Group used soft hard grace used soft hard grace
-----------------------------------------------------------------------
-#2 -- 144 0 0 3 0 0
-
-
+Usage OK (type=g)
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v3] xfstests: Improve test 219 to work with different filesystems
2011-06-29 16:04 [PATCH v3] xfstests: Improve test 219 to work with different filesystems Jan Kara
@ 2011-07-15 15:39 ` Alex Elder
2011-07-18 15:36 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Alex Elder @ 2011-07-15 15:39 UTC (permalink / raw)
To: Jan Kara; +Cc: xfs
On Wed, 2011-06-29 at 18:04 +0200, Jan Kara wrote:
> Different filesystems account different amount of metadata in quota. Thus it is
> impractical to check for a particular amount of space occupied by a file
> because there is no right value. Change the test to verify whether the amount
> of space is between the expected amount of space and the expected amount +5%.
> The number of files is checked exactly as previously.
>
> Signed-off-by: Jan Kara <jack@suse.cz>
Looks good. After verifying it (at least on XFS), I
will commit this for you.
Reviewed-by: Alex Elder <aelder@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] xfstests: Improve test 219 to work with different filesystems
2011-07-15 15:39 ` Alex Elder
@ 2011-07-18 15:36 ` Jan Kara
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2011-07-18 15:36 UTC (permalink / raw)
To: Alex Elder; +Cc: Jan Kara, xfs
On Fri 15-07-11 10:39:14, Alex Elder wrote:
> On Wed, 2011-06-29 at 18:04 +0200, Jan Kara wrote:
> > Different filesystems account different amount of metadata in quota. Thus it is
> > impractical to check for a particular amount of space occupied by a file
> > because there is no right value. Change the test to verify whether the amount
> > of space is between the expected amount of space and the expected amount +5%.
> > The number of files is checked exactly as previously.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
>
> Looks good. After verifying it (at least on XFS), I
> will commit this for you.
>
> Reviewed-by: Alex Elder <aelder@sgi.com>
Thanks for testing and committing!
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-18 15:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-29 16:04 [PATCH v3] xfstests: Improve test 219 to work with different filesystems Jan Kara
2011-07-15 15:39 ` Alex Elder
2011-07-18 15:36 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox