diff --git a/Makefile.am b/Makefile.am index 338e7226ab10f0dd776e7bae471fc005ed339077..87d0f7a813a7e10837f9edfd687d6a94fa132e88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -867,6 +867,7 @@ maninput = \ man/footer.man man/footer.html $(mangen) TEST_FILES = \ + htest/data/clean-nonzero-score.data \ htest/data/common-suffix.data \ htest/data/empty-cluster.data \ htest/data/hail-alloc-drbd.json \ diff --git a/htest/data/clean-nonzero-score.data b/htest/data/clean-nonzero-score.data new file mode 100644 index 0000000000000000000000000000000000000000..72762fa91c2da8222de01967942b9f8dfda08374 --- /dev/null +++ b/htest/data/clean-nonzero-score.data @@ -0,0 +1,15 @@ +group-01|fake-uuid-01|preferred| + +node-01-001|91552|0|91424|953674|953674|16|N|fake-uuid-01|1 +node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1 +node-01-003|91552|0|91296|953674|953674|16|N|fake-uuid-01|1 + +new-0|128|1024|1|running|Y|node-01-003||diskless||1 +new-1|128|1024|1|running|Y|node-01-002||diskless||1 +new-2|128|1024|1|running|Y|node-01-001||diskless||1 +new-3|128|1024|1|running|Y|node-01-003||diskless||1 +new-4|128|1024|1|running|Y|node-01-002||diskless||1 + + +|128,1,1024,1,1,1|128,1,1024,1,1,1|32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0 +group-01|128,1,1024,1,1,1|128,1,1024,1,1,1|32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0 diff --git a/htest/shelltests/htools-balancing.test b/htest/shelltests/htools-balancing.test index 550cee984494a36a55334c32a6693562eba4063c..6c54d554065863d04c99b1b14798d68c3551158e 100644 --- a/htest/shelltests/htools-balancing.test +++ b/htest/shelltests/htools-balancing.test @@ -97,6 +97,26 @@ diff -u $T/simu-rebal-merged.tiered $T/simu-rebal.tiered.original >>>2 >>>=0 +# and hcheck should report this as needs rebalancing +./htest/hcheck -t$TESTDATA_DIR/n1-failure.data +>>>/Cluster needs rebalancing./ +>>>= 1 + +# ... unless we request no-simulation mode +./htest/hcheck -t$TESTDATA_DIR/n1-failure.data --no-simulation +>>>/Running in no-simulation mode./ +>>>= 0 + +# and a clean cluster should be reported as such +./htest/hcheck $BACKEND_BAL_STD +>>>/No need to rebalance cluster, no problems found./ +>>>= 0 + +# ... and even one with non-zero score +./htest/hcheck -t $TESTDATA_DIR/clean-nonzero-score.data +>>>/No need to rebalance cluster, no problems found./ +>>>= 0 + # hbal should work on empty groups as well ./htest/hbal -t$TESTDATA_DIR/n1-failure.data -G group-02 >>>/Group size 0 nodes, 0 instances/