Statistics
| Branch: | Tag: | Revision:

root @ 7796e1f8

# Date Author Comment
7796e1f8 08/27/2013 04:50 pm Helga Velroyen

cluster init: deprecate --no-drbd-storage

Whether or not a particular type of storage is enabled
or not is determined by the list of enabled disk templates
in the cluster's configuration. This makes the option
'--no-drbd-storage' obsolete, because it is subsumed by...

9af7ece3 08/27/2013 04:50 pm Helga Velroyen

cluster verify: check drbd helper only when drbd enabled

This change makes sure that 'gnt-cluster verify' only
checks for the DRBD usermode helper, if DRBD is actually
enabled.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

7c577910 08/27/2013 04:50 pm Helga Velroyen

cmdlib/cluster.py: unit tests for usermode helper

This patch factors out the functions that deal with setting
and modifying the DRBD usermode helper in cluster.py in
order to make them more unittestable. The unit tests are
provided as well. No functional changes otherwise....

c121d42f 08/27/2013 04:50 pm Helga Velroyen

gnt_cluster.py: unit test for usermode helper

This patch factors out the functions in gnt_cluster
(related to cluster init and cluster modify) which
deal with setting / determining the drbd usermode helper
to make them more testable. Unit tests for the extracted...

af95196c 08/27/2013 04:50 pm Helga Velroyen

bootstrap.py: unit tests for setting the usermode helper

This patch factors out the function that checks the DRBD
usermode helper in bootstrap (cluster init) in order to make
it more testable. It also contains the unit tests. Otherwise,
no functional changes....

46204919 08/27/2013 03:08 pm Klaus Aehlig

In the manpages, use unversioned paths

Ganeti now installs all its files into a version-specific directory
and only adds symbolic links at the canonical installation places.
Nevertheless, make documentation, in particular man pages, still contain
the old places, i.e., the places where the symbolic links are added....

c3ae7998 08/27/2013 11:46 am Klaus Aehlig

Change versiondir to adhere the changed design

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Guido Trotter <>

4c4153b5 08/27/2013 11:46 am Klaus Aehlig

Change design to install to ${PREFIX}/lib/ganeti-${VERSION}

Even though the ${PREFIX}/opt/ only came into the design in the review
process, it is not the best choice, as /opt is reserverd for manually
installed software, but Ganeti intends to be packaged. Use ${libdir}...

6afb9fb4 08/27/2013 09:32 am Jose A. Lopes

Simplify '_CheckOutputFields'

Function '_CheckOutputFields' was receiving three field sets, two of
which were simply being merged together. This was complicated and
unnecessary. This patch simplifies '_CheckOutputFields' to take
simply two field sets.
...

dc3dcdaf 08/27/2013 09:32 am Jose A. Lopes

Add 'SF_NODE' to 'VALID_STORAGE_FIELDS'

Constant 'SF_NODE' is a storage field and, therefore, should be in
'VALID_STORAGE_FIELDS'. This patch fixes this and also reference to
these constants, namely, in 'cmdlib' and 'qa'.

Signed-off-by: Jose A. Lopes <>...

c2266ec8 08/27/2013 09:31 am Jose A. Lopes

Remove storage field duplication in 'qa'

QA was adding 'SF_TYPE' to a list containing all storage fields (i.e.,
'VALID_STORAGE_FIELDS'). However, 'SF_TYPE' is already part of
'VALID_STORAGE_FIELDS', which means this element was occurring twice
in the list....

0ac2ff3b 08/23/2013 03:16 pm Spyros Trigazis

Update iallocator design to include MonD data

Add "MonD data" sub-section.

Signed-off-by: Spyros Trigazis <>
Signed-off-by: Michele Tartara <>
Reviewed-by: Michele Tartara <>

f51e9849 08/23/2013 10:27 am Klaus Aehlig

Add name for the Parameter ND_OVS

That was forgotten when the parameter was added.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

03b0b21b 08/23/2013 09:56 am Klaus Aehlig

Add new node parameters to Object.hs

In commit 807d8853, new node parameters were introduced in the python world.
Add them to the haskell world as well to restore consistency.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

9cf292af 08/22/2013 06:02 pm Klaus Aehlig

Add configure option on whether to install symlinks

