* [PATCH 0/2] Two fixups for quota tests
@ 2019-11-01 11:00 Jan Kara
2019-11-01 11:00 ` [PATCH 1/2] generic/382: Make test independent of fs allocation Jan Kara
2019-11-01 11:00 ` [PATCH 2/2] generic/235: Fix false failure on ext2 Jan Kara
0 siblings, 2 replies; 3+ messages in thread
From: Jan Kara @ 2019-11-01 11:00 UTC (permalink / raw)
To: fstests
Hello,
the two patches in this series fix up false test failures in generic/235
and generic/382 tests for ext2/ext3. In both cases the problem is the
tests assume particular amount of blocks is consumed but this is not the
case for ext2/ext3 due to indirect blocks.
Honza
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] generic/382: Make test independent of fs allocation
2019-11-01 11:00 [PATCH 0/2] Two fixups for quota tests Jan Kara
@ 2019-11-01 11:00 ` Jan Kara
2019-11-01 11:00 ` [PATCH 2/2] generic/235: Fix false failure on ext2 Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2019-11-01 11:00 UTC (permalink / raw)
To: fstests; +Cc: Jan Kara
Test generic/382 depends on filesystem allocating exactly 30M of blocks
when writing 30M file. This is not true for some filesystems - e.g. for
ext2 due to indirect blocks - while leads to false positive failures.
In this case, the test is not actually interested in comparing exact
usage, rather in verifying the ability to write 30M worth of data. So
instead of comparing 'xfs_quota report' output, just depend on detecting
error when writing files.
Signed-off-by: Jan Kara <jack@suse.cz>
---
tests/generic/382 | 9 ++-------
tests/generic/382.out | 12 ------------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/tests/generic/382 b/tests/generic/382
index 50816f69a915..5ae229052bdc 100755
--- a/tests/generic/382
+++ b/tests/generic/382
@@ -67,21 +67,16 @@ do_test()
$XFS_QUOTA_PROG -x -c "report $type -N -bi" $SCRATCH_MNT | grep -v ^root | _filter_spaces
## blocks default quota test ##
- _user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
- echo "$qname blocks quota after write 30M data"
- $XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+ _user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" 2>&1 | _filter_xfs_io
rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
## inode default quota test ##
for ((i=0; i<30; i++));do
- _user_do "echo -n > ${SCRATCH_MNT}/file${i}"
+ _user_do "echo -n > ${SCRATCH_MNT}/file${i}" 2>&1
done
sync
- echo "$qname inode quota after creating 30 inodes"
- $XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
}
diff --git a/tests/generic/382.out b/tests/generic/382.out
index ad32ccd334bd..a538ca67368c 100644
--- a/tests/generic/382.out
+++ b/tests/generic/382.out
@@ -5,21 +5,9 @@ fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
wrote 31457280/31457280 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-user blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-user inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
=== group quota test ===
group blocks and inode limit
fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
wrote 31457280/31457280 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-group blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-group inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] generic/235: Fix false failure on ext2
2019-11-01 11:00 [PATCH 0/2] Two fixups for quota tests Jan Kara
2019-11-01 11:00 ` [PATCH 1/2] generic/382: Make test independent of fs allocation Jan Kara
@ 2019-11-01 11:00 ` Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2019-11-01 11:00 UTC (permalink / raw)
To: fstests; +Cc: Jan Kara
The test gives false failure on ext2 filesystem as 64k file already has
indirect block and so space usage does not exactly match expectation.
The test really needs to verify only whether quota accounting got
reenabled so just test using creating another empty file which is not
prone to these problems.
Signed-off-by: Jan Kara <jack@suse.cz>
---
tests/generic/235 | 5 +++--
tests/generic/235.out | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/generic/235 b/tests/generic/235
index 6adc803c04b7..01db4711a0ec 100755
--- a/tests/generic/235
+++ b/tests/generic/235
@@ -55,8 +55,9 @@ _try_scratch_mount "-o remount,ro" 2>&1 | tee -a $seqres.full | _filter_scratch
touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
_try_scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
-$XFS_IO_PROG -c 'pwrite 0 64k' -c 'fsync' \
- $SCRATCH_MNT/testfile >>$seqres.full 2>&1
+touch $SCRATCH_MNT/testfile2
+chown $qa_user:$qa_user $SCRATCH_MNT/testfile2
+
do_repquota
_scratch_unmount 2>/dev/null
diff --git a/tests/generic/235.out b/tests/generic/235.out
index abcb47a69d06..87b16e0acf6d 100644
--- a/tests/generic/235.out
+++ b/tests/generic/235.out
@@ -17,10 +17,10 @@ Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa -- 64 0 0 1 0 0
+fsgqa -- 0 0 0 2 0 0
*** 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
----------------------------------------------------------------------
-fsgqa -- 64 0 0 1 0 0
+fsgqa -- 0 0 0 2 0 0
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-01 11:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01 11:00 [PATCH 0/2] Two fixups for quota tests Jan Kara
2019-11-01 11:00 ` [PATCH 1/2] generic/382: Make test independent of fs allocation Jan Kara
2019-11-01 11:00 ` [PATCH 2/2] generic/235: Fix false failure on ext2 Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).