LGTM, thanks On Thu, Mar 26, 2015 at 2:37 PM, 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> 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: Klaus Aehlig <[email protected]> > --- > test/hs/Test/Ganeti/HTools/Cluster.hs | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/test/hs/Test/Ganeti/HTools/Cluster.hs > b/test/hs/Test/Ganeti/HTools/Cluster.hs > index bfb2921..e80f2a3 100644 > --- a/test/hs/Test/Ganeti/HTools/Cluster.hs > +++ b/test/hs/Test/Ganeti/HTools/Cluster.hs > @@ -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 > -- > 2.2.0.rc0.207.ga3a616c > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
