Revision da1dcce1
b/htest/Test/Ganeti/Objects.hs | ||
---|---|---|
364 | 364 |
ipolicy <- arbitrary |
365 | 365 |
diskparams <- pure (GenericContainer Map.empty) |
366 | 366 |
num_networks <- choose (0, 3) |
367 |
networks <- vectorOf num_networks genValidNetwork |
|
367 |
net_uuid_list <- vectorOf num_networks (arbitrary::Gen String) |
|
368 |
nic_param_list <- vectorOf num_networks (arbitrary::Gen PartialNic) |
|
369 |
net_map <- pure (GenericContainer . Map.fromList $ |
|
370 |
zip net_uuid_list nic_param_list) |
|
368 | 371 |
-- timestamp fields |
369 | 372 |
ctime <- arbitrary |
370 | 373 |
mtime <- arbitrary |
... | ... | |
372 | 375 |
serial <- arbitrary |
373 | 376 |
tags <- Set.fromList <$> genTags |
374 | 377 |
let group = NodeGroup name members ndparams alloc_policy ipolicy diskparams |
375 |
networks ctime mtime uuid serial tags
|
|
378 |
net_map ctime mtime uuid serial tags
|
|
376 | 379 |
return group |
377 | 380 |
|
378 | 381 |
instance Arbitrary NodeGroup where |
b/htools/Ganeti/Objects.hs | ||
---|---|---|
501 | 501 |
-- | The disk parameters type. |
502 | 502 |
type DiskParams = Container (Container JSValue) |
503 | 503 |
|
504 |
-- | A mapping from network UUIDs to nic params of the networks. |
|
505 |
type Networks = Container PartialNic |
|
506 |
|
|
504 | 507 |
$(buildObject "NodeGroup" "group" $ |
505 | 508 |
[ simpleField "name" [t| String |] |
506 | 509 |
, defaultField [| [] |] $ simpleField "members" [t| [String] |] |
... | ... | |
508 | 511 |
, simpleField "alloc_policy" [t| AllocPolicy |] |
509 | 512 |
, simpleField "ipolicy" [t| PartialIPolicy |] |
510 | 513 |
, simpleField "diskparams" [t| DiskParams |] |
511 |
, defaultField [| [] |] $ simpleField "networks" [t| [Network] |]
|
|
514 |
, simpleField "networks" [t| Networks |]
|
|
512 | 515 |
] |
513 | 516 |
++ timeStampFields |
514 | 517 |
++ uuidFields |
Also available in: Unified diff