As of Ganeti 2.10, all files are installed into a single, version
specific, directory. In this way, several Ganeti versions can be
installed in parallel. Appropriate symbolic links in the search path
will be added by the Ganeti upgrade procedure. For the initial...

667e9959 08/22/2013 06:01 pm Klaus Aehlig

Move installation to a single Ganeti specific directory

As first step of implementing the new upgrade procedure (see design
document), make Ganeti install all files into a single directory,
$(prefix)/opt/Ganeti-$(VERSION). Symbolic links outside to this directory...

8baa9ca7 08/21/2013 06:26 pm Sebastian Gebhard

Add OpenvSwitch functionality to LUNodeAdd

This patch adds functionality to LUNodeAdd to
- check the arguments given. It will warn if no physical link is given
and fail if OpenvSwitch is not enabled, but parameters are given
- call the RPC to configure OpenvSwitch on the node...

90d8d4d1 08/21/2013 06:26 pm Sebastian Gebhard

Add RPC functionality for creating OpenvSwitches

This patches adds the needed RPC functions in order to create the
OpenvSwitches on the nodes.

Signed-off-by: Sebastian Gebhard <>
Signed-off-by: Klaus Aehlig <>
Reviewed-by: Klaus Aehlig <>

c760c1aa 08/21/2013 06:26 pm Sebastian Gebhard

Add parameters for OpenvSwitch to gnt-node

Extend gnt-node by parameters for OpenvSwitch. --ovs Flag to enable
OpenvSwitch, --ovs-name for the name of the OpenvSwitch and --ovs-link
for the interface to connect to.

Signed-off-by: Sebastian Gebhard <>...

2e5fc2ed 08/21/2013 06:26 pm Sebastian Gebhard

Documentation of new node parameters

This will add the new node parameters to the ganeti man page.

Signed-off-by: Sebastian Gebhard <>
Signed-off-by: Klaus Aehlig <>
Reviewed-by: Klaus Aehlig <>

7699ab7b 08/21/2013 06:26 pm Sebastian Gebhard

Minor documentations fixed to gnt-node man page

Fix two grammatical errors in gnt-node man page

Signed-off-by: Sebastian Gebhard <>
Signed-off-by: Klaus Aehlig <>
Reviewed-by: Klaus Aehlig <>

4daa5eb9 08/21/2013 06:26 pm Sebastian Gebhard

Backend: Create openvswitches on the nodes

This is the functionality to create the OpenvSwitches on the nodes.
Parameters are given via opcode and checked as well as extended with
the defaults.

Signed-off-by: Sebastian Gebhard <>
Signed-off-by: Klaus Aehlig <>...

807d8853 08/21/2013 06:21 pm Sebastian Gebhard

Add params for OpenvSwitch to ndparams

This patch introduces the needed fields for OpenvSwitch parameters
into ndparams and also provides the default values.

The parameters are:
ND_OVS: boolean, to show whether OpenvSwitch is enabled or not
ND_OVS_NAME: the name of the OpenvSwitch to create...

4ab6784a 08/21/2013 06:20 pm Sebastian Gebhard

Add design for OpenvSwitch autoconfiguration

This design doc adds details about how the autoconfiguration of
openvswitch should work in the cluster <-> node group <-> node
hierarchy. Parameters that are needed for succesful configration
are idenfied and inheritance of parameters is defined....

1583d0e4 08/21/2013 10:27 am Thomas Thrainer

Adapt tests for merged changes in IPolicy handling

The enabled disk templates in IPolicies are stricter checked after the
merge from 2.9, so adapt the tests to follow those changes.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

4a8c84f3 08/21/2013 10:27 am Thomas Thrainer

Add unit tests for LUInstanceMultiAlloc

This patch adds unit test coverage for LUInstanceMultiAlloc.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

bf2a3eba 08/21/2013 10:27 am Thomas Thrainer

Add unit test for LUInstanceRename

This patch adds unit test coverage for LUInstanceRename.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

72bac0c5 08/21/2013 10:27 am Thomas Thrainer

Add basic unit tests for instance import

This patch adds basic unit tests for instance import in
LUInstanceCreate. It does not provide full coverage though.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

57da0458 08/21/2013 10:27 am Thomas Thrainer

