Statistics
| Branch: | Tag: | Revision:

root / test / py @ 70e8dd0a

# Date Author Comment
70e8dd0a 10/11/2013 02:13 pm Helga Velroyen

Move unit tests for --file-storage-dir to cmdlib/*

There were some unit tests for the '--file-storage-dir'
option of 'gnt-cluster modify' still left in the unit
test file ganeti.cmdlib.cluster_unittest.py.
With the introducion of the unit test framework for...

916c0e6f 10/11/2013 02:13 pm Helga Velroyen

Move disk template unit tests to test/py/cmdlib/

This patch moves some unit tests related to dis/enabling
disk templates from ganeti.cmdlib.cluster_unittest.py
to cmdlib/cluster_unittest.py to utilized the new cmdlib
unit test framework.

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

6e513917 10/11/2013 02:13 pm Helga Velroyen

Make GetDiskTemplateSets output disabled disk templates

This patch extends the 'GetDiskTemplateSets' function to
also output the list of disk templates that were enabled
before this operation, but will be disabled afterwards.
This patch also includes code to check for instances using...

87e23f2d 10/11/2013 02:13 pm Helga Velroyen

Rename GetEnabledDiskTemplates to include disabled ones

This patch solely renames the functions
_GetEnabledDiskTemplates* to _GetDiskTemplateSets, because
in later patches, we will refactor it to not only output
disk templates that are or get enabled, but also the ones...

e8c86ab1 10/09/2013 07:39 pm Klaus Aehlig

Merge branch 'stable-2.9' into master

  • stable-2.9
    Version bump for 2.9.0 rc2
    Update NEWS for 2.9.0 rc2
    Downgrade 'vif_script'
    Downgrade 'xen_cmd'
    Add test cluster config for version 2.9
    Remove superfluous import of 'errors'
    Start NEWS entry for 2.9.0 rc2...
d48c944b 10/09/2013 01:40 pm Helga Velroyen

Use 'DTS_LVM' when possible

This patch replaces all usages of the utility function
'GetLvmDiskTemplate' by the new 'DTS_LVM' constant
to make it consistant with the usage of other DTS_*
constants.

Additionally, it provides a unit tests to ensure
consistancy between DTS_LVM and the mapping of disk...

e8936ef7 10/09/2013 01:40 pm Helga Velroyen

iallocator: use lookup by disk template

So far, the iallocator requested storage information
about all enabled disk templates but discarded all but
the LVM information, even if it was allocating space
for a non-LVM instance. With this patch, it now only
asks for the one that is relevant for...

b669aa41 10/09/2013 01:40 pm Helga Velroyen

utils/storage.py: storage info lookup by disk template

This patch improves the handling of storage information
before and after a call to the RPC 'node_info'. It
adds a function to not only call for all storage
information on the cluster (as it is used right now),...

efbd15d8 10/08/2013 02:01 pm Helga Velroyen

Downgrade 'vif_script'

This patch adds removing the 'vif_script' attribute
from the cluster's config when downgrading from 2.9
to 2.8. Adaption of the unit test is included.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Klaus Aehlig <>

1d9f9df7 10/08/2013 02:01 pm Helga Velroyen

Downgrade 'xen_cmd'

This downgrades the cluster's hypervisor parameters for the
xen hypervisors with respect to the 'xen_cmd' attribute.
A unit tests is provided.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Klaus Aehlig <>

a61383b0 10/08/2013 02:00 pm Helga Velroyen

Remove superfluous import of 'errors'

Signed-off-by: Helga Velroyen <>
Reviewed-by: Klaus Aehlig <>

2f1278d8 10/08/2013 01:14 pm Klaus Aehlig

Provide utility function to check a configuration version

In order for 'gnt-cluster upgrade --resume' to determine whether the configuration
is already upgraded, it needs to compare whether a configuration version is compatible
with a Ganeti target version. Provide a utility function for this....

f2b91949 10/07/2013 01:47 pm Klaus Aehlig

Provide an inverse to UnescapeAndSplit

With utils.UnescapeAndSplit, we have a function to parse
arbitrary non-empty string lists encoded as strings. Also
provide the appropriate encoding function.

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

346c3037 10/04/2013 05:11 pm Klaus Aehlig

Provide means of submitting jobs to a drained queue

During an upgrade, the job queue needs to be drained in order to avoid
new jobs coming to the cluster. Nevertheless, the upgrade process
needs to carry out some maintenance, like redistributing the new...

78521495 10/04/2013 05:10 pm Klaus Aehlig

Add predicate whether to call cfgupgrade --downgrade

Provide a predicate that, given the current version and the
version to go to, tells whether it is appropriate to call
cfgupgrade --downgrade.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Jose Lopes <>

0890e0d1 10/04/2013 05:10 pm Klaus Aehlig

Add utility function to recognize upgrade ranges

Upgrading is possible within the same major version to any equal
or higher minor version. Downgrading is possible within the same
major version to the previous minor version. Moreover, automatic
upgrades are only supported from version 2.10 onwards. Add a utility...

1eda3dd3 10/04/2013 05:09 pm Klaus Aehlig

Add utility function to parse version strings

The new 'gnt-cluster upgrade' command will get a Ganeti version as
argument. So provide a function able to parse it.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Jose Lopes <>

537dba0c 10/02/2013 05:55 pm Raffa Santi

Add tests specific to the user/kernelspace access feature

Check that the validation procedures don't accept invalid values
and also don't choke on valid values.

Signed-off-by: Santi Raffa <>
Reviewed-by: Thomas Thrainer <>

117a85a0 10/02/2013 05:55 pm Raffa Santi

Add Userspace RBD support in KVM

  • Add device class object in block_device tuple
  • Update hv_xen.py for new block_devices format
  • Fix tests broken by the change

Signed-off-by: Santi Raffa <>
Reviewed-by: Thomas Thrainer <>

9b9e088c 10/02/2013 05:55 pm Raffa Santi

Define 'access' disk-parameter type

Add the "access" parameter to the RBD configuration. Fix test broken
by this change.

Signed-off-by: Santi Raffa <>
Reviewed-by: Thomas Thrainer <>

d4d424fb 10/02/2013 03:50 pm Jose A. Lopes

Replace 'IALLOCATOR_NEVAC_*' with 'NODE_EVAC_*'

Replace uses of 'IALLOCATOR_NEVAC_PRI', 'IALLOCATOR_NEVAC_SEC',
'IALLOCATOR_NEVAC_ALL', and 'IALLOCATOR_NEVAC_MODES', with
'NODE_EVAC_PRI', 'NODE_EVAC_SEC', 'NODE_EVAC_ALL', and
'NODE_EVAC_MODES', given that these constants are repeated....

f3cb57d5 09/27/2013 02:25 pm Michele Tartara

Prevent lint error in mocked classes

Accessing private methods of parent classes is bad, but it is sometimes the best
approach for classes mocking them for testing reasons.
Selectively disable the related lint error just for the few functions that need
to do it....

317a3fdb 09/27/2013 02:24 pm Michele Tartara

Fix indentation for newer lints

Newer versions of pylint are more strict regarding indentation rules. This
commit fixes a couple of indentations that they consider wrong.

Signed-off-by: Michele Tartara <>
Reviewed-by: Jose A. Lopes <>

3c260845 09/26/2013 04:02 pm Thomas Thrainer

Honor disks_active of instance when adding disks

Adding a disk to an instance used to leave the disk behind activated, no
matter how the disks_active flag of the instance was. This changes make
sure that new disks are only active if the other disks of the instance...

922a9e65 09/26/2013 04:02 pm Thomas Thrainer

Wait for disk sync when adding a disk

When creating an instance, gnt-instance waits for instance disks to
sync. Inconsistently, this was not the case for adding a disk to an
instance. This patch changes the default behavior to wait for sync when
adding a disk, but honor the --no-wait-for-sync option which...

42e85303 09/25/2013 04:49 pm Klaus Aehlig

Merge branch 'stable-2.9' into master

  • stable-2.9
    Including missing RST files in packaging
    Update supported lint tools version numbers
    Fix some wrong indentations in the code
    Disable parenthesis indentation check
    Fix an improperly escaped string...
08d58f4c 09/25/2013 03:07 pm Klaus Aehlig

Merge branch 'stable-2.8' into stable-2.9

  • stable-2.8
    Add additional tests for utils.Retry
    Make retry tests independent of actual time
    Fix corner-case in handling of remaining retry time
    Perform proper cleanup on termination of Haskell daemons

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

effc1b86 09/25/2013 01:50 pm Jose A. Lopes

Move 'BuildVersion' to 'lib/utils/version.py'

Functions 'BuildVersion' and 'SplitVersion' are no longer needed by
the constants and, given that they are not constants, they should be
moved elsewhere. Since they are only used by 'cfgupgrade' and tests,
these functions are moved to 'lib/utils/version.py' and references to...

b8669a69 09/25/2013 01:49 pm Jose A. Lopes

Hs2Py constants: update Python references

Update references to constants that were previously in the generated
'lib/_autoconf.py' and since the previous patch have been included in
the Hs2Py constant generation.

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

5e34123e 09/25/2013 10:51 am Michele Tartara

Make QmpMessage a proper container

Newer pylint versions complain that QmpMessage is not a proper container because
it does not implement the len() and delitem() methods. This commit
implements them.

Also, tests are added.

Signed-off-by: Michele Tartara <>...

117899a7 09/24/2013 10:37 am Thomas Thrainer

Fix cfgupgrade test wrt. downgrading physical_id

The physical_id field can't be recreated during downgrades, so don't
expect it to be during the test.

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

5275a77f 09/24/2013 09:17 am Thomas Thrainer

Remove physical_id field from disks during upgrade

The physical_id field is no longer supported in disk objects, so remove
it during upgrades.

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

fd424c8a 09/24/2013 09:17 am Thomas Thrainer

Remove physical_id from config mock

Disk objects no longer support the physical_id field, so remove it from
mocked disk objects.

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

3d835d1b 09/24/2013 09:17 am Thomas Thrainer

Fix tests related to the physical_id field

Remove all references to the physical_id field of disk objects in tests.

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

32265e72 09/20/2013 03:22 pm Klaus Aehlig

Add additional tests for utils.Retry

Also have some tests where the time the various components
(inspecting the time function, calling the function, etc) have
a non-trivial time. Also, have two tests demonstrating that
the number of retries actually depends on the amount of time...

38d1ee54 09/20/2013 03:22 pm Klaus Aehlig

Make retry tests independent of actual time

Even in the tests, real time is used. While, generally, the assumptions
about execution time are pretty safe, in some rare circumstances, e.g.,
on machines with extremely heavy load they do not hold true, thus rendering...

47cce79a 09/17/2013 06:45 pm Sebastian Gebhard

Further tests for LUNodeAdd

This patch adds tests for the remaining functionality of LUNodeAdd.

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

55ba3ad6 09/17/2013 06:45 pm Sebastian Gebhard

Add unittests for OpenvSwitch in LUNodeAdd

This patch adds node_unittest.py containing the framework for unit
testing LUNodeAdd.
At this point, only test setup and tests for OpenvSwitch are
implemented.

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

4256f8fe 09/17/2013 06:45 pm Sebastian Gebhard

Replace more IPs with reserved adresses

Recently, some IP addresses were changed to TEST-NETs from RFC 5737.
This patch changes some more occurences of wrong IPs and replaces them.

TEST-NET-1 is used for primary_ips, TEST-NET-2 for networks and TEST-NET-3 for...

d45574de 09/17/2013 06:45 pm Sebastian Gebhard

Mock RPC for unit tests

This patch enables patching the rpc module to create a mocked version
which can be used to mock a rpc.DnsOnlyRunner(). This is needed for
unit testing LUNodeAdd, as it need to run RPCs against nodes not yet
present in the configuration....

11414807 09/13/2013 02:20 pm Klaus Aehlig

Fix example IPs and hostnames in tests

Our tests are a form of documentation, and hence should use
IPs from the TEST-NET ranges according to RFC 5737. They definitely
should not use real public IP addresses.

Similarly, example host names should be from one of the reserved...

2f3230f6 09/12/2013 03:56 pm Thomas Thrainer

Add unit test for LUInstanceQuery and -QueryData

This patch provides rudimentary unit test coverage for LUInstanceQuery
and LUInstanceQueryData.

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

d1b2ffe8 09/12/2013 03:56 pm Thomas Thrainer

Add unit tests for LUInstanceMigrate and -Failover

This patch adds rudimentary unit test coverage for LUInstanceMigrate and
LUInstanceFailover.

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

b02063fe 09/12/2013 03:56 pm Thomas Thrainer

Add unit tests for LUInstanceChangeGroup

This patch provides unit test coverage for LUInstanceChangeGroup.

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

27619aac 09/12/2013 03:56 pm Thomas Thrainer

Add unit tests for LUInstanceSetParams

This patch adds unit tests for LUInstanceSetParams. It does not provide
100% coverage, but covers a significant portion.

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

f41b569f 09/12/2013 03:56 pm Thomas Thrainer

Fix testMasterNetmask in TestLUClusterSetParams

The netmask was previously wrongly given as a bitmask, now it's given as
the net prefix length.

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

0c5f1b13 09/12/2013 03:23 pm Thomas Thrainer

Merge branch 'stable-2.9' into master

  • stable-2.9
    Fix bridging in net-common
    Sync build_chroot with buildbot slack role
    Auto-upgrade of disks' config wrt LD-renaming
    Fix tests regarding DISK_LD_DEFAULTS
    Fixing renaming of DISK_LD_DEFAULTS
    Replace LD_* constants with DT_* constants...
73d6b4a7 08/29/2013 04:13 pm Helga Velroyen

Auto-upgrade of disks' config wrt LD-renaming

This patch adds auto-upgrade functionality to the disk
objects with respected to the switch from LD constants
to DT constants. Unit tests are provided.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Guido Trotter <>

880ab678 08/29/2013 12:02 pm Helga Velroyen

Fix tests regarding DISK_LD_DEFAULTS

This fixes two remaining issues regarding the renaming
of DISK_LD_DEFAULTS:

- The keys of the map DISK_LD_DEFAULTS cannot be compared
to DISK_TEMPLATES right away, because there are no
defaults for the diskless template. This patch adjusts...

6da90c0a 08/28/2013 10:13 pm Helga Velroyen

Fixing renaming of DISK_LD_DEFAULTS

This fixes the somewhat over-eager renaming of
DISK_LD_DEFAULTS to DISK_DT_DEFAULTS, which clashes
with another occurence of DISK_DT_DEFAULTS. This
patch just undoes the renaming and additionally fixes
a test regarding shared file storage....

cd3b4ff4 08/28/2013 06:19 pm Helga Velroyen

Replace LD_* constants with DT_* constants

LD_* constants are basically like DT_* constants, except
for that both file and shared file were mapped to file.
In order to not having to maintain three slightly different
sets of disk-related constants (DT, LD and ST), we merge...

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

cluster init/modify: set helper without DRBD being enabled

The logic around the DRBD usermode helper so far was that
setting it was only possible when DRDB was not explicitely
disabled. This patches changes it in a way that it is
consistent to how Ganeti handles the volume group name....

31ccfc0e 08/27/2013 04:50 pm Helga Velroyen

cluster modify: deprecate --no-drbd-storage

As in the previous patch, the option '--no-drbd-storage'
is deprectated, because it is subsumed by the non-inclusion
of 'drbd' in the list of enabled disk templates.

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

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...

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....

f148fe23 08/27/2013 03:04 pm Klaus Aehlig

Merge branch 'stable-2.8' into stable-2.9

  • stable-2.8
    Add function to unwrap Results logging failures
    Make the DRBD collector more failure-resilient
    Prepare GetLinuxNodeInfo for testing
    Add unit test for GetLinuxNodeInfo
    NEWS update and version bump for 2.8 rc2...
902eb29f 08/22/2013 06:18 pm Michele Tartara

Add unit test for GetLinuxNodeInfo

The function was not unit tested previously.

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

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...

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...

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...
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 <>

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 <>...

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...

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 <>...

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 <>

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 <>

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 <>