diff options
author | vmallika <vmallika@redhat.com> | 2015-05-25 13:35:48 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-05-25 11:34:22 -0700 |
commit | 225ff553106396066d68d8c757e5c001f5d9ab15 (patch) | |
tree | 34acc904eb69ec0ee5507ab3cb9e2632bb34a426 /tests/basic/quota.t | |
parent | b51ee5f8d1f80d66effffc06c1e49099c04014a4 (diff) |
Quota: fix testcases not to send parallel writes for accurate
quota enforcement
Currently quota enforcer doesn't consider parallel writes
and allows quota to exceed limit where there are high rate
of parallel writes. Bug# 1223658 tracks the issue.
This patch fixes the spurious failures by not sending
parallel writes.
Using O_SYNC and O_APPEND flags and block size
not more that 256k (For higher block size NFS client
splits the block into 256k chinks and does parallel writes)
Change-Id: I297c164b030cecb87ce5b494c02b09e8b073b276
BUG: 1223798
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/10878
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'tests/basic/quota.t')
-rwxr-xr-x | tests/basic/quota.t | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/basic/quota.t b/tests/basic/quota.t index 7a3aaee2bcf..5552c4fdc3d 100755 --- a/tests/basic/quota.t +++ b/tests/basic/quota.t @@ -8,6 +8,10 @@ cleanup; +QDD=$(dirname $0)/quota +# compile the test write program and run it +build_tester $(dirname $0)/quota.c -o $QDD + TESTS_EXPECTED_IN_LOOP=19 TEST glusterd @@ -72,22 +76,20 @@ TEST $CLI volume quota $V0 hard-timeout 0 ## Verify quota enforcement ## ----------------------------- -# compile the test write program and run it -TEST $CC $(dirname $0)/quota.c -o $(dirname $0)/quota; # Try to create a 12MB file which should fail -TEST ! $(dirname $0)/quota $M0/test_dir/1.txt "12582912" +TEST ! $QDD $M0/test_dir/1.txt 256 48 TEST rm $M0/test_dir/1.txt # wait for marker's accounting to complete EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir" -TEST dd if=/dev/urandom of=$M0/test_dir/2.txt bs=1024k count=8 +TEST $QDD $M0/test_dir/2.txt 256 32 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir" TEST rm $M0/test_dir/2.txt EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir" ## rename tests -TEST dd if=/dev/urandom of=$M0/test_dir/2 bs=1024k count=8 +TEST $QDD $M0/test_dir/2 256 32 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir" TEST mv $M0/test_dir/2 $M0/test_dir/0 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir" @@ -144,8 +146,7 @@ done #53-62 for i in `seq 1 9`; do - TEST_IN_LOOP dd if=/dev/urandom of="$M0/$TESTDIR/dir1/10MBfile$i" \ - bs=1024k count=10; + TEST_IN_LOOP $QDD "$M0/$TESTDIR/dir1/10MBfile$i" 256 40 done # 63-64 @@ -160,7 +161,7 @@ EXPECT_WITHIN $REBALANCE_TIMEOUT "0" rebalance_completed ## <Try creating data beyond limit> ## -------------------------------- for i in `seq 1 200`; do - dd if=/dev/urandom of="$M0/$TESTDIR/dir1/1MBfile$i" bs=1024k count=1 \ + $QDD of="$M0/$TESTDIR/dir1/1MBfile$i" 256 4\ 2>&1 | egrep -v '(No space left|Disc quota exceeded)' done @@ -194,4 +195,5 @@ EXPECT 'Stopped' volinfo_field $V0 'Status'; TEST $CLI volume delete $V0; TEST ! $CLI volume info $V0; +rm -f $QDD cleanup; |