Commit 754b9b1c authored by Klaus Aehlig's avatar Klaus Aehlig

Add unit tests for hroller

Add a unit test for hroller in a situation where the order
is completely determined. There are 3 nodes where node 2 has,
for each of the other nodes, an instanced shared with it. So
node 2 has to be a reboot group of its own. There are no more
instances, hence, my minimality, the other two nodes have to
form a single group. Node 1 is the master, and hence has to
be rebooted last; this determines the order.

Also add a unit test verifying that hroller rejects configurations
with multiple master nodes, even if the option --force is given.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 000ca91a
......@@ -1004,16 +1004,19 @@ TEST_FILES = \
test/data/htools/hbal-split-insts.data \
test/data/htools/invalid-node.data \
test/data/htools/missing-resources.data \
test/data/htools/multiple-master.data \
test/data/htools/n1-failure.data \
test/data/htools/rapi/groups.json \
test/data/htools/rapi/info.json \
test/data/htools/rapi/instances.json \
test/data/htools/rapi/nodes.json \
test/data/htools/unique-reboot-order.data \
test/hs/shelltests/htools-balancing.test \
test/hs/shelltests/htools-basic.test \
test/hs/shelltests/htools-dynutil.test \
test/hs/shelltests/htools-excl.test \
test/hs/shelltests/htools-hail.test \
test/hs/shelltests/htools-hroller.test \
test/hs/shelltests/htools-hspace.test \
test/hs/shelltests/htools-invalid.test \
test/hs/shelltests/htools-multi-group.test \
......
group-01|fake-uuid-01|preferred|
node-01-001|91552|0|91424|953674|953674|16|M|fake-uuid-01|1
node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1
node-01-003|91552|0|91296|953674|953674|16|M|fake-uuid-01|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
group-01|fake-uuid-01|preferred|
node-01-001|91552|0|91424|953674|953674|16|M|fake-uuid-01|1
node-01-002|91552|0|91296|953674|953674|16|N|fake-uuid-01|1
node-01-003|91552|0|91296|953674|953674|16|N|fake-uuid-01|1
new-0|128|1152|1|running|Y|node-01-001|node-01-002|drbd||1
new-1|128|1152|1|running|Y|node-01-002|node-01-003|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
./test/hs/hroller --no-headers -t $TESTDATA_DIR/unique-reboot-order.data
>>>
node-01-002
node-01-003,node-01-001
>>>= 0
......@@ -62,6 +62,12 @@ Error: This program doesn't take any arguments.
>>>2/Error: Cannot create node graph/
>>>=1
# hroller should reject a configuration with more than one master,
# even with -f
./test/hs/hroller -f -t$TESTDATA_DIR/multiple-master.data
>>>2/Error: Found more than one master node/
>>>=1
# hbal doesn't accept invalid priority
./test/hs/hbal --priority=abc
>>>2/Unknown priority/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment