summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2014-03-25 09:36:45 +0530
committerVijay Bellur <vbellur@redhat.com>2014-04-02 07:53:15 -0700
commit1c1b8269d994c0885d753c8f0da8d5154876c7ae (patch)
tree251d8d772aa29af73f4073fabff81f31a2e2868c
parent0c1d78f5c52c69268ec3a1d8d5fcb1a1bf15f243 (diff)
tests/quota: Wait till the rebalance is complete
Change-Id: Ia6f0c81fb1542ce1de965a69a61535691df056c3 BUG: 1077159 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7380 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Justin Clift <justin@gluster.org> Tested-by: Justin Clift <justin@gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rwxr-xr-xtests/basic/quota.t18
-rw-r--r--tests/dht.rc1
2 files changed, 15 insertions, 4 deletions
diff --git a/tests/basic/quota.t b/tests/basic/quota.t
index 81b1c2100bc..cfc4f06950d 100755
--- a/tests/basic/quota.t
+++ b/tests/basic/quota.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../dht.rc
cleanup;
@@ -110,7 +111,7 @@ EXPECT "150.0MB" hard_limit "/test_dir/in_test_dir";
## <Test quota functionality in add-brick senarios>
## ------------------------------------------------
###################################################
-QUOTALIMIT=1024
+QUOTALIMIT=100
QUOTALIMITROOT=2048
TESTDIR="addbricktest"
@@ -135,8 +136,8 @@ done
#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;
+ TEST_IN_LOOP dd if=/dev/urandom of="$M0/$TESTDIR/dir1/10MBfile$i" \
+ bs=1M count=10;
done
# 63-64
@@ -145,11 +146,20 @@ done
TEST $CLI volume add-brick $V0 $H0:$B0/brick{3,4}
TEST $CLI volume rebalance $V0 start;
+## Wait for rebalance
+while true; do
+ rebalance_completed
+ if [ $? -eq 1 ]; then
+ sleep 1;
+ else
+ break;
+ fi
+done
## <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 \
+ dd if=/dev/urandom of="$M0/$TESTDIR/dir1/1MBfile$i" bs=1M count=1 \
&>/dev/null
done
diff --git a/tests/dht.rc b/tests/dht.rc
index 663ea543173..54425c9dc69 100644
--- a/tests/dht.rc
+++ b/tests/dht.rc
@@ -76,4 +76,5 @@ function rebalance_completed()
fi
echo $val
+ return $val
}