ganeti
Safe HaskellNone

Test.Ganeti.Query.Query

Description

Unittests for ganeti-htools.

Synopsis

Helpers

hasUnknownFields :: [FieldDefinition] -> Bool Source #

Checks if a list of field definitions contains unknown fields.

Test cases

Node queries

prop_queryNode_noUnknown :: Property Source #

Tests that querying any existing fields, via either query or queryFields, will not return unknown fields.

prop_queryNode_Unknown :: Property Source #

Tests that an unknown field is returned as such.

checkResultType :: FieldDefinition -> ResultEntry -> Property Source #

Checks that a result type is conforming to a field definition.

prop_queryNode_types :: Property Source #

Tests that querying any existing fields, the following three properties hold: RSNormal corresponds to a Just value, any other value corresponds to Nothing, and for a RSNormal and value field, the type of the value corresponds to the type of the field as declared in the FieldDefinition.

case_queryNode_allfields :: Assertion Source #

Test that queryFields with empty fields list returns all node fields.

areNodeNamesSane :: ConfigData -> Bool Source #

Check if cluster node names are unique (first elems).

prop_queryNode_filter :: Property Source #

Check that the nodes reported by a name filter are sane.

Group queries

prop_queryGroup_nodeCount :: Property Source #

Check that the node count reported by a group list is sane.

FIXME: also verify the node list, etc.

Job queries

prop_queryJob_noUnknown :: Property Source #

Tests that querying any existing fields, via either query or queryFields, will not return unknown fields. This uses undefined for config, as job queries shouldn't use the configuration, and an explicit filter as otherwise non-live queries wouldn't return any result rows.

prop_queryJob_Unknown :: Property Source #

Tests that an unknown field is returned as such.

Misc other tests

prop_getRequestedNames :: Property Source #

Tests that requested names checking behaves as expected.