$(genArbitrary ''Hypervisor)
+$(genArbitrary ''StorageType)
+
instance (Arbitrary a) => Arbitrary (Types.NonEmpty a) where
arbitrary = do
QuickCheck.NonEmpty lst <- arbitrary
prop_Hypervisor_serialisation :: Hypervisor -> Property
prop_Hypervisor_serialisation = testSerialisation
+-- | Test 'StorageType' serialisation.
+prop_StorageType_serialisation :: StorageType -> Property
+prop_StorageType_serialisation = testSerialisation
+
testSuite "Types"
[ 'prop_AllocPolicy_serialisation
, 'prop_DiskTemplate_serialisation
, 'prop_CVErrorCode_serialisation
, 'case_CVErrorCode_pyequiv
, 'prop_Hypervisor_serialisation
+ , 'prop_StorageType_serialisation
]
, RpcCallVersion(..)
, RpcResultVersion(..)
- , StorageType(..)
, StorageField(..)
, RpcCallStorageList(..)
, RpcResultStorageList(..)
-- ** StorageList
-- | StorageList
--- Get list of storage units.
--- FIXME: This may be moved to Objects
-$(declareSADT "StorageType"
- [ ( "STLvmPv", 'C.stLvmPv )
- , ( "STFile", 'C.stFile )
- , ( "STLvmVg", 'C.stLvmVg )
- ])
-$(makeJSONInstance ''StorageType)
-- FIXME: This may be moved to Objects
$(declareSADT "StorageField"
, CVErrorCode(..)
, cVErrorCodeToRaw
, Hypervisor(..)
+ , StorageType(..)
) where
import qualified Text.JSON as JSON
, ( "Fake", 'C.htFake )
])
$(THH.makeJSONInstance ''Hypervisor)
+
+-- | Storage type.
+$(THH.declareSADT "StorageType"
+ [ ("StorageFile", 'C.stFile)
+ , ("StorageLvmPv", 'C.stLvmPv)
+ , ("StorageLvmVg", 'C.stLvmVg)
+ ])
+$(THH.makeJSONInstance ''StorageType)