Introduce GetMockLU and reduce use of _FakeLU

Introduce a new method of creating a mocked LU for tests, and reduce the
use of the legacy _FakeLU class.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

e066018b 08/21/2013 10:27 am Thomas Thrainer

Add unit tests for LUInstanceRemove and -Move

This patch adds unit test coverage for LUInstanceRemove and
LUInstanceMove.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

66222813 08/21/2013 10:27 am Thomas Thrainer

Add unit tests for LUInstanceCreate and move tests

- Move instance related tests to instance_unittest.py
- Adapt moved tests to the new test framework where appropriate
- Add unit test coverage for LUInstanceCreate
- Only instance creation is covered yet, no imports...

7b6996a8 08/21/2013 10:26 am Thomas Thrainer

disk_template param is optional in instance create

The disk_template parameter is optional during disk create (the first
enabled disk template is taken in this case), so don't require it.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

d2429198 08/21/2013 10:25 am Thomas Thrainer

Merge branch 'stable-2.9' into master

  • stable-2.9
    Allow instance mods if only osparams are given
    Use node UUIDs for locking instead of node names
    Allow instance mods if only osparams are given
    Fix a node name vs. UUID bug in instance import
    Typo in hroller man page...
cf9f3b92 08/20/2013 06:44 pm Klaus Aehlig

Design document for automatised upgrades

This design document describes how upgrade and downgrades
can be made more automatic for future versions.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

dd84e715 08/20/2013 03:48 pm Thomas Thrainer

Merge branch 'stable-2.8' into stable-2.9

  • stable-2.8
    Allow instance mods if only osparams are given
    Fix harep manpage title
    Use FQDN to check master node status

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Klaus Aehlig <>

125e1230 08/20/2013 03:18 pm Thomas Thrainer

Allow instance mods if only osparams are given

osparams are now recognized as changes, so changing only those without
other changes works too now.

(cherry picked from commit 5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)

Signed-off-by: Thomas Thrainer <>...

6869f673 08/20/2013 02:46 pm Thomas Thrainer

Use node UUIDs for locking instead of node names

LUInstanceMultiAlloc used node names instead of node UUIDs to lock
required nodes. This patch fixes this bug.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

71a3ad07 08/20/2013 01:54 pm Helga Velroyen

Set pcre version to 0.94.4

Running 'make' in the chroot complains about pcre 0.94.4
being required.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Michele Tartara <>

5eae613c 08/20/2013 01:53 pm Thomas Thrainer

Allow instance mods if only osparams are given

osparams are now recognized as changes, so changing only those without
other changes works too now.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

a61a0813 08/19/2013 04:23 pm Thomas Thrainer

Fix a node name vs. UUID bug in instance import

This patch fixes a bug where node names were incorrectly used as node
UUID's.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

64ef390e 08/19/2013 02:34 pm Helga Velroyen

Typo in hroller man page

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

b9aae98b 08/19/2013 11:09 am Thomas Thrainer

Use node UUID for locking in LUInstanceMove

This LU (incorrectly) used the node name for locking. This patch
corrects this error.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

2c7c1fa8 08/16/2013 03:12 pm Apollon Oikonomopoulos

Fix harep manpage title

The harep manpage title underline was one character short, leading in
pandoc producing an invalid manpage header.

Signed-off-by: Apollon Oikonomopoulos <>
Reviewed-by: Thomas Thrainer <>

3c768f88 08/14/2013 03:19 pm Thomas Thrainer

Add unit test for LUGroupVerifyDisks

This patch adds unit test coverage for LUGroupVerifyDisks.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

4b8f9420 08/14/2013 03:19 pm Thomas Thrainer

Add unit test for LUGroupEvacuate

This patch adds unit test coverage for LUGroupEvacuate.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

7ac3f7b0 08/14/2013 03:19 pm Thomas Thrainer

Add unit tests for LUGroupRename

This patch adds unit test coverage for LUGroupRename.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

8ef0c3eb 08/14/2013 03:19 pm Thomas Thrainer

Add unit tests for LUGroupRemove

This patch adds unit test coverage for LUGroupRemove.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

67d2f602 08/14/2013 03:19 pm Thomas Thrainer

Add unit tests for LUGroupSetParams

