From: Klaus Aehlig Date: Wed, 26 Jun 2013 11:58:36 +0000 (+0200) Subject: Add test for the --full-evacuation option X-Git-Tag: v2.9.0beta1~152 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/ed74dde59b0491f484d3dabf2edbba97f2c2587c Add test for the --full-evacuation option 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 Reviewed-by: Michele Tartara --- diff --git a/Makefile.am b/Makefile.am index 3181009..91f3f37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..e011828 --- /dev/null +++ b/test/data/htools/hroller-full.data @@ -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 diff --git a/test/hs/shelltests/htools-hroller.test b/test/hs/shelltests/htools-hroller.test index e7b4e7f..422eda6 100644 --- a/test/hs/shelltests/htools-hroller.test +++ b/test/hs/shelltests/htools-hroller.test @@ -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