summaryrefslogtreecommitdiffstats
path: root/tests/bugs/quota/bug-1038598.t
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-05-25 13:35:48 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-05-25 11:34:22 -0700
commit225ff553106396066d68d8c757e5c001f5d9ab15 (patch)
tree34acc904eb69ec0ee5507ab3cb9e2632bb34a426 /tests/bugs/quota/bug-1038598.t
parentb51ee5f8d1f80d66effffc06c1e49099c04014a4 (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/bugs/quota/bug-1038598.t')
-rw-r--r--tests/bugs/quota/bug-1038598.t12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/bugs/quota/bug-1038598.t b/tests/bugs/quota/bug-1038598.t
index d930a4f62e8..10fdb23424f 100644
--- a/tests/bugs/quota/bug-1038598.t
+++ b/tests/bugs/quota/bug-1038598.t
@@ -4,6 +4,10 @@
cleanup;
+QDD=$(dirname $0)/quota
+# compile the test write program and run it
+build_tester $(dirname $0)/../../basic/quota.c -o $QDD
+
TEST glusterd
TEST pidof glusterd
TEST $CLI volume info;
@@ -59,12 +63,12 @@ TEST $CLI volume quota $V0 limit-usage /test_dir 10MB 50
EXPECT "10.0MB" hard_limit "/test_dir";
EXPECT "50%" soft_limit "/test_dir";
-TEST dd if=/dev/zero of=$M0/test_dir/file1.txt bs=1024k count=4
+TEST $QDD $M0/test_dir/file1.txt 256 16
EXPECT "4.0MB" usage "/test_dir";
EXPECT 'No' sl_exceeded "/test_dir";
EXPECT 'No' hl_exceeded "/test_dir";
-TEST dd if=/dev/zero of=$M0/test_dir/file1.txt bs=1024k count=6
+TEST $QDD $M0/test_dir/file1.txt 256 24
EXPECT "6.0MB" usage "/test_dir";
EXPECT 'Yes' sl_exceeded "/test_dir";
EXPECT 'No' hl_exceeded "/test_dir";
@@ -73,10 +77,12 @@ EXPECT 'No' hl_exceeded "/test_dir";
TEST $CLI volume set $V0 features.hard-timeout 0
TEST $CLI volume set $V0 features.soft-timeout 0
-TEST ! dd if=/dev/zero of=$M0/test_dir/file1.txt bs=1024k count=15
+TEST ! $QDD $M0/test_dir/file1.txt 256 60
EXPECT 'Yes' sl_exceeded "/test_dir";
EXPECT 'Yes' hl_exceeded "/test_dir";
TEST $CLI volume stop $V0
EXPECT "1" get_aux
+rm -f $QDD
+
cleanup;