Improve the `AllocPolicy' test
This test has a few deficiencies, which this patch addresses: - using arbitrary 1 or 2 node count for allocation is obsolete, nowadays we need to use a number appropriate for the instance's disk template (and we should remove that parameter…) - generating a random node is sub-optimal, since we could generate an offline node, and no instance will fit on a cluster composed of only offline nodes - generating arbitrary instances "such that" they can be allocated is an expensive test; let's rather generate instances smaller than our template node, and add a check that they indeed can be allocated - using boolean return type, instead of nicely annotated properties For the nice annotation and the extra check, we need to change a helper function's signature, so that we can extract a bit more information out of it. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Loading
Please register or sign in to comment