History | View | Annotate | Download (17.9 kB)
Create a genInstanceMaybeBiggerThan function
This is used only once when testing Cluster.hs, but having it abstractedclarifies there what that call is about, makes that test shorter, andallows us to better do refactoring of the main genInstanceSmallerThan...
Automatically enable version-dependent GHC flags
Some GHC flags are very useful, but only appear in more recent GHCversions. To support the use of such flags while still supportingolder compilers, let's add conditional checks and enabling based onthe results....
Merge branch 'devel-2.6' into submit
Conflicts: Makefile.am (reordering, fixed) htools/Ganeti/Confd/Server.hs (hlint fixes on master) htools/Ganeti/Daemon.hs (hlint)...
Move htools backends to a separate directory
Five modules under the HTools/ directories are backendimplementations, so let's move them to a separate directory, to moreclearly show the hierarchy. I wanted to do this for a while, butmerging between branches is always an issue, so let's do it know since...
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 <iustin@google.com>...
Remove custom OpResult type/monad
Since we now have the GeneralResult as a multi-purpose monad, we canremove the custom OpResult monad, and just use 'GeneralResultFailMode' as our type. This allows removal of a few bits ofspecialised infrastructure, relying instead on the generic one....
Cleanup HTools.Types/BasicTypes imports
Before we reorganised the source tree, the 'Result' type was exportedfrom HTools/Types.hs. This changed during the reorg, but at that timewe didn't change the exports; instead, we kept re-exporting it fromthe old module for compatibility....
Improve the `AllocPolicy' test
This test has a few deficiencies, which this patch addresses:
- using arbitrary 1 or 2 node count for allocation is obsolete, nowadays we need to use a number appropriate for the instance's disk template (and we should remove that parameter…)...
Improve the `CanTieredAlloc' test
Currently, this test is very slow. Upon investigation, this is due tohow `tieredAlloc' works:
- tries to allocate one instance- if failed, shrink the instance by the "most failed" resource- restart
In this algorithm, if the "most failed" resource is e.g. memory, and...
Add new test for checking multi-allocations
This test expands the "single-alloc-no-rebalance" by allocating a fewinstances on a small cluster, and ensuring that after we allocate allof them, either we can't rebalance or if we rebalance the scoreimprovement is very small....
Improve the prop_Alloc_sane test to detect mis-allocations
Currently, this just checks that a cluster cannot be rebalanced aftera single instance allocation. However, we can also test whether theallocation decision computed a correct new cluster score, by checking...
Further hlint fixes
Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almostright. The only problem is that (confusingly) the default set of hintsis not in HLint.Default, but in HLint.HLint (it includes Default andsome built-ins).
After changing the lint file to correctly include the defaults, we had...
Add a small 'passTest' helper
This is symmetric to failTest, and allows us to use it in cases wherewe need to return a property.
While replacing 'property True' with it, I saw a case where we cansimplify the use and thus reworked that check.
Fixup test suite names
The names were not in a proper hierarchy, leading to inconsistenciesabout what they were actually tested.
We change this by reproducing in the test names the relative hierarchywithin the Ganeti directory, leading to nicer test suite names (in...
Simplify property and test case names
Since we now have separate namespaces due to the multi-file split, wedon't need to keep the name of the module in the property names, as wedon't have so many potential conflicts anymore.
We remove the group prefix handling from TestHelper and simply do a...
Split most HTools test code into separate files
Except for Ganeti.HTools.JSON, which needs rename, we split all theother test suites into separate files.
We have to add another common test helper, due to import dependencies(sigh), but otherwise this split is pretty straightforward....