Initial configuration contains the situation in which two DNS providers
are located on the nodes sharing the same power source. Hbal should
optimize this placement by simple failover.

Signed-off-by: Oleg Ponomarev <[email protected]>
---
 Makefile.am                                   |  1 +
 test/data/htools/hbal-location-exclusion.data | 12 ++++++++++++
 test/hs/shelltests/htools-hbal.test           |  9 +++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 test/data/htools/hbal-location-exclusion.data

diff --git a/Makefile.am b/Makefile.am
index d2a8eba..e4e3665 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1711,6 +1711,7 @@ TEST_FILES = \
        test/data/htools/hbal-excl-tags.data \
        test/data/htools/hbal-forth.data \
        test/data/htools/hbal-location-1.data \
+       test/data/htools/hbal-location-exclusion.data \
        test/data/htools/hbal-migration-1.data \
        test/data/htools/hbal-migration-2.data \
        test/data/htools/hbal-migration-3.data \
diff --git a/test/data/htools/hbal-location-exclusion.data 
b/test/data/htools/hbal-location-exclusion.data
new file mode 100644
index 0000000..e0b9f23
--- /dev/null
+++ b/test/data/htools/hbal-location-exclusion.data
@@ -0,0 +1,12 @@
+group-01|fake-uuid-01|preferred||
+
+node-1|16384|0|15360|409600|358400|16|N|fake-uuid-01|1|power:a
+node-2|16384|0|15360|409600|358400|16|N|fake-uuid-01|1|power:a
+node-3|16384|0|16384|409600|358400|16|N|fake-uuid-01|1|power:b
+node-4|16384|0|16384|409600|358400|1|N|fake-uuid-01|1|power:b
+
+inst01|1024|51200|1|running|Y|node-1|node-3|drbd|service-group:dns|1
+inst02|1024|51200|1|running|Y|node-2|node-4|drbd|service-group:dns|1
+
+htools:nlocation:power
+htools:iextags:service-group
diff --git a/test/hs/shelltests/htools-hbal.test 
b/test/hs/shelltests/htools-hbal.test
index 102ebfc..db6ac21 100644
--- a/test/hs/shelltests/htools-hbal.test
+++ b/test/hs/shelltests/htools-hbal.test
@@ -59,6 +59,15 @@
 >>>/Solution length=[1-9]/
 >>>= 0
 
+./test/hs/hbal --print-nodes=name,pcnt -t 
$TESTDATA_DIR/hbal-location-exclusion.data
+>>>2/Final cluster status:
+ Name   pcnt
+ node-1    0
+ node-2    1
+ node-3    1
+ node-4    0/
+>>>= 0
+
 ./test/hs/hbal -t $TESTDATA_DIR/shared-n1-failure.data --ignore-dynu
 >>>/Cluster is already well balanced/
 >>>= 0
-- 
1.9.1

Reply via email to