Fix bug in group queries related to node/instance fields
authorIustin Pop <iustin@google.com>
Mon, 25 Feb 2013 16:18:36 +0000 (17:18 +0100)
committerKlaus Aehlig <aehlig@google.com>
Tue, 30 Apr 2013 07:49:50 +0000 (09:49 +0200)
commitc42fbe285ffd56d70663144d6fe3f47c0b54f7bd
tree2e8dd588cfdbfab6a6a961222aa0d3e25abdb437
parentc54c859b3e48e9877f1043c8e731d4ebd215b3c8
Fix bug in group queries related to node/instance fields

Since we use the primitive string type for group UUIDs, the group
fields have a bug where we pass the group name as filter for node
tests, whereas the nodes themselves use the group UUID. This results
in zero node count, empty node list, and no instances being reported
as assigned to groups.

The patch fixes this and adds a test for the node count. It does some
test generation improvement, and also cleans up whitespace issues in
Test/G/Q/Query.hs (the functions case_queryNode_allfields,
prop_queryGroup_noUnknown and case_queryGroup_allfields are unchanged
but simply have indentation fixed).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Cherry-pick of e7124835, fixes issue 436
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Conflicts:
test/hs/Test/Ganeti/Objects.hs
test/hs/Test/Ganeti/Query/Query.hs
src/Ganeti/Query/Group.hs
test/hs/Test/Ganeti/Objects.hs
test/hs/Test/Ganeti/Query/Query.hs