From: Jan Kara <jack@suse.cz>
To: fstests@vger.kernel.org
Cc: Jan Kara <jack@suse.cz>
Subject: [PATCH 1/2] generic/382: Make test independent of fs allocation
Date: Fri, 1 Nov 2019 12:00:45 +0100 [thread overview]
Message-ID: <20191101110046.24994-2-jack@suse.cz> (raw)
In-Reply-To: <20191101110046.24994-1-jack@suse.cz>
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
next prev parent reply other threads:[~2019-11-01 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-01 11:00 [PATCH 0/2] Two fixups for quota tests Jan Kara
2019-11-01 11:00 ` Jan Kara [this message]
2019-11-01 11:00 ` [PATCH 2/2] generic/235: Fix false failure on ext2 Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191101110046.24994-2-jack@suse.cz \
--to=jack@suse.cz \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox