Statistics
| Branch: | Tag: | Revision:

root / htest / Test / Ganeti / Objects.hs @ a30a6178

History | View | Annotate | Download (14.1 kB)

# Date Author Comment
a30a6178 12/19/2012 05:41 pm Helga Velroyen

Renaming fam -> net_family on test network generation

Small renaming to make the test more readable.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Michele Tartara <>

5b48df93 12/19/2012 04:55 pm Helga Velroyen

Serialization compatibility test for node groups

This creates a number of node groups with up to 3 networks,
serializes them and compares them with their python equvalents.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Iustin Pop <>

0f0d7aba 12/19/2012 04:55 pm Helga Velroyen

Add a network fields to NIC params and node group type

This adds a network field to the NIC params and a list of networks
to the node group type. It adjusts the nodegroup's unit tests accordingly.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Iustin Pop <>

0b288282 12/18/2012 11:24 am Helga Velroyen

Haskell/python compatibility test for networks

This patch contains the HUnit test that checks the compatibility
of Haskell-generated networks with the python code. For that the
generation of test instances of networks was enhanced to meet
the validation steps of the python implementation. Also, so far...

76a0266e 12/11/2012 05:18 pm Helga Velroyen

Network and address pool (again)

Implementation of the network objects and address pool. Functionality
as in the reverted commit b9a616e132af9bba718d2da8c94eeec7af886814, but
now using only the vector library and not the bit-vector library.
Tested with vector library version 0.9 and 0.10., which are...

fa23de0b 12/07/2012 11:45 am Helga Velroyen

Revert "Network and address pool"

This reverts commit b9a616e132af9bba718d2da8c94eeec7af886814, which
depends on the "bitvec" library. We need to investigate a bit further that
dependency, as it in turns depends on "vector" 0.9.1 or below, since
0.10.* removed support for Data.Vector.Unboxed.Safe which it uses....

b9a616e1 12/06/2012 07:13 pm Helga Velroyen

Network and address pool

Implementation of the network and address pool class in
Haskell. Not complete yet. Includes unit tests that cover
all functionality that is so far implemented.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Iustin Pop <>

5f4fdf93 12/04/2012 01:44 pm Iustin Pop

Fix generation of clusters via 'genEmptyCluster'

The current uniqueness algorithm (generate random node names, suffix
them with node index) is actually wrong: a node named "21" at index 5
will end up with the same name as a node named "2" at position 15....

5006418e 11/30/2012 03:54 pm Iustin Pop

Make QuickCheck generator names more uniform

Due to lack of attention, we have two styles for generators of
arbitrary values: get* and gen* (e.g. getFQDN and genDiskIndices). In
order to make this more obvious that we deal with a function in the
Gen monad, let's rename all get* functions to gen*....

497beee2 11/30/2012 03:54 pm Iustin Pop

Move NICMode from Objects.hs to Types.hs

Also add some unittests for this type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

c65621d7 11/30/2012 03:48 pm Iustin Pop

Move FileDriver from Objects to Types

Another base type that we need in opcodes as well.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

22381768 11/21/2012 03:51 pm Iustin Pop

Move the 'Hypervisor' type from Objects to Types

This is a very basic type and 'Objects' is a heavy-weight module. By
moving it to 'types' we simplify (in the future) the import chains.

Signed-off-by: Iustin Pop <>
Reviewed-by: Adeodato Simo <>

edc1acde 11/21/2012 03:51 pm Iustin Pop

Generalise the JSON "Container" type

Currently, we have some types that we kept as dictionaries in the
objects representation (due to inconsistent behaviour, or other
technical reasons). This should be improved in the future, but in the
meantime we can improve the Container type by allowing its keys to be...

5e9deac0 11/20/2012 11:16 am Iustin Pop

Create a new Ganeti/Types.hs module

There are already three cases where we copied type definitions between
the htools-specific types into the main ganeti code. Let's stop doing
this ☺ and create a common types module that holds these.

Note that there already exists BasicTypes.hs, but that refers to very...

942a9a6a 10/22/2012 06:19 pm Iustin Pop

Remove multiple uses of '.&&.' with conjoin

This is just a bit of cleanup. The (.&&.) operator is internally just:

a .&& b = conjoin [a, b]

so let's replace 'a .&&. b .&&. c .&&. d' directly with 'conjoin [a,
b, c, d]'.

Signed-off-by: Iustin Pop <>...

44be51aa 09/08/2012 12:20 am Iustin Pop

Remove the slow/fast tests functionality

Since the recent commits improved the speed of the two "slow" test
groups to regular test speed, we can remove this kludge and simplify
significantly our test runner, yay!

Signed-off-by: Iustin Pop <>...

c3a8e06d 09/08/2012 12:20 am Iustin Pop

Fix arbitrary ConfigData object generation

The Cluster object, as it is defined right now, has many '[String]'
members, which means that in a standard arbitrary generator these will
become very big, which is the reason for the current slowness of the
test 'Config_serialisation'....

5b11f8db 09/05/2012 05:31 pm Iustin Pop

Further hlint fixes

Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almost
right. The only problem is that (confusingly) the default set of hints
is not in HLint.Default, but in HLint.HLint (it includes Default and
some built-ins).

After changing the lint file to correctly include the defaults, we had...

b9bdc10e 09/05/2012 05:18 pm Iustin Pop

Add some unittests for node queries

These new tests check that:

- no known fields return unknown
- any unknown field returns unknown
- the type of the fields is consistent between the getters and the
field definition
- the length of each result row corresponds with the number of fields...

9924d61e 09/05/2012 05:18 pm Iustin Pop

Add entire ConfigData serialisation tests

Using the recently-added genArbitrary, we can now implement Arbitrary
instances for even "huge" objects like Cluster, so let's use that to
implement entire ConfigData serialisation tests.

Note that, as we don't have yet proper types for some of the Params...

7022db83 09/05/2012 05:18 pm Iustin Pop

Replace manual arbitrary instances with genArbitrary

There are a few more that could be replaces, once we start using
appropriate (new)types.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

ce93b4a0 09/05/2012 04:58 pm Iustin Pop

Add Instance serialisations tests

This is not perfect, as for many of the parameters we don't have good
Arbitrary instances, but is better than nothing.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

63b068c1 09/05/2012 04:58 pm Iustin Pop

Add a test helper for simple JSON serialisation testing

While adding yet another JSON serialisation test, I realised that this
can be trivially abstracted; hence this patch, replacing both simple
versions (readJSON . showJSON == id) and the standard version (with...

8d2b6a12 09/05/2012 04:58 pm Iustin Pop

Add unit test for serialisation of DiskLogicalId and Nodes

Since the DiskLogicalId type is manually serialised/deserialised (see
Objects.hs, `encodeDLid' and `decodeDLId'), let's add a test that
checks that these are idempotent when combined.

Since we're at it, let's add the same test for Node serialisation,...

20bc5360 09/05/2012 03:34 pm Iustin Pop

Simplify property and test case names

Since we now have separate namespaces due to the multi-file split, we
don't need to keep the name of the module in the property names, as we
don't have so many potential conflicts anymore.

We remove the group prefix handling from TestHelper and simply do a...

305e174c 09/04/2012 04:50 pm Iustin Pop

Split Rpc tests from QC

This required lots of other code moves, so I created it as a
standalone patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

e5a29b6c 09/04/2012 04:50 pm Iustin Pop

Split out Objects.hs from QC.hs

This is the first file split out from QC.hs - an easy one, since it
has just one test.

The patch changes the way we build hpc excludes, since now we'll have
many modules that need to be excluded, and hpc doesn't seem to be able...