Revision c65621d7

b/htest/Test/Ganeti/Objects.hs
59 59
              <*> arbitrary <*> arbitrary <*> getFQDN <*> arbitrary
60 60
              <*> (Set.fromList <$> genTags)
61 61

  
62
$(genArbitrary ''FileDriver)
63

  
64 62
$(genArbitrary ''BlockDriver)
65 63

  
66 64
$(genArbitrary ''DiskMode)
b/htest/Test/Ganeti/Types.hs
56 56
    (QuickCheck.Positive i) <- arbitrary
57 57
    Types.mkPositive i
58 58

  
59
instance (Arbitrary a) => Arbitrary (Types.NonEmpty a) where
60
  arbitrary = do
61
    QuickCheck.NonEmpty lst <- arbitrary
62
    Types.mkNonEmpty lst
63

  
59 64
$(genArbitrary ''AllocPolicy)
60 65

  
61 66
$(genArbitrary ''DiskTemplate)
......
78 83

  
79 84
$(genArbitrary ''NodeEvacMode)
80 85

  
81
instance (Arbitrary a) => Arbitrary (Types.NonEmpty a) where
82
  arbitrary = do
83
    QuickCheck.NonEmpty lst <- arbitrary
84
    Types.mkNonEmpty lst
86
$(genArbitrary ''FileDriver)
85 87

  
86 88
-- * Properties
87 89

  
......
176 178
prop_NodeEvacMode_serialisation :: NodeEvacMode -> Property
177 179
prop_NodeEvacMode_serialisation = testSerialisation
178 180

  
181
-- | Test 'FileDriver' serialisation.
182
prop_FileDriver_serialisation :: FileDriver -> Property
183
prop_FileDriver_serialisation = testSerialisation
184

  
179 185
testSuite "Types"
180 186
  [ 'prop_AllocPolicy_serialisation
181 187
  , 'prop_DiskTemplate_serialisation
......
195 201
  , 'prop_OobCommand_serialisation
196 202
  , 'prop_StorageType_serialisation
197 203
  , 'prop_NodeEvacMode_serialisation
204
  , 'prop_FileDriver_serialisation
198 205
  ]
b/htools/Ganeti/Objects.hs
202 202
  ])
203 203
$(makeJSONInstance ''DiskType)
204 204

  
205
-- | The file driver type.
206
$(declareSADT "FileDriver"
207
  [ ("FileLoop",   'C.fdLoop)
208
  , ("FileBlktap", 'C.fdBlktap)
209
  ])
210
$(makeJSONInstance ''FileDriver)
211

  
212 205
-- | The persistent block driver type. Currently only one type is allowed.
213 206
$(declareSADT "BlockDriver"
214 207
  [ ("BlockDrvManual", 'C.blockdevDriverManual)
b/htools/Ganeti/Types.hs
59 59
  , OobCommand(..)
60 60
  , StorageType(..)
61 61
  , NodeEvacMode(..)
62
  , FileDriver(..)
62 63
  ) where
63 64

  
64 65
import qualified Text.JSON as JSON
......
251 252
  , ("NEvacAll",       'C.iallocatorNevacAll)
252 253
  ])
253 254
$(THH.makeJSONInstance ''NodeEvacMode)
255

  
256
-- | The file driver type.
257
$(THH.declareSADT "FileDriver"
258
  [ ("FileLoop",   'C.fdLoop)
259
  , ("FileBlktap", 'C.fdBlktap)
260
  ])
261
$(THH.makeJSONInstance ''FileDriver)

Also available in: Unified diff