Add test for the --full-evacuation option
authorKlaus Aehlig <aehlig@google.com>
Wed, 26 Jun 2013 11:58:36 +0000 (13:58 +0200)
committerKlaus Aehlig <aehlig@google.com>
Mon, 1 Jul 2013 07:53:59 +0000 (09:53 +0200)
In this example cluster, there are four pairs of nodes, each hosting
two instances. Each node has disk capacity for an additional instance.
Therefore, for normal online rolling reboots, there are two node groups,
of four nodes each, whereas for full evacuation, these have to be refined
to four groups, of two nodes each.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

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

index 3181009..91f3f37 100644 (file)
@@ -1084,6 +1084,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-full.data \
        test/data/htools/hroller-nodegroups.data \
        test/data/htools/hroller-nonredundant.data \
        test/data/htools/hroller-online.data \
diff --git a/test/data/htools/hroller-full.data b/test/data/htools/hroller-full.data
new file mode 100644 (file)
index 0000000..e011828
--- /dev/null
@@ -0,0 +1,22 @@
+group-01|fake-uuid-01|preferred|
+
+node-00|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-01|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-10|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-11|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-20|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-21|91552|0|91424|3102|1052|16|N|fake-uuid-01|1
+node-30|91553|0|91424|3102|1053|16|N|fake-uuid-01|1
+node-31|91553|0|91424|3102|1053|16|M|fake-uuid-01|1
+
+inst-00|128|1024|1|running|Y|node-00|node-01|drbd||1
+inst-00|128|1024|1|running|Y|node-01|node-00|drbd||1
+inst-10|128|1024|1|running|Y|node-10|node-11|drbd||1
+inst-11|128|1024|1|running|Y|node-11|node-10|drbd||1
+inst-20|128|1024|1|running|Y|node-20|node-21|drbd||1
+inst-21|128|1024|1|running|Y|node-21|node-20|drbd||1
+inst-30|128|1024|1|running|Y|node-30|node-31|drbd||1
+inst-31|128|1024|1|running|Y|node-31|node-30|drbd||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 e7b4e7f..422eda6 100644 (file)
@@ -66,3 +66,29 @@ Error: Cannot create node graph
 node-01-00.
 node-01-00.,node-02-000$/
 >>>= 0
+
+./test/hs/hroller --no-headers -t $TESTDATA_DIR/hroller-full.data
+>>>/^node-..,node-..,node-..,node-..
+node-..,node-..,node-..,node-31$/
+>>>= 0
+
+./test/hs/hroller --no-headers --full-evacuation -t $TESTDATA_DIR/hroller-full.data
+>>>/^node-..,node-..
+node-..,node-..
+node-..,node-..
+node-..,node-31$/
+>>>= 0
+
+./test/hs/hroller --no-headers --full-evacuation --one-step-only --print-moves -t $TESTDATA_DIR/hroller-full.data
+>>>/^node-..
+node-..
+  inst-.. node-.. node-..
+  inst-.. node-.. node-..
+  inst-.. node-.. node-..
+  inst-.. node-.. node-..$/
+>>>= 0
+
+./test/hs/hroller --full-evacuation -t $TESTDATA_DIR/unique-reboot-order.data
+>>>2
+Error: Not enough capacity to move secondaries
+>>>=1