This adds unit test coverage for LUGroupSetParams.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

ae904a6b 08/14/2013 03:19 pm Thomas Thrainer

Add unit test for LUGroupQuery

Provide unit test coverage for LUGroupQuery.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

d189f139 08/14/2013 03:19 pm Thomas Thrainer

Add unit tests for LUGroupAssignNodes

Add unit test coverage for LUGroupAssignNodes, including the split
instances check.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

9051a390 08/14/2013 03:19 pm Thomas Thrainer

Add unit tests for LUGroupAdd

Provide unit test coverage for LUGroupAdd.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

8129eac1 08/14/2013 03:19 pm Thomas Thrainer

Move TestLUGroupAssignNodes to group_unittest.py

While moving the test, it is adapted to the new test framework.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

6e755f9e 08/14/2013 03:19 pm Thomas Thrainer

Fix IPolicy violation check in LUGroupSetParams

cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.

Signed-off-by: Thomas Thrainer <>...

bbe0f264 08/13/2013 03:33 pm Thomas Thrainer

Fix IPolicy violation check in LUGroupSetParams

cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.

Signed-off-by: Thomas Thrainer <>...

ecff332f 08/13/2013 12:04 pm Thomas Thrainer

Use FQDN to check master node status

The master node name in SS conf is stored as FQDN, so also use the FQDN
on each node to check if it is the master node.

This fixes issue 551.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

570b6322 08/13/2013 12:02 pm Thomas Thrainer

Add test for LUClusterVerifyDisks

This LU only creates additional jobs as result, so this is a trivial
unit test.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

9fdb10be 08/13/2013 12:02 pm Thomas Thrainer

Extend unit tests for LUClusterVerifyGroup

- Add tests for additional Verify* methods
- Converted test for VerifyFiles to the new test framework
- Added possibility to prepare the LU in a test class before actually
executing the test method with it

Signed-off-by: Thomas Thrainer <>...

18397489 08/13/2013 11:59 am Thomas Thrainer

Revert "Display node name instead of UUID in error message"

This reverts commit fbff213691328562cc4029f3babaa2e72e2012c4.
When running hooks, the node name is used to identify nodes, not (as
wrongly assumed in the patch) the node UUID.

Signed-off-by: Thomas Thrainer <>...

fbff2136 08/13/2013 08:54 am Thomas Thrainer

Display node name instead of UUID in error message

The hooks callback in LUClusterGroupVerify misinterpreted the key in the
node result as name instead of node UUID. This patch fixes this, which
leads to more user friendly error messages.

Signed-off-by: Thomas Thrainer <>...

c214896c 08/12/2013 04:06 pm Thomas Thrainer

Use node name in error message

CheckNodeNotDrained displayed only the node UUID if the node is drained.
In order to provide a more helpful error message, use the node name
instead.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Guido Trotter <>

3d85d4bf 08/09/2013 02:08 pm Sebastian Gebhard

Remove duplicate argument from cabal install

network==2.3 is duplicate in cabal install. One occurrence can thus be removed.

Signed-off-by: Sebastian Gebhard <>
Reviewed-by: Guido Trotter <>

37f56360 08/09/2013 02:08 pm Sebastian Gebhard

Typo fix in lib/server/noded.py

Signed-off-by: Sebastian Gebhard <>
Reviewed-by: Guido Trotter <>

ae3ab08b 08/09/2013 11:30 am Helga Velroyen

QA: make ipolicy test respect enabled disk templates

This makes the 'gnt-cluster modify --ipolicy-*' tests
respect the enabled disk templates on the QA cluster.
If the required disk templates are not enabled, the
test is skipped.

Signed-off-by: Helga Velroyen <>...

eb161df2 08/08/2013 06:48 pm Helga Velroyen

QA: adjust tests wrt to ipolicy disk templates

This adjusts the cluster QA with respect to the new checks
between the ipolicy disk templates and the enabled disk
templates.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

c89eb67d 08/08/2013 06:48 pm Helga Velroyen

ClusterSetParams: move vg-name checks from to CheckPrereq

This fixes a bug in the logic of 'gnt-cluster modify'.
Some checks that should better be done in 'CheckPrereq'
were actually done in 'Exec'. This lead to a strange
behavior in case the execution failed, because an...

