Generators for disks
authorHelga Velroyen <helgav@google.com>
Wed, 15 May 2013 12:52:47 +0000 (14:52 +0200)
committerHelga Velroyen <helgav@google.com>
Wed, 15 May 2013 14:43:42 +0000 (16:43 +0200)
commitd9b681ea9c8ed4368b488fa7032b19b25c49e3be
treeee421ef48858d7d8a564824a1a5c2b2f83b89976
parent9598b71fba771ee17c73494e87bd47781be09c51
Generators for disks

This patch adds generators for Disk instances to the Haskell
test code. It uses somewhat more reasonable generators to
fill the fields instead of just arbitrary values.
'genDiskWithChildren' is a generator that generates a disk
with a specified number of disk children. To avoid shooting
ourselves in the foot we do not generate further (grand)
child disks for the child disks. 'genDisk' calls
'genDiskWithChildren' by requesting three children as a
resonable default.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
test/hs/Test/Ganeti/Objects.hs