Commit 6b168d4a authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Annotate every arbitrary instance field



The Arbitrary instance of the 'Instance' object is written
using the <*> syntax. Since it often uses the 'arbitrary'
generator for the instance's fields it is hard to figure
out which 'arbitrary' fills which instance field. This
patch annotates all fields with their name to make
maintenance of this code easier.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent d9b681ea
......@@ -107,13 +107,31 @@ $(genArbitrary ''PartialNic)
instance Arbitrary Instance where
arbitrary =
Instance
<$> genFQDN <*> genFQDN <*> genFQDN -- OS name, but...
-- name
<$> genFQDN
-- primary node
<*> genFQDN
-- OS
<*> genFQDN
-- hypervisor
<*> arbitrary
-- hvparams
-- FIXME: add non-empty hvparams when they're a proper type
<*> pure (GenericContainer Map.empty) <*> arbitrary
-- ... and for OSParams
<*> pure (GenericContainer Map.empty) <*> arbitrary <*> arbitrary
<*> arbitrary <*> arbitrary <*> arbitrary
<*> pure (GenericContainer Map.empty)
-- beparams
<*> arbitrary
-- osparams
<*> pure (GenericContainer Map.empty)
-- admin_state
<*> arbitrary
-- nics
<*> arbitrary
-- disks
<*> arbitrary
-- disk template
<*> arbitrary
-- network port
<*> arbitrary
-- ts
<*> arbitrary <*> arbitrary
-- uuid
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment