ganeti
Safe HaskellNone

Test.Ganeti.HTools.Node

Description

Unittests for ganeti-htools.

Synopsis

Arbitrary instances

genNode Source #

Arguments

:: Maybe Int

Minimum node size in terms of units

-> Maybe Int

Maximum node size (when Nothing, bounded just by the max... constants)

-> Gen Node 

Generates an arbitrary node based on sizing information.

genOnlineNode :: Gen Node Source #

Helper function to generate a sane node.

genEmptyOnlineNode :: Gen Node Source #

Helper function to generate a sane empty node with consistent internal data.

genExclStorNode :: Gen Node Source #

Generate a node with exclusive storage enabled.

genMaybeExclStorNode :: Gen Node Source #

Generate a node with exclusive storage possibly enabled.

genNodeList :: Gen Node -> Gen List Source #

Node list generator. Given a node generator, create a random length node list. Note that "real" clusters always have at least one node, so we don't generate empty node lists here.

genUniqueNodeList :: Gen Node -> Gen (List, NameAssoc) Source #

Node list generator where node names are unique

genNodeGraph :: Gen (Maybe Graph, List, List) Source #

Generate a node list, an instance list, and a node graph. We choose instances with nodes contained in the node list.

Test cases

prop_setAlias :: Node -> String -> Bool Source #

prop_setOffline :: Node -> Bool -> Property Source #

prop_setMcpu :: Node -> Double -> Property Source #

prop_addPriFM :: Node -> Instance -> Property Source #

Check that an instance add with too high memory or disk will be rejected.

prop_addPriFD :: Instance -> Property Source #

Check that adding a primary instance with too much disk fails with type FailDisk.

hasInstTooManySpindles :: Instance -> Int -> Bool Source #

Check if an instance exceeds a spindles limit or has no spindles set.

prop_addPriFS :: Instance -> Property Source #

Check that adding a primary instance with too many spindles fails with type FailSpindles (when exclusive storage is enabled).

prop_addPriFC :: Property Source #

Check that adding a primary instance with too many VCPUs fails with type FailCPU.

prop_addSec :: Node -> Instance -> Int -> Property Source #

Check that an instance add with too high memory or disk will be rejected.

prop_addOfflinePri :: NonNegative Int -> NonNegative Int -> Property Source #

Check that an offline instance with reasonable disk size but extra mem/cpu can always be added.

prop_addOfflineSec :: NonNegative Int -> NonNegative Int -> Ndx -> Property Source #

Check that an offline instance with reasonable disk size but extra mem/cpu can always be added.

prop_rMem :: Instance -> Property Source #

Checks for memory reservation changes.

prop_setMdsk :: Node -> SmallRatio -> Bool Source #

Check mdsk setting.

prop_showField :: Node -> Property Source #

case_emptyNodeList :: Assertion Source #

Check that no graph is created on an empty node list.

prop_numVertices :: Property Source #

Check that the number of vertices of a nodegraph is equal to the number of nodes in the original node list.

prop_numEdges :: Property Source #

Check that the number of edges of a nodegraph is equal to twice the number of instances with secondary nodes in the original instance list.

prop_nodeGraphIsColorable :: Property Source #

Check that a node graph is colorable.

prop_instanceIsEdge :: Property Source #

Check that each edge in a nodegraph is an instance.

prop_edgeIsInstance :: Property Source #

Check that each instance in an edge in the resulting nodegraph.

testHTools_Node :: Test Source #

List of tests for the Node module.

Orphan instances

Arbitrary Node # 
Instance details

Methods

arbitrary :: Gen Node

shrink :: Node -> [Node]