- Sep 05, 2012
-
-
Iustin Pop authored
During the recent moves and renames, two things have slipped through, since I didn't run make check-local… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Sep 04, 2012
-
-
Iustin Pop authored
In order to have correct code coverage results, we must somehow import all production modules into the test runner. Until now, this was done manually (when we didn't forget) in QC.hs. To improve the situation, we remove QC.hs and replace it with an auto-generated file which imports all modules. This reduces the maintenance burden and ensures we'll always have correct coverage. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This currently holds both production files and test files; since we want to treat these separately, let's split the variable in two, and introduce another one for the old, inclusive one. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This makes QC.hs obsolete, but we will remove it in a later patch, once we automatically build a file with all the imports (to ensure correct coverage results). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
These two files are not htools-specific, so let's move them out of the HTools subdirectory/module hierarchy and directly under Ganeti. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Except for Ganeti.HTools.JSON, which needs rename, we split all the other 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. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
… from QC.hs into their own files, again mirroring the production code source tree. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This required lots of other code moves, so I created it as a standalone patch. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This splits the confd/utils tests, and adds the TestCommon module for shared test code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
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 to do wildcards (it can do packages, but all our code is not-package-based). Further splitting will be done in bigger batches. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This patch starts the move of the test haskell code from `htools/Ganeti/HTools/' to its more proper place of `htest/Test/Ganeti'. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This moves the last (I think) htools-related bits out of test/ under htest/. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is another rather trivial patch, moving all the (htools) shelltests to their own directory. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Following up on the program moves, we now move the test data files. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This is the first commit of a series that will attempt to cleanup the test code organisation, which evolved somewhat organically from the initial pure htools functionality. The proposed organisation of the tree will be as follows: - htools (or maybe renamed to haskell or hs): only production code - htest: top-level test directory, containing test.hs, static helper scripts, etc. - htest/Ganeti/*.hs: modules implementing the actual test properties and test cases for the correspondingly-named production code modules - htest/data: containing test data files for the test cases This particular patch moves all the test code (test.hs, hpc-htools.hs symlink) and helper scripts (offline-test.sh, etc.) from htools/ to htest/, while updating the files themselves (if they had paths mentioning htools/), .gitignore and the Makefile. The only special mention is that in Makefile, we used to have a BINARY shell variable in binary build rule; that was computed via stripping `htools/' prefix; I've cleaned that and replaced with $(notdir $@); even though it's duplicated a few times, it leads to more readable make output (and easier to copy-paste). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This means that the verification of the correctness of the regex is done once, at the deserialisation/creation time, as in the Python code. To do this, we have to change the FilterRegex type from an alias to String to a more complex data type, and we have to create manual read/show/eq instance (phew!). Unittests are added which test these instances, since it's the first time I do this manually. An additional improvement is that we now check that regex-pcre has been compiled correctly, per the documentation (otherwise we get runtime errors). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Per the new query module hierarchy, rename Qlang to Query/Language and Queryd to Query/Server. This way, all query-related functionality is now "contained" in the Query/ directory. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This adds basic infrastructure for filtering (fully functional except, as usual, for runtime data), and then uses it for node queries. Since the filtering exports regex matching as an external functionality, we have to use a regex library. There are many flavours of these in Haskell (see http://www.haskell.org/haskellwiki/Regular_expressions ), but since we want to be as compatible as we can with Python's, we use the regex-pcre one, which is a wrapper to the widely used 'pcre' library. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This will allow us to run generic computations in an Applicative context, if a monadic one is not needed (or not applicable due to class constraints). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
In preparation for introducing filtering functionality, we convert the 'Filter' type from a '*' kind to a '* -> *' kind. This allows us to define some general properties for the filter, and for example introduce later an easy filter compilation, etc. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
Since we have all the definitions already, we can easily enable this. Manual testing shows no difference between the Python and the Haskell versions of node list-fields. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
* devel-2.6: Fix warnings/errors with newer pylint Fix decorator uses which crash newer pylint Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Iustin Pop authored
* stable-2.6: Fix warnings/errors with newer pylint Fix decorator uses which crash newer pylint Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
René Nussbaumer authored
This is the final part: * Parsing the new request type * Feed it to allocList * Format the result Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
René Nussbaumer authored
This function iterates over the tryMGAlloc function, updates the node list and instance list, and refeeds it recursively until no new instances are left. This allows us then to allocate multiple instances and see if they would fit together. Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 03, 2012
-
-
Iustin Pop authored
To help developing Ganeti on newer distributions, let's try to fix pylint warnings/errors. I'm using pylint from current Debian wheezy: pylint 0.25.1, astng 0.23.1, common 0.58.0, and we have 3 things that needs fixing. First, a really wide "except", with the silencing in the wrong place. I'm not sure why this doesn't have "except Exception", so let's add it. However, pylint still complains about "Catching too general exception", even though we do want to catch both system and our exception, so let's add a silence for W0703. It's true that we shouldn't catch KeyboardInterrupt and friends, but that should be cleaned up on the master branch. Second, pylint complains about "redefining name builtin tuple", because we do some pattern matching in the except blocks in netutils. This seems to be a false positive, but let's clean the code around this. And finally, type inference again goes bad, so let's silence E1103 with its "boolean doesn't have 'get' method". After this, I can run "make lint", and by extension "make commit-check" on Debian Wheezy, yay! We might be able to bump our required pylint versions to something not ancient… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
* devel-2.6: Instance autorepair design Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Pylint version: pylint 0.25.1, astng 0.23.1, common 0.58.0 crashes when passing the fully-qualified decorator name with: File "/usr/lib/pymodules/python2.7/pylint/checkers/base.py", line 161, in visit_function if not redefined_by_decorator(node): File "/usr/lib/pymodules/python2.7/pylint/checkers/base.py", line 116, in redefined_by_decorator decorator.expr.name == node.name): AttributeError: 'Getattr' object has no attribute 'name' I found out that simply using a shortened name will 'fix' this issue, so let's do this to allow running newer pylint versions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This design describes a tool that will perform automatic repairs on instances when they are detected to be unhealthy (living on offline or drained nodes, at the moment). These repairs can be scheduled automatically or requested as a one-off by a tool or person. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This was missed; we add the definition and the de-serialisation support. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This is the initial support for Query2: basic infrastructure (except filtering) and node query support (without RPC). It implements all the fields (tests by comparison with list-fields on the Python side), except that: - filter is not done - since RPC is not integrated yet, the runtime gathering/computing is simply stubbed out However, the infrastructure seems pretty reasonable, so I'm sending as is. Note that I've split the functions/declarations into multiple files, to keep each file clean and readable. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This fixes an old TODO for moving these; now they can be reused in the Haskell Query2 implementation. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This adds the VTYPE_* conversion to VType, used for QFT equivalence later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This enhances convert-constants to not flatten dicts completely, but also generate a so-called association list for them. This allows either direct use of the 'lookup' function, or (for performance) conversion to Data.Map and optimised lookup later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This adds two related improvements to THH: - for parameters, we declare a list with all their fields, so that Query2 can build the list of fields (e.g. for hvparams, or ndparams) automatically - we declare a new type class for "DictObjects", i.e. objects which can be converted to a [(String, JSValue)] list of pairs; while this applies to all our objects, it will be used first for filled parameters, so that we can implement the lookup functions generically Note that we re-export the new class from Objects.hs, so that other modules don't have to import THH. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This is a simple type declaration for NodeRole, a NdParamObject type class, and a few related helper functions for nodes and node groups. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
I'd rather not introduce this typo in the Haskell code too, and also not having them identical is not good. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
These mirror the TaggableObject in Python, in the sense that we will be able to define generic functions for querying such fields. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-
Iustin Pop authored
This patch corrects the definitions in Qlang.hs to match what Python expects on the wire; this means replacing some manual data type definitions with 'buildObject' so that we get serialisation (and field names) for free, adding (manually) JSON instances for types which are not represented as objects in JSON, etc. Due to more TH usage, I had to shift some definitions around, since TH breaks the "define in any order" property (
☹️ ). After that, we simply add a call into the stub Query/Query.hs module which, for all queries, responds with "query not supported". The reason for the deep directory structure is because I want to separate the functionality into multiple submodules, for smaller module size and readability. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
-