diff --git a/htest/Test/Ganeti/Types.hs b/htest/Test/Ganeti/Types.hs index 971b974ad6163bce6222e17cc37a0bb02dfbbc87..7116871182052a675b48bdb3fc685e29ce3ef5d0 100644 --- a/htest/Test/Ganeti/Types.hs +++ b/htest/Test/Ganeti/Types.hs @@ -132,6 +132,8 @@ $(genArbitrary ''OpSubmitPriority) $(genArbitrary ''OpStatus) +$(genArbitrary ''ELogType) + -- * Properties prop_AllocPolicy_serialisation :: AllocPolicy -> Property @@ -352,6 +354,10 @@ prop_JobDependency_serialisation = testSerialisation prop_OpSubmitPriority_serialisation :: OpSubmitPriority -> Property prop_OpSubmitPriority_serialisation = testSerialisation +-- | Test 'ELogType' serialisation. +prop_ELogType_serialisation :: ELogType -> Property +prop_ELogType_serialisation = testSerialisation + testSuite "Types" [ 'prop_AllocPolicy_serialisation , 'case_AllocPolicy_order @@ -394,4 +400,5 @@ testSuite "Types" , 'prop_JobId_serialisation , 'prop_JobDependency_serialisation , 'prop_OpSubmitPriority_serialisation + , 'prop_ELogType_serialisation ] diff --git a/htools/Ganeti/Types.hs b/htools/Ganeti/Types.hs index e24edaf636324958126bfbd5f5cef369157d1227..850114c1a0bf97dc7937016c9c15bb3358d1f974 100644 --- a/htools/Ganeti/Types.hs +++ b/htools/Ganeti/Types.hs @@ -89,6 +89,7 @@ module Ganeti.Types , OpStatus(..) , opStatusToRaw , opStatusFromRaw + , ELogType(..) ) where import Control.Monad (liftM) @@ -453,12 +454,20 @@ $(THH.makeJSONInstance ''OpSubmitPriority) -- | Our ADT for the OpCode status at runtime (while in a job). $(THH.declareSADT "OpStatus" - [ ("OP_STATUS_QUEUED", 'C.opStatusQueued) - , ("OP_STATUS_WAITING", 'C.opStatusWaiting) - , ("OP_STATUS_CANCELING", 'C.opStatusCanceling) - , ("OP_STATUS_RUNNING", 'C.opStatusRunning) - , ("OP_STATUS_CANCELED", 'C.opStatusCanceled) - , ("OP_STATUS_SUCCESS", 'C.opStatusSuccess) - , ("OP_STATUS_ERROR", 'C.opStatusError) - ]) + [ ("OP_STATUS_QUEUED", 'C.opStatusQueued) + , ("OP_STATUS_WAITING", 'C.opStatusWaiting) + , ("OP_STATUS_CANCELING", 'C.opStatusCanceling) + , ("OP_STATUS_RUNNING", 'C.opStatusRunning) + , ("OP_STATUS_CANCELED", 'C.opStatusCanceled) + , ("OP_STATUS_SUCCESS", 'C.opStatusSuccess) + , ("OP_STATUS_ERROR", 'C.opStatusError) + ]) $(THH.makeJSONInstance ''OpStatus) + +-- | Type for the job message type. +$(THH.declareSADT "ELogType" + [ ("ELogMessage", 'C.elogMessage) + , ("ELogRemoteImport", 'C.elogRemoteImport) + , ("ELogJqueueTest", 'C.elogJqueueTest) + ]) +$(THH.makeJSONInstance ''ELogType)