3f8567e1 08/08/2013 06:48 pm Helga Velroyen

man gnt-cluster: mention ipolicy check

This updates the 'gnt-cluster' man page to mention the
relationship between the ipolicy's list of allowed disk
templates and the cluster-wide enabled-disk templates.

Signed-off-by: Helga Velroyen <>...

a8f04850 08/08/2013 06:48 pm Helga Velroyen

Update NEWS file regarding ipolicy checks

This patch updates the NEWS file to mention the new checks
between the ipolicy's list of allowed disk tempaltes and
the cluster-wide enabled disk templates.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

702243ec 08/08/2013 06:48 pm Helga Velroyen

gnt-group add/modify: ipolicy vs disk templates

This patch adds a consistency check between the ipolicy's
list of allowed disk templates with the cluster-wide
enable disk templates when a new node group is added
or a group is modified.

It also fixes a bug in gnt-group where the list of allowed...

4e771a95 08/08/2013 06:48 pm Helga Velroyen

Move Ipolicy utility function to cmdlib/common.py

Since the check of consistency between an ipolicy and
the list of enabled disk templates will not only be
needed on cluster modification, but also on group
modification, we move the respective function and its...

d514e18b 08/08/2013 06:48 pm Helga Velroyen

bootstrap: restrict ipolicy to enabled disk templates

With this patch, on cluster creation, the initial instance
policy's list of allowed disk templates will be modified
in a way that it does not contain any disk templates which
are not enabled cluster-wise....

33a6464e 08/08/2013 06:48 pm Helga Velroyen

gnt-cluster modify: ipolicy vs enabled disk templates

This patch adds a check to LUClusterSetParams which
ensures that the list of allowed disk templates is a
subset of the list of cluster-wide enabled disk
templates. Unit tests are included.

Signed-off-by: Helga Velroyen <>...

1532b078 08/08/2013 06:48 pm Helga Velroyen

gnt-cluster modify: factor out ipolicy check

This refactors the LUClusterSetParams to do all ipolicy
sanity / validity checks in a separate function
in order to increase testability. No function changes
otherwise.

Signed-off-by: Helga Velroyen <>...

fdfa63cb 08/08/2013 06:19 pm Thomas Thrainer

Disable pylint warning to fix build

The _CheckLUResult method gets overridden in a subclass which actually
requires the self parameter, so ignore the pylint remark about it.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

b8f45292 08/08/2013 05:21 pm Thomas Thrainer

Add possibility to access locked LU in tests

This features is useful to test (private) methods of LU's during tests,
where those methods rely on the LU being completely initialized and
locking already performed.

An initial version of unit tests for LUClusterVerifyGroup makes use of...

850be460 08/08/2013 05:20 pm Thomas Thrainer

Add test for LUClusterVerifyConfig

Add unit test covering LUClusterVerifyConfig.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

c60f7675 08/08/2013 05:20 pm Thomas Thrainer

Add test for LUClusterVerify

As this LU returns other jobs as result, submitting jobs from within
LU's is now mocked too.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

9e67e425 08/08/2013 01:38 pm Jose A. Lopes

Fix TINicParams type predicate

Change the value type of the 'TINicParams' dictionary predicate from
'Maybe NonEmptyString' to 'Maybe String' to be compatible with the
Haskell definition.

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Thomas Thrainer <>

961ddf1e 08/08/2013 11:10 am Thomas Thrainer

Generate text report of Haskell coverage

In order to generate a coverage graph, we generate also the coverage
data as text format. This eases parsing on Buildbot.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

5cbf7832 08/08/2013 10:31 am Jose A. Lopes

Fix opcodes and parameters

  • fix some return types in opcodes and some types and documentation in
    parameters.
  • fix serialization of the default value of the 'name' parameter in
    the opcodes related to tags when tag kind is 'cluster'
  • revert changes to 'pShutdownTimeout'' and its references because the...
08cef8fc 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterRename

Also mock the netutils and ssh module in order to test all code paths.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

c487ae24 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterRepairDiskSizes

Also add build method for easy building of disk objects to the test
framework.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

f02733cc 08/07/2013 06:52 pm Thomas Thrainer

Introduce shortcut properties for config objects

Some configuration objects are accessed quite often, so introduce
shortcut properties for those.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

