Safe Haskell | None |
---|
Unittests for ganeti-htools.
Synopsis
- genInstanceWithin :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Maybe Int -> Gen Instance
- genInstanceSmallerThan :: Int -> Int -> Int -> Maybe Int -> Gen Instance
- genInstanceSmallerThanNode :: Node -> Gen Instance
- genInstanceMaybeBiggerThanNode :: Node -> Gen Instance
- genInstanceOnNodeList :: List -> Gen Instance
- genInstanceList :: Gen Instance -> Gen List
- prop_creat :: Instance -> Property
- prop_setIdx :: Instance -> Idx -> Property
- prop_setName :: Instance -> String -> Bool
- prop_setAlias :: Instance -> String -> Bool
- prop_setPri :: Instance -> Ndx -> Property
- prop_setSec :: Instance -> Ndx -> Property
- prop_setBoth :: Instance -> Ndx -> Ndx -> Bool
- prop_shrinkMG :: Instance -> Property
- prop_shrinkMF :: Instance -> Property
- prop_shrinkCG :: Instance -> Property
- prop_shrinkCF :: Instance -> Property
- prop_shrinkDG :: Instance -> Property
- prop_shrinkDF :: Instance -> Property
- prop_setMovable :: Instance -> Bool -> Property
- testHTools_Instance :: Test
Arbitrary instances
genInstanceWithin :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Maybe Int -> Gen Instance Source #
Generates a random instance with maximum and minimum diskmemcpu values.
genInstanceSmallerThan :: Int -> Int -> Int -> Maybe Int -> Gen Instance Source #
Generate an instance with maximum diskmemcpu values.
genInstanceSmallerThanNode :: Node -> Gen Instance Source #
Generates an instance smaller than a node.
genInstanceMaybeBiggerThanNode :: Node -> Gen Instance Source #
Generates an instance possibly bigger than a node. In any case, that instance will be bigger than the node's ipolicy's lower bound.
genInstanceOnNodeList :: List -> Gen Instance Source #
Generates an instance with nodes on a node list. The following rules are respected: 1. The instance is never bigger than its primary node 2. If possible the instance has different pnode and snode 3. Else disk templates which require secondary nodes are disabled
genInstanceList :: Gen Instance -> Gen List Source #
Generates an instance list given an instance generator.
Test cases
prop_creat :: Instance -> Property Source #
prop_setIdx :: Instance -> Idx -> Property Source #
prop_setName :: Instance -> String -> Bool Source #
prop_setAlias :: Instance -> String -> Bool Source #
prop_setPri :: Instance -> Ndx -> Property Source #
prop_setSec :: Instance -> Ndx -> Property Source #
prop_shrinkMG :: Instance -> Property Source #
prop_shrinkMF :: Instance -> Property Source #
prop_shrinkCG :: Instance -> Property Source #
prop_shrinkCF :: Instance -> Property Source #
prop_shrinkDG :: Instance -> Property Source #
prop_shrinkDF :: Instance -> Property Source #
prop_setMovable :: Instance -> Bool -> Property Source #
testHTools_Instance :: Test Source #