Test for hroller taking non-redundant instances into account
authorKlaus Aehlig <aehlig@google.com>
Tue, 14 May 2013 09:45:22 +0000 (11:45 +0200)
committerKlaus Aehlig <aehlig@google.com>
Wed, 22 May 2013 09:08:56 +0000 (11:08 +0200)
The example cluster consists of 6 nodes, each hosting 2 instances and
having capacity for 3. So, while the drbd-induced graph consists of
only insulated nodes, no more than two nodes can be rebooted at the
same time.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Makefile.am
test/data/htools/hroller-nonredundant.data [new file with mode: 0644]
test/hs/shelltests/htools-hroller.test

index 27c9b97..24ac39e 100644 (file)
@@ -1056,6 +1056,7 @@ TEST_FILES = \
        test/data/htools/rapi/info.json \
        test/data/htools/rapi/instances.json \
        test/data/htools/rapi/nodes.json \
+       test/data/htools/hroller-nonredundant.data \
        test/data/htools/hroller-online.data \
        test/data/htools/unique-reboot-order.data \
        test/hs/shelltests/htools-balancing.test \
diff --git a/test/data/htools/hroller-nonredundant.data b/test/data/htools/hroller-nonredundant.data
new file mode 100644 (file)
index 0000000..73f73aa
--- /dev/null
@@ -0,0 +1,25 @@
+group-01|fake-uuid-01|preferred|
+
+node-01-000|91552|0|91424|3100|1052|16|M|fake-uuid-01|1
+node-01-001|91552|0|91424|3100|1052|16|N|fake-uuid-01|1
+node-01-002|91552|0|91424|3100|1052|16|N|fake-uuid-01|1
+node-01-003|91552|0|91424|3100|1052|16|N|fake-uuid-01|1
+node-01-004|91552|0|91424|3100|1052|16|N|fake-uuid-01|1
+node-01-005|91552|0|91424|3100|1052|16|N|fake-uuid-01|1
+
+inst-00|128|1024|1|running|Y|node-01-000||plain||1
+inst-01|128|1024|1|running|Y|node-01-000||plain||1
+inst-10|128|1024|1|running|Y|node-01-001||plain||1
+inst-11|128|1024|1|running|Y|node-01-001||plain||1
+inst-20|128|1024|1|running|Y|node-01-002||plain||1
+inst-21|128|1024|1|running|Y|node-01-002||plain||1
+inst-30|128|1024|1|running|Y|node-01-003||plain||1
+inst-31|128|1024|1|running|Y|node-01-003||plain||1
+inst-40|128|1024|1|running|Y|node-01-004||plain||1
+inst-41|128|1024|1|running|Y|node-01-004||plain||1
+inst-50|128|1024|1|running|Y|node-01-005||plain||1
+inst-51|128|1024|1|running|Y|node-01-005||plain||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
+
index d2499d7..bfa064d 100644 (file)
@@ -34,3 +34,18 @@ node-01-002
 node-01-003/
 >>>= 0
 
+./test/hs/hroller --no-headers -t $TESTDATA_DIR/hroller-nonredundant.data
+>>>/^node-01-00.,node-01-00.
+node-01-00.,node-01-00.
+node-01-00.,node-01-000$/
+>>>= 0
+
+./test/hs/hroller --skip-non-redundant -t $TESTDATA_DIR/hroller-nonredundant.data
+>>>2
+Error: Cannot create node graph
+>>>=1
+
+./test/hs/hroller --no-headers --ignore-non-redundant -t $TESTDATA_DIR/hroller-nonredundant.data
+>>>/^node-01-00.,node-01-00.,node-01-00.,node-01-00.,node-01-00.,node-01-000$/
+>>>= 0
+