Commit 76d6ca61 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

In CanTieredAlloc test set IPolicy



Changing the test to allocate on nodes with a non-trivial
instance policy has two advantages.

- We test in a more realistic (and also more challenging)
  environment.

- Once the lower limit of the ipolicy is reached no more
  allocations are possible, thus having fewer shrinking
  rounds---and hence speeding up the test by a factor of 4.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent a5f87855
......@@ -39,6 +39,7 @@ module Test.Ganeti.HTools.Cluster (testHTools_Cluster) where
import Test.QuickCheck hiding (Result)
import Control.Monad (liftM)
import qualified Data.IntMap as IntMap
import Data.Maybe
......@@ -168,7 +169,8 @@ prop_Alloc_sane inst =
prop_CanTieredAlloc :: Property
prop_CanTieredAlloc =
forAll (choose (2, 5)) $ \count ->
forAll (genOnlineNode `suchThat` isNodeBig 4) $ \node ->
forAll (liftM (Node.setPolicy Types.defIPolicy)
(genOnlineNode `suchThat` isNodeBig 4)) $ \node ->
forAll (genInstanceMaybeBiggerThanNode node) $ \inst ->
let nl = makeSmallCluster node count
il = Container.empty
......
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