ganeti
Safe HaskellNone

Test.Ganeti.Types

Description

Unittests for Types.

Synopsis

Arbitrary instance

allDiskTemplates :: [DiskTemplate] Source #

Valid disk templates (depending on configure options).

allStorageTypes :: [StorageType] Source #

Valid storage types.

genReasonElem :: Gen ReasonElem Source #

Generates one element of a reason trail

genReasonTrail :: Gen ReasonTrail Source #

Generates a reason trail

Properties

case_AllocPolicy_order :: Assertion Source #

Test AllocPolicy ordering is as expected.

prop_NonNeg_pass :: NonNegative Int -> Property Source #

Tests building non-negative numbers.

prop_NonNeg_fail :: Positive Int -> Property Source #

Tests building non-negative numbers.

prop_Positive_pass :: Positive Int -> Property Source #

Tests building positive numbers.

prop_Positive_fail :: NonNegative Int -> Property Source #

Tests building positive numbers.

prop_Neg_pass :: Positive Int -> Property Source #

Tests building negative numbers.

prop_Neg_fail :: NonNegative Int -> Property Source #

Tests building negative numbers.

prop_NonEmpty_pass :: NonEmptyList String -> Property Source #

Tests building non-empty lists.

case_NonEmpty_fail :: Assertion Source #

Tests building positive numbers.

prop_MigrationMode_serialisation :: MigrationMode -> Property Source #

Tests migration mode serialisation.

prop_VerifyOptionalChecks_serialisation :: VerifyOptionalChecks -> Property Source #

Tests verify optional checks serialisation.

prop_DdmSimple_serialisation :: DdmSimple -> Property Source #

Tests DdmSimple serialisation.

prop_DdmFull_serialisation :: DdmFull -> Property Source #

Tests DdmFull serialisation.

case_CVErrorCode_pyequiv :: Assertion Source #

Tests equivalence with Python, based on Constants.hs code.

prop_Hypervisor_serialisation :: Hypervisor -> Property Source #

Test Hypervisor serialisation.

prop_OobCommand_serialisation :: OobCommand -> Property Source #

Test OobCommand serialisation.

prop_NodeEvacMode_serialisation :: EvacMode -> Property Source #

Test NodeEvacMode serialisation.

prop_FileDriver_serialisation :: FileDriver -> Property Source #

Test FileDriver serialisation.

prop_RebootType_serialisation :: RebootType -> Property Source #

Test RebootType serialisation.

prop_ExportMode_serialisation :: ExportMode -> Property Source #

Test ExportMode serialisation.

case_IAllocatorMode_pyequiv :: Assertion Source #

Tests equivalence with Python, based on Constants.hs code.

prop_NICMode_serialisation :: NICMode -> Property Source #

Test NICMode serialisation.

prop_OpStatus_serialization :: OpStatus -> Property Source #

Test OpStatus serialisation.

prop_JobStatus_serialization :: JobStatus -> Property Source #

Test JobStatus serialisation.

case_JobStatus_order :: Assertion Source #

Test JobStatus ordering is as expected.

case_NICMode_pyequiv :: Assertion Source #

Tests equivalence with Python, based on Constants.hs code.

case_FinalizedJobStatus_pyequiv :: Assertion Source #

Tests equivalence with Python, based on Constants.hs code.

prop_JobId_serialisation :: JobId -> Property Source #

Tests JobId serialisation (both from string and ints).

prop_JobId_fractional :: Property Source #

Tests that fractional job IDs are not accepted.

case_JobId_BadTypes :: Assertion Source #

Tests that a job ID is not parseable from "bad" JSON values.

prop_OpSubmitPriority_string :: OpSubmitPriority -> Property Source #

Tests string formatting for OpSubmitPriority.

prop_ELogType_serialisation :: ELogType -> Property Source #

Test ELogType serialisation.

Orphan instances

Arbitrary ClockTime # 
Instance details

Methods

arbitrary :: Gen ClockTime

shrink :: ClockTime -> [ClockTime]

Arbitrary DiskTemplate #

Custom Arbitrary instance for DiskTemplate, which needs to handle the case of file storage being disabled at configure time.

Instance details

Arbitrary TagKind # 
Instance details

Methods

arbitrary :: Gen TagKind

shrink :: TagKind -> [TagKind]

Arbitrary AllocPolicy # 
Instance details

Arbitrary InstanceStatus # 
Instance details

Arbitrary MigrationMode # 
Instance details

Arbitrary VerifyOptionalChecks # 
Instance details

Arbitrary CVErrorCode # 
Instance details

Arbitrary DdmSimple # 
Instance details

Arbitrary DdmFull # 
Instance details

Methods

arbitrary :: Gen DdmFull

shrink :: DdmFull -> [DdmFull]

Arbitrary Hypervisor # 
Instance details

Arbitrary OobCommand # 
Instance details

Arbitrary StorageType #

Custom Arbitrary instance for StorageType, which needs to handle the case of file storage being disabled at configure time.

Instance details

Arbitrary EvacMode # 
Instance details

Arbitrary FileDriver # 
Instance details

Arbitrary InstCreateMode # 
Instance details

Arbitrary RebootType # 
Instance details

Arbitrary ExportMode # 
Instance details

Arbitrary IAllocatorTestDir # 
Instance details

Arbitrary IAllocatorMode # 
Instance details

Arbitrary NICMode # 
Instance details

Methods

arbitrary :: Gen NICMode

shrink :: NICMode -> [NICMode]

Arbitrary JobStatus # 
Instance details

Arbitrary FinalizedJobStatus # 
Instance details

Arbitrary JobDependency # 
Instance details

Arbitrary JobIdDep # 
Instance details

Arbitrary JobId # 
Instance details

Methods

arbitrary :: Gen JobId

shrink :: JobId -> [JobId]

Arbitrary OpSubmitPriority # 
Instance details

Arbitrary OpStatus # 
Instance details

Arbitrary ELogType # 
Instance details

Arbitrary a => Arbitrary (NonEmpty a) # 
Instance details

Methods

arbitrary :: Gen (NonEmpty a)

shrink :: NonEmpty a -> [NonEmpty a]

(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (Negative a) # 
Instance details

Methods

arbitrary :: Gen (Negative a)

shrink :: Negative a -> [Negative a]

(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (Positive a) # 
Instance details

Methods

arbitrary :: Gen (Positive a)

shrink :: Positive a -> [Positive a]

(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (NonNegative a) # 
Instance details

Methods

arbitrary :: Gen (NonNegative a)

shrink :: NonNegative a -> [NonNegative a]