a794b8d7 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterSetParams

Some changes to the test framework were performed while writing this
test:
- Extended builder for disks
- Introduced builder for NICs
- Fixed bugs in RpcResultsBuilder

Signed-off-by: Thomas Thrainer <>...

812e07ab 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterPostInit

Also extract common assertion logic for hook invocations to
CmdlibTestCase.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

b730e2a7 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterQuery

Unit-test LUClusterQuery. Some changes in the mocked cluster
configuration are made, because the configuration was not completely
valid before.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

6aac41fa 08/07/2013 06:52 pm Thomas Thrainer

Add unit test for LUClusterRedistConf

Unit-test LUClusterRedistConf. Given the simplicity of the LU, this unit
test only exercises the LU code.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

6bb43023 08/07/2013 06:52 pm Thomas Thrainer

Use ConfigWriter.GetMasterNodeInfo() consistently

This shortcut method to get the node object of the master node directly
makes the code more readable and concise. Therefore, use it everywhere
where appropriate.

Signed-off-by: Thomas Thrainer <>...

bd6fb93b 08/07/2013 06:52 pm Thomas Thrainer

Add unit tests for LUClusterDestroy

This patch adds unit test for the LUClusterDestroy Logical Unit.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

1fa88aa6 08/07/2013 06:51 pm Thomas Thrainer

Move cmdlib-related unittests to cmdlib/

ganeti.cmdlib_unittest.py and
ganeti.cmdlib.instance_storage_unittest.py are moved to the
test/py/cmdlib directory. Also, they are renamed to match the names in
this module.

Additionally, instance_storage_unittest.py was added to the makefile, so...

0e1b5262 08/07/2013 06:51 pm Thomas Thrainer

Move cluster-related unittest to cluster_unittest

cmdlib_unittest should still be split further, but at least the cluster
related tests are moved to the proper file yet.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

eb172e55 08/07/2013 06:51 pm Thomas Thrainer

Add unit tests for LUClusterConfigQuery

Also, proper initialization of the runtime architecture information was
added.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

e0b8df13 08/07/2013 06:51 pm Thomas Thrainer

Add unit test for LUClusterDeactivateMasterIp

This patch adds unit tests for the LUClusterDeactivateMasterIp Logical
Unit.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

19830e88 08/07/2013 06:48 pm Thomas Thrainer

Add unit test for LUClusterActivateMasterIp

In order to properly assert the called RPC method, eq is implemented
on ConfigObject as well.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

e969a81f 08/07/2013 06:48 pm Thomas Thrainer

Add unit test for LUTestAllocator

Additionally to adding unit tests for LUTestAllocator, the test
framework was adapted for its requirements.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

ef725c86 08/07/2013 06:48 pm Thomas Thrainer

Remove unneeded checks

Those checks are already covered by the "types" in the opcodes, so
remove them.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

bd39b6bb 08/07/2013 06:48 pm Thomas Thrainer

Enable pylint and PEP8 for test support code

The test support code is mainly written from scratch, so in order to
ensure to keep the code quality high, enable pylint and PEP8 checks
for it.

Due to some specialities of the test code, a dedicate pylintrc-test file...

3efa7659 08/07/2013 06:48 pm Thomas Thrainer

Initial version of cmdlib test framework

The initial version of the cmdlib test framework is able to execute LU's
with the following components mocked:

  • Configuration
  • IAllocator interface
  • Lock manager
  • MCPU processor
  • RPC runner

A base test class is provided which makes it easy to execute opcodes and...

72a7f6b3 08/07/2013 06:48 pm Thomas Thrainer

Install python mock using easy_install in chroot

We require a newer mock library, so install it using easy_install in
chroot.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>

242e6bdd 08/07/2013 06:48 pm Thomas Thrainer

Require newer python mock library

Older Python mock libraries do not provide MagicMock, which eases
mocking of complex objects quite a bit. As this is a build/test
dependency only, requiring a new version is OK (it's available via
easy_install).

Signed-off-by: Thomas Thrainer <>...

2fe9deec 08/07/2013 06:48 pm Thomas Thrainer

Remove Python < 2.6 compatibility code

This code was used for Python versions < 2.6 which we don't support any
more.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Michele Tartara <>