ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.QC
Contents
Constants
Helper functions
Arbitrary instances
Actual tests
Utils tests
PeerMap tests
Container tests
Instance tests
Text backend tests
Node tests
Cluster tests
OpCodes tests
Jobs tests
Loader tests
Types tests
Description
Unittests for ganeti-htools.
Synopsis
run :: Testable prop => prop -> Args -> IO Result
maxMem :: Int
maxDsk :: Int
maxCpu :: Int
defGroup :: Group
defGroupList :: List
defGroupAssoc :: Map String Gdx
isFailure :: OpResult a -> Bool
makeSmallCluster :: Node -> Int -> List
isNodeBig :: Node -> Int -> Bool
canBalance :: Table -> Bool -> Bool -> Bool -> Bool
assignInstance :: List -> List -> Instance -> Idx -> Idx -> (List, List)
newtype DNSChar = DNSChar {
dnsGetChar :: Char
}
getName :: Gen String
getFQDN :: Gen String
genNode :: Maybe Int -> Maybe Int -> Gen Node
newtype SmallRatio = SmallRatio Double
prop_Utils_if'if :: Bool -> Int -> Int -> Bool
prop_Utils_select :: Int -> [Int] -> [Int] -> Bool
prop_Utils_select_undefd :: [Int] -> NonEmptyList Int -> Bool
prop_Utils_select_undefv :: [Int] -> NonEmptyList Int -> Bool
prop_Loader_compareNameComponent_equal :: String -> Bool
prop_Loader_compareNameComponent_prefix :: NonEmptyList Char -> String -> Bool
Documentation
run :: Testable prop => prop -> Args -> IO ResultSource
Constants
maxMem :: IntSource
Maximum memory (1TiB, somewhat random value).
maxDsk :: IntSource
Maximum disk (8TiB, somewhat random value).
maxCpu :: IntSource
Max CPUs (1024, somewhat random value).
defGroup :: GroupSource
defGroupList :: ListSource
defGroupAssoc :: Map String GdxSource
Helper functions
isFailure :: OpResult a -> BoolSource
Simple checker for whether OpResult is fail or pass.
makeSmallCluster :: Node -> Int -> ListSource

Update an instance to be smaller than a node.

Create an instance given its spec.

Create a small cluster by repeating a node spec.

isNodeBig :: Node -> Int -> BoolSource
Checks if a node is big enough.
canBalance :: Table -> Bool -> Bool -> Bool -> BoolSource
assignInstance :: List -> List -> Instance -> Idx -> Idx -> (List, List)Source
Assigns a new fresh instance to a cluster; this is not allocation, so no resource checks are done.
Arbitrary instances
newtype DNSChar Source
Defines a DNS name.
Constructors
DNSChar
dnsGetChar :: Char
getName :: Gen StringSource
getFQDN :: Gen StringSource
genNodeSource
:: Maybe IntMinimum node size in terms of units
-> Maybe IntMaximum node size (when Nothing, bounded just by the max... constants)
-> Gen Node
Generas an arbitrary node based on sizing information.
newtype SmallRatio Source
Constructors
SmallRatio Double
Actual tests
Utils tests
prop_Utils_if'if :: Bool -> Int -> Int -> BoolSource

If the list is not just an empty element, and if the elements do not contain commas, then join+split should be idempotent.

Split and join should always be idempotent.

fromObjWithDefault, we test using the Maybe monad and an integer value.

Test that functional if' behaves like the syntactic sugar if.

prop_Utils_selectSource
:: IntDefault result
-> [Int]List of False values
-> [Int]List of True values
-> BoolTest result
Test basic select functionality
prop_Utils_select_undefdSource
:: [Int]List of False values
-> NonEmptyList IntList of True values
-> BoolTest result
Test basic select functionality with undefined default
prop_Utils_select_undefvSource
:: [Int]List of False values
-> NonEmptyList IntList of True values
-> BoolTest result
Test basic select functionality with undefined list values
PeerMap tests
Container tests
Instance tests
Text backend tests
Node tests
Cluster tests
OpCodes tests
Jobs tests
Loader tests
prop_Loader_compareNameComponent_equal :: String -> BoolSource

Checks that the number of primary instances recorded on the nodes is zero.

Check that compareNameComponent on equal strings works.

prop_Loader_compareNameComponent_prefix :: NonEmptyList Char -> String -> BoolSource
Check that compareNameComponent on prefix strings works.
Types tests
Produced by Haddock version 2.6.0