Safe Haskell | None |
---|
Unittests for ganeti-htools.
Synopsis
- checkQueryResults :: ConfigData -> Query -> String -> [[ResultEntry]] -> Property
- makeNodeQuery :: Filter FilterField -> Query
- expectBadQuery :: ConfigData -> Query -> String -> Property
- namesToResult :: [String] -> [[ResultEntry]]
- genClusterNames :: Int -> Int -> Gen (ConfigData, [String])
- prop_node_single_filter :: Property
- prop_node_many_filter :: Property
- prop_node_name_ordering :: Property
- prop_node_regex_filter :: Property
- prop_node_bad_filter :: String -> Int -> Property
- prop_makeSimpleFilter :: Property
- testQuery_Filter :: Test
Helpers
checkQueryResults :: ConfigData -> Query -> String -> [[ResultEntry]] -> Property Source #
Run a query and check that we got a specific response.
makeNodeQuery :: Filter FilterField -> Query Source #
Makes a node name query, given a filter.
expectBadQuery :: ConfigData -> Query -> String -> Property Source #
Checks if a given operation failed.
namesToResult :: [String] -> [[ResultEntry]] Source #
A helper to construct a list of results from an expected names list.
genClusterNames :: Int -> Int -> Gen (ConfigData, [String]) Source #
Generates a cluster and returns its node names too.
Test cases
prop_node_single_filter :: Property Source #
Tests single node filtering: eq should return it, and (lt and gt) should fail.
prop_node_many_filter :: Property Source #
prop_node_name_ordering :: Property Source #
Tests name ordering consistency: requesting a 'simple filter' results in identical name ordering as the wanted names, requesting a more complex filter results in a niceSort-ed order.
prop_node_regex_filter :: Property Source #
Tests node regex filtering. This is a very basic test :(
prop_node_bad_filter :: String -> Int -> Property Source #
Tests node regex filtering. This is a very basic test :(
prop_makeSimpleFilter :: Property Source #
Tests make simple filter.
testQuery_Filter :: Test Source #