« Previous | Next » 

Revision 9e679143

ID9e6791437f5ac3aa844067b2ae6a4031984f14a9

Added by Iustin Pop over 11 years ago

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 <>
Reviewed-by: Guido Trotter <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences