ganeti
Safe HaskellNone

Test.Ganeti.Storage.Drbd.Parser

Description

Unittests for the DRBD Parser

Synopsis

Documentation

case_drbd80_emptyline :: Assertion Source #

Test a DRBD 8.0 file with an empty line inside.

case_drbd80_emptyversion :: Assertion Source #

Test a DRBD 8.0 file with an empty version.

case_drbd84_sync :: Assertion Source #

Test a DRBD 8.4 file with an ongoing synchronization.

case_drbd84 :: Assertion Source #

Test a DRBD 8.4 file.

case_drbd84_emptyfirst :: Assertion Source #

Test a DRBD 8.4 file with the first resource empty.

case_drbd83_sync_krnl2_6_39 :: Assertion Source #

Test a DRBD 8.3 file with a NULL caracter inside.

case_drbd83_sync :: Assertion Source #

Test a DRBD 8.3 file with an ongoing synchronization.

case_drbd83_sync_want :: Assertion Source #

Test a DRBD 8.3 file not from git sources, with an ongoing synchronization and the "want" field

case_drbd83 :: Assertion Source #

Test a DRBD 8.3 file.

case_drbd8 :: Assertion Source #

Test a DRBD 8.0 file with a missing device.

splitEvery :: Int -> [e] -> [[e]] Source #

Function for splitting a list in chunks of a given size. FIXME: an equivalent function exists in Data.List.Split, but it seems pointless to add this package as a dependence just for this single use. In case it is ever added, just remove this function definition and use the one from the package.

testCommaInt :: String -> Int -> Assertion Source #

Function for testing whether a single comma-separated integer is parsed correctly.

gen_prop_CommaInt :: Int -> Int -> Property Source #

Generate a property test for CommaInt numbers in a given range.

prop_commaInt_noCommas :: Property Source #

Test if <4 digit integers are recognized correctly.

prop_commaInt_1Comma :: Property Source #

Test if integers with 1 comma are recognized correctly.

prop_commaInt_multipleCommas :: Property Source #

Test if integers with multiple commas are recognized correctly.

prop_commaInt_max3WithoutComma :: Property Source #

Test whether the parser is actually able to behave as intended with numbers without commas. That is, if a number with more than 3 digits is parsed, only up to the first 3 digits are considered (because they are a valid commaInt), and the rest is ignored. e.g.: parse "1234" = 123

case_commaInt_non_triplet :: Assertion Source #

Test if non-triplets are handled correctly (they are assumed NOT being part of the number).