Fix htool unittest failure due to invalid prereqs
authorIustin Pop <iustin@google.com>
Thu, 14 Jul 2011 09:32:22 +0000 (11:32 +0200)
committerIustin Pop <iustin@google.com>
Thu, 14 Jul 2011 10:14:59 +0000 (12:14 +0200)
commit3158250d7b3696cc349b941ba707d55f1fd1a6d2
tree1fb481961fbe6fc3ae976b429d3b471909d8c974
parentbef83fd1972100aca9f4e2acb6e82d6524e7d168
Fix htool unittest failure due to invalid prereqs

Currently, the test prop_Node_rMem does some reserved memory checks on
nodes, and for the test to work correctly (can add more instances) we
require that the node free memory is greater than zero via a
prerequisite.

However, if the node free memory is exactly 1, the call to
setInstanceSmallerThanNode will set the instance memory to "free
memory `div` 2", and since this is integer division, the instance
memory will get set to 0. Which means that the node reserved memory
will not increase when we add this instance as secondary.

To work around, we simply require that the node memory is high enough
(we use our 'base' unit of memory).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
htools/Ganeti/HTools/QC.hs