From: David Zafman Date: Sat, 14 Dec 2019 01:14:51 +0000 (-0800) Subject: test: Fix test case for pool based balancing instead of rule batched X-Git-Tag: v14.2.8~20^2~18^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e51e0896fd91c1c9e4ee7ec50b1571ef74c134dd;p=ceph.git test: Fix test case for pool based balancing instead of rule batched Signed-off-by: David Zafman (cherry picked from commit 8e46bbbf36e3d3795c1d3ba50c431ac80467da20) --- diff --git a/qa/standalone/mgr/balancer.sh b/qa/standalone/mgr/balancer.sh index f7aba3156d36..ce38dd137542 100755 --- a/qa/standalone/mgr/balancer.sh +++ b/qa/standalone/mgr/balancer.sh @@ -195,17 +195,20 @@ function TEST_balancer2() { sleep 30 ceph osd df - # FINAL_PER_OSD2 should distribute evenly + # We should be with plue or minus 1 of FINAL_PER_OSD2 + # This is because here each pool is balanced independently + MIN=$(expr $FINAL_PER_OSD2 - 1) + MAX=$(expr $FINAL_PER_OSD2 + 1) PGS=$(ceph osd df --format=json-pretty | jq '.nodes[0].pgs') - test $PGS -eq $FINAL_PER_OSD2 || return 1 + test $PGS -ge $MIN -a $PGS -le $MAX || return 1 PGS=$(ceph osd df --format=json-pretty | jq '.nodes[1].pgs') - test $PGS -eq $FINAL_PER_OSD2 || return 1 + test $PGS -ge $MIN -a $PGS -le $MAX || return 1 PGS=$(ceph osd df --format=json-pretty | jq '.nodes[2].pgs') - test $PGS -eq $FINAL_PER_OSD2 || return 1 + test $PGS -ge $MIN -a $PGS -le $MAX || return 1 PGS=$(ceph osd df --format=json-pretty | jq '.nodes[3].pgs') - test $PGS -eq $FINAL_PER_OSD2 || return 1 + test $PGS -ge $MIN -a $PGS -le $MAX || return 1 PGS=$(ceph osd df --format=json-pretty | jq '.nodes[4].pgs') - test $PGS -eq $FINAL_PER_OSD2 || return 1 + test $PGS -ge $MIN -a $PGS -le $MAX || return 1 teardown $dir || return 1 }