- Mar 12, 2013
-
-
Michele Tartara authored
Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
* devel-2.7 Add QA for instance creation with policy violation Add QA for policy-instance interactions Add QA for cluster policies Unit tests for objects.InstancePolicy + a fix Unit tests for objects.FillIPolicy() + small fix Fix upgrade of policy in objects.Cluster Fix instance policy checks for default back-end parameters Fix restoring default instance specs in group policies Unit tests for cmdlib._GetUpdatedIPolicy() Fix policy check for disk templates Fix merge 8e09e801 that resulted in duplicated code GanetiRapiClient: fix the no_remember option Conflicts: qa/qa_cluster.py qa/qa_instance.py Conflicts are due to QA config in master using objects instead of dictionaries. Also updated some new QA code in devel for the same reason. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michele Tartara authored
The first line of a function should be blank, unless it is able to contain the whole function. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 11, 2013
-
-
Bernardo Dal Seno authored
When instance policy is violated, creation fails. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Violations on policy changes are checked. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
qa_cluster.TestClusterSetISpecs() is exported as it will be used in future tests. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Tests for: objects.InstancePolicy.CheckParameterSyntax() objects.InstancePolicy.CheckDiskTemplates() objects.InstancePolicy.CheckISpecSyntax() Instance policies with an empty disk-template list now are reported. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
IPOLICY_DEFAULTS is now a legal policy (the disk-templates entry was a set instead of a list, before). Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Unknown elements were silently removed on startup. This means that a software upgrade could result in lost configuration information if cfgupgrade wasn't run promptly. Added unit test for Cluster.UpgradeConfig() to cover this case. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Policy violations of back-end parameters that used the cluster default value were not reported in cluster-verify. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
"default" was not accepted as a valid input value for instance specs in group policies, due to a bug introduced in 2cc673a3 (and released with 2.6.0). Added QA for this and another similar case. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Not 100% coverage, though. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
Instance disk template is checked against the policy, and diskless instances aren't checked for the number of disks. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Bernardo Dal Seno authored
A fragment in LUInstanceCreate.CheckPrereq() removed in commit ba147ff8 was reintroduced in merge 8e09e801 due to a change in df28c49b. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Daniel Krambrock authored
There was a typo which prevented the correct option from being passed to RAPI Signed-off-by:
Daniel Krambrock <danielk_lists@z9d.de> Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 08, 2013
-
-
Iustin Pop authored
* devel-2.7: Change hbal behaviour in case of early exit Fix build/sphinx_ext.py with tuple defaults for op params Fix bug in man build rule Fix hscolour style sheet building Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, hbal exits with status 1 if early exit is requested, even when all jobs are successful. This is counter-intuitive behaviour, so let's fix it (Issue 386). Note that the man page had conflicting information already, so it's a good thing to clean this up. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 06, 2013
-
-
Michele Tartara authored
The "reason" opcode parameter can now apply to multiple opcodes, not just the one for rebooting instances. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
When an OpCode's parameter has a tuple as default value, this code will break: buf.write("defaults to ``%s``" % default) The patch fixes this and other potential cases by always passing a tuple to '%'. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently the man page build rule is run without ‘-e’, so the actual checks in there are just warnings (check-man-warnings, check-man-dashes). The patch fixes this and also fixes the man pages which made me see the problem. Additionally, check-man-dashes is now verbose, otherwise it's hard to find out actually where in the page the error is. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently we only symlink this into two hard-coded directories, which breaks the source code viewing for all the others. The patch replaces this with automatic building; as playing with relative symlinks is non-trivial, I just generate it many times (the file is small enough (<250) that it shouldn't matter, size-wise, and it takes 2ms to do it). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Michele Tartara authored
The "reason" attribute will be common to many opcodes. This patch factors it out so that it will be possible for the next commits to use it without code duplication. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 05, 2013
-
-
Iustin Pop authored
* devel-2.7: Update required pylint version Constants.hs.in: improve Haddock markup in the template convert-constants: generate better Haddock markup Expand Haddock to run over test files as well Conflicts: Makefile.am (curl changes and new hs directories) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This should help a lot of users, since pylint 0.21.1 was quite an old version… The tree is "clean" w.r.t. the new pylint version. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently the Python source constants are used as-is, which is not nice on the eyes (especially for unqualified names, it was hard to separate them visually). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This patch does multiple enhancements to the way we build the Haddock docs, motivated by the fact that if we don't run Haddock over test files as well, bad formatting can be submitted and will accumulate over time (without any checks). The patch does: - replace manual built ALL_APIDOC_HS_DIRS with automatically built one (from HS_DIRS) - change Haddock so that it runs from the top directory (instead of from src/) - change HsColour target file to be built via bash parameter substitution, rather than sed (I don't know how to do it in one go, so I use 2 intermediate variables) - change 'hs-apidoc' target so that it depends on the real target file; in case no source file has been modified, running 'make hs-apidoc' twice will not result in two runs - run HsColour/Haddock under en_US.UTF-8 locale, otherwise they can't parse correctly the Unicode chars in the test files Additionally, wrong formatting (oops) in a test file has been corrected. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
* devel-2.7: (23 commits) Add export lists for files which didn't have them Fix Haskell compatibility tests with disabled file storage Fix QA with disabled file storage Fix convert-constants handling of booleans Fix handling of disabled (shared) file storage Fix low verbosity levels in htools Fix improperly formatted docstring Allow iallocator to work without LVM storage Allow rpc.MakeLegacyNodeInfo to parse non-LVM results Fix LUTestAllocator with instance alloc Fix confd issue regarding --no-lvm-storage Fix networks in _PrepareNicModifications() Fix sphinx label namespace Clarify use of move-instance with self-signed certificates Remove early returns in network LUs Fix HooksDict() in case of no tags Add networks to _AllIDs() Fix locking in LUNetworkConnect() Fix networks in LUInstanceSetParams() Fix another docstring typo ... Conflicts: src/Ganeti/Query/Node.hs (trivial; function rename in master and 'vgs' change in devel-2.7) also exported new entity from TestCommon.hs (used in master) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This further improves the comparison for "non-trivial" numbers. Without this patch, there are still cases where the absolute error is too big, and we need to switch to relative error. Concept has been taken from <http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ >. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 04, 2013
-
-
Iustin Pop authored
According to the documentation, “This function is almost ten times faster than rational, but is slightly less accurate. For 94.2% of numbers, this function and rational give identical results, but for the remaining 5.8%, this function loses precision around the 15th decimal place. For 0.001% of numbers, this function will lose precision at the 13th or 14th decimal place.”. What happens is that for our tests, it can happen that “Attoparsec.double (show a_double)” is quite different from “a_double”, such that we have much more than 1e-12 absolute difference. Since our xm lists should not be too big, I think switching to rational is better. Next patch also changes the way we compare doubles, so maybe this patch is not really needed… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the test uses a frequency of 5 string/5 double/1 list for generating Arbitrary instances of ListConfig. However, the list case has simply a "choose (1, 20)" `vectorOf` arbitrary, which means it could recurse forever. Manually running only this test gives runtime as such: - ~100-200ms: very often - ~1-2s: often - ~5s: rare - ~20s: very rare (but I hit this when running < 30 times the test, so…) On average, this makes this test one of the slowest ones, which is annoying. By changing to a sized generator, we can control the depth of the recursion, ensuring that we have a consistent runtime: out of 100 runs, one is 229ms, one is 164ms, the other are 80-120ms. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently, this tests and its helper function 'isAlmostEqual' uses plain booleans to signify failures, which means you can't really debug a failed test. The patch changes the call chain to use annotated properties all through, which results in messages like: Failing almost equal check Delta 3.725290298461914e-9 not smaller than 1e-12 expected: 2.147785408767952e7 but got: 2.1477854087679517e7 which (IMHO) it's much more readable. The patch also replaces a 'fail' with 'failTest' in another test. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This implements QffHostname and fixes the node listing (as well as export listing when filtering on node name). This bug was hidden by the fact that node listing with "gnt-node list aa" works if you don't have live queries (as it was originally), as the choosing of wanted nodes out of the config based on short names works. What didn't work was later post-filtering based on such short names (kind of duplicate, but that's how the code path is). By implementing QffHostname, we can have custom equality checks, like in the Python code. What I don't like is how convoluted the testing on various left/right combinations is, but I didn't find an easier way. The included unittest tests the partial filtering behaviour, and fails if the node name flag is not set to QffHostname. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
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>
-
Iustin Pop authored
After implementing a few of the query executor functions, it turns out that we have the same general pattern: - compile the filter - extract the selected fields - determine whether we need to run collectors - do a first pass filtering - run the collector if needed - compute the final fields For pure config queries, the collector/final computation is not needed, but otherwise the code flow is the same. We can therefore abstract all the queries that originate in the config (i.e. except the job query) and have a single code path for all of them, just with different parameters. To do this, we add some stub collectors for group/network queries, which don't have live data. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
The fields are not yet complete, but at least we can enable the list-field query to see what is there already. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Following the new naming style introduced in Exports.hs, this patch renames the other resources to export non-qualified names (fieldMap as opposed to nodeFieldMap), and to use qualified module imports. Also fixes a haddock issue in a docstring. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Two test helper files didn't have export lists (lost during the split of tests). This patch finally reintroduces them, to hopefully make the export list saner and with fewer changes for purely-internal changes. Additionally, a few missing docstrings are added as well. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
When file storage is disabled at ./configure time, we shouldn't pass opcodes containing DTFile/DTSharedFile/StorageFile to Python for validation, as they will fail. This patch implements this by simply tweaking the Arbitrary instances for DiskTemplate and StorageType (which IMHO is a nice and clean way!), and also fixing the generation of arbitrary IPolicies to use the correct 'allDiskTemplates' list (otherwise we'd loop forever trying to generate a list of all templates). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently QA tries to use “gnt-node list-storage” with all storage types, but when file storage is disabled this will fail. The patch changes it so that if file storage is disabled, we test that indeed fails, and otherwise we include it in the regular tests. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-