Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.opcodes_unittest.py @ 8bc17ebb

History | View | Annotate | Download (15.6 kB)

# Date Author Comment
8bc17ebb 12/17/2012 01:29 pm Iustin Pop

Add optional formatting for OP_DSC_FIELD

For some opcodes, the output is not "stable", and depends on the exact
input values; this makes it harder to check consistency against
Haskell code.

To compensate for this, we add a way to override the formatting of the...

08f31176 11/30/2012 03:54 pm Iustin Pop

Add test for mutable default values in opcode parameters

This is not comprehensive, since in Python one can't determine what is
and what is not mutable; but I've added a few base cases (list, dict,
set).

The patch also improves (makes more uniform) the error messages in the...

5dff65da 11/30/2012 07:10 am Michael Hanselmann

opcodes: Replace manual loop with map

Also remove a superfluous empty line in test file.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

6ae72286 11/21/2012 08:21 am Michael Hanselmann

Add unit test for default parameter default values

Fails if the default value of an opcode parameter doesn't verify.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

12e62af5 09/24/2012 02:48 pm René Nussbaumer

Adding the new opcode for multi-allocation

Skeleton for the multi-allocation opcode

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

32683096 09/12/2012 12:27 pm René Nussbaumer

Make the slots functionality more modular

As we will introduce another set of containers using the slots trick
we abstract away as much as possible to separate bases classes. The
child classes then adapt them for their needs. This leads to less code...

48796673 02/21/2012 09:18 pm Michael Hanselmann

Add result checks for OpTags*

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

415feb2e 02/21/2012 05:34 pm René Nussbaumer

opcodes: Annotate the OP_RESULT of query operations

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

202fb4e0 02/20/2012 06:57 pm Michael Hanselmann

opcodes: Add result checks for OpBackup*

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5fa3d337 02/20/2012 02:57 pm Michael Hanselmann

Improve opcode result check test to have a whitelist

Only whitelisted opcodes may not have a result check.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

0813170b 02/13/2012 04:02 pm Michael Hanselmann

Fix unittest breakage after commit a2aadb34b

Thou shalt run “make check” before sending patches.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ddc1de7c 02/01/2012 08:24 am Michael Hanselmann

Add stricter checks for OpInstanceSetParams.{nics,disks}

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

8f227489 02/01/2012 08:24 am Michael Hanselmann

Stricter check for OS modifications passed to OpClusterSetParams

Don't just check the first element of each item, but also make sure the
OS name is a string and not empty.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

bdfd7802 08/12/2011 03:12 pm Michael Hanselmann

Clarify job ID-related type checks, add unittests

Instead of a rather complicated expression only “JobId” is output. Job
ID lists (like generated by “SubmitManyJobs”) are limited to two-item
lists. Unittests are added.

Signed-off-by: Michael Hanselmann <>...

1ce03fb1 07/26/2011 02:19 pm Michael Hanselmann

Add ht-based result checks to opcodes

This adds the infrastructure necessary to check opcode results using
ht-based functions. Checks are added for two opcodes.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

b247c6fc 07/21/2011 08:33 am Michael Hanselmann

jqueue: Implement submitting multiple jobs with dependencies

With this change users of the “SubmitManyJobs” interface can use
relative job dependencies. Relative job IDs in dependencies are resolved
before handing the job off to the workerpool.

Signed-off-by: Michael Hanselmann <>...

3ce9a5e7 05/09/2011 06:49 pm Michael Hanselmann

opcodes: Add function for compact summary

Depending on the opcode and its parameters, the existing “Summary”
function can give a rater long summary. For displaying the summary in
logs and in the lock monitor, it should be shorter. Hence this new
function is added to just use the opcode ID with common prefixes...

45d4c81c 02/04/2011 07:05 pm Michael Hanselmann

Add opcode parameter descriptions

These will be used in automatically generated parts of the RAPI
documentation. Not all opcodes are documented so far, but each added
opcode's parameters need to be fully documented (verified by an
assertion).

Signed-off-by: Michael Hanselmann <>...

197b323b 02/04/2011 07:05 pm Michael Hanselmann

opcodes: Prepare addition of parameter descriptions

For now they're all set to None, but a following patch will set descriptions.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ff0d18e6 01/18/2011 01:47 pm Iustin Pop

Check consistency of the class names and OP_ID

As the class names should be now consistent with the OP_IDs, we add a
check for wrongly-defined OP_IDs.

However, the future removal of the hand-coded OP_IDs will render this
obsolete, so this check is introduced just to make sure that the...

687c10d9 01/10/2011 02:41 pm Iustin Pop

Generalize the OpCode-should-be-in-mcpu test

Currently, the unittest TestDispatchTable in mcpu unittest does a
hard-coded approach to test whether an opcode should be included or
not in the mcpu.Processor dispatch table. This is not flexible, so we
replace it with two changes:...

65ffb373 01/05/2011 12:42 pm Michael Hanselmann

Improve opcode summary tests

Test full summary instead of just format.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

1cbef6d8 01/05/2011 12:42 pm Michael Hanselmann

Migrate code verifying opcode parameters to base class

This allows the function to be used in other places as well.
An optional parameter is added to control whether default
values should be set. Unittests are added, providing full
coverage.

Signed-off-by: Michael Hanselmann <>...

dbc96028 01/05/2011 12:40 pm Michael Hanselmann

Improve tests for OP_ID

… by detecting duplicates.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

65e183af 01/05/2011 12:40 pm Michael Hanselmann

opcodes: Add opcode parameter definitions

This is the first step for migrating them from cmdlib. A metaclass is
used to define “__slots__” upon class creation time (not instantiation).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

c32b908e 02/23/2010 06:31 pm Michael Hanselmann

Add unittests for ganeti.opcodes

According to “coverage”, this covers 99% of the code.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>