htools-excl.test: add test case for exclusion tags in hbal
authorDato Simó <dato@google.com>
Fri, 12 Oct 2012 15:03:15 +0000 (16:03 +0100)
committerDato Simó <dato@google.com>
Wed, 17 Oct 2012 13:13:26 +0000 (14:13 +0100)
In preparation for future modifications in the exclusion tags field, add a
test that verifies that exclusion tags are being honored: in a test cluster
with two instances of the same exclusion group in each node, hbal should
shuffle instances around to improve the score.

Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

test/data/htools/hbal-excl-tags.data [new file with mode: 0644]
test/htools-excl.test

diff --git a/test/data/htools/hbal-excl-tags.data b/test/data/htools/hbal-excl-tags.data
new file mode 100644 (file)
index 0000000..a91de7e
--- /dev/null
@@ -0,0 +1,12 @@
+group-01|fake-uuid-01|preferred
+
+node-01|16384|0|14336|409600|153600|16|N|fake-uuid-01|1
+node-02|16384|0|13312|409600|153600|16|N|fake-uuid-01|1
+
+dns1|1024|51200|1|running|Y|node-01|node-02|drbd|service-group:dns,foo|1
+dns2|1024|51200|1|running|Y|node-01|node-02|drbd|service-group:dns,foo|1
+ftp1|1024|51200|1|running|Y|node-02|node-01|drbd|test:ftp,bar|1
+ftp2|1024|51200|1|running|Y|node-02|node-01|drbd|test:ftp,bar|1
+admin|1024|51200|1|running|Y|node-02|node-01|drbd|foo|1
+
+htools:iextags:service-group
index 6d97377..22e485a 100644 (file)
@@ -8,3 +8,8 @@
 
 ./test/hbal $BACKEND_EXCL --exclude-instances new-0 --select-instances new-1
 >>>= 0
+
+# Test exclusion tags too (both from the command line and cluster tags).
+./test/hbal -t $TESTDATA_DIR/hbal-excl-tags.data --exclusion-tags test
+>>> /Cluster score improved/
+>>>= 0