From 1c1b8269d994c0885d753c8f0da8d5154876c7ae Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Tue, 25 Mar 2014 09:36:45 +0530 Subject: tests/quota: Wait till the rebalance is complete Change-Id: Ia6f0c81fb1542ce1de965a69a61535691df056c3 BUG: 1077159 Signed-off-by: Varun Shastry Reviewed-on: http://review.gluster.org/7380 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Reviewed-by: Justin Clift Tested-by: Justin Clift Reviewed-by: Vijay Bellur --- tests/basic/quota.t | 18 ++++++++++++++---- tests/dht.rc | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/basic/quota.t b/tests/basic/quota.t index 81b1c2100..cfc4f0695 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"; ## ## ------------------------------------------------ ################################################### -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 ## ## -------------------------------- 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 663ea5431..54425c9dc 100644 --- a/tests/dht.rc +++ b/tests/dht.rc @@ -76,4 +76,5 @@ function rebalance_completed() fi echo $val + return $val } -- cgit