summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2013-12-02 15:49:58 +0530
committerVijay Bellur <vbellur@redhat.com>2014-01-22 21:39:57 -0800
commit6c9fe8fa8896c5f4fbe8c9bac6c2c7f9add92a0b (patch)
treef9e5c595e8deb1c8194e11bfadef4cc4a0c7c6f7 /tests
parent7bea98fa5845ced670d7bb2d9b1336c03855a798 (diff)
cluster/dht: Set quota limit key in dht_selfheal of dirs.
Also fixed check in dht_is_subvol_in_layout to check if the layouts are zero'ed out. Change-Id: I4bf8ebf66d3ef1946309b6c9aac9e79bf8a6d495 BUG: 969461 Signed-off-by: shishir gowda <sgowda@redhat.com> Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/6392 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic/quota.t71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/basic/quota.t b/tests/basic/quota.t
index 5c531adbf79..81b1c2100bc 100755
--- a/tests/basic/quota.t
+++ b/tests/basic/quota.t
@@ -5,6 +5,8 @@
cleanup;
+TESTS_EXPECTED_IN_LOOP=19
+
TEST glusterd
TEST pidof glusterd
TEST $CLI volume info;
@@ -102,6 +104,75 @@ TEST $CLI volume quota $V0 limit-usage /test_dir/in_test_dir 150MB
EXPECT "150.0MB" hard_limit "/test_dir/in_test_dir";
## -----------------------------
+
+###################################################
+## ------------------------------------------------
+## <Test quota functionality in add-brick senarios>
+## ------------------------------------------------
+###################################################
+QUOTALIMIT=1024
+QUOTALIMITROOT=2048
+TESTDIR="addbricktest"
+
+rm -rf $M0/*;
+
+## <Create directories and test>
+## -----------------------------
+# 41-42
+TEST mkdir $M0/$TESTDIR
+TEST mkdir $M0/$TESTDIR/dir{1..10};
+
+
+# 43-52
+## <set limits>
+## -----------------------------
+TEST $CLI volume quota $V0 limit-usage / "$QUOTALIMITROOT"MB;
+for i in {1..10}; do
+ TEST_IN_LOOP $CLI volume quota $V0 limit-usage /$TESTDIR/dir$i \
+ "$QUOTALIMIT"MB;
+done
+## </Enable quota and set limits>
+
+#53-62
+for i in `seq 1 9`; do
+ TEST_IN_LOOP dd if=/dev/urandom of="$M0/$TESTDIR/dir1/100MBfile$i" \
+ bs=1M count=100;
+done
+
+# 63-64
+## <Add brick and start rebalance>
+## -------------------------------
+TEST $CLI volume add-brick $V0 $H0:$B0/brick{3,4}
+TEST $CLI volume rebalance $V0 start;
+
+
+## <Try creating data beyond limit>
+## --------------------------------
+for i in `seq 1 200`; do
+ dd if=/dev/urandom of="$M0/$TESTDIR/dir1/10MBfile$i" bs=1M count=10 \
+ &>/dev/null
+done
+
+# 65
+## <Test whether quota limit crossed more than 10% of limit>
+## ---------------------------------------------------------
+USED_KB=`du -s $M0/$TESTDIR/dir1 | cut -f1`;
+USED_MB=$(($USED_KB/1024));
+TEST [ $USED_MB -le $((($QUOTALIMIT * 110) / 100)) ]
+
+# 66-67
+## <Test the xattrs healed to new brick>
+## -------------------------------------
+TEST getfattr -d -m "trusted.glusterfs.quota.limit-set" -e hex \
+ --absolute-names $B0/brick{3,4}/$TESTDIR/dir{1..10};
+# Test on root.
+TEST getfattr -d -m "trusted.glusterfs.quota.limit-set" -e hex \
+ --absolute-names $B0/brick{3,4};
+
+## -------------------------------------------------
+## </Test quota functionality in add-brick senarios>
+## -------------------------------------------------
+
TEST $CLI volume quota $V0 disable
TEST $CLI volume stop $V0;
EXPECT 'Stopped' volinfo_field $V0 'Status';