* [PATCH v2] xfstests: fix failed 022 case with qgroup limit test
@ 2014-01-06 9:17 Wang Shilong
0 siblings, 0 replies; only message in thread
From: Wang Shilong @ 2014-01-06 9:17 UTC (permalink / raw)
To: xfs; +Cc: linux-btrfs, jbacik, t-itoh
To have noexceed test, we should clear data before and then retry.
However, when we are near to quota limit, we may fail to truncate/remove
data before, so we restart everthing here.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
changelog v1->v2:
on the right way to fix failed case(Thanks to Tsutomu Itoh)
---
tests/btrfs/022 | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/tests/btrfs/022 b/tests/btrfs/022
index 5b18643..41d8588 100644
--- a/tests/btrfs/022
+++ b/tests/btrfs/022
@@ -94,8 +94,8 @@ _rescan_test()
_fail "exclusive values don't match after rescan"
}
-#basic limit testing
-_limit_test()
+#basic exceed limit testing
+_limit_test_exceed()
{
run_check $BTRFS_UTIL_PROG subvol create $SCRATCH_MNT/a
run_check $BTRFS_UTIL_PROG quota enable $SCRATCH_MNT
@@ -104,6 +104,15 @@ _limit_test()
dd if=/dev/urandom of=$SCRATCH_MNT/a/file bs=10M count=1 >> \
$seqres.full 2>&1
[ $? -ne 0 ] || _fail "quota should have limited us"
+}
+
+#basic noexceed limit testing
+_limit_test_noexceed()
+{
+ run_check $BTRFS_UTIL_PROG subvol create $SCRATCH_MNT/a
+ run_check $BTRFS_UTIL_PROG quota enable $SCRATCH_MNT
+ subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
+ run_check $BTRFS_UTIL_PROG qgroup limit 5M 0/$subvolid $SCRATCH_MNT
dd if=/dev/urandom of=$SCRATCH_MNT/a/file bs=4M count=1 >> \
$seqres.full 2>&1
[ $? -eq 0 ] || _fail "should have been allowed to write"
@@ -121,7 +130,12 @@ _scratch_unmount
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
-_limit_test
+_limit_test_exceed
+_scratch_unmount
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+_limit_test_noexceed
# success, all done
echo "Silence is golden"
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-06 9:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 9:17 [PATCH v2] xfstests: fix failed 022 case with qgroup limit test Wang Shilong
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).